/* Conference Homepage Template — Archivo font for title, system stack for body */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/archivo-300.woff2") format("woff2");
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/archivo-700.woff2") format("woff2");
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Palette defaults (overridden by public/static/theme.css) ───────────── */
:root {
  --sidebar-bg:       #1a365d;
  --primary:          #1a365d;
  --primary-light:    #2a4a7f;
  --red:              var(--primary);
  --accent:           #2a9d8f;
  --ev-main-border:   #2a4a7f;
  --ev-main-bg:       rgba(42, 74, 127, 0.07);
  --ev-other-border:  #8b6aae;
  --ev-other-bg:      rgba(139, 106, 174, 0.08);
  --ev-social-border: var(--accent);
  --ev-social-bg:     rgba(42, 157, 143, 0.09);

  /* Structural — shared across all conferences */
  --text:       #2d2d2d;
  --text-light: #555e68;
  --bg:         #ffffff;
  --bg-alt:     #f8f9fa;
  --border:     #e5e7eb;
  --radius:     6px;
  --sidebar-w:  320px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Structural dark mode — palette dark mode lives in theme.css */
    --text:       #e0e2e8;
    --text-light: #8890a0;
    --bg:         #13141c;
    --bg-alt:     #1a1c26;
    --border:     #252832;
  }
}

:root[data-theme="dark"] {
  --text:       #e0e2e8;
  --text-light: #8890a0;
  --bg:         #13141c;
  --bg-alt:     #1a1c26;
  --border:     #252832;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary-light); }
a:hover { color: var(--primary); }

/* ── Layout — desktop: sidebar + scrollable content; mobile: stacked ────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
/*
 * Grain texture via SVG feTurbulence blended into the background-color.
 * background-blend-mode: overlay means the noise lightens/darkens the base
 * color without touching the text layer above.
 */
.sidebar {
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.28);
  z-index: 20;
  overflow: hidden;

  background-color: var(--sidebar-bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E"),
    linear-gradient(165deg, rgba(255,255,255,0.07) 0%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.18) 100%);
  background-blend-mode: overlay, normal;
  background-size: 200px 200px, 100% 100%;

  border-right: 3px solid var(--accent);
}

.sidebar-top {
  padding: 2.5rem 2rem 0;
}

/* ── Title ──────────────────────────────────────────────────────────────── */
.acronym {
  font-family: "Archivo", sans-serif;
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: 0.06em;
}

/* Stagger-reveal on load */
.acronym span {
  display: block;
  opacity: 0;
  transform: translateY(5px);
  animation: titleIn 0.4s ease forwards;
}

.acronym span:nth-child(1) { animation-delay: 0.05s; }
.acronym span:nth-child(2) { animation-delay: 0.13s; }
.acronym span:nth-child(3) { animation-delay: 0.21s; }
.acronym span:nth-child(4) { animation-delay: 0.29s; }
.acronym span:nth-child(5) { animation-delay: 0.37s; }

@keyframes titleIn {
  to { opacity: 1; transform: translateY(0); }
}

.acronym .nudge strong { margin-left: 0.15em; }

.acronym strong {
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
}

/* Collapsed header — mobile only */
.header-collapsed { display: none; }

.sidebar .subtitle {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  opacity: 0.82;
  line-height: 1.5;
}

.sidebar .meta {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.62;
}

/* ── Nav — accent active indicator bar ─────────────────────────────────── */
.sidebar nav {
  position: relative;
  padding: 0 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar nav::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--bar-top, 0);
  height: var(--bar-height, 0);
  width: 3px;
  background: var(--accent);
  border-radius: 1.5px;
  transition: top 0.25s ease, height 0.25s ease, opacity 0.25s ease;
  opacity: var(--bar-opacity, 0);
}

.sidebar nav a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  color: #fff;
  padding-left: 3px;
}

.theme-toggle {
  display: block;
  margin: 0 2rem 2rem;
  padding: 0.3rem 0.85rem;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

/* Icon shows what you're switching TO: light mode → offer moon, dark mode → offer sun */
.theme-toggle::after {
  content: "☽";
  margin-left: 0.35em;
  font-size: 1em;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle::after { content: "☀"; }
}
:root[data-theme="dark"] .theme-toggle::after { content: "☀"; }

/* ── Content column ─────────────────────────────────────────────────────── */
.content {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

main {
  max-width: 860px;
  padding: 0 2rem;
}

/* ── Sections — fade-in on scroll (JS adds .visible) ───────────────────── */
section {
  padding: 2.5rem 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

section.visible {
  opacity: 1;
  transform: none;
}

section h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--red);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  padding-top: 0.1rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.7rem;
  box-shadow: 0 1px 0 var(--accent);
}

section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}

.prose p { max-width: 640px; }

.info-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 1rem;
  margin-top: 1.2rem;
  font-size: 0.95rem;
}

.info-list dt { font-weight: 600; color: var(--primary); }
.info-list dd { color: var(--text); }

.sponsors-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  margin-top: 1.2rem;
}

.sponsor-logo {
  max-height: 60px;
  max-width: 200px;
  object-fit: contain;
}

.tba {
  color: var(--text-light);
  font-style: italic;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer {
  padding: 2.5rem 2rem 1.5rem;
  font-size: 0.75rem;
  color: var(--text-light);
}

footer a { color: var(--text-light); text-decoration: none; }
footer a:hover { color: var(--text); }

/* ── Speakers ───────────────────────────────────────────────────────────── */
.speaker-list { list-style: none; }

.speaker-list li { padding: 0.35rem 0; }

.speaker-list .name { font-weight: 500; }

/* Accent underline grows from left on hover */
a.name {
  text-decoration: none;
  color: var(--text);
  position: relative;
}

a.name::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s ease;
}

a.name:hover { color: var(--primary); }
a.name:hover::after { width: 100%; }

.speaker-list .affil {
  display: block;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Speaker cards (plenary — with portrait photos) */
.speaker-cards { list-style: none; }

.speaker-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
}

.speaker-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.18);
}

.speaker-card .name { font-weight: 500; }

.speaker-card .affil {
  display: block;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ── Block wrapper spacing ──────────────────────────────────────────────── */
.block + .block { margin-top: 1.5rem; }

/* ── Module layout: sidebar ─────────────────────────────────────────────── */
/* Stage 2 (769–959px): stacked, but second block's list stays two-column */
@media (min-width: 769px) {
  section.layout--sidebar > .block:nth-child(3) .speaker-list {
    columns: 2;
    column-gap: 1.5rem;
  }

  section.layout--sidebar > .block:nth-child(3) .speaker-list li {
    break-inside: avoid;
  }
}

/* Stage 1 (≥960px): side-by-side grid */
@media (min-width: 960px) {
  section.layout--sidebar {
    display: grid;
    grid-template-columns: 1fr 2fr;
    column-gap: 2.5rem;
    align-items: start;
  }

  section.layout--sidebar > h2 {
    grid-column: 1 / -1;
  }

  section.layout--sidebar > .block { margin-top: 0; }
}

/* ── Schedule — shared event type styles ───────────────────────────────── */
.event--plenary,
.event--talk {
  border-left: 2px solid var(--ev-main-border);
  background: var(--ev-main-bg);
}

.event--plenary .label { font-weight: 600; }

.event--break .label {
  color: var(--text-light);
  font-style: italic;
}

.event--other {
  background: var(--ev-other-bg);
  border-left: 2px solid var(--ev-other-border);
}

.event--social {
  background: var(--ev-social-bg);
  border-left: 2px solid var(--ev-social-border);
}

.event--social .label { font-weight: 500; }

.event--empty { background: var(--bg-alt); }

/* ── Schedule — desktop grid ────────────────────────────────────────────── */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(var(--schedule-days, 3), 1fr);
  grid-template-rows: auto repeat(16, minmax(2rem, auto));
  gap: 2px 1rem;
}

.schedule-mobile { display: none; }

.day-header,
.day-header-mobile {
  background: var(--sidebar-bg);
  color: #fff;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.day-header {
  grid-row: 1;
  border-radius: var(--radius) var(--radius) 0 0;
  white-space: nowrap;
}

.schedule-grid .event {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.75rem;
  background: var(--bg-alt);
  border-radius: 3px;
  min-height: 0;
  transition: box-shadow 0.2s ease, padding-left 0.2s ease;
}

/* Replace border-left with inset box-shadow so width can animate */
.schedule-grid .event--plenary,
.schedule-grid .event--talk {
  --strip-color: var(--ev-main-border);
  border-left: none;
  box-shadow: inset 2px 0 0 var(--strip-color);
}

.schedule-grid .event--other {
  --strip-color: var(--ev-other-border);
  border-left: none;
  box-shadow: inset 2px 0 0 var(--strip-color);
}

.schedule-grid .event--social {
  --strip-color: var(--ev-social-border);
  border-left: none;
  box-shadow: inset 2px 0 0 var(--strip-color);
}

.schedule-grid .event:not(.event--empty):not(.event--break):hover {
  box-shadow: inset 5px 0 0 var(--strip-color);
  padding-left: calc(0.75rem + 3px);
}

.schedule-grid .event .time {
  font-size: 0.75rem;
  color: var(--text-light);
  min-width: 2.8rem;
  flex-shrink: 0;
  text-align: center;
}

.schedule-grid .event .label { font-size: 0.85rem; }

/* ── Schedule — mobile fallback ─────────────────────────────────────────── */
.schedule-mobile .day {
  background: var(--bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.schedule-mobile .event {
  display: flex;
  padding: 0.4rem 0.75rem;
  gap: 0.6rem;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.schedule-mobile .event:last-child { border-bottom: none; }

.schedule-mobile .event .time {
  font-size: 0.8rem;
  color: var(--text-light);
  min-width: 3rem;
  flex-shrink: 0;
}

.schedule-mobile .event .label { font-size: 0.9rem; }

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .acronym span {
    animation: none;
    opacity: 1;
    transform: none;
  }

  section {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .schedule-grid .event { transition: none; }
  .sidebar nav a { transition: none; }
  a.name::after { transition: none; }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 959px) {
  .schedule-grid { display: none; }
  .schedule-mobile { display: block; }
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    position: relative;
    height: auto;
    box-shadow: none;
    flex-direction: column;
    text-align: center;
    border-right: none;
    border-bottom: 3px solid var(--accent);
  }

  .sidebar-top { padding: 1.5rem; }

  .acronym {
    font-size: 1.3rem;
    line-height: 1.5;
    letter-spacing: 0.04em;
  }

  .acronym .nudge strong { margin-left: 0; }

  .sidebar nav { display: none; }
  .theme-toggle  { display: none; }

  /* Collapsed header — fixed, appears when full header scrolls away */
  .header-collapsed {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--sidebar-bg);
    color: #fff;
    padding: 0.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: slide-down 0.2s ease-out;
  }

  .header-collapsed .collapsed-title {
    font-family: "Archivo", sans-serif;
    font-size: 1rem;
    letter-spacing: 0.12em;
    margin-right: 0.75rem;
  }

  .header-collapsed .collapsed-meta {
    font-size: 0.75rem;
    opacity: 0.7;
  }

  @keyframes slide-down {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
  }

  .content {
    height: auto;
    overflow: visible;
    overscroll-behavior: auto;
  }

  section h2 {
    top: 2.6rem; /* below .header-collapsed */
  }

  main { padding: 0 1.5rem; }
  footer { padding: 2.5rem 1.5rem 1.5rem; }

}
