/*
Theme Name: Hidden Stories Editorial
Description: Cinematic editorial theme with a native WordPress archive and six-language publishing.
Version: 2.0.1
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: hidden-stories-editorial
*/
:root {
  color-scheme: light;
  --paper: #faf7f2;
  --ink: #151416;
  --muted: #595250;
  --line: #d0c8bd;
  --dark: #101114;
  --gold: #d3aa71;
  --bronze: #774914;
  --serif: "Baskerville", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.6 var(--sans); }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
summary, button, select { cursor: pointer; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
:focus-visible { outline: 2px solid #9b5e21; outline-offset: 4px; }
.masthead :focus-visible, .footer :focus-visible, .hero :focus-visible { outline-color: #f0bd82; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font: 500 2rem/1.08 var(--serif); letter-spacing: -.035em; overflow-wrap: anywhere; }
.frame { width: min(100% - 7rem, 1320px); margin-inline: auto; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: 1rem; padding: .6rem 1rem; background: white; z-index: 20; }
.skip-link:not(:focus) { clip-path: inset(50%); width: 1px; height: 1px; padding: 0; overflow: hidden; }
.masthead { background: var(--dark); color: #f8f1e7; border-bottom: 1px solid #343032; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: 74px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: #fff7eb; text-decoration: none; font: 400 clamp(1.35rem, 2.65vw, 2.15rem)/1 var(--serif); white-space: nowrap; letter-spacing: -.045em; }
.brand img { flex: none; }
.navigation > summary { display: none; }
.primary-nav { display: flex; align-items: center; gap: clamp(1.12rem, 2.65vw, 2.55rem); white-space: nowrap; font: 1.04rem/1.2 var(--serif); }
@media (min-width: 851px) { .navigation:not([open]) > .primary-nav { display: flex; content-visibility: visible; } }
.primary-nav a, .language-menu summary { text-decoration: none; padding-block: .65rem; border-bottom: 1px solid transparent; }
.primary-nav a:hover, .primary-nav a[aria-current], .language-menu summary:hover { color: #efc18b; border-color: #efc18b; }
.language-menu { position: relative; }
.language-menu summary::after { display: inline-block; content: ""; width: 5px; height: 5px; margin-inline-start: .5em; border: solid currentColor; border-width: 0 1px 1px 0; transform: translateY(-.22em) rotate(45deg); }
.language-popover { position: absolute; z-index: 5; inset-inline-start: -.7rem; top: 100%; min-width: 9rem; padding: .35rem .65rem; background: #212123; border: 1px solid #544537; box-shadow: 0 10px 24px #0003; }
.language-popover a { display: block; }
.search-link { display: inline-flex; align-items: center; gap: .45rem; }
.search-label { display: none; }
.hero { color: #fffbf6; background-color: #111012; position: relative; isolation: isolate; overflow: hidden; }
.hero-image, .hero-image img, .hero::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-image { z-index: -2; }
.hero-image img { object-fit: cover; object-position: center 43%; }
.hero::after { z-index: -1; content: ""; background: linear-gradient(90deg, #0e0d0ff5 0%, #0e0d0fe3 26%, #0e0d0f76 54%, transparent 81%); }
.hero-inner { min-height: clamp(355px, 32vw, 510px); display: flex; align-items: center; padding-block: clamp(3rem, 6vw, 5.25rem); }
.hero-copy { width: min(100%, 760px); }
.hero h1 { font-size: clamp(3.6rem, 6.2vw, 7.3rem); letter-spacing: -.045em; line-height: .98; }
.hero p { margin-top: 1.12rem; color: #f4e8db; font: clamp(1.12rem, 1.75vw, 1.45rem)/1.45 var(--serif); max-width: 38rem; }
.hero-actions { margin-top: 1.5rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: .55rem 1.25rem; border: 1px solid transparent; border-radius: 3px; text-decoration: none; font: 650 .96rem/1.25 var(--sans); }
.gold { background: var(--gold); color: #1b130c; }
.gold:hover { background: #e8bd80; }
.light-outline { border-color: #d9cbba; color: #fbf0e3; background: #100e1080; }
.light-outline:hover { background: #fff2db25; }
.dark { color: #fff8ee; background: var(--dark); }
.dark:hover { background: #393237; }
.outline { border-color: #a8957c; background: transparent; color: var(--ink); }
.outline:hover { background: #efe4d3; }
.home-content { padding-top: clamp(1.6rem, 3.4vw, 3.2rem); }
.section-heading { display: flex; align-items: center; gap: clamp(.8rem, 2.1vw, 2.3rem); margin-bottom: 1.55rem; }
.section-heading h2 { font-size: clamp(2.15rem, 4.4vw, 4.2rem); }
.section-heading > span { flex: 1; min-width: .5rem; height: 1px; background: #837970; }
.text-link { text-underline-offset: .2em; text-decoration-thickness: 1px; }
.text-link:hover, .story-card a:hover, .directory a:hover { color: var(--bronze); }
.section-heading a { white-space: nowrap; font: 600 .98rem/1.3 var(--serif); }
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: clamp(1rem, 2vw, 2rem); }
.story-card { min-width: 0; }
.story-image { display: block; width: 100%; overflow: hidden; aspect-ratio: 1.62; background: #e6dcd0; }
.story-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.story-card a { text-decoration: none; }
.story-card :is(h2,h3) a:hover { text-decoration: underline; text-underline-offset: .14em; }
.card-copy { padding-block: .72rem 1rem; }
.card-meta { font-size: .82rem; font-weight: 650; color: var(--bronze); }
.card-meta a:last-child { color: var(--muted); }
.story-card :is(h2,h3) { margin-top: .32rem; font-size: clamp(1.62rem, 2.6vw, 2.8rem); }
.card-excerpt { margin-top: .58rem; color: var(--muted); font-size: .93rem; }
.card-date { margin-top: .45rem; color: var(--muted); font-size: .8rem; }
.latest { margin-bottom: 1.15rem; }
.latest .card-excerpt, .latest .card-date { display: none; }
.directory { border-top: 1px solid #a0978c; display: flex; align-items: baseline; gap: clamp(1rem, 3vw, 2.6rem); padding-block: 1.18rem; }
.directory h2 { font-size: clamp(1.45rem, 2.65vw, 2.35rem); flex: 0 0 min(30%, 15rem); }
.directory-links { display: flex; align-items: center; flex-wrap: wrap; gap: .42rem .9rem; }
.directory-links a { padding-inline-end: .9rem; border-inline-end: 1px solid #a79a8c; font: 500 1rem/1.25 var(--serif); text-decoration: none; padding-block: .23rem; }
.directory-links a:last-child { padding-inline-end: 0; border-inline-end: 0; }
.brand-intro { border-top: 1px solid #a0978c; text-align: center; padding: clamp(2.8rem, 6vw, 5.8rem) 0; }
.brand-intro h2 { font-size: clamp(2.15rem, 4.3vw, 4.3rem); }
.brand-intro p { margin: .85rem auto; max-width: 51ch; color: var(--muted); }
.footer { background: var(--dark); color: #efdfcd; padding: 3rem 0 1rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1.75rem; }
.footer p { margin-top: .9rem; max-width: 29ch; }
.footer nav { display: grid; align-content: start; gap: .42rem; }
.footer nav strong { color: var(--gold); margin-bottom: .4rem; }
.footer nav a { width: fit-content; text-decoration: none; }
.footer a:hover { color: var(--gold); }
.footer-base { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid #51453c; margin-top: 2rem; padding-top: .9rem; align-items: center; }
.archive, .standard-page, .reading { padding-block: clamp(2.3rem, 5vw, 5rem); min-height: 65vh; }
.page-heading { margin-bottom: 2rem; }
.page-heading h1 { font-size: clamp(3rem, 7vw, 6.25rem); margin-bottom: .6rem; }
.page-heading p { color: var(--muted); max-width: 62ch; }
.filters { display: grid; grid-template-columns: minmax(155px,2fr) repeat(3,minmax(112px,1fr)) auto; gap: .85rem; align-items: end; background: #f0e9de; border-block: 1px solid var(--line); padding: 1rem; margin-bottom: 1.65rem; }
.filters label, .contact-panel label { display: grid; gap: .28rem; font: 650 .9rem/1.45 var(--sans); }
.filters input, .filters select, .contact-panel input:not([type=checkbox]), .contact-panel textarea { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #a19384; background: #fffcf7; color: var(--ink); border-radius: 3px; padding: .55rem .65rem; }
.filters .button { align-self: end; }
.result-count { color: var(--muted); margin-bottom: .7rem; }
.empty { padding: 1.5rem; background: #f0e9de; border: 1px solid var(--line); }
.pagination { padding-top: 2rem; }
.pagination ul { display: flex; flex-wrap: wrap; gap: .7rem; list-style: none; padding: 0; }
.pagination .page-numbers:not(ul) { display: block; padding: .4rem .72rem; text-decoration: none; border: 1px solid #ad9d88; }
.pagination .current { background: var(--dark); color: #fff5eb; }
.breadcrumbs ol, .byline { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; font-size: .86rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-inline-end: .6rem; color: #866746; }
.story-heading { max-width: 900px; margin: 2rem auto 1.5rem; text-align: center; }
.story-heading h1 { font-size: clamp(3rem, 7vw, 6.65rem); }
.eyebrow { text-transform: uppercase; color: var(--bronze); font-size: .78rem; font-weight: 700; letter-spacing: .12em; margin-bottom: .5rem; }
.deck { margin: .7rem auto; max-width: 55ch; font: clamp(1.18rem, 2vw, 1.45rem)/1.55 var(--serif); color: var(--muted); }
.byline, .translation-links { justify-content: center; }
.byline li + li::before { content: "·"; margin-inline-end: .6rem; }
.translation-links { margin-top: .9rem; display: flex; flex-wrap: wrap; gap: .9rem; color: var(--bronze); }
.reading-image { max-width: 1020px; margin: 0 auto 2.8rem; }
.reading-image img { width: 100%; display: block; max-height: 570px; height: auto; aspect-ratio: 2; object-fit: cover; }
.reading-image figcaption { padding-block: .5rem; font-size: .88rem; color: var(--muted); }
.article-body { width: min(100%, 69ch); margin: 0 auto; font: clamp(1.13rem, 1.85vw, 1.38rem)/1.8 var(--serif); overflow-wrap: anywhere; }
.article-body > * + * { margin-top: 1em; }
.article-body h2 { margin-top: 1.5em; }
.article-body img, .article-body video, .article-body iframe { max-width: 100%; }
.article-body img, .article-body video { height: auto; }
.article-body blockquote { margin-inline: 0; border-inline-start: 2px solid #b27e42; padding-inline-start: 1.1em; color: #47362b; }
.article-body a { color: var(--bronze); text-underline-offset: .21em; }
.reading-tools, .adjacent { width: min(100%, 700px); margin: 2.2rem auto; display: flex; flex-wrap: wrap; gap: .7rem; }
.copy-status { align-self: center; color: var(--muted); }
.adjacent { justify-content: space-between; border-block: 1px solid var(--line); padding-block: 1rem; }
.adjacent span { display: block; color: var(--muted); font-size: .83rem; }
.related { margin-top: 3rem; }
.contact-panel { margin-top: 2.5rem; border-top: 1px solid var(--line); }
.contact-panel form { display: grid; gap: 1rem; }
.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.contact-panel .button { justify-self: start; }
.contact-panel .consent { display: flex; align-items: start; gap: .55rem; }
.consent input { width: 1.1rem; height: 1.1rem; }
.form-feedback { background: #f0e9de; border: 1px solid var(--line); padding: .55rem .8rem; }
[dir=rtl] .article-body, [dir=rtl] h1, [lang=ar].card-excerpt, h3[lang=ar] { font-family: "HS Naskh", "Noto Naskh Arabic", serif; letter-spacing: normal; line-height: 1.65; }
@font-face { font-family: "HS Naskh"; src: url('media/naskh-arabic.woff') format('woff'); font-display: swap; unicode-range: U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF; }
@media (max-width: 1000px) {
  .frame { width: calc(100% - 4rem); }
  .filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filters label:first-child { grid-column: 1/-1; }
}
@media (max-width: 850px) {
  .frame { width: calc(100% - 3rem); }
  .masthead-inner { min-height: 64px; position: relative; }
  .navigation > summary { display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; }
  .menu-lines { width: 23px; height: 16px; position: relative; border-block: 1px solid currentColor; }
  .menu-lines::after { content: ""; display: block; position: absolute; top: 7px; width: 100%; border-top: 1px solid currentColor; }
  .menu-label { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
  .primary-nav { position: absolute; z-index: 10; inset-inline: -1.5rem; top: 100%; display: grid; gap: 0; background: var(--dark); padding: .35rem 1.5rem 1rem; box-shadow: 0 18px 25px #0003; }
  .primary-nav > a, .language-menu summary { min-height: 44px; padding-block: .75rem; }
  .language-popover { position: static; box-shadow: none; }
  .search-label { display: inline; }
  .hero h1 { font-size: clamp(3.25rem, 8.1vw, 5.2rem); }
}
@media (max-width: 650px) {
  .frame { width: calc(100% - 2rem); }
  .masthead-inner { min-height: 60px; }
  .primary-nav { inset-inline: -1rem; padding-inline: 1rem; }
  .hero-inner { min-height: 440px; padding-block: 2rem 1.55rem; align-items: end; }
  .hero-image img { object-position: center 23%; }
  .hero::after { background: linear-gradient(0deg,#101012 2%,#101012e8 32%,#1010123c 67%,transparent 100%); }
  .hero h1 { font-size: clamp(2.7rem, 9.3vw, 4.8rem); max-width: 12ch; }
  .hero-break { display: none; }
  .hero p { margin-top: .75rem; }
  .hero-actions { margin-top: 1rem; }
  .hero-actions .button { min-width: min(100%, 10rem); }
  .hero .light-outline { display: none; }
  .hero .gold { width: 100%; }
  .story-grid { grid-template-columns: 1fr; gap: .95rem; }
  .section-heading { gap: .58rem; margin-bottom: .9rem; }
  .section-heading h2 { font-size: clamp(1.95rem, 7.9vw, 2.7rem); }
  .section-heading a { font-size: .82rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1/-1; }
  .directory { display: block; padding-block: .9rem; }
  .directory h2 { margin-bottom: .35rem; }
  .directory-links { gap: .35rem .56rem; }
  .directory-links a { padding-inline-end: .55rem; min-height: 32px; display: inline-flex; align-items: center; }
  .filters { padding: .8rem; gap: .6rem; }
  .contact-row { grid-template-columns: 1fr; }
  .reading-image img { aspect-ratio: 1.5; }
}

.directory-empty { color: var(--muted); font-size: .92rem; }
