/*
 * PyCon Lithuania — base design system. Replaces Pico CSS.
 *
 * Identity: Baltic amber. Persistent here — sea-dark neutral, the
 * Mina/Saira Condensed type pairing, the "inclusion" signature mark.
 * What rotates per edition is the accent hue: one real documented
 * amber variant per year, defined in its own theme/{year}.css file
 * (see app/static/css/theme/). Each file uses light-dark() to pair
 * that variant's daylight color with its real UV-fluorescence color,
 * so dark mode isn't just "the same hue on a darker background" —
 * it's the same specimen under a different light, which is
 * materially true of amber.
 *
 * Variants used so far: butterscotch (2025), cognac (2026, also the
 * fallback in theme/default.css), lemon (2027). In reserve for future
 * editions: cherry (dark red-brown) and blue amber — the rarest
 * documented variant, ordinary honey-brown in daylight but famous for
 * glowing blue under UV — save that one for a milestone edition.
 */

/* Self-hosted — modern browsers partition the font cache per-origin
   now anyway, so Google Fonts' CDN no longer gives a shared-cache
   benefit, only the cost of a third-party origin. */
@font-face {
  font-family: 'Mina';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/mina.woff2') format('woff2');
}
@font-face {
  font-family: 'Saira Condensed';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/saira-condensed.woff2') format('woff2');
}

:root {
  color-scheme: light dark;
}
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

:root {
  --font-family-display: 'Mina', serif;
  --font-family-sans-serif: 'Saira Condensed', system-ui, -apple-system, sans-serif;
  --font-family: var(--font-family-sans-serif);
  --border-radius: 0.375rem;
  --card-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --del-color: light-dark(#c0392b, #e5735f);
  --ins-color: light-dark(#1f9d55, #4bc97f);
  --spacing: 1rem;

  --background-color: light-dark(#faf6ef, #0c1418);
  --color: light-dark(#17110a, #e8f4f2);
  --muted-color: light-dark(#7a6a58, #6f8f92);
  --muted-border-color: light-dark(#e6dcc9, rgba(120, 200, 210, 0.15));
  --card-background-color: light-dark(#ffffff, #101b21);
  --card-sectioning-background-color: light-dark(#f5efe2, #16242b);
}

/* ── Base typography ──────────────────────────────────────── */
body {
  font-family: var(--font-family);
  background: var(--background-color);
  color: var(--color);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-display);
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 0.6rem;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
p { margin-bottom: 1rem; }
small { color: var(--muted-color); font-size: 0.85em; }
hr {
  border: none;
  border-top: 1px solid var(--muted-border-color);
  margin: 1.5rem 0;
}
a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { opacity: 0.85; }
del { color: var(--del-color); }
ins { color: var(--ins-color); text-decoration: underline; }
code {
  background: var(--card-sectioning-background-color);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.9em;
}

hgroup { margin-bottom: 1.5rem; }
hgroup > *:not(:first-child) { color: var(--muted-color); font-weight: 400; }

/* ── Layout container ─────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;
}
/* A calmer, narrower measure for single-focus reading/form pages
   (CFP, financial aid, code of conduct) — the wide margin either
   side is the point, not unused space. */
.container-prose {
  width: 100%;
  max-width: 740px;
  margin-inline: auto;
  padding-inline: 1rem;
}
.overflow-auto { overflow-x: auto; }

/* ── Nav ──────────────────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}
nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.25rem;
  padding: 0;
}
nav a { text-decoration: none; color: inherit; }
nav a:hover { color: var(--primary); opacity: 1; }

/* ── Buttons ──────────────────────────────────────────────── */
button,
[role="button"],
input[type="submit"],
input[type="button"] {
  display: inline-block;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  padding: 0.55em 1.2em;
  background: var(--primary);
  color: var(--primary-inverse);
  transition: filter 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
button:hover, [role="button"]:hover, input[type="submit"]:hover, input[type="button"]:hover {
  filter: brightness(0.92);
}
button:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid var(--primary-focus);
  outline-offset: 2px;
}

button.secondary, [role="button"].secondary {
  background: var(--secondary-background);
  color: var(--secondary-inverse);
}
button.contrast, [role="button"].contrast {
  background: var(--color);
  color: var(--background-color);
}
button.outline, [role="button"].outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
  filter: none;
}
button.outline:hover, [role="button"].outline:hover {
  background: var(--primary);
  color: var(--primary-inverse);
  filter: none;
}
button.outline.secondary, [role="button"].outline.secondary {
  color: var(--secondary-background);
  border-color: var(--secondary-background);
}
button.outline.secondary:hover, [role="button"].outline.secondary:hover {
  background: var(--secondary-background);
  color: var(--secondary-inverse);
}
button.outline.contrast, [role="button"].outline.contrast {
  color: var(--color);
  border-color: var(--color);
}
button.outline.contrast:hover, [role="button"].outline.contrast:hover {
  background: var(--color);
  color: var(--background-color);
}

/* ── Icon buttons ─────────────────────────────────────────── */
/* Icon-only nav chrome (theme toggle, mobile menu, notification bell) —
   never real CTAs, so they stay quiet: no fill, no border by default,
   just a soft tint on hover/focus. Circular so they read as a control,
   not a lopsided text button around a tiny glyph. */
[role="button"].icon-button,
a.icon-button,
button.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  line-height: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-color);
  filter: none;
}
.icon-button svg { display: block; width: 1.15rem; height: 1.15rem; }
.icon-button:hover {
  background: var(--card-sectioning-background-color);
  color: var(--primary);
  filter: none;
}

[role="group"] { display: flex; gap: 0.6rem; flex-wrap: wrap; }
fieldset[role="group"] { display: flex; border: none; padding: 0; margin-bottom: 0.75rem; }

/* Two labeled fields side by side (Company / Job title, City / Country) —
   even columns, normal gap. Distinguished from the joined-pill pattern
   below by having <label> as direct children instead of a bare input. */
fieldset[role="group"]:has(> label) { gap: 0.75rem; }
fieldset[role="group"]:has(> label) > label { flex: 1; margin-bottom: 0; }

/* A bare input joined directly to a button/link, no wrapping label —
   a single joined pill (Website + "Visit" button, newsletter signup),
   not separate fields. No gap; only the outer corners round. */
fieldset[role="group"]:not(:has(> label)) { gap: 0; }
fieldset[role="group"]:not(:has(> label)) > input { flex: 1; margin-bottom: 0; border-radius: var(--border-radius) 0 0 var(--border-radius); }
fieldset[role="group"]:not(:has(> label)) > button,
fieldset[role="group"]:not(:has(> label)) > input[type="submit"],
fieldset[role="group"]:not(:has(> label)) > a[role="button"] { border-radius: 0 var(--border-radius) var(--border-radius) 0; }

/* ── Grid ─────────────────────────────────────────────────── */
.grid {
  display: grid;
  /* Capped max track (not 1fr): a handful of cards keep their natural
     size and sit centered in quiet margin, rather than stretching to
     fill the row just because the row is wide. */
  grid-template-columns: repeat(auto-fit, minmax(200px, 280px));
  justify-content: center;
  gap: var(--spacing);
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
}

/* ── Cards ────────────────────────────────────────────────── */
article {
  background: var(--card-background-color);
  border: 1px solid var(--muted-border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--card-box-shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  container-type: inline-size;
}
.grid > article { margin-bottom: 0; }
article > header {
  background: var(--card-sectioning-background-color);
  margin: -1.25rem -1.25rem 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--muted-border-color);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  font-weight: 600;
}

/* ── Badges ───────────────────────────────────────────────── */
mark {
  display: inline-block;
  background: color-mix(in oklch, var(--primary) 15%, transparent);
  color: var(--primary);
  padding: 0.15em 0.6em;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 600;
}

/* ── Tables ───────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--muted-border-color);
}
thead th { font-weight: 600; border-bottom: 2px solid var(--muted-border-color); }

/* ── Details / summary ────────────────────────────────────── */
details {
  border: 1px solid var(--muted-border-color);
  border-radius: var(--border-radius);
  padding: 0 1rem;
  margin-bottom: 0.6rem;
}
details[open] { padding-bottom: 0.75rem; }
summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.7rem 0;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "\25B8";
  display: inline-block;
  margin-right: 0.5em;
  color: var(--primary);
  transition: transform 0.15s ease;
}
details[open] summary::before { transform: rotate(90deg); }

/* ── Forms ────────────────────────────────────────────────── */
label { display: block; margin-bottom: 0.3rem; font-weight: 600; font-size: 0.9rem; }
input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"]),
select,
textarea {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--muted-border-color);
  border-radius: var(--border-radius);
  background: var(--background-color);
  color: var(--color);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}
textarea { field-sizing: content; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary-focus);
  outline-offset: 1px;
  border-color: var(--primary);
}
input:user-invalid, select:user-invalid, textarea:user-invalid {
  border-color: var(--del-color);
}
input[type="checkbox"], input[type="radio"] {
  width: 1.15em;
  height: 1.15em;
  accent-color: var(--primary);
  margin-right: 0.4em;
}

/* A checkbox marked role="switch" means "toggle", not "checkbox" —
   render it as one instead of a tiny tickbox pretending to be one. */
input[type="checkbox"][role="switch"] {
  appearance: none;
  width: 2.25em;
  height: 1.25em;
  padding: 0;
  margin: 0 0.5em 0 0;
  border-radius: 999px;
  background: var(--muted-border-color);
  position: relative;
  vertical-align: middle;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
input[type="checkbox"][role="switch"]::before {
  content: "";
  position: absolute;
  top: 0.1875em;
  left: 0.1875em;
  width: 0.875em;
  height: 0.875em;
  border-radius: 50%;
  background: var(--card-background-color);
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
input[type="checkbox"][role="switch"]:checked {
  background: var(--primary);
}
input[type="checkbox"][role="switch"]:checked::before {
  transform: translateX(1em);
}

/* A link/button marked aria-disabled="true" (e.g. "visit profile" links
   with nothing to visit yet) must look inert, not identical to a live
   one — otherwise there's no visual reason not to click it. */
[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
[aria-disabled="true"]:hover {
  background: inherit;
  filter: none;
}

/* ── Compact status row (Connected Accounts, similar lists) ───────
   A table stretches Provider/Status/Action across the full width for
   content that's a few words each. This sizes to content instead. */
.status-rows {
  border-top: 1px solid var(--muted-border-color);
}
.status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--muted-border-color);
}
.status-row-name {
  font-weight: 600;
  min-width: 8rem;
}
.status-row-status {
  color: var(--muted-color);
  flex: 1;
}
.status-row-action {
  margin-left: auto;
}

/* ── Loading indicator — the inclusion mark, not a generic spinner ── */
[aria-busy="true"]:not(input, select, textarea)::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.5em;
  vertical-align: -0.15em;
  background: var(--primary);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path d='M16 9 Q20 13 16 17 Q12 21 16 23 Q11 21 11 16 Q11 10 16 9Z'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path d='M16 9 Q20 13 16 17 Q12 21 16 23 Q11 21 11 16 Q11 10 16 9Z'/></svg>") center/contain no-repeat;
  animation: inclusion-pulse 1.1s ease-in-out infinite;
}
@keyframes inclusion-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%      { transform: scale(1.15); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  [aria-busy="true"]::before { animation: none; }
}

/* ── The inclusion mark — used sparingly: hero eyebrow, dividers ── */
.inclusion-mark {
  display: inline-block;
  vertical-align: -0.15em;
}

/* ── Hero eyebrow — names the edition's amber variant, not a stat bar ── */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--primary);
  margin-bottom: 1rem;
}
.hero-tally {
  font-size: 0.9rem;
}
.hero-subtitle {
  font-family: var(--font-family-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* ── CFP status eyebrow + timeline ──────────────────────────────── */
.timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-block: 1px solid var(--muted-border-color);
}
.timeline-item strong {
  display: block;
  font-family: var(--font-family-display);
  font-size: 1.1rem;
}
.timeline-item[data-passed="true"] { opacity: 0.5; }

/* ── CFP submission result (success/error) ──────────────────────── */
.cfp-result {
  border-left: 3px solid var(--primary);
}
.cfp-result.is-error {
  border-left-color: var(--del-color);
}
