/* Go Madrid · charlas
   Cartel editorial: papel, tinta y el cian de Go como único acento. */

:root {
  --paper: #f3efe6;
  --paper-2: #ebe5d8;
  --surface: #fbf9f4;
  --ink: #15191d;
  --ink-2: #4a5157;
  --ink-3: #7c8186;
  --rule: #d9d2c3;
  --go: #00add8;
  --go-ink: #00728f;      /* cian con contraste suficiente sobre papel */
  --go-wash: rgba(0, 173, 216, 0.12);
  --danger: #b4321f;

  --font-display: "Bricolage Grotesque", ui-serif, Georgia, serif;
  --font-body: "Instrument Sans", ui-sans-serif, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --radius: 14px;
  --grain-opacity: 0.08;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101316;
    --paper-2: #161a1e;
    --surface: #181d21;
    --ink: #ece7dc;
    --ink-2: #b4b0a6;
    --ink-3: #85837c;
    --rule: #2b3136;
    --go-ink: #3cc6e8;
    --go-wash: rgba(0, 173, 216, 0.14);
    --danger: #ff7a63;
    --grain-opacity: 0.05;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
/* Grano de papel */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--go-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
::selection { background: var(--go); color: #fff; }
:focus-visible { outline: 2px solid var(--go); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); font-size: 0.8em; letter-spacing: 0; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 0.98; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.05; }
h4 { font-size: 1.05rem; font-weight: 600; margin: 0; line-height: 1.3; }

.eyebrow { color: var(--go-ink); margin: 0 0 10px; font-size: 0.82rem; }

/* ---------- Header / footer ---------- */

.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.brand {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.35rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.brand-mark {
  background: var(--go); color: #fff; border-radius: 8px;
  padding: 1px 8px 3px; transform: rotate(-3deg); display: inline-block;
}
nav { display: flex; align-items: center; gap: 22px; }
.nav-link { color: var(--ink-2); text-decoration: none; font-weight: 500; transition: color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .nav-link:hover { color: var(--ink); } }

.site-footer { margin-top: 96px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 0.9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 28px; padding-bottom: 40px; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
  padding: 12px 22px; border-radius: 999px;
  font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--go-ink); border-color: var(--go-ink); color: #fff; }
}
.btn-small { padding: 7px 14px; font-size: 0.9rem; }
.btn-wide { width: 100%; padding: 15px 22px; font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
}
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
@media (hover: hover) and (pointer: fine) {
  .btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
}
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* Estado "enviando" de htmx: se cruza el texto con un ligero blur. */
.btn-sending { display: none; }
.htmx-request .btn-label, form.htmx-request .btn-label { display: none; }
.htmx-request .btn-sending, form.htmx-request .btn-sending { display: inline; animation: pulse 900ms ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.55; } }

/* ---------- Hero + ticket ---------- */

.hero {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: start;
  padding: 72px 0 24px;
}
.hero h1 em { font-style: normal; color: var(--go-ink); }
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 46ch; margin: 24px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.ticket {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px 24px 20px;
  box-shadow: 8px 8px 0 var(--go);
  transform: rotate(1.2deg);
}
.ticket-top { display: flex; justify-content: space-between; color: var(--ink-3); }
.ticket-countdown { color: var(--go-ink); font-weight: 500; }
.ticket-date { display: flex; align-items: flex-end; gap: 12px; margin-top: 4px; }
.ticket-day {
  font-family: var(--font-display); font-weight: 800; font-size: 6.2rem; line-height: 0.85;
  letter-spacing: -0.05em; font-variant-numeric: tabular-nums;
}
.ticket-month {
  font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; line-height: 1;
  text-transform: uppercase; display: flex; flex-direction: column; padding-bottom: 6px;
}
.ticket-month small { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 400; color: var(--ink-3); margin-top: 4px; }
.ticket-label { position: relative; color: var(--ink-2); margin: 10px 0 0; padding-bottom: 16px; border-bottom: 1.5px dashed var(--rule); }
/* Muescas de entrada de cine, alineadas con la línea discontinua */
.ticket-label::before, .ticket-label::after {
  content: ""; position: absolute; bottom: -12px; width: 22px; height: 22px;
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: 50%;
}
.ticket-label::before { left: -36px; clip-path: inset(0 0 0 50%); }
.ticket-label::after { right: -36px; clip-path: inset(0 50% 0 0); }
.ticket-label::first-letter { text-transform: uppercase; }
.ticket-body { padding-top: 6px; }
.ticket-cta { display: inline-block; margin-top: 16px; font-weight: 600; text-decoration: none; }
.ticket-cta span { display: inline-block; transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .ticket-cta:hover span { transform: translateX(4px); } }

/* ---------- Bloques ---------- */

.block { margin-top: 88px; }
.block-head { margin-bottom: 28px; }
.block-intro { color: var(--ink-2); margin: 12px 0 0; max-width: 58ch; }

/* Agenda */
.agenda { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.agenda-row {
  display: grid; grid-template-columns: 180px 1fr; gap: 32px;
  padding: 26px 0; border-bottom: 1px solid var(--rule);
  animation: rise 420ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.agenda-date { display: flex; flex-direction: column; }
.agenda-day {
  font-family: var(--font-display); font-weight: 800; font-size: 3.6rem; line-height: 0.9;
  letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.agenda-month { color: var(--ink-3); text-transform: uppercase; margin-top: 6px; }
.agenda-body { min-width: 0; padding-top: 4px; }
.link-cta { display: inline-block; margin-top: 14px; font-family: var(--font-mono); font-size: 0.85rem; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .link-cta:hover { text-decoration: underline; } }

/* Charlas */
.talks { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.talk { padding-left: 16px; border-left: 2px dashed var(--ink-3); }
.talk-confirmed { border-left: 3px solid var(--go); }
.talk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.meta { color: var(--ink-2); font-size: 0.92rem; margin: 4px 0 0; overflow-wrap: anywhere; }
.tag {
  flex: none; font-family: var(--font-mono); font-size: 0.72rem; line-height: 1;
  padding: 5px 8px; border-radius: 999px; border: 1px solid var(--ink-3); color: var(--ink-2);
}
.tag-ok { background: var(--go); border-color: var(--go); color: #fff; }
details { margin-top: 6px; }
details summary { cursor: pointer; color: var(--ink-3); font-size: 0.85rem; list-style: none; width: fit-content; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+ "; font-family: var(--font-mono); }
details[open] summary::before { content: "− "; }
.abstract { white-space: pre-line; font-size: 0.95rem; color: var(--ink-2); margin: 8px 0 0; max-width: 65ch; }
.empty { color: var(--ink-3); margin: 0; }

.talk-workshop { border-left-style: dotted; }
.talk-workshop.talk-confirmed { border-left: 3px solid var(--go); }
.prefers { color: var(--go-ink); font-size: 0.78rem; margin-top: 6px; }
.sub-head { font-family: var(--font-mono); font-weight: 400; font-size: 0.85rem; color: var(--ink-3); margin: 36px 0 14px; letter-spacing: 0; }
.agenda-workshops + .sub-head { margin-top: 36px; }
.block-head-split { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }

.talks-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.talks-grid .talk {
  background: var(--surface); border: 1px solid var(--rule); border-left: 2px dashed var(--ink-3);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 18px;
}

/* Histórico */
.past { display: grid; gap: 0; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: 1.5px solid var(--ink); }
.past-item { padding: 18px 18px 18px 0; border-bottom: 1px solid var(--rule); }
.past-item h3 { font-family: var(--font-mono); font-weight: 500; font-size: 0.85rem; letter-spacing: 0; color: var(--ink-3); text-transform: uppercase; }
.past-item ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.past-item li span { display: block; color: var(--ink-3); font-size: 0.9rem; }

/* ---------- Formulario ---------- */

.form-page { padding-top: 64px; max-width: 680px; }
.panel { transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out); }
@starting-style { .panel.success { opacity: 0; transform: translateY(8px); } }
.panel.success {
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius);
  padding: 32px; box-shadow: 8px 8px 0 var(--go);
}
.panel.success p:not(.eyebrow) { color: var(--ink-2); }

.form fieldset { border: 0; border-top: 1.5px solid var(--ink); padding: 22px 0 30px; margin: 0; }
.form legend {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; padding: 0 12px 0 0;
  display: flex; align-items: baseline; gap: 10px;
}
.form legend .mono { color: var(--go-ink); }
.form label { display: block; font-weight: 600; margin: 18px 0 6px; font-size: 0.95rem; }
.form fieldset > label:first-of-type { margin-top: 8px; }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--rule); border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.form textarea { resize: vertical; min-height: 140px; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--go); box-shadow: 0 0 0 4px var(--go-wash);
}
.form [aria-invalid="true"] { border-color: var(--danger); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hint { color: var(--ink-3); font-size: 0.85rem; margin: 6px 0 0; }
.error { color: var(--danger); font-size: 0.9rem; margin: 6px 0 0; font-weight: 500; }
.alert {
  border: 1.5px solid var(--danger); color: var(--danger); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 24px; font-weight: 500;
}
@starting-style { .alert { opacity: 0; transform: translateY(-4px); } }
.alert { transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Tipo de propuesta: charla / workshop */
.kind-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.kind-option { margin: 0 !important; font-weight: 400 !important; cursor: pointer; display: block; }
.kind-option input { position: absolute; opacity: 0; pointer-events: none; }
.kind-card {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  background: var(--surface); border: 1.5px solid var(--rule); border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 150ms ease, box-shadow 200ms var(--ease-out), transform 160ms var(--ease-out);
}
.kind-option:active .kind-card { transform: scale(0.98); }
.kind-option input:checked + .kind-card { border-color: var(--ink); box-shadow: 5px 5px 0 var(--go); }
.kind-option input:focus-visible + .kind-card { outline: 2px solid var(--go); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .kind-option:hover input:not(:checked) + .kind-card { border-color: var(--ink-3); }
}
.kind-title { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.kind-title::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px;
  border: 1.5px solid var(--ink-3); border-radius: 50%; vertical-align: 1px;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.kind-option input:checked + .kind-card .kind-title::before {
  background: var(--go); border-color: var(--go); box-shadow: inset 0 0 0 2px var(--surface);
}
.kind-desc { color: var(--ink-2); font-size: 0.9rem; line-height: 1.4; }

/* Mostrar solo los campos del tipo elegido */
.form:has(input[name="kind"][value="workshop"]:checked) .only-talk { display: none; }
.form:not(:has(input[name="kind"][value="workshop"]:checked)) .only-workshop { display: none; }
.only-workshop, .only-talk { animation: fade 200ms ease; }
fieldset > .only-talk > label:first-child,
fieldset > .only-workshop > label:first-child { margin-top: 8px; }

.date-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.optional { color: var(--ink-3); font-weight: 400; }

/* ---------- Admin ---------- */

.admin-head { padding-top: 64px; }
#board .block { margin-top: 48px; }
#board h2 { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.count { color: var(--ink-3); font-weight: 400; font-size: 1rem; }
.admin-talk {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 12px;
}
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.kind-badge { font-size: 0.72rem; background: var(--ink); color: var(--paper); border-radius: 6px; padding: 2px 6px; vertical-align: 2px; }
.admin-workshop { border-left: 3px solid var(--ink); }
.admin-actions input[type="date"],
.admin-actions select {
  font: inherit; font-size: 0.9rem; padding: 7px 10px; border-radius: 999px;
  border: 1.5px solid var(--rule); background: var(--paper); color: var(--ink); max-width: 100%;
}
.flash {
  display: inline-block; margin: 32px 0 0; padding: 8px 14px; border-radius: 999px;
  background: var(--go); color: #fff;
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}
@starting-style { .flash { opacity: 0; transform: translateY(-6px); } }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 48px; }
  .ticket { transform: none; margin-right: 8px; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  body { font-size: 16px; }
  .nav-link { display: none; }
  .agenda-row { grid-template-columns: 1fr; gap: 12px; }
  .agenda-date { flex-direction: row; align-items: baseline; gap: 10px; }
  .agenda-day { font-size: 2.6rem; }
  .ticket-day { font-size: 5rem; }
  .form .row { grid-template-columns: 1fr; gap: 0; }
  .kind-picker, .date-row { grid-template-columns: 1fr; }
  .block { margin-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .agenda-row { animation: fade 200ms ease both; animation-delay: 0ms; }
  .btn:active { transform: none; }
  .ticket-cta span { transition: none; }
}
@keyframes fade { from { opacity: 0; } }
