/*
Theme Name: Athan Research
Theme URI: https://athanmyanmar.org
Author: Athan
Description: Custom theme for Athan, a Myanmar-based freedom of expression research organization. Dark editorial design with a red and gold accent system, publication flipbook viewer, and Customizer-managed homepage content.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: athan-research
*/

:root{
  --bg:#0E0C0B;
  --surface:#18140F;
  --surface-2:#211B14;
  --line: rgba(237,230,218,0.10);
  --line-strong: rgba(237,230,218,0.18);
  --cream:#EDE6DA;
  --cream-dim:#A79C8C;
  --red:#B03A2E;
  --red-dim:#7D2A21;
  --brass:#F0B429;
  --teal:#4C7A6B;
  --slate:#6E7C8C;
}
*{box-sizing:border-box; margin:0; padding:0;}
html{ scroll-behavior:smooth; }
body{
  background:var(--bg);
  color:var(--cream);
  font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
.mm, .lang-mm{ font-family:'Noto Sans Myanmar', sans-serif; }
a{ color:inherit; text-decoration:none; }
.wrap{ max-width:1160px; margin:0 auto; padding:0 32px; }
img,svg{ display:block; max-width:100%; }
ul{ list-style:none; }
button, input, textarea{ font-family:inherit; }

/* skip link */
.skip-link{
  position:absolute; left:-9999px; top:0; background:var(--red); color:#fff;
  padding:12px 20px; z-index:1000;
}
.skip-link:focus{ left:10px; top:10px; }

/* focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible{
  outline:2px solid var(--brass); outline-offset:2px;
}

/* ---------- redaction motif (signature element) ---------- */
.redact-row{ display:flex; gap:6px; align-items:center; }
.redact-bar{ height:3px; background:var(--red); border-radius:1px; }
.scanline{
  position:absolute; left:0; right:0; height:1px;
  background:linear-gradient(90deg, transparent, var(--brass) 20%, var(--brass) 80%, transparent);
  opacity:0.35; pointer-events:none;
}

/* ---------- header ---------- */
header.site-header{
  border-bottom:0.5px solid var(--line);
  position:sticky; top:0; background:rgba(14,12,11,0.92); backdrop-filter:blur(6px);
  z-index:100;
}
.header-inner{ display:flex; align-items:center; justify-content:space-between; padding:18px 0; gap:20px; }
.logo{ display:flex; align-items:center; gap:10px; }
.logo-mark{ width:34px; height:34px; border:1.5px solid var(--red); border-radius:6px; display:flex; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden; }
.logo-mark img{ width:100%; height:100%; object-fit:cover; }
.logo-mark span{ font-family:'Fraunces',serif; font-weight:600; color:var(--red); font-size:18px; }
.logo-text{ font-family:'Fraunces',serif; font-weight:500; font-size:19px; letter-spacing:0.2px; }
.logo-sub{ font-size:10px; color:var(--cream-dim); text-transform:uppercase; letter-spacing:0.09em; margin-top:1px; }
.main-nav{ display:flex; align-items:center; gap:28px; flex-wrap:wrap; }
.main-nav ul{ display:flex; align-items:center; gap:28px; }
.main-nav li{ position:relative; }
.main-nav a{ font-size:13px; color:var(--cream-dim); font-weight:500; transition:color .15s; }
.main-nav a:hover, .main-nav a:focus-visible{ color:var(--cream); }
.main-nav .sub-menu{
  display:none; position:absolute; top:100%; left:0; background:var(--surface);
  border:0.5px solid var(--line-strong); border-radius:8px; padding:8px; min-width:200px; margin-top:10px;
}
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu{ display:block; }
.main-nav .sub-menu a{ display:block; padding:8px 10px; border-radius:5px; font-size:13px; }
.main-nav .sub-menu a:hover{ background:var(--surface-2); }
.nav-cta{ display:flex; align-items:center; gap:14px; flex-shrink:0; }
.lang-toggle{ font-size:13px; padding:6px 12px; border:0.5px solid var(--line-strong); border-radius:20px; color:var(--cream-dim); white-space:nowrap; }
.lang-toggle:hover{ color:var(--cream); border-color:var(--line-strong); }
.btn-take-action{
  background:var(--brass); color:#3A2A05; font-size:13px; font-weight:500;
  padding:9px 18px; border-radius:5px; letter-spacing:0.01em; white-space:nowrap; display:inline-block;
}
.menu-toggle{ display:none; background:transparent; border:0.5px solid var(--line-strong); border-radius:6px; padding:8px 10px; color:var(--cream); }

/* ---------- hero ---------- */
.hero{ position:relative; overflow:hidden; border-bottom:0.5px solid var(--line); }
.hero-photo{
  position:relative; height:420px; background-size:cover; background-position:center;
}
.hero-photo::after{
  content:''; position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(14,12,11,0.35) 0%, rgba(14,12,11,0.90) 78%, var(--bg) 100%);
}
.hero-photo.no-image{
  background-image: repeating-linear-gradient(135deg, #241E17 0px, #241E17 2px, #1B1712 2px, #1B1712 26px);
}
.hero-body{ padding:56px 0 70px; position:relative; }
.hero-eyebrow{ display:flex; align-items:center; gap:10px; margin-bottom:22px; flex-wrap:wrap; }
.hero-eyebrow .redact-bar:nth-child(1){ width:26px; }
.hero-eyebrow .redact-bar:nth-child(2){ width:14px; background:var(--brass); }
.hero-eyebrow .redact-bar:nth-child(3){ width:9px; }
.hero-eyebrow-text{ font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:0.12em; text-transform:uppercase; color:var(--cream-dim); }
.hero h1{
  font-family:'Fraunces',serif; font-weight:500; font-size:52px; line-height:1.08;
  max-width:760px; letter-spacing:-0.01em;
}
.hero h1 em{ font-style:italic; color:var(--red); font-weight:500; }
.hero p.lede{ font-size:17px; color:var(--cream-dim); max-width:520px; margin:26px 0 34px; }
.hero-actions{ display:flex; gap:14px; flex-wrap:wrap; }
.btn-primary{ background:var(--red); color:var(--cream); padding:13px 26px; border-radius:6px; font-size:14px; font-weight:500; display:inline-block; }
.btn-primary:hover{ background:var(--red-dim); }
.btn-ghost{ border:0.5px solid var(--line-strong); padding:13px 26px; border-radius:6px; font-size:14px; font-weight:500; color:var(--cream); display:inline-block; }
.btn-ghost:hover{ border-color:var(--cream-dim); }

/* ---------- stats bar ---------- */
.stats{ border-bottom:0.5px solid var(--line); background:var(--surface); }
.stats-inner{ display:flex; flex-wrap:wrap; }
.stat{ padding:28px 32px 26px; border-right:0.5px solid var(--line); border-top:2px solid transparent; flex:1 1 220px; min-width:220px; }
.stat-icon{ width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center; margin-bottom:16px; }
.stat-icon svg{ width:18px; height:18px; }
.stat-icon.c-red{ background:rgba(176,58,46,0.15); color:var(--red); }
.stat-icon.c-brass{ background:rgba(240,180,41,0.15); color:var(--brass); }
.stat.border-red{ border-top-color:var(--red); }
.stat.border-brass{ border-top-color:var(--brass); }
.stat-label{ font-size:12px; color:var(--cream-dim); text-transform:uppercase; letter-spacing:0.07em; margin-bottom:10px; }
.stat-value{ font-family:'IBM Plex Mono',monospace; font-size:34px; font-weight:500; }
.stat-value.c-red{ color:var(--red); }
.stat-value.c-brass{ color:var(--brass); }
.stat-note{ font-size:11px; color:var(--cream-dim); margin-top:8px; }

/* ---------- section heading ---------- */
.section{ padding:76px 0; border-bottom:0.5px solid var(--line); }
.section:last-of-type{ border-bottom:none; }
.section-head{ display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:40px; gap:20px; flex-wrap:wrap; }
.section-eyebrow{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--brass); letter-spacing:0.1em; text-transform:uppercase; margin-bottom:12px; }
.section-head h2{ font-family:'Fraunces',serif; font-size:30px; font-weight:500; max-width:480px; }
.section-head .view-all{ font-size:13px; color:var(--cream-dim); border-bottom:0.5px solid var(--line-strong); padding-bottom:2px; white-space:nowrap; }
.section-head .view-all:hover{ color:var(--cream); }

/* ---------- publications grid ---------- */
.pubs{ display:flex; margin-bottom:1px; }
.pub-card{ background:var(--bg); padding:20px; display:flex; flex-direction:column; align-items:flex-start; gap:8px; }
.pub-card.is-latest{ background:var(--surface); }
.pub-card-img{ width:calc(100% + 40px); margin:-20px -20px 4px -20px; object-fit:cover; object-position:top center; display:block; height:120px; }
.pub-card-img-placeholder{ background:linear-gradient(135deg, var(--surface), var(--bg)); }
.pub-latest-label{ font-family:'IBM Plex Mono',monospace; font-size:10px; text-transform:uppercase; letter-spacing:0.08em; color:var(--brass); }

/* Featured (latest) card: full-width horizontal layout — image on the
   left stretches to match the text block's own height, so there's never
   a size mismatch regardless of how long the title/excerpt run. */
.pub-featured{ flex-direction:row; align-items:stretch; background:var(--surface); padding:0; border:0.5px solid var(--line); width:100%; gap:0; height:320px; overflow:hidden; }
.pub-featured .pub-card-img{ width:42%; height:100%; margin:0; flex-shrink:0; object-position:top center; }
.pub-featured-body{ padding:26px 30px; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; gap:8px; flex:1; min-width:0; overflow:hidden; }
.pub-featured-body h3{ font-size:22px; -webkit-line-clamp:3; }
.pub-featured-body p{ margin:0; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

/* Remaining posts: a plain flex row that wraps. Unlike CSS Grid, extra
   space on an incomplete last row is simply shared among the cards
   already there — no leftover empty track/gap is ever possible. */
.pubs-row{ display:flex; flex-wrap:wrap; gap:1px; background:var(--line); border:0.5px solid var(--line); border-top:none; }
.pubs-row .pub-card{ flex:1 1 220px; }
.pub-card:hover h3{ color:var(--brass); }
.pub-tag{ font-size:10px; font-family:'IBM Plex Mono',monospace; text-transform:uppercase; letter-spacing:0.08em; padding:4px 9px; border-radius:3px; align-self:flex-start; }
.tag-monthly-briefing, .tag-briefing{ background:rgba(240,180,41,0.16); color:#F5C863; }
.tag-research-papers, .tag-research{ background:rgba(176,58,46,0.16); color:#E08277; }
.tag-open-letter, .tag-openletter{ background:rgba(76,122,107,0.18); color:#8FC4B2; }
.tag-statements, .tag-statement{ background:rgba(110,124,140,0.2); color:#B7C2CE; }
.tag-announcements, .tag-press-release, .tag-default{ background:rgba(167,156,140,0.16); color:var(--cream-dim); }
.pub-card h3{ font-family:'Fraunces',serif; font-weight:500; font-size:16px; line-height:1.35; transition:color .15s; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.pub-card p{ font-size:13.5px; color:var(--cream-dim); }
.pub-meta{ font-size:11px; color:var(--cream-dim); font-family:'IBM Plex Mono',monospace; margin-top:auto; padding-top:8px; }
.flip-hint{ display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--brass); margin-top:2px; background:transparent; border:none; cursor:pointer; padding:0; }
.flip-hint:hover{ text-decoration:underline; }
.flip-icon{ width:14px; height:14px; flex-shrink:0; }

/* ---------- focus areas ---------- */
.focus-grid{ display:flex; flex-wrap:wrap; gap:1px; background:var(--line); border:0.5px solid var(--line); }
.focus-card{ background:var(--bg); padding:30px 26px; flex:1 1 240px; border-top:2px solid transparent; transition:transform .15s, background .15s; }
.focus-card:hover{ transform:translateY(-3px); background:var(--surface); }
.focus-card.border-red{ border-top-color:var(--red); }
.focus-card.border-brass{ border-top-color:var(--brass); }
.focus-icon{ width:44px; height:44px; border-radius:10px; display:flex; align-items:center; justify-content:center; margin-bottom:18px; }
.focus-icon svg{ width:22px; height:22px; }
.focus-icon.c-red{ background:rgba(176,58,46,0.15); color:var(--red); }
.focus-icon.c-brass{ background:rgba(240,180,41,0.15); color:var(--brass); }
.focus-num{ font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--cream-dim); margin-bottom:8px; letter-spacing:0.05em; }
.focus-card h3{ font-family:'Fraunces',serif; font-size:17px; font-weight:500; margin-bottom:10px; }
.focus-card p{ font-size:13px; color:var(--cream-dim); }

/* ---------- dashboard teaser ---------- */
.dash-panel{ background:var(--surface); border:0.5px solid var(--line); border-radius:10px; padding:36px; display:flex; flex-wrap:wrap; gap:40px; align-items:center; position:relative; overflow:hidden; }
.dash-panel::before{ content:''; position:absolute; top:0; left:0; right:0; height:3px; background:linear-gradient(90deg, var(--red), var(--brass)); }
.dash-panel > div{ flex:1 1 320px; }
.dash-copy .section-eyebrow{ margin-bottom:14px; }
.dash-copy h2{ font-family:'Fraunces',serif; font-size:26px; margin-bottom:14px; }
.dash-copy p{ color:var(--cream-dim); font-size:14px; margin-bottom:22px; }
.dash-chart{ background:var(--bg); border:0.5px solid var(--line); border-radius:8px; padding:22px; }
.dash-chart-title{ font-size:11px; color:var(--cream-dim); text-transform:uppercase; letter-spacing:0.06em; margin-bottom:16px; }
.bars{ display:flex; align-items:flex-end; gap:6px; height:110px; }
.bars div{ flex:1; background:var(--red); border-radius:2px 2px 0 0; opacity:0.85; }

/* ---------- newsletter ---------- */
.newsletter{ background:var(--surface-2); }
.nl-inner{ display:flex; justify-content:space-between; align-items:center; gap:30px; padding:56px 0; flex-wrap:wrap; }
.nl-copy h2{ font-family:'Fraunces',serif; font-size:24px; margin-bottom:8px; }
.nl-copy p{ color:var(--cream-dim); font-size:13.5px; }
.nl-form{ display:flex; gap:0; border:0.5px solid var(--line-strong); border-radius:6px; overflow:hidden; min-width:320px; flex:1 1 360px; max-width:460px; }
.nl-form input{ flex:1; background:transparent; border:none; padding:14px 16px; color:var(--cream); font-family:'IBM Plex Mono',monospace; font-size:13px; min-width:0; }
.nl-form input::placeholder{ color:var(--cream-dim); }
.nl-form button{ background:var(--red); color:var(--cream); border:none; padding:0 22px; font-size:13px; font-weight:500; cursor:pointer; }
.nl-form button:hover{ background:var(--red-dim); }
.nl-note{ font-size:11px; color:var(--cream-dim); margin-top:10px; }

/* ---------- generic content page ---------- */
.page-header{ padding:60px 0 40px; border-bottom:0.5px solid var(--line); }
.page-header .section-eyebrow{ margin-bottom:14px; }
.page-header h1{ font-family:'Fraunces',serif; font-size:38px; font-weight:500; }
.entry-meta{ font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--cream-dim); }
.flipbook-canvas-wrap{ width:100%; }
.entry-content{ padding:50px 0; max-width:760px; margin:0 auto; font-size:16px; line-height:1.8; }
.entry-content h2{ font-family:'Fraunces',serif; font-size:24px; margin:32px 0 14px; font-weight:500; }
.entry-content h3{ font-family:'Fraunces',serif; font-size:19px; margin:26px 0 12px; font-weight:500; }
.entry-content p{ margin-bottom:16px; color:var(--cream); }
.entry-content a{ color:var(--brass); text-decoration:underline; text-underline-offset:2px; }
.entry-content ul, .entry-content ol{ margin:0 0 16px 22px; }
.entry-content ul{ list-style:disc; }
.entry-content ol{ list-style:decimal; }
.entry-content blockquote{ border-left:3px solid var(--red); padding:4px 0 4px 20px; color:var(--cream-dim); font-style:italic; margin:20px 0; }
.entry-content img{ border-radius:8px; margin:20px 0; }
.wp-caption, .wp-block-image{ margin:20px 0; }

/* ---------- archive / list pages ---------- */
.archive-list{ display:flex; flex-direction:column; gap:1px; background:var(--line); border:0.5px solid var(--line); margin:40px 0; }
.archive-item{ background:var(--bg); padding:22px 26px; display:flex; flex-direction:column; align-items:flex-start; gap:10px; }
.archive-item h3{ font-family:'Fraunces',serif; font-weight:500; font-size:19px; }
.archive-item h3 a:hover{ color:var(--brass); }
.archive-item p{ font-size:13.5px; color:var(--cream-dim); }
.pagination{ display:flex; gap:10px; justify-content:center; padding:20px 0 60px; }
.pagination a, .pagination span{ padding:8px 14px; border:0.5px solid var(--line-strong); border-radius:6px; font-size:13px; }
.pagination .current{ background:var(--red); border-color:var(--red); }

/* ---------- flipbook viewer ---------- */
.flipbook-overlay{
  position:fixed; inset:0; background:rgba(8,7,6,0.94); z-index:1000;
  display:none; align-items:center; justify-content:center; flex-direction:column; padding:24px;
  overflow-y:auto;
}
.flipbook-overlay.open{ display:flex; }
.flipbook-toolbar{ display:flex; justify-content:space-between; align-items:center; width:100%; max-width:1000px; margin-bottom:14px; }
.flipbook-toolbar span{ font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--cream-dim); }
.flipbook-close{ background:transparent; border:0.5px solid var(--line-strong); color:var(--cream); border-radius:6px; padding:8px 16px; cursor:pointer; font-size:13px; }
.flipbook-close:hover{ border-color:var(--red); color:var(--red); }
.flipbook-stage{ background:#111; border-radius:6px; overflow:hidden; width:min(92vw, 1000px); max-width:100%; }
.flipbook-loading{ color:var(--cream-dim); font-size:13px; font-family:'IBM Plex Mono',monospace; padding:40px; }
.flipbook-nav{ display:flex; gap:10px; margin-top:14px; }
.flipbook-nav button{ background:var(--surface); border:0.5px solid var(--line-strong); color:var(--cream); border-radius:6px; padding:8px 16px; cursor:pointer; font-size:13px; }
.flipbook-nav button:hover{ border-color:var(--brass); }
.flipbook-nav button:disabled{ opacity:0.4; cursor:not-allowed; }

/* ---------- footer ---------- */
footer.site-footer{ padding:56px 0 30px; }
.foot-top{ display:flex; flex-wrap:wrap; gap:40px; margin-bottom:44px; }
.foot-top > div{ flex:1 1 200px; }
.foot-brand{ flex:1.6 1 240px; }
.foot-brand .logo-text{ font-size:20px; }
.foot-brand p{ color:var(--cream-dim); font-size:13px; margin-top:12px; max-width:220px; }
.foot-col h4{ font-size:12px; text-transform:uppercase; letter-spacing:0.07em; color:var(--cream-dim); margin-bottom:16px; }
.foot-col ul{ display:flex; flex-direction:column; gap:11px; }
.foot-col a{ font-size:13.5px; color:var(--cream); opacity:0.85; }
.foot-col a:hover{ opacity:1; color:var(--brass); }
.foot-social{ display:flex; gap:10px; margin-top:18px; }
.foot-social a{ width:32px; height:32px; border:0.5px solid var(--line-strong); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:13px; color:var(--cream-dim); }
.foot-social a:hover{ color:var(--cream); border-color:var(--cream-dim); }
.foot-bottom{ display:flex; justify-content:space-between; padding-top:24px; border-top:0.5px solid var(--line); font-size:12px; color:var(--cream-dim); flex-wrap:wrap; gap:10px; }

/* ---------- responsive ---------- */
@media(max-width:860px){
  .hero h1{ font-size:34px; }
  .stats-inner{ flex-direction:column; }
  .stat{ border-right:none; border-bottom:0.5px solid var(--line); }
  .main-nav{ display:none; }
  .menu-toggle{ display:inline-flex; }
  body.nav-open .main-nav{
    display:flex; flex-direction:column; align-items:flex-start; gap:16px;
    position:fixed; top:0; right:0; bottom:0; width:80%; max-width:320px;
    background:var(--surface); padding:80px 28px 28px; z-index:99; border-left:0.5px solid var(--line-strong);
  }
  body.nav-open .main-nav ul{ flex-direction:column; align-items:flex-start; gap:16px; }
  body.nav-open .main-nav .sub-menu{ position:static; margin-top:8px; display:block; border:none; padding-left:12px; }
}

/* Featured post only switches to a stacked layout on genuinely narrow
   (phone-width) screens, so it stays side-by-side — like RSF's lead
   story layout — at medium widths, including inside the Customizer's
   narrowed preview pane. */
@media(max-width:600px){
  .pub-featured{ flex-direction:column; height:auto; }
  .pub-featured .pub-card-img{ width:100%; height:240px; min-width:0; }
}
