/* The Archive: gallery + single post. Every class is prefixed ar- so theme CSS can't collide. */
.aem-ar {
  --ar-bg: #e8eef0; --ar-surface: #f9fbfb; --ar-ink: #142a30; --ar-muted: #4d646b; --ar-line: #c3d2d7;
  --ar-accent: #1d6a86; --ar-accent-ink: #fff; --ar-gold: #d9a21b; --ar-gold-ink: #2a1f00;
  --ar-hero: #12303a; --ar-hero-ink: #f1f6f6; --ar-hero-muted: #b7cdd3; --ar-ridge-back: #1b4654;
  --ar-serif: 'Young Serif', Georgia, 'Times New Roman', serif;
  background: var(--ar-bg); color: var(--ar-ink);
  font-family: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.5;
  box-sizing: border-box;
}
.aem-ar *, .aem-ar *::before, .aem-ar *::after { box-sizing: inherit; }
.aem-ar a { color: inherit; }
.aem-ar button, .aem-ar input, .aem-ar select { font: inherit; color: inherit; }
.aem-ar :focus-visible { outline: 3px solid var(--ar-gold); outline-offset: 2px; }
.aem-ar h1, .aem-ar h2, .aem-ar h3 { color: inherit; text-transform: none; letter-spacing: normal; }

/* Header band runs edge to edge even inside a narrow theme container */
.aem-ar .ar-hero { position: relative; left: 50%; right: 50%; width: 100vw; margin-left: -50vw; margin-right: -50vw; overflow: hidden; background: var(--ar-hero); color: var(--ar-hero-ink); }
.aem-ar .ar-hero-in { position: relative; z-index: 2; max-width: 1280px; margin: 0 auto; padding: 24px 28px 132px; }
.aem-ar .ar-hero-ridge { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 130px; z-index: 1; display: block; }
.aem-ar .ar-ridge-back { fill: var(--ar-ridge-back); }
.aem-ar .ar-ridge-front { fill: var(--ar-bg); }
.aem-ar .ar-welcome { font-size: 14px; color: var(--ar-hero-muted); }
.aem-ar .ar-welcome strong { color: var(--ar-hero-ink); font-weight: 600; }
.aem-ar .ar-title { font-family: var(--ar-serif); font-weight: 400; font-size: clamp(32px, 5vw, 56px); line-height: 1.05; letter-spacing: -.01em; margin: 28px 0 14px; color: var(--ar-hero-ink); }
.aem-ar .ar-logo { display: inline-block; margin-top: 22px; padding: 10px 18px; background: #fbfdfd; border-radius: 12px; line-height: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.aem-ar .ar-logo img { display: block; height: 88px; width: auto; max-width: 100%; }
.aem-ar .ar-logo + .ar-title { margin-top: 22px; }
.aem-ar .ar-title--post { font-size: clamp(30px, 5vw, 54px); line-height: 1.08; max-width: 26ch; margin: 14px 0 12px; }
.aem-ar .ar-lede { max-width: 58ch; margin: 0; font-size: 18px; line-height: 1.6; color: var(--ar-hero-muted); }
.aem-ar .ar-hero-meta { margin: 0; font-size: 16px; color: var(--ar-hero-muted); }
.aem-ar .ar-hero-meta a, .aem-ar .ar-crumbs a { color: var(--ar-hero-ink); text-underline-offset: 3px; }
.aem-ar .ar-crumbs { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 30px; font-size: 14px; color: var(--ar-hero-muted); }
.aem-ar .ar-hero--post .ar-hero-in { padding-top: 12px; }

/* Gallery layout */
.aem-ar .ar-layout { max-width: 1280px; margin: 0 auto; padding: 8px 28px 90px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 52px; }
.aem-ar .ar-rail { position: sticky; top: 20px; align-self: start; }
.aem-ar .ar-rail h2 { font-family: var(--ar-serif); font-weight: 400; font-size: 19px; margin: 28px 0 8px; padding: 0; }
.aem-ar .ar-search label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.aem-ar .ar-search input { width: 100%; padding: 11px 12px; border: 1px solid var(--ar-line); border-radius: 6px; background: var(--ar-surface); height: auto; }
.aem-ar .ar-rail-toggle { display: none; }
.aem-ar .ar-cats { list-style: none; margin: 0; padding: 0; }
.aem-ar .ar-cats button { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 9px 10px 9px 14px; border: 0; border-left: 3px solid transparent; background: none; cursor: pointer; font-size: 15px; border-radius: 0; box-shadow: none; text-transform: none; }
.aem-ar .ar-cats button:hover { background: var(--ar-surface); }
.aem-ar .ar-cats button[aria-pressed="true"] { border-left-color: var(--ar-gold); background: var(--ar-surface); font-weight: 600; }
.aem-ar .ar-cats .ar-n { color: var(--ar-muted); font-variant-numeric: tabular-nums; font-weight: 400; }
.aem-ar .ar-evsel { width: 100%; padding: 10px 12px; border: 1px solid var(--ar-line); border-radius: 6px; background: var(--ar-surface); height: auto; }
.aem-ar .ar-tags { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.aem-ar .ar-tags button, .aem-ar .ar-tags a { padding: 5px 0; border: 0; background: none; cursor: pointer; font-size: 15px; color: var(--ar-muted); text-decoration: underline; text-decoration-color: var(--ar-line); text-underline-offset: 4px; text-decoration-thickness: 1px; box-shadow: none; text-transform: none; border-radius: 0; }
.aem-ar .ar-tags button:hover, .aem-ar .ar-tags a:hover { color: var(--ar-ink); }
.aem-ar .ar-tags button[aria-pressed="true"] { color: var(--ar-accent); font-weight: 600; text-decoration-color: var(--ar-gold); text-decoration-thickness: 3px; }

/* Tag picker: type to find, pick several */
.aem-ar .ar-tagbox { position: relative; }
.aem-ar .ar-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aem-ar .ar-chips:not(:empty) { margin-bottom: 8px; }
.aem-ar .ar-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 4px 8px 4px 11px; border: 1px solid var(--ar-accent); border-radius: 999px; background: #e1eef2; background: color-mix(in srgb, var(--ar-accent) 10%, var(--ar-surface)); color: var(--ar-ink); font-size: 14px; line-height: 1.3; cursor: pointer; box-shadow: none; text-transform: none; }
.aem-ar .ar-chip:hover { background: #cfe3ea; background: color-mix(in srgb, var(--ar-accent) 20%, var(--ar-surface)); }
.aem-ar .ar-chip span:last-child { font-size: 17px; line-height: 1; color: var(--ar-muted); }
.aem-ar .ar-combo { position: relative; }
.aem-ar .ar-tag-input { width: 100%; padding: 10px 36px 10px 12px; border: 1px solid var(--ar-line); border-radius: 6px; background: var(--ar-surface); height: auto; }
.aem-ar .ar-tag-input::placeholder { color: var(--ar-muted); }
.aem-ar .ar-tag-toggle { position: absolute; top: 0; right: 0; bottom: 0; width: 34px; border: 0; background: none; color: var(--ar-muted); cursor: pointer; display: grid; place-items: center; padding: 0; box-shadow: none; }
.aem-ar .ar-tag-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.aem-ar .ar-tag-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; margin: 0; padding: 4px 0; list-style: none; background: var(--ar-surface); border: 1px solid var(--ar-line); border-radius: 8px; box-shadow: 0 10px 28px rgba(15, 35, 42, .22); }
.aem-ar .ar-tag-list[hidden] { display: none; }
.aem-ar .ar-opt { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 12px 8px 34px; position: relative; cursor: pointer; font-size: 15px; line-height: 1.35; }
.aem-ar .ar-opt-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.aem-ar .ar-opt .ar-n { color: var(--ar-muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.aem-ar .ar-opt.is-active, .aem-ar .ar-opt:hover { background: #e1eef2; background: color-mix(in srgb, var(--ar-accent) 10%, var(--ar-surface)); }
.aem-ar .ar-opt.is-selected { font-weight: 600; }
.aem-ar .ar-opt.is-selected::before { content: ''; position: absolute; left: 13px; top: 50%; width: 5px; height: 10px; margin-top: -7px; border: solid var(--ar-accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.aem-ar .ar-opt-empty { padding: 10px 12px; color: var(--ar-muted); font-size: 14px; }
.aem-ar .ar-match { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--ar-muted); }
.aem-ar .ar-match[hidden] { display: none; }
.aem-ar .ar-match button { padding: 3px 11px; border: 1px solid var(--ar-line); border-radius: 999px; background: var(--ar-surface); color: var(--ar-ink); font-size: 14px; cursor: pointer; box-shadow: none; text-transform: none; }
.aem-ar .ar-match button[aria-pressed="true"] { background: var(--ar-accent); border-color: var(--ar-accent); color: var(--ar-accent-ink); font-weight: 600; }

.aem-ar .ar-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 20px; padding-bottom: 14px; margin-bottom: 28px; border-bottom: 1px solid var(--ar-line); }
.aem-ar .ar-status { font-size: 15px; color: var(--ar-muted); }
.aem-ar .ar-status strong { color: var(--ar-ink); font-weight: 600; }
.aem-ar .ar-linkbtn { border: 0; background: none; padding: 0; margin-left: 10px; color: var(--ar-accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 15px; box-shadow: none; }
.aem-ar .ar-sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ar-muted); margin: 0; }
.aem-ar .ar-sort select { padding: 8px 10px; border: 1px solid var(--ar-line); border-radius: 6px; background: var(--ar-surface); height: auto; width: auto; }

/* Cards */
.aem-ar .ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 38px 28px; }
.aem-ar .ar-card { display: block; text-decoration: none; color: inherit; }
.aem-ar .ar-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 3px; overflow: hidden; background: #1a2a30; }
.aem-ar .ar-thumb > img, .aem-ar .ar-thumb > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; max-width: none; }
.aem-ar .ar-thumb-blank { position: absolute; inset: 0; background: linear-gradient(160deg, #27406b, #e9a35b); }
.aem-ar .ar-badge-new { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 2px; background: var(--ar-gold); color: var(--ar-gold-ink); font-size: 12.5px; font-weight: 600; }
.aem-ar .ar-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,18,22,.28); opacity: 0; transition: opacity .15s; }
.aem-ar .ar-play span { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.94); display: grid; place-items: center; }
.aem-ar .ar-play span::before { content: ''; margin-left: 4px; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #12303a; }
.aem-ar .ar-card:hover .ar-play, .aem-ar .ar-card:focus-visible .ar-play { opacity: 1; }
.aem-ar .ar-card h3 { font-family: var(--ar-serif); font-weight: 400; font-size: 19px; line-height: 1.25; margin: 13px 0 5px; padding: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aem-ar .ar-card:hover h3 { color: var(--ar-accent); text-decoration: underline; text-underline-offset: 3px; }
.aem-ar .ar-meta { font-size: 13.5px; color: var(--ar-muted); line-height: 1.45; }
.aem-ar .ar-more { display: flex; justify-content: center; margin-top: 52px; }
.aem-ar .ar-btn { display: inline-block; padding: 12px 22px; border: 0; border-radius: 6px; background: var(--ar-accent); color: var(--ar-accent-ink); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; line-height: 1.3; text-align: center; }
.aem-ar .ar-btn:hover { filter: brightness(1.08); color: var(--ar-accent-ink); }
.aem-ar .ar-btn--quiet { background: transparent; color: var(--ar-ink); border: 1px solid var(--ar-line); }
.aem-ar .ar-btn--quiet:hover { color: var(--ar-ink); }
.aem-ar .ar-empty { grid-column: 1 / -1; padding: 60px 0; max-width: 46ch; }
.aem-ar .ar-empty h3 { font-family: var(--ar-serif); font-weight: 400; font-size: 24px; margin: 0 0 8px; }
.aem-ar .ar-empty p { margin: 0 0 16px; color: var(--ar-muted); }

/* Single post */
.aem-ar .ar-post { max-width: 1280px; margin: 0 auto; padding: 36px 28px 90px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px 56px; }
.aem-ar .ar-post:not(:has(.ar-post-side)) { grid-template-columns: minmax(0, 1fr); }
.aem-ar .ar-player { position: relative; aspect-ratio: 16 / 9; border-radius: 3px; overflow: hidden; background: #12303a; }
.aem-ar .ar-player-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; max-width: none; }
.aem-ar .ar-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.aem-ar .ar-player-play { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: rgba(8,18,22,.16); cursor: pointer; display: grid; place-items: center; border-radius: 0; box-shadow: none; }
.aem-ar .ar-player-play span { width: 86px; height: 86px; border-radius: 50%; background: rgba(255,255,255,.95); display: grid; place-items: center; }
.aem-ar .ar-player-play span::before { content: ''; margin-left: 6px; border-style: solid; border-width: 16px 0 16px 25px; border-color: transparent transparent transparent #12303a; }
.aem-ar .ar-vids { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.aem-ar .ar-vids li { margin: 0; padding: 0; }
.aem-ar .ar-vids button { display: flex; gap: 14px; width: 100%; text-align: left; padding: 11px 14px; border: 1px solid var(--ar-line); border-left: 4px solid transparent; border-radius: 4px; background: var(--ar-surface); cursor: pointer; font-size: 15px; line-height: 1.45; box-shadow: none; text-transform: none; }
.aem-ar .ar-vids button:hover { border-color: var(--ar-accent); }
.aem-ar .ar-vids button[aria-current="true"] { border-left-color: var(--ar-gold); font-weight: 600; }
.aem-ar .ar-num { color: var(--ar-muted); font-variant-numeric: tabular-nums; min-width: 1.2em; }
.aem-ar .ar-prose { max-width: 66ch; margin-top: 32px; font-size: 17.5px; line-height: 1.7; }
.aem-ar .ar-prose p { margin: 0 0 1.1em; }
.aem-ar .ar-prose h2, .aem-ar .ar-prose h3 { font-family: var(--ar-serif); font-weight: 400; font-size: 24px; line-height: 1.25; margin: 1.5em 0 .5em; }
.aem-ar .ar-featuring { color: var(--ar-muted); }
.aem-ar .ar-featuring strong { color: var(--ar-ink); font-weight: 600; margin-right: 6px; }
.aem-ar .ar-post-tags { margin-top: 30px; }
.aem-ar .ar-post-side { position: sticky; top: 20px; align-self: start; }
.aem-ar .ar-resource { padding: 22px; background: var(--ar-surface); border: 1px solid var(--ar-line); border-left: 5px solid var(--ar-gold); border-radius: 4px; }
.aem-ar .ar-resource svg { display: block; width: 34px; height: 34px; color: var(--ar-accent); }
.aem-ar .ar-resource h2 { font-family: var(--ar-serif); font-weight: 400; font-size: 22px; line-height: 1.25; margin: 12px 0 6px; padding: 0; }
.aem-ar .ar-resource p { margin: 0 0 16px; color: var(--ar-muted); font-size: 15px; line-height: 1.55; }
.aem-ar .ar-resource .ar-btn { display: block; }
.aem-ar .ar-resource .ar-fine { margin: 10px 0 0; font-size: 13px; }
.aem-ar .ar-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 26px 0 0; font-size: 15px; }
.aem-ar .ar-facts--first { margin-top: 0; }
.aem-ar .ar-facts dt { color: var(--ar-muted); margin: 0; }
.aem-ar .ar-facts dd { margin: 0; }
.aem-ar .ar-fblink { display: inline-block; margin-top: 18px; font-size: 15px; color: var(--ar-accent); text-underline-offset: 3px; }
.aem-ar .ar-related { grid-column: 1 / -1; margin-top: 28px; padding-top: 36px; border-top: 1px solid var(--ar-line); }
.aem-ar .ar-related > h2 { font-family: var(--ar-serif); font-weight: 400; font-size: 26px; margin: 0 0 24px; padding: 0; }
.aem-ar .ar-prevnext { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px 32px; margin-top: 48px; }
.aem-ar .ar-prevnext a { display: block; max-width: 420px; text-decoration: none; }
.aem-ar .ar-prevnext small { display: block; color: var(--ar-muted); font-size: 13.5px; margin-bottom: 2px; }
.aem-ar .ar-pt { font-family: var(--ar-serif); font-size: 18px; line-height: 1.3; }
.aem-ar .ar-prevnext a:hover .ar-pt { color: var(--ar-accent); text-decoration: underline; text-underline-offset: 3px; }
.aem-ar .ar-newer { margin-left: auto; text-align: right; }

/* Subscribers-only panel */
.aem-ar .ar-locked { max-width: 920px; margin: 0 auto; padding: 40px 28px 90px; }
.aem-ar .ar-locked h2 { font-family: var(--ar-serif); font-weight: 400; font-size: clamp(28px, 4vw, 38px); line-height: 1.15; margin: 0 0 12px; padding: 0; }
.aem-ar .ar-locked-text { max-width: 62ch; margin: 0 0 16px; font-size: 17px; color: var(--ar-muted); line-height: 1.6; }
.aem-ar .ar-locked-actions { margin: 24px 0 36px; }
.aem-ar--locked:not(:has(.ar-hero)) { background: transparent; }

/* Small screens */
@media (max-width: 899px) {
  .aem-ar .ar-hero-in { padding: 18px 18px 112px; }
  .aem-ar .ar-title { margin-top: 22px; }
  .aem-ar .ar-logo img { height: 68px; }
  .aem-ar .ar-layout { grid-template-columns: 1fr; gap: 22px; padding: 4px 18px 80px; }
  .aem-ar .ar-rail { position: static; }
  .aem-ar .ar-rail h2:first-of-type { margin-top: 22px; }
  .aem-ar .ar-rail-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 14px; padding: 11px 14px; border: 1px solid var(--ar-line); border-radius: 6px; background: var(--ar-surface); cursor: pointer; font-weight: 600; }
  .aem-ar .ar-rail-body { display: none; }
  .aem-ar .ar-rail-body.is-open { display: block; }
  .aem-ar .ar-post { grid-template-columns: 1fr; padding: 24px 18px 80px; gap: 28px; }
  .aem-ar .ar-post-side { position: static; }
  .aem-ar .ar-locked { padding: 28px 18px 70px; }
}
@media (prefers-reduced-motion: reduce) { .aem-ar .ar-play { transition: none; } }
