/* =============================================================
   ARTICLES ARCHIVE — SpinesTech — "THE DISPATCH" redesign
   Full structural refactor (paired with a fully rewritten
   page-articles.php) — new markup, new component system, same
   WP_Query / helper-function logic underneath. Shares the same
   ink + gold + emerald + parchment identity as the case-studies
   redesign, so the site reads as one deliberate product.
   Keeps .reveal / .reveal--visible / --delay so the site's existing
   scroll-reveal script keeps working unmodified.

   NOTE: Google Fonts @import REMOVED from here on purpose — it was
   render-blocking and caused a flash of unstyled hero (plain olive
   background) before the grid/glow background painted. The Cairo +
   JetBrains Mono fonts are now enqueued separately via inc/enqueue.php
   (wp_enqueue_style, parallel-loaded, non-blocking) instead.
   ============================================================= */

.art-page :where(*, *::before, *::after) { box-sizing: border-box; }
.art-page :where(img) { display: block; max-width: 100%; }
.art-page :where(a) { color: inherit; text-decoration: none; }
.art-page :where(ul) { list-style: none; padding: 0; margin: 0; }

.art-page {
    --ap-ink: #0a130e;
    --ap-ink-deep: #070d09;
    --ap-emerald: #036d36;
    --ap-emerald-bright: #1fae62;
    --ap-parchment: #ece6d7;
    --ap-parchment-line: #d9d2bf;
    --ap-surface: #fdfdfb;
    --ap-gold: #b6903a;
    --ap-text: #0c1c14;
    --ap-text-soft: #56655a;
    --ap-on-ink: #eef1ea;
    --ap-on-ink-soft: rgba(238, 241, 234, 0.64);
    --ap-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font-display: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    position: relative;
    overflow-x: hidden;
    background: var(--ap-parchment);
    color: var(--ap-text);
    font-family: var(--font-display);
}
.art-page * { overflow-wrap: break-word; }

.art-page::before {
    content: "";
    position: fixed; inset: -10% -10%; z-index: 1; pointer-events: none;
    opacity: 0.03; mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-size: 220px 220px;
}
.art-page > * { position: relative; z-index: 2; }
@media (prefers-reduced-motion: reduce) { .art-page::before { display: none; } }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s ease; transition-delay: var(--delay, 0ms); }
.reveal--visible { opacity: 1; transform: translateY(0); }
.art-cinematic { animation: apFadeUp 1.1s cubic-bezier(0.16,1,0.3,1) forwards; animation-delay: var(--delay, 0s); opacity: 0; transform: translateY(30px); }
@keyframes apFadeUp { to { opacity: 1; transform: translateY(0); } }

@keyframes apDrift { 0%, 100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(0,-16px,0) scale(1.05); } }
@keyframes apScan { 0% { transform: translateY(-110%); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(480%); opacity: 0; } }
@keyframes apSweep { 0% { background-position: -120% 0; } 100% { background-position: 220% 0; } }

.art2-eyebrow { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }
.art2-eyebrow::before { content: ""; width: 1.4rem; height: 1px; background: currentColor; }

.art-btn { display: inline-flex; align-items: center; gap: 0.6rem; padding: 1rem 2.1rem; border-radius: 0.5rem; font-family: system-ui, sans-serif; font-size: 1rem; font-weight: 700; text-decoration: none; position: relative; overflow: hidden; transition: transform 0.25s var(--ap-ease), box-shadow 0.25s ease, background 0.25s ease; }
.art-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.35) 46%, transparent 62%); background-size: 220% 100%; background-position: 130% 0; transition: background-position 0.7s var(--ap-ease); pointer-events: none; }
.art-btn:hover::after { background-position: -30% 0; }
.art-btn--primary { background: var(--ap-emerald); color: #fff; box-shadow: 0 10px 24px -8px rgba(3,109,54,0.45); }
.art-btn--primary:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -8px rgba(3,109,54,0.58); }
.art-btn--ghost { background: transparent; color: #fff; border: 1px solid rgba(238,241,234,0.28); }
.art-btn--ghost:hover { background: rgba(238,241,234,0.06); border-color: var(--ap-gold); }

/* Viewfinder corner-bracket, reused from the case-studies system */
.art2-frame { position: relative; }
.art2-frame::before, .art2-frame::after { content: ""; position: absolute; width: 1.5rem; height: 1.5rem; z-index: 3; pointer-events: none; opacity: 0.85; transition: width 0.3s ease, height 0.3s ease; }
.art2-frame::before { inset-block-start: 0.6rem; inset-inline-start: 0.6rem; border-block-start: 2px solid var(--ap-gold); border-inline-start: 2px solid var(--ap-gold); }
.art2-frame::after  { inset-block-end: 0.6rem; inset-inline-end: 0.6rem; border-block-end: 2px solid var(--ap-gold); border-inline-end: 2px solid var(--ap-gold); }
.art2-frame:hover::before, .art2-frame:hover::after { width: 2rem; height: 2rem; }

/* =============================================================
   HERO
   ============================================================= */
.art2-hero { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 84% -10%, #123522 0%, var(--ap-ink) 55%, var(--ap-ink) 100%); padding-block: var(--space-2xl, clamp(4.5rem,9vw,8rem)) var(--space-xl, clamp(3.5rem,7vw,6rem)); text-align: center; }
.art2-hero__shader { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; opacity: 0.5; }
.art2-hero__glow-1 { position: absolute; top: -16%; inset-inline-end: -8%; width: min(38rem,55vw); height: min(38rem,55vw); background: radial-gradient(circle, rgba(31,174,98,0.15), transparent 70%); animation: apDrift 12s ease-in-out infinite; }
.art2-hero__glow-2 { position: absolute; bottom: -20%; inset-inline-start: -10%; width: min(26rem,40vw); height: min(26rem,40vw); background: radial-gradient(circle, rgba(182,144,58,0.09), transparent 72%); animation: apDrift 15s ease-in-out infinite reverse; }
.art2-hero__grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(238,241,234,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(238,241,234,0.04) 1px, transparent 1px); background-size: 32px 32px; mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, #000 25%, transparent 88%); -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, #000 25%, transparent 88%); }
.art2-hero__scan { position: absolute; inset-inline: 10%; inset-block-start: 0; height: 40%; background: linear-gradient(to bottom, transparent, rgba(31,174,98,0.3), transparent); animation: apScan 3.8s cubic-bezier(0.4,0,0.2,1) 0.3s 1 both; }

.art2-hero__inner { position: relative; z-index: 2; max-width: 52rem; margin-inline: auto; color: #fff; display: flex; flex-direction: column; align-items: center; }
.art2-eyebrow--hero { justify-content: center; color: var(--ap-gold); margin-block-end: 1.1rem; }
.art2-eyebrow--hero::after { content: ""; width: 1.4rem; height: 1px; background: currentColor; }

.art2-hero__title { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.9rem, 4.5vw, 3.3rem); line-height: 1.22; margin-block-end: 1.4rem; letter-spacing: -0.015em; }
.art2-hero__title-accent { background: linear-gradient(100deg, var(--ap-emerald-bright) 0%, #63d999 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.art2-hero__subtitle { font-family: system-ui, sans-serif; font-size: clamp(1rem, 1.5vw, 1.15rem); color: var(--ap-on-ink-soft); line-height: 1.8; margin-block-end: 1.1rem; }
.art2-hero__note { font-family: var(--font-mono); font-size: 0.82rem; color: rgba(238,241,234,0.42); line-height: 1.8; margin-block-end: 2.25rem; }
.art2-hero__pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.art2-pill { padding: 0.5rem 1.1rem; border-radius: 999px; background: rgba(238,241,234,0.05); border: 1px solid rgba(238,241,234,0.16); color: var(--ap-on-ink-soft); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.02em; cursor: default; transition: border-color 0.25s ease, color 0.25s ease; }
.art2-pill:hover { border-color: var(--ap-gold); color: #fff; }

/* =============================================================
   FEATURED ARTICLE — front-page spread
   ============================================================= */
.art2-featured { position: relative; z-index: 5; margin-block-start: -4rem; margin-block-end: clamp(3.5rem, 6vw, 5.5rem); }
.art2-featured__card {
    display: grid; grid-template-columns: minmax(0, 1fr);
    background: var(--ap-surface); border-radius: 0.7rem; overflow: hidden;
    border: 1px solid var(--ap-parchment-line);
    box-shadow: 0 1px 1px rgba(12,28,20,0.04), 0 34px 60px -20px rgba(12,28,20,0.3);
    min-width: 0;
}
@media (min-width: 768px) { .art2-featured__card { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }

.art2-featured__media { position: relative; overflow: hidden; height: 240px; background: var(--ap-ink); }
@media (min-width: 768px) { .art2-featured__media { height: auto; min-height: 100%; } }
.art2-featured__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s ease; filter: saturate(0.94) contrast(1.02); }
.art2-featured__card:hover .art2-featured__media img { transform: scale(1.05); }
.art2-featured__media-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,19,14,0.55) 0%, transparent 45%); pointer-events: none; }
.art2-featured__badge { position: absolute; top: 1rem; inset-inline-start: 1rem; z-index: 2; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.85rem; border-radius: 999px; background: rgba(10,19,14,0.6); border: 1px solid rgba(182,144,58,0.4); backdrop-filter: blur(6px); color: var(--ap-gold); font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; }
.art2-featured__badge .material-symbols-outlined { font-size: 0.95rem; }

.art2-featured__body { padding: clamp(2rem, 4vw, 3.25rem); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.art2-featured__eyebrow { display: flex; align-items: center; gap: 0.7rem; margin-block-end: 1.1rem; }
.art2-featured__eyebrow span:first-child { font-family: var(--font-mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.08em; color: var(--ap-emerald); text-transform: uppercase; }
.art2-featured__eyebrow-line { width: 1.6rem; height: 1px; background: rgba(3,109,54,0.35); }

.art2-featured__body h2 { font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; line-height: 1.3; margin-block-end: 1.1rem; overflow-wrap: anywhere; }
.art2-featured__body h2 a { color: var(--ap-text); }
.art2-featured__body h2 a:hover { color: var(--ap-emerald); }
.art2-featured__body p { font-family: system-ui, sans-serif; font-size: 0.98rem; color: var(--ap-text-soft); line-height: 1.85; margin-block-end: 1.6rem; overflow-wrap: anywhere; }

.art2-featured__footer { display: flex; align-items: center; justify-content: space-between; border-block-start: 1px solid var(--ap-parchment-line); padding-block-start: 1.35rem; }
.art2-featured__time { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--ap-text-soft); }
.art2-featured__time .material-symbols-outlined { font-size: 1rem; }

.art2-read-link { display: inline-flex; align-items: center; gap: 0.5rem; font-family: system-ui, sans-serif; font-weight: 800; color: var(--ap-emerald); }
.art2-read-link .material-symbols-outlined { transition: transform 0.25s ease; }
.art2-read-link:hover .material-symbols-outlined { transform: translateX(-4px); }
[dir="ltr"] .art2-read-link:hover .material-symbols-outlined { transform: translateX(4px); }
.art2-read-link--sm { font-size: 0.85rem; }

/* =============================================================
   GRID — index cards
   ============================================================= */
.art2-grid-section { margin-block-end: var(--space-xl, clamp(3.5rem,7vw,6rem)); }
.art2-grid-section__head { display: flex; align-items: center; gap: 1.75rem; margin-block-end: 2.5rem; }
.art2-grid-section__head h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--ap-text); white-space: nowrap; }
.art2-grid-section__rule { flex: 1; height: 1px; background: var(--ap-parchment-line); }

.art2-grid { display: grid; gap: 1.75rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px)  { .art2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .art2-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.art2-card { position: relative; isolation: isolate; background: var(--ap-surface); border-radius: 0.6rem; overflow: hidden; border: 1px solid var(--ap-parchment-line); display: flex; flex-direction: column; min-width: 0; transition: box-shadow 0.35s var(--ap-ease), transform 0.35s var(--ap-ease), border-color 0.3s ease; }
.art2-card:hover { box-shadow: 0 1px 1px rgba(12,28,20,0.04), 0 26px 48px -18px rgba(12,28,20,0.28); transform: translateY(-6px); border-color: rgba(182,144,58,0.35); }

.art2-card__media { position: relative; display: block; height: 12.5rem; overflow: hidden; background: var(--ap-ink); }
.art2-card__media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.94); transition: filter 0.5s ease, transform 0.6s ease; }
.art2-card:hover .art2-card__media img { filter: saturate(1.02); transform: scale(1.06); }
.art2-card__cat-badge { position: absolute; top: 0.75rem; inset-inline-start: 0.75rem; z-index: 1; font-family: var(--font-mono); background: rgba(10,19,14,0.6); backdrop-filter: blur(4px); border: 1px solid rgba(182,144,58,0.3); color: var(--ap-gold); font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.28rem 0.65rem; border-radius: 999px; max-width: calc(100% - 1.5rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.art2-card__body { padding: 1.6rem; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.art2-card__cat { font-family: var(--font-mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.06em; color: var(--ap-emerald); text-transform: uppercase; margin-block-end: 0.6rem; }
.art2-card__body h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; line-height: 1.4; margin-block-end: 0.8rem; min-height: 2.9rem; overflow-wrap: anywhere; }
.art2-card__body h3 a { color: var(--ap-text); }
.art2-card__body h3 a:hover { color: var(--ap-emerald); }
.art2-card__body p { font-family: system-ui, sans-serif; font-size: 0.84rem; color: var(--ap-text-soft); line-height: 1.7; margin-block-end: 1.35rem; flex: 1; overflow-wrap: anywhere; }
.art2-card__footer { display: flex; align-items: center; justify-content: space-between; border-block-start: 1px solid var(--ap-parchment-line); padding-block-start: 1rem; margin-block-start: auto; }
.art2-card__time { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ap-text-soft); }

/* =============================================================
   PAGINATION
   ============================================================= */
.art2-pagination { display: flex; justify-content: center; gap: 0.6rem; margin-block-start: 3.5rem; flex-wrap: wrap; }
.art2-page-btn { width: 2.75rem; height: 2.75rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--ap-surface); border: 1px solid var(--ap-parchment-line); color: var(--ap-text-soft); font-family: var(--font-mono); font-weight: 700; transition: background 0.25s ease, transform 0.25s ease, color 0.25s ease, border-color 0.25s ease; }
.art2-page-btn:hover { border-color: var(--ap-gold); transform: translateY(-2px); }
.art2-page-btn.current { background: var(--ap-emerald); color: #fff; border-color: var(--ap-emerald); }
.art2-empty { text-align: center; color: var(--ap-text-soft); padding-block: 2rem; font-family: system-ui, sans-serif; }

/* =============================================================
   TOPICS — coverage notes
   ============================================================= */
.art2-topics { background: var(--ap-surface); padding-block: var(--space-2xl, clamp(4.5rem,9vw,8rem)); border-block: 1px solid var(--ap-parchment-line); }
.art2-topics__head { text-align: center; margin-block-end: 3rem; }
.art2-topics__head .art2-eyebrow { justify-content: center; color: var(--ap-gold); }
.art2-topics__head .art2-eyebrow::before { display: none; }
.art2-topics__head h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.15rem); font-weight: 800; color: var(--ap-text); margin-block: 0.6rem 1rem; }
.art2-topics__rule { display: inline-block; width: 2.75rem; height: 3px; border-radius: 999px; background: linear-gradient(90deg, var(--ap-emerald), var(--ap-emerald-bright)); }

.art2-topics__grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px)  { .art2-topics__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .art2-topics__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.art2-topic-card { position: relative; padding: 1.9rem; border-radius: 0.5rem; background: var(--ap-parchment); border: 1px solid var(--ap-parchment-line); transition: transform 0.3s var(--ap-ease), box-shadow 0.3s var(--ap-ease), border-color 0.3s ease; }
.art2-topic-card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -20px rgba(12,28,20,0.28); border-color: rgba(182,144,58,0.4); }
.art2-topic-card__icon { width: 3rem; height: 3rem; border-radius: 0.55rem; background: rgba(3,109,54,0.08); color: var(--ap-emerald); display: flex; align-items: center; justify-content: center; margin-block-end: 1.4rem; transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), background 0.3s ease, color 0.3s ease; }
.art2-topic-card:hover .art2-topic-card__icon { background: var(--ap-emerald); color: #fff; transform: scale(1.08) rotate(-4deg); }
.art2-topic-card h4 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--ap-text); margin-block-end: 0.7rem; }
.art2-topic-card p { font-family: system-ui, sans-serif; font-size: 0.86rem; color: var(--ap-text-soft); line-height: 1.7; }

/* =============================================================
   FINAL CTA
   ============================================================= */
.art2-cta-wrap { padding-block: var(--space-2xl, clamp(4.5rem,9vw,8rem)); }
.art2-cta { position: relative; overflow: hidden; background: var(--ap-ink-deep); border-radius: 0.9rem; padding: var(--space-xl, clamp(3.5rem,7vw,6rem)); text-align: center; }
.art2-cta__glow { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; }
.art2-cta__glow--1 { width: 320px; height: 320px; background: rgba(31,174,98,0.22); top: -80px; inset-inline-end: -80px; }
.art2-cta__glow--2 { width: 280px; height: 280px; background: rgba(182,144,58,0.14); bottom: -80px; inset-inline-start: -80px; }
.art2-cta__inner { position: relative; z-index: 2; }
.art2-cta__inner .art2-eyebrow { justify-content: center; color: var(--ap-gold); margin-block-end: 1rem; }
.art2-cta__inner .art2-eyebrow::before { display: none; }
.art2-cta__inner h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 800; color: #fff; line-height: 1.3; margin-block-end: 1.5rem; }
.art2-cta__inner p { font-family: system-ui, sans-serif; font-size: clamp(1rem, 1.6vw, 1.1rem); color: var(--ap-on-ink-soft); line-height: 1.8; max-width: 42rem; margin-inline: auto; margin-block-end: 2.25rem; }
.art2-cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

@media (max-width: 767px) {
    .art2-hero__pills, .art2-cta__actions { flex-direction: column; align-items: center; }
    .art-btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .art-page *, .art-page *::before, .art-page *::after { animation: none !important; transition-duration: 0s !important; }
}