:root {
  color-scheme: light;
  --bg: #fbf6ef;
  --surface: #ffffff;
  --ink: #2a2420;
  --muted: #6b6058;
  --line: #eadfd2;
  --accent: #a4472c;        /* terracota */
  --accent-soft: #f6e4da;
  --sky: #3f6e8c;           /* celeste porteño, apagado */
  --sky-soft: #e4eef4;
  --sun: #f3d27a;
  --sun-soft: #fdf1cf;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 6px 20px rgba(60, 40, 20, .06);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 8px; }

.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;
}

/* ── Portada ─────────────────────────────────────────────────────────── */
.hero {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 1.5rem;
}
.kicker {
  font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 11vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: .6rem 0 1.1rem;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.lead { font-size: 1.08rem; color: var(--ink); }
.quote {
  margin: 1.4rem 0 0;
  padding: .9rem 1.1rem;
  border-left: 3px solid var(--sun);
  background: var(--sun-soft);
  border-radius: 0 12px 12px 0;
}
.quote p { font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.quote cite { display: block; font-style: normal; font-size: .85rem; color: var(--muted); margin-top: .25rem; }
.context { margin-top: 1.2rem; font-size: .85rem; color: var(--muted); white-space: pre-wrap; }

.howto { margin-top: 1rem; font-size: .92rem; color: var(--muted); }
.howto summary { cursor: pointer; color: var(--sky); font-weight: 500; padding: .4rem 0; }
.howto p { margin: .4rem 0; }
.legend { list-style: none; padding: 0; margin: .4rem 0; display: flex; flex-wrap: wrap; gap: .4rem .9rem; color: var(--ink); }

/* ── Navegación por día ──────────────────────────────────────────────── */
.days {
  position: sticky; top: 0; z-index: 5;
  background: rgba(251, 246, 239, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.days-inner {
  max-width: 40rem; margin: 0 auto;
  display: flex; gap: .4rem;
  overflow-x: auto; scrollbar-width: none;
  padding: .65rem 1.25rem;
}
.days-inner::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 44px;
  padding: .5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 500; font-size: .92rem;
  cursor: pointer;
  white-space: nowrap;
}
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
.tab .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-left: .45rem; vertical-align: middle;
}
.tab.on .dot { background: var(--sun); }

/* ── Panel del día ───────────────────────────────────────────────────── */
.panel { max-width: 40rem; margin: 0 auto; padding: 1.75rem 1.25rem 2rem; outline: none; }
.day-head { margin-bottom: 1.5rem; }
.day-date { font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.day-title { font-family: var(--serif); font-weight: 600; font-size: 1.9rem; line-height: 1.15; margin: .3rem 0 .5rem; letter-spacing: -.01em; }
.day-intro { color: var(--muted); }

.moment { position: relative; padding-left: 1.1rem; margin-bottom: 1.4rem; border-left: 2px solid var(--line); }
.moment-label {
  font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: .6rem;
}
.moment-label::before {
  content: ''; position: absolute; left: -6px; margin-top: .3rem;
  width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
}
.moment > * + * { margin-top: .75rem; }

.time {
  display: inline-block; font-variant-numeric: tabular-nums;
  font-family: var(--sans); font-weight: 600; font-size: .85em;
  color: var(--accent); margin-right: .45rem;
}

/* Líneas simples del día */
.step { padding: .15rem 0; }
.step-title { font-weight: 500; }
.step-note { color: var(--muted); font-size: .92rem; }
.step.highlight {
  background: var(--sun-soft); border-radius: 12px; padding: .8rem 1rem;
}
.step.highlight .step-title { font-family: var(--serif); font-style: italic; font-size: 1.08rem; font-weight: 400; }

/* Tarjetas */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1rem;
  box-shadow: var(--shadow);
}
.card-top { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .45rem; }
.cat { font-size: .8rem; color: var(--muted); font-weight: 500; }
.card-title { font-family: var(--serif); font-weight: 600; font-size: 1.22rem; line-height: 1.25; }
.desc { margin-top: .45rem; }
.note { margin-top: .4rem; font-size: .9rem; color: var(--muted); }

.card.fixed { border: 2px solid var(--sky); background: linear-gradient(180deg, var(--sky-soft), var(--surface) 70%); }
.reserva {
  display: inline-block; margin-top: .55rem;
  font-size: .85rem; font-weight: 600;
  padding: .25rem .65rem; border-radius: 999px;
}
.reserva.booked { background: var(--sky); color: #fff; }
.reserva.required { background: var(--accent); color: #fff; }
.reserva.recommended { background: var(--accent-soft); color: var(--accent); }

.pill { font-size: .75rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; margin-left: .35rem; }
.card-top .pill { margin-left: 0; }
.pill.soft { background: var(--bg); border: 1px dashed #cdbdab; color: var(--muted); }
.pending { margin-top: .45rem; font-size: .85rem; color: var(--muted); font-style: italic; }

.tags { list-style: none; padding: 0; margin: .8rem 0 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.tag {
  font-size: .8rem; color: var(--muted);
  background: var(--bg); border-radius: 999px; padding: .2rem .6rem;
}

/* Variantes */
.alt { margin-left: .2rem; }
.alt-label { font-family: var(--serif); font-style: italic; color: var(--muted); margin-bottom: .35rem; }
.card.variant { border-style: dashed; box-shadow: none; background: transparent; }

/* Reacciones */
.reactions {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem;
  margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line);
}
.react {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  min-height: 62px; padding: .45rem .25rem;
  border-radius: 14px; border: 1.5px solid transparent;
  background: var(--bg);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.react:active { transform: scale(.96); }
.react-emoji { font-size: 1.35rem; line-height: 1; }
.react-label { font-size: .74rem; line-height: 1.15; text-align: center; color: var(--muted); }
.react.on { background: var(--accent-soft); border-color: var(--accent); }
.react.on .react-label { color: var(--ink); font-weight: 700; }
.react-check {
  position: absolute; top: -7px; right: -5px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700;
  display: grid; place-items: center;
}
.reactions:has(.on) .react:not(.on) { opacity: .6; }

/* Plano livre */
.livre {
  margin-top: 1.6rem;
  padding: 1.4rem 1.25rem;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--sun-soft) 0%, #fbe3c4 100%);
  border: 1px solid #f0d49a;
}
.livre-title { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; margin-bottom: .4rem; }
.livre p { font-size: 1.02rem; }
.livre-btn {
  margin-top: 1rem; min-height: 46px; padding: .6rem 1.1rem;
  border-radius: 999px; border: 1.5px solid var(--ink);
  background: transparent; font-weight: 600; cursor: pointer;
}
.livre-btn.on { background: var(--ink); color: #fff; }

.next {
  display: block; width: 100%; margin-top: 1.6rem; min-height: 52px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; cursor: pointer;
}

/* Resumen */
.recado-label { display: block; font-weight: 600; margin-bottom: .4rem; }
#recado {
  width: 100%; font: inherit; color: inherit;
  border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem;
  background: var(--surface); resize: vertical;
}
.preview {
  margin: 1.2rem 0 0; padding: 1rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--sans); font-size: .92rem; white-space: pre-wrap; word-break: break-word;
}
.actions { display: grid; gap: .6rem; margin-top: 1rem; }
.btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 52px; border-radius: 16px; border: 1.5px solid var(--ink);
  background: var(--surface); color: var(--ink);
  font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--ink); color: #fff; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 999px;
  font-size: .9rem; transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem 1.25rem 2.5rem; }

@media (min-width: 640px) {
  .hero { padding-top: 4.5rem; }
  .react-label { font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Selector de idioma */
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lang-btn {
  flex: 0 0 auto;
  min-height: 40px; padding: .4rem .85rem;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: .85rem; font-weight: 500;
  cursor: pointer;
}

/* Fotos de las tarjetas */
.photo { position: relative; margin: -1.1rem -1.1rem .9rem; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; background: var(--line); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, center); }
.photo figcaption {
  position: absolute; right: .5rem; bottom: .4rem;
  font-size: .66rem; color: #fff; background: rgba(0, 0, 0, .45);
  padding: .1rem .45rem; border-radius: 6px;
}
.photo.secondary { margin: .8rem 0 .2rem; border-radius: 12px; }

/* Respaldo visual si ninguna foto carga */
.photo-fallback {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  padding: 1rem; text-align: center;
  background: linear-gradient(135deg, #f3e6d6 0%, #e9d3bd 100%);
}
.photo-fallback.cat-arlivre { background: linear-gradient(135deg, #e3ecdc 0%, #cbdcc0 100%); }
.photo-fallback.cat-musica, .photo-fallback.cat-noite { background: linear-gradient(135deg, #2f3346 0%, #4a3b4f 100%); color: #f6ead8; }
.photo-fallback.cat-feira { background: linear-gradient(135deg, #f6e4da 0%, #efcdb9 100%); }
.photo-fallback-emoji { font-size: 2rem; line-height: 1; }
.photo-fallback-name { font-family: var(--serif); font-size: 1.15rem; font-style: italic; max-width: 20ch; }

/* Ver más */
.more { margin-top: .6rem; }
.more summary {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 40px;
  cursor: pointer; color: var(--sky); font-weight: 600; font-size: .9rem; list-style: none;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: '▾'; transition: transform .15s ease; }
.more[open] summary::after { transform: rotate(180deg); }
.more .more-close, .more[open] .more-open { display: none; }
.more[open] .more-close { display: inline; }
.more-text { margin-top: .2rem; color: var(--ink); font-size: .95rem; }
.more-link { display: inline-block; margin-top: .5rem; font-size: .85rem; color: var(--sky); }
