/* Public site styles. Same palette as the kurser app (_tokens.scss). */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #fafaf7; --bg-2: #ffffff; --bg-3: #f3f2ee;
  --fg: #16161a; --fg-2: #3c3c44; --fg-3: #6b6b75;
  --border: #e6e5df; --accent: #c08b1c; --accent-2: #a87614;
  --accent-soft: #f6e6bf; --accent-soft-fg: #3d2a05; --logo-invert: 0;
}
/* Dark palette: chosen explicitly, or by the system when nothing is chosen. */
[data-theme='dark'] {
  --bg: #0e0f12; --bg-2: #15171c; --bg-3: #1c1f25;
  --fg: #f4f4f5; --fg-2: #d4d4d8; --fg-3: #a1a1aa;
  --border: #26282f; --accent: #e6b450; --accent-2: #f0c46e;
  --accent-soft: #2d2208; --accent-soft-fg: #f3d999; --logo-invert: 1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0e0f12; --bg-2: #15171c; --bg-3: #1c1f25;
    --fg: #f4f4f5; --fg-2: #d4d4d8; --fg-3: #a1a1aa;
    --border: #26282f; --accent: #e6b450; --accent-2: #f0c46e;
    --accent-soft: #2d2208; --accent-soft-fg: #f3d999; --logo-invert: 1;
  }
}
.theme-toggle {
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--fg-2); cursor: pointer; padding: 6px 10px; font-size: 1rem; line-height: 1;
}
.theme-toggle:hover { background: var(--bg-3); color: var(--fg); }
.theme-toggle .when-dark { display: none; }
[data-theme='dark'] .theme-toggle .when-light { display: none; }
[data-theme='dark'] .theme-toggle .when-dark { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .when-light { display: none; }
  :root:not([data-theme='light']) .theme-toggle .when-dark { display: inline; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.015em; font-weight: 700; margin: 1.4em 0 0.5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-top: 0.4em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p, ul, ol, blockquote, table { color: var(--fg-2); }
blockquote { border-left: 3px solid var(--accent); margin: 1em 0; padding: 0.2em 1em; color: var(--fg-3); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; z-index: 100; }

/* Header + navigation */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px;
  background: color-mix(in oklch, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 700; text-decoration: none; margin-right: auto; }
.brand img { width: 40px; height: 40px; filter: invert(var(--logo-invert)); }
.nav-toggle { display: none; font-size: 1.5rem; background: none; border: 0; color: var(--fg); cursor: pointer; padding: 4px 10px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.site-nav li { position: relative; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--fg-2); font-weight: 600; font-size: 0.95rem; text-decoration: none;
}
.site-nav a:hover, .site-nav li[aria-current] > a { background: var(--accent-soft); color: var(--accent-soft-fg); }
.site-nav .has-children > a::after { content: ' ▾'; font-size: 0.75em; color: var(--fg-3); }
.site-nav li ul {
  display: none; position: absolute; top: 100%; left: 0; min-width: 240px;
  flex-direction: column; gap: 0; padding: 6px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(20, 20, 30, 0.12);
}
.site-nav li:hover > ul, .site-nav li:focus-within > ul { display: flex; }
.site-nav li ul a { font-weight: 500; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; width: 100%; order: 10; }
  .site-header.open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav li ul { display: flex; position: static; box-shadow: none; border: 0; padding: 0 0 0 16px; background: transparent; }
  .site-nav .has-children > a::after { content: ''; }
}

/* Content */
.site-main { max-width: 820px; margin: 0 auto; padding: 24px 20px 64px; }
.site-main:has(.start-grid) { max-width: 1180px; }

/* Start page */
.hero-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 8px 0 28px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.hero-band h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.hero-band .lead p { margin: 0; color: var(--fg-3); font-size: 1.05rem; max-width: 60ch; }
.btn-cta { flex: 0 0 auto; background: var(--accent); color: #1a1100; font-weight: 700; padding: 12px 20px; border-radius: 10px; text-decoration: none; white-space: nowrap; }
.btn-cta:hover { background: var(--accent-2); color: #1a1100; }

.start-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.start-grid h2, .discover h2 { margin: 0 0 14px; font-size: 1.35rem; }
.start-aside { display: grid; gap: 28px; }

.news-featured { background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.news-featured img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.news-featured-text { padding: 16px 18px 18px; }
.news-featured time { color: var(--fg-3); font-size: 0.9rem; }
.news-featured h3 { margin: 4px 0 8px; font-size: 1.35rem; }
.news-featured h3 a { color: var(--fg); text-decoration: none; }
.news-featured p { margin: 0 0 6px; }
.news-featured .more { font-weight: 600; }
.news-tiles { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.news-tile a { display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--fg); }
.news-tile a:hover { border-color: var(--accent); }
.news-tile img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.news-tile-text { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; }
.news-tile time { color: var(--fg-3); font-size: 0.85rem; }

.today-date { color: var(--accent-2); margin: -6px 0 10px; font-size: 0.95rem; }
.today-list { list-style: none; padding: 0 16px; margin: 0; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; }
.today-list:empty { display: none; }
.today-row { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.today-row:last-child { border-bottom: 0; }
.today-time { display: flex; flex-direction: column; line-height: 1.3; }
.today-time b { font-size: 1.05rem; }
.today-time span { color: var(--fg-3); font-size: 0.9rem; }
.today-text { display: flex; flex-direction: column; gap: 2px; }
.today-text strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.today-text > span { color: var(--fg-3); font-size: 0.92rem; }
.now { font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #0f2e21; color: #75e0a8; }
.today-empty { color: var(--fg-3); margin: 0; }

.upcoming-list { list-style: none; padding: 0; margin: 0; }
.upcoming-row { border-bottom: 1px solid var(--border); }
.upcoming-row:last-child { border-bottom: 0; }
.upcoming-row a { display: grid; grid-template-columns: 58px 1fr; gap: 14px; align-items: center; padding: 12px 0; text-decoration: none; color: var(--fg); }
.date-badge { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--border); line-height: 1.1; }
.date-badge b { font-size: 1.35rem; }
.date-badge span { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.upcoming-text { display: flex; flex-direction: column; gap: 2px; }
.upcoming-text span { color: var(--fg-3); font-size: 0.92rem; }

.discover { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.discover .cards { margin-top: 0; }

@media (max-width: 960px) {
  .start-grid { grid-template-columns: 1fr; gap: 32px; }
  .start-aside { order: -1; }
  .hero-band { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .news-tiles { grid-template-columns: 1fr; }
}

/* Link cards */
.cards { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.cards li a {
  display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--fg);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  transition: border-color 0.18s, transform 0.18s;
}
.cards li a:hover { border-color: var(--accent); transform: translateY(-2px); }
.cards img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
/* A card without a picture still keeps the row's rhythm. */
.cards li a:not(:has(img))::before { content: ''; display: block; aspect-ratio: 3 / 2; background: linear-gradient(135deg, var(--accent-soft), var(--bg-3)); }
.card-text { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.card-text strong { font-size: 1.02rem; }
.card-text span { color: var(--fg-3); font-size: 0.9rem; line-height: 1.4; }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); padding: 28px 20px 40px;
  text-align: center; color: var(--fg-3); font-size: 0.9rem;
}
.site-footer p { margin: 4px 0; color: inherit; }
