/* ============================================
   FIKR INSTITUTE — style.css
   Editorial publication stylesheet
   ============================================ */

/* ======== RESET & BASE ======== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #1a2744;
  --gold:    #b8922a;
  --text:    #1c1c1c;
  --muted:   #6b6760;
  --faint:   #9e9a95;
  --bg:      #f7f5f0;
  --bg2:     #efece6;
  --surface: #ffffff;
  --border:  #e2ddd6;
  --border2: #ccc8c0;
  --red:     #c62828;
  --green:   #2e7d32;

  --font-head: 'Playfair Display', 'Georgia', serif;
  --font-body: 'Source Serif 4', 'Georgia', serif;
  --font-ui:   'DM Sans', system-ui, sans-serif;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; }
img { max-width: 100%; height: auto; }
button { font-family: var(--font-ui); }

/* ======== NAVIGATION ======== */
.site-nav {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.05em;
}

.nav-brand span { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 2px;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

/* SUPPORT BUTTON */
.nav-support-btn {
  display: inline-block;
  margin-left: 12px;
  padding: 7px 14px;
  background: var(--gold);
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.15s ease;
}

.nav-support-btn:hover {
  background: #a07820;
  color: #fff !important;
  border-color: rgba(255,255,255,0.25);
}

.nav-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
}

.nav-mobile {
  display: none;
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 0;
}

.nav-mobile a {
  display: block;
  padding: 12px 24px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 15px;
}

.nav-mobile a:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.nav-mobile.open { display: block; }

/* ======== HERO ======== */
.hero {
  background: var(--navy);
  padding: 100px 24px 80px;
  text-align: center;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

.hero-headline {
  font-family: var(--font-head);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-sub {
  font-family: var(--font-body);
  font-size: 17px;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-hero-primary {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  padding: 14px 28px;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: background 0.15s;
}

.btn-hero-primary:hover { background: #a07820; }

.btn-hero-secondary {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 14px 28px;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-hero-secondary:hover { background: rgba(255,255,255,0.18); }

/* ======== TICKER ======== */
.ticker-wrap {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 40px;
}

.ticker-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0 16px;
  background: rgba(184,146,42,0.15);
  border-right: 1px solid rgba(184,146,42,0.3);
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-scroll {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  padding: 0 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ======== PAGE WRAP ======== */
.page-wrap { min-height: 100vh; }

.page-header {
  background: var(--navy);
  padding: 64px 0 48px;
}

.page-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-header-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.page-header-title {
  font-family: var(--font-head);
  font-size: clamp(28px,4vw,44px);
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.page-header-sub {
  font-size: 16px;
  color: rgba(255,255,255,0.65);
  max-width: 560px;
  line-height: 1.6;
}

.content-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ======== HOME LAYOUT ======== */
.home-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.home-section { margin-bottom: 56px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--navy);
  padding-bottom: 10px;
}

.section-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
}

.section-more {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.section-more:hover { color: var(--navy); }

/* ======== FEATURED GRID (HOMEPAGE) ======== */
.featured-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
  align-items: start;
}

.featured-grid.no-side {
  grid-template-columns: 1fr;
}

.featured-lead { }

.featured-side {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ======== LEAD CARD ======== */
.lead-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 28px;
  transition: border-color 0.15s;
}

.lead-card:hover { border-color: var(--navy); }

.lead-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.lead-card-image {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  margin-bottom: 16px;
}

.lead-card-title {
  font-family: var(--font-head);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.22;
  margin-bottom: 14px;
}

.lead-card-summary {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-card-meta {
  font-size: 12px;
  color: var(--faint);
}

/* ======== SIDE CARDS ======== */
.side-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 16px 18px;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 8px;
}

.side-card:last-child { margin-bottom: 0; }

.side-card:hover {
  border-color: var(--navy);
  background: #fdfcf9;
}

.side-card-image {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  margin-bottom: 10px;
}

.side-card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.side-card-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.side-card-meta {
  font-size: 11px;
  color: var(--faint);
}

/* ======== INTEL CARD ======== */
.intel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 16px;
}

.intel-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 20px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.intel-card:hover {
  border-color: var(--navy);
  box-shadow: 0 2px 12px rgba(26,39,68,0.07);
}

.intel-card-image {
  width: calc(100% + 40px);
  height: 170px;
  object-fit: cover;
  display: block;
  margin: -20px -20px 14px;
  border-bottom: 1px solid var(--border);
}

.intel-card-title {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin: 10px 0 8px;
}

.intel-card-summary {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.intel-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--faint);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ======== TAGS ======== */
.tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
}

.tag-intel    { background: var(--navy); color: #fff; }
.tag-analysis { background: var(--gold); color: #fff; }
.tag-econ     { background: #1a6b4a; color: #fff; }
.tag-military { background: var(--red); color: #fff; }
.tag-special  { background: #6b3a7a; color: #fff; }
.tag-region   { background: var(--bg2); color: var(--muted); border: 1px solid var(--border2); }
.tag-region-dark { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.9); }

/* ======== FILTER BAR ======== */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.filter-chip {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.filter-chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* ======== REGIONS GRID ======== */
.regions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.region-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.15s;
}

.region-chip:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.region-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ======== LOADING / EMPTY ======== */
.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px;
  color: var(--faint);
}

.loading-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 2px solid var(--border2);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px;
  color: var(--faint);
  font-size: 14px;
}

/* ======== ARTICLE BODY SECTIONS ======== */
.art-sec { margin-bottom: 36px; }

.art-sec-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: block;
}

.art-sec p {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.75;
  color: #1a1a1a;
  margin-bottom: 20px;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.art-sec p:last-child { margin-bottom: 0; }

/* ======== POST PAGE ======== */
.post-outer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

.post-main {
  min-width: 0;
  max-width: 760px;
}

.post-featured-image {
  margin-bottom: 36px;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  display: block;
  border-radius: 2px;
}

.post-featured-caption {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
  text-align: center;
  font-style: italic;
  border-bottom: 1px solid var(--border);
}

.post-sidebar {
  position: sticky;
  top: 80px;
}

.sidebar-section {
  margin-bottom: 36px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--navy);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.sidebar-related-card {
  display: block;
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}

.sidebar-related-card:last-child { border-bottom: none; }

.sidebar-related-card:hover .sidebar-card-title {
  color: var(--gold);
}

.sidebar-card-image {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  margin-bottom: 10px;
}

.sidebar-card-title {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 5px;
  transition: color 0.15s;
}

.sidebar-card-meta {
  font-size: 11px;
  color: var(--faint);
}

/* ======== GALLERY ======== */
.post-gallery {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
  margin: 32px 0;
}

.gallery-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
  gap: 10px;
}

.gallery-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
  cursor: pointer;
  transition: opacity 0.2s;
}

.gallery-item img:hover { opacity: 0.85; }

.gallery-caption {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  text-align: center;
}

/* ======== VIDEO ======== */
.post-video {
  margin: 32px 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.video-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.post-video video,
.post-video iframe {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
}

/* ======== LIGHTBOX ======== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  background: none;
  border: none;
}

/* ======== NOT FOUND ======== */
.not-found {
  max-width: 600px;
  margin: 80px auto;
  text-align: center;
  padding: 0 24px;
}

.not-found h2 {
  font-family: var(--font-head);
  font-size: 28px;
  color: var(--navy);
  margin-bottom: 12px;
}

.not-found p {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 24px;
}

/* ======== ADMIN OVERRIDES ======== */
.admin-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ======== RESPONSIVE ======== */
@media (max-width: 960px) {
  .post-outer {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .post-sidebar {
    position: static;
  }
}

@media (max-width: 900px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-menu-btn { display: block; }
  .nav-support-btn { display: none; }
  .hero { padding: 60px 24px 48px; }
  .intel-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .page-header { padding: 40px 0 32px; }
  .hero-headline { font-size: 28px; }
  .hero-actions { flex-direction: column; align-items: center; }
}

/* ======== PRINT ======== */
@media print {
  .site-nav,
  .filter-bar,
  .post-sidebar {
    display: none;
  }

  .post-outer {
    grid-template-columns: 1fr;
  }
}
/* SUPPORT DROPDOWN */

.nav-support-dropdown {
  position: relative;
  display: inline-block;
  margin-left: 12px;
}

.nav-support-btn {
  display: inline-block;
  padding: 7px 14px;
  background: var(--gold);
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.15s ease;
  cursor: pointer;
  font-family: var(--font-ui);
}

.nav-support-btn:hover {
  background: #a07820;
  color: #fff !important;
  border-color: rgba(255,255,255,0.25);
}

.nav-support-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 300;
  overflow: hidden;
}

.nav-support-dropdown.open .nav-support-menu {
  display: block;
}

.nav-support-menu a {
  display: block;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.nav-support-menu a:last-child {
  border-bottom: none;
}

.nav-support-menu a:hover {
  background: var(--bg2);
  color: var(--navy);
}

@media (max-width: 768px) {
  .nav-support-dropdown {
    display: none;
  }
}