@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ── BASE ── */
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  transition: background var(--duration-slow) var(--ease),
              color var(--duration-slow) var(--ease);
}

/* ── LAYOUT ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ── TYPOGRAPHY SCALE ── */
.t-display-xl {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--ink);
}
.t-display-lg {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}
.t-display-md {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}
.t-display-sm {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}
.t-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.t-prose {
  font-family: var(--font-prose);
  font-size: clamp(1rem, 2vw, 1.1875rem);
  line-height: 1.82;
  color: var(--ink);
}

/* ── SECTION HEADER ── */
.sh {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.sh-label {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 3vw, 1.375rem);
  font-weight: 700;
  color: var(--gold);
}
.sh-more {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--duration-fast);
}
.sh-more:hover { color: var(--accent); }
.sh-gold .sh-label { color: var(--gold); }

/* ── PILLS ── */
.pill {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 20px;
  white-space: nowrap;
  display: inline-block;
  transition: opacity var(--duration-fast);
  cursor: pointer;
}
.pill:hover { opacity: 0.75; }
.pill-lang   { background: var(--ink2); color: var(--bg); }
.pill-format { background: transparent; color: var(--muted); border: 1.5px solid var(--rule); }
.pill-red    { background: var(--accent); color: #fff; }
.pill-gold   { background: var(--gold);   color: #fff; }

/* ── METADATA ROW ── */
.meta-item {}
.meta-label {
  font-family: var(--font-ui);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.meta-value {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}

/* ── POSTER CARD ── */
.poster-card { cursor: pointer; }
.poster-card-img {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  margin-bottom: 0.55rem;
  transition: box-shadow var(--duration-mid) var(--ease);
}
.poster-card-img img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform var(--duration-mid) var(--ease);
}
.poster-card:hover .poster-card-img img { transform: scale(1.04); }
.poster-card:hover .poster-card-img { box-shadow: 0 10px 28px rgba(18,10,8,0.22); }
.poster-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 10, 8, 0.8);
  opacity: 0;
  transition: opacity var(--duration-mid) var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  text-align: center;
}
.poster-card:hover .poster-card-overlay { opacity: 1; }
.overlay-lang {
  font-size: 0.5938rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.overlay-title {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.overlay-year { font-size: 0.5625rem; color: rgba(255,255,255,0.5); }
.poster-card-meta {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.poster-card-title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  transition: color var(--duration-fast);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.poster-card:hover .poster-card-title { color: var(--accent); }
.poster-card-dir { font-size: 0.6875rem; color: var(--muted); margin-top: 2px; }

/* ── SKIP LINK ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 4px 4px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.875rem;
  z-index: 9999;
  transition: top 0.15s;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ── FOCUS RINGS ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }
.pill:focus-visible,
.lang-btn:focus-visible { border-radius: 20px; }
/* Toggle thumb glow on keyboard focus */
.toggle input:focus-visible ~ .toggle-thumb {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}
/* Fix focus ring clipped by overflow:hidden on poster card images */
.poster-card:focus-visible {
  outline: none;
}
.poster-card:focus-visible .poster-card-img {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── BUTTONS ── */
.btn {
  font-family: var(--font-ui);
  font-size: 0.7188rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: 2px;
  border: none;
  transition: background var(--duration-fast), transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:active { transform: scale(0.97); }
.btn-ink   { background: var(--ink);   color: var(--bg); }
.btn-ink:hover { background: var(--ink2); box-shadow: 0 4px 14px rgba(28,23,20,0.22); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dk); box-shadow: 0 4px 14px rgba(184,50,40,0.32); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn-ghost:hover { background: var(--bg2); box-shadow: 0 2px 8px rgba(28,23,20,0.10); }
.btn-text  { background: none; color: var(--accent); padding-left: 0; padding-right: 0; border: none; }

/* ── DIVIDER ── */
.rule { border: none; border-top: 0.5px solid var(--rule); }

/* ── PROSE BODY ── */
.prose { font-family: var(--font-prose); font-size: clamp(0.9375rem, 1.8vw, 1.0625rem); line-height: 1.82; color: var(--ink); }
.prose p { margin-bottom: 1.4rem; }
.prose em  { font-style: italic; }
.prose strong { font-weight: 600; }
.prose blockquote {
  background: var(--bg2);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  border-left: 3px solid var(--gold);
}
.prose blockquote p {
  font-family: var(--font-prose);
  font-size: 1.0625rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--ink);
  margin: 0;
}
/* no drop cap inside blockquotes */
.prose blockquote p::first-letter {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  float: none;
  margin: 0;
}

/* dark mode */
.dark .prose blockquote {
  background: var(--bg2);
  border-left-color: var(--gold);
}
.prose figure { margin: 2rem 0; }
.prose figure img { width: 100%; border-radius: 3px; }
.prose figcaption {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ── PROSE LINKS ── */
.prose a,
.prose-link {
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  transition: border-color var(--duration-fast), color var(--duration-fast);
}
.prose a:hover,
.prose-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── UNDERLINE LINK ANIMATION ── */
.link-underline {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: left bottom;
  padding-bottom: 1px;
  transition: background-size var(--duration-mid) var(--ease);
}
.link-underline:hover { background-size: 100% 1.5px; }

/* ── FADE UP ANIMATION ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp var(--duration-slow) var(--ease) both; }

/* ── READING PROGRESS BAR ── */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 500;
  transition: width 0.1s linear;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── RESPONSIVE UTILITIES ── */
@media (max-width: 768px) {
  :root { --gutter: 1.25rem; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
