/* ==========================================================================
   Sesión Digital (versión de prueba) — se apoya en css/inicio-prueba.css
   Reutiliza sus tokens (--navy-*, --gold, --card, --line…), .eyebrow, .btn-primary,
   .magic-card, [data-blur-fade], .dot-pattern y los modos de accesibilidad.
   ========================================================================== */

/* ---------- Encabezado de página ---------- */
.page-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 28px 0 88px;
  color: #fff;
  background: linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 55%, var(--navy-800) 100%);
}
.page-hero::after { /* filo dorado inferior */
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px; z-index: -1;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.page-hero .dot-pattern { fill: rgba(255, 255, 255, .13); }

.crumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; font-size: .8125rem; color: var(--on-navy-muted); }
.crumbs li + li::before { content: "›"; margin-right: .5rem; color: var(--gold); }
.crumbs a { color: var(--on-navy); text-decoration: none; border-bottom: 1px solid transparent; }
.crumbs a:hover { color: var(--gold); border-color: currentColor; }
.crumbs [aria-current] { color: #fff; font-weight: 500; }

.page-hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px 56px; align-items: end;
  margin-top: 40px;
}
.page-hero h1 {
  margin: .5rem 0 .75rem;
  font-family: var(--serif); font-weight: 700; font-size: clamp(2rem, 4.4vw, 3.25rem); line-height: 1.08; letter-spacing: -.01em;
}
.page-lede { max-width: 58ch; font-size: 1.0625rem; line-height: 1.65; color: var(--on-navy); }

.stats { display: grid; grid-template-columns: repeat(4, auto); gap: 0; }
.stats > div { padding: 2px 28px; border-left: 1px solid rgba(201, 162, 39, .45); }
.stats > div:first-child { padding-left: 0; border-left: 0; }
.stats dt { order: 2; font-size: .6875rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--on-navy-muted); }
.stats dd { font-family: var(--serif); font-weight: 700; font-size: 2.25rem; line-height: 1.1; color: #fff; }
.stats > div { display: flex; flex-direction: column; }

/* ---------- Última sesión (tarjeta que se superpone al encabezado) ---------- */
.latest { position: relative; z-index: 2; margin-top: -48px; }
.latest-card {
  display: grid; grid-template-columns: 148px minmax(0, 1fr) auto; align-items: stretch;
  background: var(--card); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.latest-date {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px 12px;
  color: #fff; text-align: center;
  background: linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 55%, var(--navy-800) 100%);
}
.latest-date::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold); }
.ld-day { font-family: var(--serif); font-weight: 700; font-size: 3.5rem; line-height: 1; }
.ld-month { margin-top: .35rem; font-size: .75rem; font-weight: 700; letter-spacing: .2em; color: var(--gold); }
.ld-year { font-size: .8125rem; letter-spacing: .12em; color: var(--on-navy-muted); }
.latest-body { padding: 26px 32px; align-self: center; }
.latest-body h2 { margin: .35rem 0 .6rem; font-family: var(--serif); font-weight: 800; font-size: clamp(1.4rem, 2.4vw, 1.85rem); line-height: 1.15; color: var(--ink); }
.latest-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; font-size: .9375rem; color: var(--muted); }
.latest-meta .fa { color: var(--gold-text); margin-right: .1rem; }
.latest-cta { align-self: center; margin: 0 32px 0 0; white-space: nowrap; }

.code {
  display: inline-block; padding: .1rem .5rem; border: 1px solid var(--line); border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .75rem; letter-spacing: .04em; color: var(--muted); background: var(--page);
}

/* ---------- Disposición ---------- */
.layout--sessions { margin-top: 48px; margin-bottom: 72px; }

/* ---------- Barra de herramientas ---------- */
.toolbar { display: grid; gap: 16px; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }

.year-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.year-tabs a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.4rem;
  font-family: var(--serif); font-weight: 700; font-size: 1.125rem; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .2s, box-shadow .2s, background .2s, color .2s;
}
.year-tabs a:hover { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, .16); }
.year-tabs a[aria-current="page"] { background: var(--navy-900); border-color: var(--navy-900); color: #fff; box-shadow: inset 0 -3px 0 var(--gold); }

.filters { display: none; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.js .filters { display: flex; }

.search-box { position: relative; flex: 1 1 280px; max-width: 420px; }
.search-box .fa { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--gold-text); font-size: 1rem; pointer-events: none; }
.search-box input {
  width: 100%; height: 44px; padding: 0 14px 0 40px; font: inherit; font-size: .9375rem; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.search-box input::placeholder { color: var(--muted); }
.search-box input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, .25); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 40px; padding: 0 1rem;
  font-size: .8125rem; font-weight: 500; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .2s, background .2s, color .2s;
}
.chip span { padding: .05rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--page); color: var(--muted); }
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed="true"] { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.chip[aria-pressed="true"] span { background: rgba(255, 255, 255, .16); color: #fff; }

.result-count { font-size: .8125rem; color: var(--muted); }

/* ---------- Meses y sesiones ---------- */
.month + .month { margin-top: 36px; }
.month-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 14px; padding-bottom: 10px;
  font-family: var(--serif); font-weight: 800; font-size: 1.375rem; color: var(--ink);
  border-bottom: 2px solid var(--gold);
}
.month-title span { font-family: var(--sans); font-weight: 700; font-size: .6875rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.session-list { display: grid; gap: 10px; }
.session {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; align-items: center; gap: 18px;
  padding: 14px 20px 14px 14px; background: var(--card); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.session[hidden], .month[hidden], .empty[hidden] { display: none; }

.s-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center; height: 64px;
  background: var(--page); border: 1px solid var(--line); border-radius: var(--radius-sm); pointer-events: none;
}
.s-day { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; line-height: 1; color: var(--ink); }
.s-wd { margin-top: .2rem; font-size: .625rem; font-weight: 700; letter-spacing: .16em; color: var(--gold-text); }

.session > .s-body { position: static; min-width: 0; }
.s-title { font-family: var(--serif); font-weight: 700; font-size: 1.125rem; line-height: 1.25; }
.s-link { color: var(--ink); text-decoration: none; }
.s-link::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; } /* toda la tarjeta es clicable */
.s-link:focus-visible { outline: none; }
.session:has(.s-link:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.session:hover .s-link { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.s-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; margin-top: .3rem; font-size: .875rem; color: var(--muted); }

.badge {
  justify-self: end; padding: .3rem .75rem; font-size: .6875rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  border-radius: 999px; border: 1px solid transparent; white-space: nowrap; pointer-events: none;
}
.badge--ordinaria { background: #e8edf5; color: #0f1d32; border-color: #cfd8e6; }
.badge--extraordinaria { background: #fbf3d6; color: #5c4605; border-color: #e7d48a; }
.badge--preparatoria { background: #e3f1ec; color: #0d4a39; border-color: #b9dccf; }
.badge--otra { background: #f0f1f3; color: #3b4656; border-color: #d9dde3; }

.s-go { display: inline-flex; align-items: center; gap: .5rem; font-size: .6875rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); pointer-events: none; transition: color .2s; }
.s-go .fa { transition: transform .2s; }
.session:hover .s-go { color: var(--gold-text); }
.session:hover .s-go .fa { transform: translateX(4px); }

.empty { padding: 36px 24px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius-md); }
.link-btn { margin-left: .5rem; padding: 0; background: none; border: 0; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }

/* ---------- Barra lateral ---------- */
.layout--sessions .side { gap: 20px; position: sticky; top: 16px; }
.info-card { padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); font-size: .9375rem; }
.info-card .eyebrow { margin-bottom: 14px; }
.info-card p + p { margin-top: .75rem; }
.info-strong { font-family: var(--serif); font-weight: 700; font-size: 1.0625rem; line-height: 1.3; color: var(--ink); }
.info-lines { margin-top: .6rem; display: grid; gap: .3rem; color: var(--muted); }
.info-lines .fa { color: var(--gold-text); margin-right: .35rem; }
.info-lines a { color: var(--ink); font-weight: 700; text-decoration: none; }
.info-lines a:hover { color: var(--gold-text); text-decoration: underline; }
.link-list li + li { border-top: 1px solid var(--line); }
.link-list a { display: block; padding: .65rem 0; color: var(--ink); text-decoration: none; transition: color .2s, padding-left .2s; }
.link-list a:hover { color: var(--gold-text); padding-left: .35rem; }
.source { font-size: .8125rem; color: var(--muted); }

/* ---------- Accesibilidad: contraste alto / amarillo ---------- */
html.a11y-contrast .page-hero, html.a11y-yellow .page-hero { background: #000; border-bottom: 1px solid #fff; }
html.a11y-contrast .latest-card, html.a11y-yellow .latest-card,
html.a11y-contrast .session, html.a11y-yellow .session,
html.a11y-contrast .info-card, html.a11y-yellow .info-card,
html.a11y-contrast .year-tabs a, html.a11y-yellow .year-tabs a,
html.a11y-contrast .chip, html.a11y-yellow .chip,
html.a11y-contrast .search-box input, html.a11y-yellow .search-box input { background: #000; border: 1px solid #fff; color: var(--text); }
html.a11y-contrast .latest-date, html.a11y-yellow .latest-date { background: #000; border-right: 1px solid #fff; }
html.a11y-contrast .latest-body h2, html.a11y-yellow .latest-body h2,
html.a11y-contrast .s-link, html.a11y-yellow .s-link,
html.a11y-contrast .s-day, html.a11y-yellow .s-day,
html.a11y-contrast .month-title, html.a11y-yellow .month-title,
html.a11y-contrast .info-strong, html.a11y-yellow .info-strong { color: var(--text); }
html.a11y-contrast .s-date, html.a11y-yellow .s-date,
html.a11y-contrast .code, html.a11y-yellow .code { background: #000; border-color: #fff; color: var(--text); }
html.a11y-contrast .badge, html.a11y-yellow .badge { background: #000; color: var(--text); border-color: #fff; }
html.a11y-contrast .chip[aria-pressed="true"], html.a11y-yellow .chip[aria-pressed="true"],
html.a11y-contrast .year-tabs a[aria-current="page"], html.a11y-yellow .year-tabs a[aria-current="page"] { background: var(--gold); color: #000; border-color: var(--gold); }
html.a11y-contrast .chip span, html.a11y-yellow .chip span { background: transparent; color: inherit; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats > div { padding: 2px 20px; }
}

@media (max-width: 991.98px) {
  .page-hero-grid { grid-template-columns: 1fr; margin-top: 28px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats > div { padding: 2px 16px; }
  .latest-card { grid-template-columns: 124px minmax(0, 1fr); }
  .latest-cta { grid-column: 1 / -1; justify-self: start; margin: 0 0 26px 32px; }
  .layout--sessions .side { position: static; grid-template-columns: 1fr 1fr; }
  .layout--sessions .source { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .page-hero { padding-bottom: 80px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 20px 0; }
  .stats > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stats dd { font-size: 1.9rem; }
  .latest { margin-top: -40px; }
  .latest-card { grid-template-columns: 1fr; }
  .latest-date { flex-direction: row; gap: .75rem; padding: 14px 18px; justify-content: flex-start; }
  .latest-date::before { left: 0; right: 0; bottom: auto; width: auto; height: 4px; }
  .ld-day { font-size: 2.25rem; }
  .ld-month { margin-top: 0; }
  .latest-body { padding: 20px 20px 8px; }
  .latest-cta { margin: 0 20px 22px; }
  .search-box { max-width: none; }
  .session { grid-template-columns: 56px minmax(0, 1fr); gap: 4px 14px; padding: 12px 14px 12px 12px; }
  .s-date { height: 56px; }
  .badge { grid-column: 2; justify-self: start; margin-top: .35rem; }
  .s-go { display: none; }
  .layout--sessions .side { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .session:hover .s-go .fa, .link-list a:hover { transform: none; padding-left: 0; }
}
