/*
Theme Name:  KeLasTambang News
Theme URI:   https://kelastambang.com
Author:      KeLasTambang
Author URI:  https://kelastambang.com
Description: A modern news-style WordPress theme for KeLasTambang — Indonesia's Mining Education & Industry Intelligence Platform.
Version:     1.0.0
License:     GNU General Public License v2 or later
Text Domain: kelastambang
Tags:        news, blog, mining, custom-menu, featured-images, translation-ready
*/

/* ============================================================
   IMPORT FONTS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@400;500;600;700;800&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --forest:        #1C3A2B;
  --forest-mid:    #27503D;
  --forest-light:  #346651;
  --forest-pale:   #4A8066;
  --copper:        #B8832A;
  --copper-bright: #D09A38;
  --copper-light:  #E8BE70;
  --copper-pale:   #F5E8C8;
  --stone:         #EAE6DE;
  --cream:         #F6F3EE;
  --white:         #FDFCFA;
  --text-dark:     #1A2E22;
  --text-mid:      #3A4E42;
  --text-muted:    #6B7D72;
  --border:        #E0DDD6;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; object-fit: cover; }
a { text-decoration: none; color: inherit; }
a:hover { color: var(--copper); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  background: var(--forest);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 1px;
  padding: 6px 0; text-align: center;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: #fff;
  border-bottom: 3px solid var(--forest);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; max-width: 1200px; margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 44px; height: 44px; background: var(--forest); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Montserrat', sans-serif; font-size: 10px; font-weight: 800;
  color: var(--copper-light); letter-spacing: -0.5px; line-height: 1.1; text-align: center;
}
.logo-text { font-family: 'Montserrat', sans-serif; }
.logo-text .kelas   { font-size: 22px; font-weight: 800; color: var(--forest); }
.logo-text .tambang { font-size: 22px; font-weight: 300; color: var(--copper); }
.logo-text .tagline { font-size: 10px; color: var(--text-muted); letter-spacing: 1px; display: block; margin-top: -2px; }

/* Main Nav (WordPress menu) */
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.main-nav ul li a {
  font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: 0.5px; color: var(--text-dark); padding: 6px 10px;
  border-radius: 4px; transition: background 0.2s, color 0.2s; white-space: nowrap; display: block;
}
.main-nav ul li a:hover,
.main-nav ul li.current-menu-item > a { background: var(--cream); color: var(--forest); }
.main-nav ul li.menu-item-has-children > a::after { content: ' ▾'; font-size: 9px; }

/* Dropdown */
.main-nav ul li { position: relative; }
.main-nav ul li ul {
  display: none; position: absolute; top: 100%; left: 0; min-width: 200px;
  background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--forest);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1); z-index: 200; padding: 8px 0;
}
.main-nav ul li:hover > ul { display: block; }
.main-nav ul li ul li a { font-size: 12px; padding: 8px 16px; white-space: nowrap; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.btn-account {
  font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 700;
  padding: 7px 16px; background: var(--forest); color: #fff !important;
  border-radius: 4px; transition: background 0.2s;
}
.btn-account:hover { background: var(--forest-mid); }
.icon-search { font-size: 18px; color: var(--text-mid); cursor: pointer; }

/* ============================================================
   SEARCH FORM
   ============================================================ */
.search-wrap { display: none; position: absolute; top: 100%; right: 0; background: #fff; border: 1px solid var(--border); padding: 12px; width: 280px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); z-index: 300; }
.search-wrap.open { display: block; }
.search-wrap input[type="search"] { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; font-family: 'Inter', sans-serif; font-size: 14px; outline: none; }
.search-wrap input[type="search"]:focus { border-color: var(--forest); }
.search-wrap button { margin-top: 8px; width: 100%; padding: 8px; background: var(--forest); color: #fff; border: none; border-radius: 4px; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 1px; cursor: pointer; }

/* ============================================================
   CATEGORY NAV BAR
   ============================================================ */
.cat-nav { background: var(--cream); border-bottom: 1px solid var(--border); overflow-x: auto; }
.cat-nav-inner { display: flex; gap: 0; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.cat-nav ul { list-style: none; display: flex; margin: 0; padding: 0; }
.cat-nav ul li a {
  font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; color: var(--text-mid); padding: 10px 14px;
  border-bottom: 3px solid transparent; white-space: nowrap; display: block;
  transition: color 0.2s, border-color 0.2s;
}
.cat-nav ul li a:hover,
.cat-nav ul li.current-menu-item > a { color: var(--forest); border-color: var(--copper); }

/* ============================================================
   SECTION LABELS
   ============================================================ */
.section-label {
  display: inline-block; font-family: 'Montserrat', sans-serif;
  font-size: 11px; font-weight: 800; letter-spacing: 2.5px;
  color: #fff; background: var(--forest); padding: 4px 12px; margin-bottom: 16px;
}
.section-label.copper { background: var(--copper); }

/* ============================================================
   CATEGORY TAGS
   ============================================================ */
.cat-tag {
  display: inline-block; font-family: 'Montserrat', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: #fff; background: var(--forest); padding: 3px 8px;
  border-radius: 2px; margin-bottom: 6px; text-transform: uppercase;
}
/* Dynamic category colors — assign via CSS class on category slug */
.cat-tag.policy, .cat-tag.kebijakan, .cat-tag.regulations, .cat-tag.regulasi { background: #2563EB; }
.cat-tag.technology, .cat-tag.teknologi { background: #7C3AED; }
.cat-tag.investment, .cat-tag.investasi { background: var(--copper); }
.cat-tag.environment, .cat-tag.lingkungan, .cat-tag.esg { background: #059669; }
.cat-tag.career, .cat-tag.sdm, .cat-tag.careers { background: #DC2626; }
.cat-tag.commodity, .cat-tag.komoditas, .cat-tag.commodities { background: #0891B2; }
.cat-tag.opinion, .cat-tag.opini, .cat-tag.analysis { background: #475569; }
.cat-tag.events { background: #BE185D; }

.post-date { font-size: 11px; color: var(--text-muted); font-family: 'Montserrat', sans-serif; }

/* No thumbnail fallback */
.no-thumb {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--forest), var(--forest-pale));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.6); letter-spacing: 2px; text-transform: uppercase;
}

/* ============================================================
   HERO SECTION: TOP STORIES + HEADLINE + SIDEBAR
   ============================================================ */
.hero-section { padding: 28px 0 24px; border-bottom: 1px solid var(--border); }
.hero-grid {
  display: grid; grid-template-columns: 260px 1fr 280px;
  gap: 24px; align-items: start;
}

/* Left: Top Stories */
.top-stories { border-right: 1px solid var(--border); padding-right: 20px; }
.top-stories-list { list-style: none; }
.top-stories-list li {
  display: flex; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border); align-items: flex-start;
}
.top-stories-list li:last-child { border-bottom: none; }
.top-story-img { width: 68px; height: 52px; border-radius: 3px; flex-shrink: 0; overflow: hidden; background: var(--stone); }
.top-story-img img { width: 100%; height: 100%; object-fit: cover; }
.top-story-info { flex: 1; }
.top-story-info h4 { font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--text-dark); margin-bottom: 4px; }
.top-story-info h4 a:hover { color: var(--copper); }

/* Center: Headline */
.headline-img { width: 100%; height: 380px; border-radius: 4px; overflow: hidden; margin-bottom: 14px; background: var(--stone); position: relative; }
.headline-img img { width: 100%; height: 100%; object-fit: cover; }
.headline-img .hl-tag { position: absolute; top: 12px; left: 12px; }
.headline-center h2 { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; line-height: 1.3; color: var(--text-dark); margin-bottom: 8px; }
.headline-center h2 a:hover { color: var(--forest); }
.headline-center .excerpt { font-size: 14px; color: var(--text-mid); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Right: Sidebar */
.sidebar { border-left: 1px solid var(--border); padding-left: 20px; }
.sidebar-card { display: flex; flex-direction: column; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.sidebar-card:last-child { border-bottom: none; margin-bottom: 0; }
.sidebar-card-img { width: 100%; height: 140px; border-radius: 3px; overflow: hidden; background: var(--stone); margin-bottom: 8px; }
.sidebar-card-img img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-card h4 { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text-dark); margin-bottom: 4px; }
.sidebar-card h4 a:hover { color: var(--copper); }

/* ============================================================
   LATEST STORIES
   ============================================================ */
.latest-section { padding: 28px 0; border-bottom: 1px solid var(--border); }
.latest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.story-card { display: flex; flex-direction: column; }
.story-card-img { width: 100%; height: 180px; border-radius: 4px; overflow: hidden; background: var(--stone); margin-bottom: 10px; position: relative; }
.story-card-img img { width: 100%; height: 100%; object-fit: cover; }
.story-card-img .cat-tag { position: absolute; top: 8px; left: 8px; }
.story-card h3 { font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--text-dark); margin-bottom: 6px; }
.story-card h3 a:hover { color: var(--forest); }
.story-card .excerpt { font-size: 13px; color: var(--text-mid); line-height: 1.55; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
.story-card .meta { font-family: 'Montserrat', sans-serif; font-size: 10px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }

/* Load More / Pagination */
.load-more-wrap { text-align: center; margin-top: 28px; }
.btn-load-more {
  font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: var(--forest); border: 2px solid var(--forest); padding: 10px 28px; border-radius: 4px;
  transition: all 0.2s; cursor: pointer; background: transparent; display: inline-flex; align-items: center; gap: 6px;
}
.btn-load-more:hover { background: var(--forest); color: #fff; }
.kt-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.kt-pagination a, .kt-pagination span {
  font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 700;
  padding: 8px 14px; border: 2px solid var(--border); border-radius: 4px; color: var(--text-mid);
  transition: all 0.2s;
}
.kt-pagination a:hover, .kt-pagination span.current { background: var(--forest); color: #fff; border-color: var(--forest); }

/* ============================================================
   FEATURED TOPICS
   ============================================================ */
.topics-section { padding: 28px 0; border-bottom: 1px solid var(--border); }
.topics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.topic-card { position: relative; border-radius: 6px; overflow: hidden; height: 160px; cursor: pointer; display: block; }
.topic-card img { width: 100%; height: 100%; object-fit: cover; }
.topic-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(28,58,43,0.85) 50%, transparent); display: flex; align-items: flex-end; padding: 14px; }
.topic-overlay h4 { font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 800; letter-spacing: 0.5px; color: #fff; }
.topic-no-img { width: 100%; height: 100%; background: linear-gradient(135deg, var(--forest), var(--forest-pale)); }

/* ============================================================
   WHAT'S ON
   ============================================================ */
.whats-on-section { padding: 28px 0; }
.events-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.event-card { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.event-card-img { height: 160px; background: var(--stone); overflow: hidden; }
.event-card-img img { width: 100%; height: 100%; object-fit: cover; }
.event-card-body { padding: 14px; }
.event-card-body .event-date { font-family: 'Montserrat', sans-serif; font-size: 10px; font-weight: 700; color: var(--copper); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.event-card-body h4 { font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--text-dark); margin-bottom: 6px; }
.event-card-body p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ============================================================
   SINGLE POST PAGE
   ============================================================ */
.single-layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; padding: 36px 0; }
.post-hero-img { width: 100%; height: 420px; border-radius: 6px; overflow: hidden; margin-bottom: 24px; background: var(--stone); }
.post-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.post-header { margin-bottom: 24px; }
.post-header h1 { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 700; line-height: 1.25; color: var(--text-dark); margin-bottom: 12px; }
.post-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-family: 'Montserrat', sans-serif; font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; }
.post-meta .author { color: var(--forest); font-weight: 700; }
.post-content { font-size: 16px; line-height: 1.8; color: var(--text-mid); }
.post-content h2 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--text-dark); margin: 28px 0 12px; }
.post-content h3 { font-size: 18px; font-weight: 700; color: var(--text-dark); margin: 24px 0 10px; }
.post-content p { margin-bottom: 18px; }
.post-content ul, .post-content ol { padding-left: 24px; margin-bottom: 18px; }
.post-content li { margin-bottom: 6px; }
.post-content blockquote { border-left: 4px solid var(--copper); padding: 12px 20px; background: var(--cream); margin: 24px 0; font-style: italic; color: var(--text-mid); }
.post-content img { border-radius: 4px; margin: 20px 0; }
.post-tags { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.post-tag { font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 600; padding: 4px 12px; border: 1px solid var(--border); border-radius: 20px; color: var(--text-mid); transition: all 0.2s; }
.post-tag:hover { background: var(--forest); color: #fff; border-color: var(--forest); }

/* Single Sidebar */
.single-sidebar {}
.sidebar-widget { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.sidebar-widget:last-child { border-bottom: none; }
.widget-title { font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--forest); text-transform: uppercase; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--copper); display: inline-block; }
.related-post { display: flex; gap: 10px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.related-post:last-child { border-bottom: none; margin-bottom: 0; }
.related-post-img { width: 64px; height: 50px; border-radius: 3px; overflow: hidden; flex-shrink: 0; background: var(--stone); }
.related-post-img img { width: 100%; height: 100%; object-fit: cover; }
.related-post h5 { font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--text-dark); }
.related-post h5 a:hover { color: var(--copper); }

/* ============================================================
   ARCHIVE / CATEGORY PAGE
   ============================================================ */
.archive-header { padding: 28px 0 20px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.archive-header h1 { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700; color: var(--text-dark); }
.archive-header p { font-size: 14px; color: var(--text-muted); margin-top: 6px; }
.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 0 0 36px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--forest); color: rgba(255,255,255,0.85); padding: 40px 0 20px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-brand .logo-text .kelas   { color: #fff; font-size: 20px; }
.footer-brand .logo-text .tambang { color: var(--copper-light); font-size: 20px; }
.footer-brand p { font-size: 13px; line-height: 1.6; margin-top: 10px; color: rgba(255,255,255,0.7); }
.footer-col h5 { font-family: 'Montserrat', sans-serif; font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--copper-light); margin-bottom: 12px; text-transform: uppercase; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 7px; }
.footer-col ul li a { font-size: 13px; color: rgba(255,255,255,0.75); transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--copper-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 16px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: rgba(255,255,255,0.5); }

/* ============================================================
   PAGINATION — WordPress default .page-numbers output
   ============================================================ */
ul.page-numbers {
  list-style: none !important;
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 28px 0 12px;
  padding: 0 !important;
}
ul.page-numbers li {
  list-style: none !important;
  margin: 0;
  padding: 0;
}
ul.page-numbers li a.page-numbers,
ul.page-numbers li span.page-numbers {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; font-weight: 700;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 4px;
  color: var(--text-mid);
  display: block;
  transition: all 0.2s;
  line-height: 1;
}
ul.page-numbers li a.page-numbers:hover { background: var(--forest); color: #fff; border-color: var(--forest); }
ul.page-numbers li span.current        { background: var(--forest); color: #fff !important; border-color: var(--forest); }
ul.page-numbers li a.prev,
ul.page-numbers li a.next              { color: var(--forest); font-size: 14px; }

/* ============================================================
   NAV — Force text visibility (override any plugin/theme conflicts)
   ============================================================ */
.main-nav ul li a {
  color: var(--text-dark) !important;
  font-weight: 700 !important;
}
.main-nav ul li a:hover,
.main-nav ul li.current-menu-item > a,
.main-nav ul li.current_page_item > a {
  background: var(--cream) !important;
  color: var(--forest) !important;
}
.cat-nav ul li a {
  color: var(--text-mid) !important;
  font-weight: 700 !important;
}
.cat-nav ul li.current-menu-item > a,
.cat-nav ul li.current_page_item > a {
  color: var(--forest) !important;
  border-color: var(--copper) !important;
}

/* ============================================================
   CATEGORY TAG — Generic / Blog fallback colors
   ============================================================ */
.cat-tag.blog      { background: var(--forest-light); }
.cat-tag.news      { background: #0891B2; }
.cat-tag.report    { background: #475569; }
.cat-tag.general   { background: var(--forest-pale); }
/* Any unmatched slug defaults to forest green (base .cat-tag style) */

/* ============================================================
   LOAD MORE — hide duplicate pagination link
   ============================================================ */
.load-more-wrap .btn-load-more { margin-top: 12px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 220px 1fr; }
  .sidebar { display: none; }
  .topics-grid { grid-template-columns: repeat(2, 1fr); }
  .single-layout { grid-template-columns: 1fr; }
  .single-sidebar { display: none; }
}
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .top-stories { display: none; }
  .latest-grid, .archive-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .events-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; }
  .headline-img { height: 240px; }
  .post-header h1 { font-size: 24px; }
}
@media (max-width: 480px) {
  .latest-grid, .archive-grid { grid-template-columns: 1fr; }
  .topics-grid { grid-template-columns: 1fr 1fr; }
}
