/* Tokens e estilos base herdados do index.html de referência. */
:root {
  --bg: #12151a;
  --panel: #1a1f26;
  --panel-raised: #20262f;
  --hairline: #2c333d;
  --ink: #eee9e0;
  --ink-dim: #9aa3ae;
  --gold: #d7a53a;
  --gold-dim: #8a723a;
  --marquee: #c1502e;
  --marquee-ink: #ef8a66;
  --focus: #f0c661;
  --ok: #7fbf8a;
  --danger: #e0664a;
  color-scheme: dark;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f1ea;
    --panel: #ffffff;
    --panel-raised: #fbf9f4;
    --hairline: #ddd6c6;
    --ink: #201c14;
    --ink-dim: #635c4d;
    --gold: #8c5f1d;
    --gold-dim: #c79a52;
    --marquee: #a83e21;
    --marquee-ink: #a83e21;
    --focus: #8c5f1d;
    --ok: #2f7a3e;
    --danger: #b23a1f;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f4f1ea;
  --panel: #ffffff;
  --panel-raised: #fbf9f4;
  --hairline: #ddd6c6;
  --ink: #201c14;
  --ink-dim: #635c4d;
  --gold: #8c5f1d;
  --gold-dim: #c79a52;
  --marquee: #a83e21;
  --marquee-ink: #a83e21;
  --focus: #8c5f1d;
  --ok: #2f7a3e;
  --danger: #b23a1f;
  color-scheme: light;
}
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--panel); padding: 8px 12px; border-radius: 4px; z-index: 10; }
.skip-link:focus { top: 12px; }

.wrap { max-width: 920px; margin: 0 auto; padding: 32px 20px 64px; }

header.hero { margin-bottom: 28px; }
.kicker {
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.02em;
  margin: 0 0 6px;
}
h1 {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.05;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.sub {
  color: var(--ink-dim);
  font-size: 15.5px;
  max-width: 56ch;
  line-height: 1.55;
  margin: 0;
}

/* Abas de mês */
.tabs {
  display: flex;
  gap: 6px;
  margin: 28px 0 0;
  border-bottom: 1px solid var(--hairline);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 500;
  background: none;
  border: none;
  color: var(--ink-dim);
  padding: 10px 14px 12px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.15s ease;
}
.tab:hover { color: var(--ink); }
.tab .yr { font-family: 'Inter', sans-serif; font-size: 11.5px; margin-left: 4px; }
.tab .count {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  color: var(--ink-dim);
  margin-left: 5px;
}
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 2px;
  background: var(--gold);
}
.tab:focus-visible { outline-offset: -2px; }

/* Navegação anterior/próximo */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 14px;
}
.month-nav h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 22px;
  margin: 0;
}
.month-nav .month-count { color: var(--ink-dim); font-size: 13px; font-family: 'Inter', sans-serif; font-weight: 400; margin-left: 8px; white-space: nowrap; }
.nav-btns { display: flex; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 4px;
  border: 1px solid var(--hairline);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.icon-btn:hover:not(:disabled) { background: var(--panel-raised); border-color: var(--gold-dim); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

/* Grade mensal */
.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}
.weekdays span {
  font-size: 11.5px;
  text-align: center;
  color: var(--ink-dim);
  padding-bottom: 4px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cell {
  min-height: 46px;
  border-radius: 4px;
  padding: 6px 6px 5px;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  display: block;
  width: 100%;
}
.cell.pad { visibility: hidden; }
.cell .num {
  font-size: 12px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.cell.today .num { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.cell.has-release {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--gold);
  cursor: pointer;
}
.cell.has-release .num { color: var(--ink); font-weight: 600; }
.cell.has-release .dot-row {
  display: flex;
  gap: 3px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.cell .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--marquee);
}
.cell .dot.forecast { background: transparent; box-shadow: inset 0 0 0 1px var(--marquee); }
.cell.has-release:hover { background: var(--panel-raised); }
.cell.has-release:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.cell.has-release[aria-pressed="true"] { background: var(--panel-raised); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }

/* Celular: lista em vez de grade */
.list { display: none; }
@media (max-width: 560px) {
  .grid, .weekdays { display: none; }
  .list { display: block; }
  .wrap { padding-top: 24px; }
}
.day-row {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}
.day-row .d {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 600;
  width: 42px;
  flex: none;
  color: var(--gold);
  line-height: 1;
  padding-top: 2px;
}
.day-row .wd {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  color: var(--ink-dim);
  margin-top: 4px;
}
.day-row .films { flex: 1; min-width: 0; }
.film-line { padding: 3px 0; }
.film-line summary {
  cursor: pointer;
  list-style: none;
  padding: 2px 0;
  border-radius: 3px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.film-line summary::-webkit-details-marker { display: none; }
.film-line summary::after { content: "+"; flex: none; width: 22px; height: 22px; border: 1px solid var(--hairline); border-radius: 50%; display: grid; place-items: center; color: var(--ink-dim); font-size: 14px; line-height: 1; margin-top: 1px; }
.film-line[open] summary::after { content: "–"; }
.film-line .film-title { font-weight: 600; font-size: 14.5px; margin: 0; }
.film-line .film-genres { color: var(--ink-dim); font-size: 12.5px; }
.film-line .more { padding: 6px 0 8px; }

/* Painel de detalhes */
.panel {
  margin-top: 22px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 20px 22px;
}
.panel .date-title {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}
.panel .date-count { color: var(--ink-dim); font-size: 13px; margin: 0 0 14px; }
.film {
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
}
.film:first-of-type { border-top: none; }
.film-title { font-weight: 600; font-size: 15.5px; margin: 0 0 3px; }
.film-title .year { color: var(--ink-dim); font-weight: 400; }
.film-meta { color: var(--gold); font-size: 12.5px; margin: 0 0 4px; }
.film-cast { color: var(--ink-dim); font-size: 13px; margin: 0; line-height: 1.5; }
.film-synopsis { font-size: 13.5px; line-height: 1.6; margin: 8px 0 0; max-width: 70ch; white-space: pre-line; }
.film-date { color: var(--ink-dim); font-size: 12px; margin: 0 0 4px; }
.badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  vertical-align: 2px;
  margin-left: 6px;
  border: 1px dashed var(--marquee-ink);
  color: var(--marquee-ink);
}

.empty-hint, .state {
  color: var(--ink-dim);
  font-size: 13.5px;
  text-align: center;
  padding: 20px 0 4px;
}
.state { padding: 48px 0; }
.state .btn { margin-top: 12px; }
.legend { color: var(--ink-dim); font-size: 12px; display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.legend .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--marquee); margin-right: 6px; vertical-align: 1px; }
.legend .dot.forecast { background: transparent; box-shadow: inset 0 0 0 1px var(--marquee); }

.site-footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--hairline); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-dim); }
.site-footer a { color: var(--ink-dim); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* Botões genéricos */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid var(--hairline);
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--panel-raised); border-color: var(--gold-dim); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1a1408; font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--gold); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--hairline); border-top-color: var(--gold);
  display: inline-block; animation: spin 0.8s linear infinite; vertical-align: -4px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  * { scroll-behavior: auto !important; }
}
@media (max-width: 560px) {
  #hint { display: none; }
  .month-nav h2 { font-size: 20px; }
}
