/* ═══════════════════════════════════════════════════════
   The Masthead — Online Magazine
   Namespace: MAG  ·  Prefix: mag_
   Editorial · Typographic · Authoritative
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,300;1,8..60,400&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Core palette — overrideable via theme editor */
  --accent:         #C41E3A;
  --accent-dark:    #8B1527;
  --accent-light:   #F8E8EB;
  --ink:            #1A1A1A;
  --ink-mid:        #3D3D3D;
  --ink-light:      #6B6B6B;
  --ink-xlight:     #9B9B9B;
  --paper:          #FAFAF8;
  --paper-mid:      #F0F0EC;
  --paper-dark:     #E4E4DC;
  --rule:           #DDDDD5;
  --white:          #FFFFFF;
  --black:          #0A0A0A;
  /* Typography */
  --font-display:   'Playfair Display', Georgia, serif;
  --font-body:      'Source Serif 4', Georgia, serif;
  --font-ui:        'DM Sans', system-ui, sans-serif;
  /* Scale */
  --radius:         4px;
  --radius-lg:      8px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.06);
  --shadow:         0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:      0 12px 40px rgba(0,0,0,.12);
  /* Layout */
  --max-w:          1280px;
  --content-w:      720px;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: var(--font-body); color: var(--ink); background: var(--paper); margin: 0; line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ─────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); color: var(--ink); line-height: 1.2; margin: 0 0 .6em; font-weight: 700; }
h1, h2, h3 { color: var(--accent); }  /* match the drop-cap colour */
p { margin: 0 0 1.4em; }
blockquote { border-left: 4px solid var(--accent); margin: 2em 0; padding: .8em 1.4em; background: var(--paper-mid); font-style: italic; font-size: 1.05rem; color: var(--ink-mid); border-radius: 0 var(--radius) var(--radius) 0; }
blockquote cite { display: block; font-size: .82rem; font-style: normal; color: var(--ink-xlight); margin-top: .5em; font-family: var(--font-ui); }
code { background: var(--paper-dark); padding: 2px 6px; border-radius: 3px; font-size: .88em; }

/* ── Announcement bar ───────────────────────────────────── */
.announce-bar { background: var(--accent); color: #fff; text-align: center; padding: 7px 20px; font-size: .78rem; font-family: var(--font-ui); font-weight: 500; letter-spacing: .03em; }
.announce-bar a { color: rgba(255,255,255,.85); text-decoration: underline; }

/* ── Top utility bar ────────────────────────────────────── */
.top-bar { background: var(--ink); color: rgba(255,255,255,.55); display: flex; align-items: center; justify-content: space-between; padding: 6px 24px; font-size: .7rem; font-family: var(--font-ui); letter-spacing: .06em; }
.top-bar a { color: rgba(255,255,255,.55); font-size: .7rem; transition: color .15s; }
.top-bar a:hover { color: var(--accent); text-decoration: none; }
.top-bar-date { text-transform: uppercase; letter-spacing: .1em; }
.top-bar-social { display: flex; gap: 14px; }
.top-bar-links { display: flex; gap: 20px; }

/* ── Masthead / Header ──────────────────────────────────── */
.masthead { background: var(--masthead-bg, var(--white)); border-bottom: 1px solid var(--rule); padding: 20px 24px; text-align: center; position: relative; }
.masthead-logo { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; color: var(--masthead-text, var(--ink)); letter-spacing: -.02em; line-height: 1; margin-bottom: 4px; }
.masthead-logo span { color: var(--accent); }
.masthead-tagline { font-family: var(--font-ui); font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--masthead-tagline, var(--ink-xlight)); }

/* ── Primary navigation ─────────────────────────────────── */
.primary-nav { background: var(--ink); position: sticky; top: 0; z-index: 500; }
.nav-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; display: flex; align-items: stretch; gap: 0; }
.nav-links-wrap { display: flex; flex-direction: row; align-items: stretch; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav-links-wrap::-webkit-scrollbar { display: none; }
.nav-link { display: flex; align-items: center; padding: 13px 14px; font-family: var(--font-ui); font-size: .73rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.7); text-decoration: none; transition: color .15s; border-bottom: 2px solid transparent; white-space: nowrap; flex-shrink: 0; }
.nav-link:hover, .nav-link.active { color: #fff; text-decoration: none; border-bottom-color: var(--accent); }
.nav-search { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 0 0 0 8px; }
.nav-search input { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); color: #fff; padding: 6px 12px; border-radius: var(--radius); font-size: .78rem; font-family: var(--font-ui); width: 170px; }
.nav-search input::placeholder { color: rgba(255,255,255,.35); }
.nav-search input:focus { outline: none; background: rgba(255,255,255,.12); border-color: var(--accent); }
.nav-search button { background: var(--accent); color: #fff; border: none; padding: 6px 11px; border-radius: var(--radius); cursor: pointer; font-size: .8rem; flex-shrink: 0; }
.nav-user-area { display: flex; align-items: center; gap: 8px; padding-left: 10px; flex-shrink: 0; }
.nav-btn { font-family: var(--font-ui); font-size: .72rem; font-weight: 600; padding: 6px 14px; border-radius: var(--radius); cursor: pointer; border: none; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; transition: all .15s; }
.nav-btn-outline { background: transparent; color: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.25); }
.nav-btn-outline:hover { color: #fff; border-color: rgba(255,255,255,.6); text-decoration: none; }
.nav-btn-accent { background: var(--accent); color: #fff; }
.nav-btn-accent:hover { background: var(--accent-dark); text-decoration: none; color: #fff; }
.nav-hamburger { display: none; background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; padding: 8px; flex-shrink: 0; }
@media(max-width: 900px) {
  .nav-hamburger { display: flex; margin-left: auto; }
  .nav-links-wrap { display: none; flex-direction: column; overflow-x: visible; position: absolute; top: 100%; left: 0; right: 0; background: var(--ink); z-index: 600; padding: 10px 0; box-shadow: var(--shadow); flex: none; }
  .nav-links-wrap.open { display: flex; }
  .nav-link { border-bottom: none; border-left: 3px solid transparent; white-space: normal; padding: 11px 18px; }
  .nav-link.active, .nav-link:hover { border-bottom-color: transparent; border-left-color: var(--accent); }
  .nav-search { display: none; }
  .nav-user-area { display: none; }
}

/* ── Breaking news ticker ────────────────────────────────── */
.breaking-bar { background: var(--accent); color: #fff; display: flex; align-items: center; overflow: hidden; }
.breaking-label { background: var(--accent-dark); padding: 7px 16px; font-family: var(--font-ui); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; flex-shrink: 0; }
.breaking-ticker { overflow: hidden; padding: 7px 20px; font-size: .8rem; font-family: var(--font-ui); }
.breaking-ticker marquee { font-size: .8rem; }

/* ── Layout containers ──────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: var(--content-w); margin: 0 auto; padding: 0 20px; }
.site-grid { display: grid; grid-template-columns: 1fr 320px; gap: 40px; max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
@media(max-width: 1000px) { .site-grid { grid-template-columns: 1fr; } .sidebar { order: 2; } }
.section { padding: 48px 0; }
.section-sm { padding: 28px 0; }
.section-divider { border: none; border-top: 1px solid var(--rule); margin: 32px 0; }

/* ── Section labels ─────────────────────────────────────── */
.section-label { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.section-label-text { font-family: var(--font-ui); font-size: .68rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-light); }
.section-label-line { flex: 1; height: 1px; background: var(--rule); }
.section-label-accent { background: var(--accent); color: #fff; font-family: var(--font-ui); font-size: .65rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; padding: 4px 12px; }

/* ── Featured carousel ──────────────────────────────────── */
.hero-carousel { position: relative; overflow: hidden; background: var(--ink); }
.carousel-track { display: flex; transition: transform .5s cubic-bezier(.4,0,.2,1); }
.carousel-slide { min-width: 100%; position: relative; height: 560px; }
@media(max-width: 768px) { .carousel-slide { height: 380px; } }
.carousel-slide-img { width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.carousel-slide-bg { width: 100%; height: 100%; background-size: cover; background-position: center; }
.carousel-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.3) 50%, transparent 100%); }
.carousel-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 40px 48px; max-width: 800px; }
@media(max-width: 768px) { .carousel-content { padding: 24px 20px; } }
.carousel-cat { display: inline-block; background: var(--accent); color: #fff; font-family: var(--font-ui); font-size: .65rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; padding: 4px 10px; margin-bottom: 12px; }
.carousel-title { font-family: var(--font-display); font-size: clamp(1.6rem, 3.5vw, 2.8rem); color: #fff; font-weight: 900; line-height: 1.15; margin-bottom: 10px; }
.carousel-meta { font-family: var(--font-ui); font-size: .78rem; color: rgba(255,255,255,.6); }
.carousel-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; background: #fff; color: var(--ink); font-family: var(--font-ui); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 10px 20px; text-decoration: none; transition: all .2s; }
.carousel-btn:hover { background: var(--accent); color: #fff; text-decoration: none; }
.carousel-nav { position: absolute; bottom: 24px; right: 48px; display: flex; gap: 8px; }
@media(max-width: 768px) { .carousel-nav { right: 20px; bottom: 16px; } }
.carousel-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); border: none; cursor: pointer; padding: 0; transition: all .2s; }
.carousel-dot.active { background: #fff; width: 24px; border-radius: 4px; }
.carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.2); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s; z-index: 2; font-size: 1rem; }
.carousel-arrow:hover { background: var(--accent); border-color: var(--accent); }
.carousel-arrow-prev { left: 16px; }
.carousel-arrow-next { right: 16px; }

/* ── Article cards ──────────────────────────────────────── */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media(max-width: 900px) { .article-grid { grid-template-columns: repeat(2, 1fr); } }
@media(max-width: 560px) { .article-grid { grid-template-columns: 1fr; } }
.article-grid-2 { grid-template-columns: repeat(2, 1fr); }
.article-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media(max-width: 900px) { .article-grid-4 { grid-template-columns: repeat(2, 1fr); } }

.article-card { display: flex; flex-direction: column; cursor: pointer; }
.article-card:hover .article-card-title { color: var(--accent); }
.article-card-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--paper-dark); margin-bottom: 14px; }
.article-card-img-placeholder { width: 100%; aspect-ratio: 16/10; background: var(--paper-dark); margin-bottom: 14px; display: flex; align-items: center; justify-content: center; color: var(--rule); font-size: 2rem; }
.article-card-cat { font-family: var(--font-ui); font-size: .65rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.article-card-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--ink); line-height: 1.3; margin-bottom: 8px; transition: color .15s; }
.article-card-title-lg { font-size: 1.45rem; }
.article-card-excerpt { font-family: var(--font-ui); font-size: .82rem; color: var(--ink-light); line-height: 1.6; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 10px; }
.article-card-meta { font-family: var(--font-ui); font-size: .7rem; color: var(--ink-xlight); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.article-card-meta .sep { opacity: .4; }
.premium-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--ink); color: #fff; font-family: var(--font-ui); font-size: .58rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border-radius: 2px; }
.featured-flag { background: var(--accent); color: #fff; }

/* ── Lead article (big) ─────────────────────────────────── */
.lead-article { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-bottom: 1px solid var(--rule); padding-bottom: 32px; margin-bottom: 32px; }
@media(max-width: 768px) { .lead-article { grid-template-columns: 1fr; } }
.lead-article-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.lead-article-body { padding: 0 0 0 32px; display: flex; flex-direction: column; justify-content: center; }
@media(max-width: 768px) { .lead-article-body { padding: 20px 0 0; } }
.lead-article-title { font-family: var(--font-display); font-size: clamp(1.4rem, 2.5vw, 2.2rem); font-weight: 900; line-height: 1.15; color: var(--ink); margin-bottom: 14px; }
.lead-article-excerpt { font-size: .95rem; color: var(--ink-mid); line-height: 1.75; margin-bottom: 14px; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar-widget { background: var(--white); border: 1px solid var(--rule); margin-bottom: 24px; }
.sidebar-widget-head { background: var(--ink); color: #fff; padding: 10px 16px; font-family: var(--font-ui); font-size: .65rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.sidebar-widget-body { padding: 16px; }
.sidebar-article { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.sidebar-article:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-article-img { width: 70px; height: 52px; object-fit: cover; flex-shrink: 0; }
.sidebar-article-title { font-family: var(--font-display); font-size: .82rem; font-weight: 700; line-height: 1.35; color: var(--ink); }
.sidebar-article-meta { font-family: var(--font-ui); font-size: .68rem; color: var(--ink-xlight); margin-top: 3px; }

/* ── Ad slots ────────────────────────────────────────────── */
.ad-slot { text-align: center; background: var(--paper-mid); border: 1px dashed var(--rule); position: relative; overflow: hidden; }
.ad-slot-label { font-family: var(--font-ui); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-xlight); position: absolute; top: 6px; right: 8px; }
.ad-slot img { width: 100%; height: auto; display: block; }
.ad-banner { width: 100%; height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-rectangle { width: 100%; height: 250px; display: flex; align-items: center; justify-content: center; }
.ad-leaderboard { width: 100%; max-width: 728px; height: 90px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }

/* ── Article page ────────────────────────────────────────── */
.article-header { padding: 40px 0 28px; border-bottom: 1px solid var(--rule); margin-bottom: 32px; }
.article-kicker { font-family: var(--font-ui); font-size: .68rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.article-kicker::after { content: ''; flex: 1; max-width: 40px; height: 1px; background: var(--accent); }
.article-title { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 3.2rem); font-weight: 900; line-height: 1.1; color: var(--accent); margin-bottom: 16px; }
.article-subtitle { font-family: var(--font-body); font-size: 1.15rem; color: var(--ink-mid); line-height: 1.6; font-style: italic; margin-bottom: 20px; font-weight: 300; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.article-author { display: flex; align-items: center; gap: 10px; }
.article-author-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--rule); }
.article-author-name { font-family: var(--font-ui); font-size: .82rem; font-weight: 600; color: var(--ink); }
.article-author-role { font-family: var(--font-ui); font-size: .7rem; color: var(--ink-xlight); }
.article-meta-item { font-family: var(--font-ui); font-size: .75rem; color: var(--ink-xlight); display: flex; align-items: center; gap: 5px; }
.article-meta-item i { color: var(--ink-xlight); font-size: .72rem; }
.article-share { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.share-btn { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; color: #fff; text-decoration: none; transition: opacity .15s; }
.share-btn:hover { opacity: .8; text-decoration: none; }
.share-facebook { background: #1877F2; }
.share-twitter  { background: #000; }
.share-linkedin { background: #0A66C2; }
.share-whatsapp { background: #25D366; }
.share-copy     { background: var(--ink-light); cursor: pointer; border: none; }

/* ── Article content ─────────────────────────────────────── */
.article-body { font-size: 1.05rem; line-height: 1.85; color: var(--ink-mid); }
.article-body h2 { font-size: 1.6rem; margin: 2em 0 .6em; color: var(--accent); }
.article-body h3 { font-size: 1.25rem; margin: 1.6em 0 .5em; color: var(--accent); }
.article-body p { margin-bottom: 1.5em; }
.article-body a { color: var(--accent); text-decoration: underline; }
.article-body ul, .article-body ol { padding-left: 1.6em; margin-bottom: 1.5em; }
.article-body li { margin-bottom: .4em; }
.article-body img { margin: 2em auto; border-radius: var(--radius); box-shadow: var(--shadow); }

/* Drop cap */
.article-body .drop-cap::first-letter,
.article-body.drop-cap > p:first-of-type::first-letter {
  font-family: var(--font-display); font-size: 4.5rem; font-weight: 900;
  float: left; line-height: .75; margin: .08em .12em -.04em 0;
  color: var(--accent);
}

/* Pull quote */
.pull-quote { border-left: none; border-top: 3px solid var(--accent); border-bottom: 1px solid var(--rule); margin: 2.5em 0; padding: 1.2em 0 1em; font-family: var(--font-display); font-size: 1.45rem; font-style: italic; font-weight: 700; color: var(--ink); line-height: 1.4; text-align: center; background: none; }
.pull-quote cite { font-family: var(--font-ui); font-size: .78rem; font-style: normal; color: var(--ink-xlight); margin-top: .6em; font-weight: 400; }

/* Callout / announcement box */
.callout-box { border-left: 4px solid var(--accent); background: var(--accent-light); padding: 16px 20px; margin: 2em 0; border-radius: 0 var(--radius) var(--radius) 0; }
.callout-box.callout-info    { border-color: #2563EB; background: #EFF6FF; }
.callout-box.callout-warning { border-color: #D97706; background: #FFFBEB; }
.callout-box.callout-success { border-color: #059669; background: #ECFDF5; }
.callout-box-title { font-family: var(--font-ui); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }

/* 2-column layout */
.col-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin: 2em 0; }
.col-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; margin: 2em 0; }
.col-2-wide { grid-template-columns: 2fr 1fr; }
.col-2-wide-right { grid-template-columns: 1fr 2fr; }
@media(max-width: 640px) { .col-2, .col-3, .col-2-wide, .col-2-wide-right { grid-template-columns: 1fr; } }

/* Inline image alignment classes */
.img-left  { float: left; margin: .5em 1.6em .8em 0; max-width: 45%; }
.img-right { float: right; margin: .5em 0 .8em 1.6em; max-width: 45%; }
.img-center { display: block; margin: 1.5em auto; }
.img-full   { display: block; margin: 1.5em -2em; max-width: none; width: calc(100% + 4em); }
.img-25  { width: 25%; }
.img-50  { width: 50%; }
.img-75  { width: 75%; }
.img-100 { width: 100%; max-width: none; }
.clearfix::after { content: ''; display: table; clear: both; }
.img-caption { font-family: var(--font-ui); font-size: .72rem; color: var(--ink-xlight); text-align: center; margin-top: 6px; font-style: italic; }

/* Article featured image */
.article-featured-img { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius); margin-bottom: 8px; }
.article-img-caption { font-family: var(--font-ui); font-size: .72rem; color: var(--ink-xlight); margin-bottom: 28px; }

/* Tags */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.tag { display: inline-block; background: var(--paper-mid); color: var(--ink-mid); font-family: var(--font-ui); font-size: .7rem; font-weight: 500; padding: 5px 12px; border-radius: 2px; border: 1px solid var(--rule); text-decoration: none; transition: all .15s; }
.tag:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }

/* ── Photo gallery ───────────────────────────────────────── */
.gallery-grid-photo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery-grid-photo.masonry-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-grid-photo.masonry-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-grid-photo.masonry-4 { grid-template-columns: repeat(4, 1fr); }
@media(max-width: 768px) { .gallery-grid-photo, .gallery-grid-photo.masonry-3, .gallery-grid-photo.masonry-4 { grid-template-columns: repeat(2, 1fr); } }
@media(max-width: 480px) { .gallery-grid-photo, .gallery-grid-photo.masonry-2, .gallery-grid-photo.masonry-3, .gallery-grid-photo.masonry-4 { grid-template-columns: 1fr; } }
.gallery-photo-item { position: relative; overflow: hidden; cursor: zoom-in; background: var(--paper-mid); border: 1px solid var(--rule); aspect-ratio: 4 / 3; }
.gallery-photo-item img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .4s ease, opacity .3s; }
.gallery-photo-item:hover img { transform: scale(1.04); opacity: .85; }
.gallery-photo-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.7), transparent); opacity: 0; transition: opacity .3s; display: flex; align-items: flex-end; padding: 14px; }
.gallery-photo-item:hover .gallery-photo-overlay { opacity: 1; }
.gallery-photo-caption { color: #fff; font-family: var(--font-ui); font-size: .75rem; line-height: 1.4; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.95); z-index: 9999; display: none; flex-direction: column; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox-img { max-width: 90vw; max-height: 80vh; object-fit: contain; border-radius: var(--radius); }
.lightbox-caption { color: rgba(255,255,255,.7); font-family: var(--font-ui); font-size: .8rem; margin-top: 14px; text-align: center; max-width: 600px; }
.lightbox-close { position: absolute; top: 20px; right: 24px; background: none; border: none; color: rgba(255,255,255,.6); font-size: 1.8rem; cursor: pointer; line-height: 1; transition: color .15s; }
.lightbox-close:hover { color: #fff; }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.1rem; transition: background .2s; border-radius: 50%; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover, .lightbox-next:hover { background: var(--accent); border-color: var(--accent); }
.lightbox-counter { position: absolute; bottom: 20px; color: rgba(255,255,255,.5); font-family: var(--font-ui); font-size: .78rem; }

/* ── Author profile ─────────────────────────────────────── */
.author-card { display: flex; gap: 24px; padding: 28px; background: var(--paper-mid); border: 1px solid var(--rule); margin: 32px 0; }
.author-card-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-card-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.author-card-role { font-family: var(--font-ui); font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.author-card-bio { font-family: var(--font-ui); font-size: .85rem; color: var(--ink-mid); line-height: 1.6; }
.author-social { display: flex; gap: 10px; margin-top: 10px; }
.author-social a { color: var(--ink-xlight); font-size: .9rem; transition: color .15s; }
.author-social a:hover { color: var(--accent); }

/* ── Subscription gate ──────────────────────────────────── */
.premium-gate { background: linear-gradient(to bottom, transparent, var(--paper)); padding: 48px 28px 32px; text-align: center; margin-top: -80px; position: relative; z-index: 2; }
.premium-gate-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 900; margin-bottom: 10px; }
.premium-gate-sub { font-family: var(--font-ui); font-size: .9rem; color: var(--ink-light); margin-bottom: 20px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer { background: var(--ink); color: rgba(255,255,255,.6); padding: 56px 0 20px; margin-top: 60px; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.footer-logo { font-family: var(--font-display); font-size: 1.8rem; font-weight: 900; color: #fff; margin-bottom: 8px; }
.footer-logo span { color: var(--accent); }
.footer-tagline { font-size: .78rem; color: rgba(255,255,255,.35); font-family: var(--font-ui); letter-spacing: .08em; margin-bottom: 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
@media(max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media(max-width: 480px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }
.footer-col { display: flex; flex-direction: column; }
.footer-col h5 { font-family: var(--font-ui); font-size: .65rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.4); margin-bottom: 14px; }
.footer-col a { display: block; color: rgba(255,255,255,.55); font-size: .82rem; font-family: var(--font-ui); margin-bottom: 8px; transition: color .15s; text-decoration: none; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: 20px; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; font-family: var(--font-ui); font-size: .72rem; color: rgba(255,255,255,.3); }
.footer-bottom-legal { display: flex; flex-direction: row; gap: 16px; align-items: center; flex-wrap: wrap; }
@media(max-width: 600px) { .footer-bottom { flex-direction: column; align-items: flex-start; } .footer-bottom-legal { gap: 12px; } }
.footer-social { display: flex; gap: 14px; }
.footer-social a { color: rgba(255,255,255,.4); font-size: .9rem; transition: color .15s; }
.footer-social a:hover { color: var(--accent); }

/* ── Forms ───────────────────────────────────────────────── */
.form-label { font-family: var(--font-ui); font-size: .78rem; font-weight: 600; color: var(--ink-mid); display: block; margin-bottom: 5px; }
.form-control { width: 100%; padding: 10px 14px; border: 1.5px solid var(--rule); border-radius: var(--radius); font-size: .9rem; font-family: var(--font-ui); color: var(--ink); background: var(--white); transition: border-color .15s; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
textarea.form-control { resize: vertical; min-height: 120px; }
.form-group { margin-bottom: 18px; }
.form-hint { font-family: var(--font-ui); font-size: .7rem; color: var(--ink-xlight); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── Buttons ──────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 22px; font-family: var(--font-ui); font-size: .82rem; font-weight: 600; letter-spacing: .04em; cursor: pointer; border: 2px solid transparent; border-radius: var(--radius); transition: all .15s; text-decoration: none; }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-outline:hover { border-color: var(--ink); text-decoration: none; }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-dark:hover { background: var(--ink-mid); text-decoration: none; color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .75rem; }
.btn-lg { padding: 14px 32px; font-size: .92rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-family: var(--font-ui); font-size: .82rem; margin-bottom: 16px; }
.alert-error   { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.alert-success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }
.alert-info    { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb { font-family: var(--font-ui); font-size: .72rem; color: var(--ink-xlight); padding: 12px 0; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.breadcrumb a { color: var(--ink-xlight); transition: color .15s; }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb-sep { opacity: .4; font-size: .6rem; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; margin: 40px 0; }
.page-btn { min-width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; font-family: var(--font-ui); font-size: .82rem; font-weight: 600; border: 1.5px solid var(--rule); background: var(--white); color: var(--ink); cursor: pointer; border-radius: var(--radius); transition: all .15s; }
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: .35; cursor: default; }

/* ── Toast ───────────────────────────────────────────────── */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 9998; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 18px; border-radius: var(--radius); color: #fff; font-family: var(--font-ui); font-size: .82rem; font-weight: 600; box-shadow: var(--shadow); animation: slideUp .25s ease; max-width: 320px; }
.toast.success { background: #059669; }
.toast.error   { background: #DC2626; }
.toast.info    { background: var(--ink); }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Utility ──────────────────────────────────────────────── */
.text-accent { color: var(--accent); }
.text-muted  { color: var(--ink-xlight); }
.text-center { text-align: center; }
.font-ui     { font-family: var(--font-ui); }
.font-display { font-family: var(--font-display); }
.img-lazy { opacity: 0; transition: opacity .3s; }
.img-lazy.loaded { opacity: 1; }
.sticky { position: sticky; top: 80px; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Reading progress bar ────────────────────────────────── */
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); z-index: 9999; transition: width .1s; width: 0; }

/* ── RSS badge ───────────────────────────────────────────── */
.rss-badge { display: inline-flex; align-items: center; gap: 5px; background: #F26522; color: #fff; font-family: var(--font-ui); font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 2px; }

/* ── Subscription plans ──────────────────────────────────── */
.plan-card { border: 2px solid var(--rule); padding: 28px; border-radius: var(--radius-lg); text-align: center; }
.plan-card.featured-plan { border-color: var(--accent); position: relative; }
.plan-price { font-family: var(--font-display); font-size: 2.8rem; font-weight: 900; color: var(--ink); line-height: 1; }
.plan-price sup { font-size: 1.2rem; vertical-align: top; margin-top: 8px; }
.plan-price sub { font-family: var(--font-ui); font-size: .85rem; color: var(--ink-xlight); }
.plan-feature { font-family: var(--font-ui); font-size: .82rem; color: var(--ink-mid); padding: 7px 0; border-bottom: 1px solid var(--rule); display: flex; align-items: center; gap: 8px; text-align: left; }
.plan-feature i { color: var(--accent); font-size: .78rem; }

/* ── Maintenance page ────────────────────────────────────── */
.maintenance-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; background: var(--ink); color: #fff; }

/* ── Quill overrides ─────────────────────────────────────── */
.ql-editor { font-family: var(--font-body); font-size: 1rem; line-height: 1.8; color: var(--ink); min-height: 400px; }
.ql-editor h1 { font-family: var(--font-display); }
.ql-editor h2 { font-family: var(--font-display); }
.ql-toolbar.ql-snow { border-color: var(--rule) !important; border-radius: var(--radius) var(--radius) 0 0 !important; background: var(--paper); }
.ql-container.ql-snow { border-color: var(--rule) !important; border-radius: 0 0 var(--radius) var(--radius) !important; }

/* ── Category filter tabs (FlyingCarpetNews / SohoMag pattern) ─── */
.cat-filter-tab, .cat-page-tab {
  padding: 7px 14px; font-family: var(--font-ui); font-size: .72rem; font-weight: 600;
  background: none; border: none; cursor: pointer; white-space: nowrap;
  transition: all .15s; flex-shrink: 0;
}
.cat-filter-tab { border-radius: 20px; color: var(--ink-light); }
.cat-filter-tab.active { color: #fff; }
.cat-page-tab { color: var(--ink-light); border-bottom: 2px solid transparent; padding: 10px 16px; margin-bottom: -2px; }
.cat-page-tab:hover { color: var(--ink); }
.cat-page-tab.active { color: var(--ink); }
.cat-filter-tabs::-webkit-scrollbar { display: none; }

/* ── Compact card (SohoMag pattern) ──────────────────── */
.article-card-compact { display: flex; flex-direction: column; cursor: pointer; }
.article-card-compact:hover .article-card-compact-title { color: var(--accent); }
.article-card-compact-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--paper-dark); margin-bottom: 10px; }
.article-card-compact-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--ink); line-height: 1.3; margin-bottom: 5px; transition: color .15s; }
.article-card-compact-date { font-family: var(--font-ui); font-size: .7rem; color: var(--ink-xlight); }
@media(max-width: 768px) {
  .top-bar-links { display: none; }
  .masthead { padding: 14px 16px; }
  .section { padding: 32px 0; }
  .article-grid { grid-template-columns: 1fr; }
  .lead-article { grid-template-columns: 1fr; }
  .img-left, .img-right { float: none; max-width: 100%; margin: 1em 0; }
  .img-full { margin: 1.5em 0; width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .col-2, .col-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* Featured badge — appears on article cards when admin marks isFeatured */
.featured-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--accent); color: #fff; font-family: var(--font-ui); font-size: .65rem; font-weight: 700; padding: 2px 7px; border-radius: 3px; text-transform: uppercase; letter-spacing: .08em; margin-left: 6px; }
.featured-badge i { font-size: .6rem; }
