/* ==========================================================
   Mathe-Cup Salzburg 2027 – modernes Stylesheet
   Eigenständig (ohne Bootstrap/Template), CD Universität Salzburg:
   Arial, Uni-Grün #346f63 (+ Farbstufen), Basaltgrau #59605E
   ========================================================== */

:root {
  --gruen: #346f63;
  --gruen-dunkel: #2b5c52;
  --gruen-75: #67938a;
  --gruen-50: #9ab7b1;
  --gruen-15: #e1e9e8;
  --basalt: #59605e;
  --basalt-15: #e6e7e7;
  --text: #111;
  --weiss: #fff;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.07);
  --wrap: 1140px;
  --kopf: 84px;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--kopf) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--weiss);
  hyphens: auto;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; color: var(--gruen); font-weight: 700; hyphens: manual; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
h3, .h3 { font-size: 1.3rem; }
h4 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
a { color: var(--gruen-dunkel); text-underline-offset: .18em; }
a:hover { color: var(--gruen); }
p a, dd a, .contact-list a { text-decoration: underline; }
strong { color: inherit; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.icon {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.18em;
}

/* ---------- Barrierefreiheit ---------- */
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 2000;
  background: var(--gruen); color: var(--weiss); padding: 10px 16px; font-weight: 700;
  border-radius: 6px; transition: top .2s;
}
.skip-link:focus { top: 8px; color: var(--weiss); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--gruen); outline-offset: 3px; border-radius: 4px;
}
.hero a:focus-visible, .band a:focus-visible { outline-color: var(--weiss); }
main:focus { outline: none; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Kopfzeile ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--basalt-15);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--kopf); gap: 16px; }
/* Logo-Datei enthält bereits die CD-Schutzzone */
.brand img { width: 190px; height: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.site-nav a {
  display: block; padding: 10px 14px; border-radius: 8px;
  color: var(--text); font-weight: 700; font-size: 1rem; text-decoration: none;
}
.site-nav a:hover { color: var(--gruen); background: var(--gruen-15); }

/* Archiv-Dropdown */
.dropdown { position: relative; }
.dropdown-toggle::after {
  content: ""; display: inline-block; margin-left: 6px; vertical-align: 2px;
  border: 5px solid transparent; border-top-color: currentColor; border-bottom: 0;
}
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px;
  background: var(--weiss); border-radius: 10px; box-shadow: var(--schatten); padding: 6px;
  border: 1px solid var(--basalt-15);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.show .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-item { font-weight: 400 !important; }

/* Handy-Menü */
.navbar-toggler {
  display: none; width: 48px; height: 48px; border: 1px solid var(--basalt-15); border-radius: 10px;
  background: var(--weiss); cursor: pointer; padding: 0;
}
.burger, .burger::before, .burger::after {
  display: block; width: 22px; height: 2px; background: var(--text); margin: 0 auto; position: relative;
  transition: transform .2s, background .2s;
}
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -7px; }
.burger::after { top: 7px; }
.navbar-toggler[aria-expanded="true"] .burger { background: transparent; }
.navbar-toggler[aria-expanded="true"] .burger::before { transform: translateY(7px) rotate(45deg); }
.navbar-toggler[aria-expanded="true"] .burger::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  :root { --kopf: 70px; }
  .brand img { width: 150px; }
  .navbar-toggler { display: block; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--weiss); border-bottom: 1px solid var(--basalt-15); box-shadow: var(--schatten);
    display: none; padding: 8px 16px 16px;
  }
  .site-nav.show { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .site-nav a { padding: 12px 10px; }
  .dropdown-menu {
    position: static; box-shadow: none; border: 0; padding: 0 0 0 16px; min-width: 0;
    display: none; opacity: 1; visibility: visible; transform: none;
  }
  .dropdown.show .dropdown-menu { display: block; }
  .dropdown:hover .dropdown-menu { display: none; }
  .dropdown.show:hover .dropdown-menu { display: block; }
}

/* ---------- Startbild ---------- */
.hero {
  position: relative; isolation: isolate; color: var(--weiss);
  min-height: min(78vh, 720px); display: flex; align-items: center;
  padding: 72px 0;
}
.hero-bg, .hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-bg img { object-fit: cover; object-position: center 40%; }
.hero-bg { z-index: -1; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(22,52,46,.70) 0%, rgba(22,52,46,.52) 38%, rgba(22,52,46,.12) 68%, rgba(22,52,46,0) 100%);
}
.hero-inner { width: 100%; }
.hero-logo { width: 96px; height: auto; margin-bottom: 18px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.eyebrow { text-transform: none; font-weight: 700; letter-spacing: .02em; opacity: .95; margin-bottom: .4em; }
.hero h1 {
  color: var(--weiss); font-size: clamp(2.4rem, 1.4rem + 4.5vw, 4.6rem); line-height: 1.05;
  margin-bottom: .25em; max-width: 14ch; text-shadow: 0 2px 16px rgba(0,0,0,.35);
}
.hero-date { font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); margin-bottom: 1em; text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.eyebrow { text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.hero-facts { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-facts li {
  background: rgba(22,52,46,.55); border: 1px solid rgba(255,255,255,.45);
  padding: 6px 14px; border-radius: 999px; font-size: .95rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px; font-weight: 700; font-size: 1.05rem;
  text-decoration: none; border: 2px solid transparent; transition: transform .15s, background .15s, color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gruen); color: var(--weiss); border-color: var(--gruen); }
.btn-primary:hover { background: var(--gruen-dunkel); color: var(--weiss); }
.btn-ghost { color: var(--weiss); border-color: rgba(255,255,255,.8); }
.btn-ghost:hover { background: var(--weiss); color: var(--gruen-dunkel); }
.btn-light { background: var(--weiss); color: var(--gruen-dunkel); }
.btn-light:hover { background: var(--gruen-15); color: var(--gruen-dunkel); }

/* ---------- Abschnitte ---------- */
.section { padding: clamp(56px, 7vw, 96px) 0; }
.tint { background: var(--gruen-15); }
.section-title { text-align: center; margin-bottom: .5em; }
.section-lead { text-align: center; max-width: 720px; margin: 0 auto 36px; color: var(--basalt); }

/* Einleitung + Eckdaten */
.intro-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.lead { font-size: 1.15rem; }
.facts-card {
  background: var(--weiss); border-radius: var(--radius); box-shadow: var(--schatten);
  border-top: 6px solid var(--gruen); padding: 28px;
}
.facts-card dl { margin: 0; display: grid; gap: 16px; }
.facts-card dt { font-weight: 700; color: var(--gruen-dunkel); display: flex; gap: 8px; align-items: center; }
.facts-card dd { margin: 2px 0 0 calc(1.15em + 8px); }

/* Zeitleiste */
.timeline { list-style: none; margin: 32px auto 0; padding: 0; max-width: 820px; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 3px; background: var(--gruen-50); border-radius: 3px;
}
.timeline li { position: relative; padding: 0 0 32px 48px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 25px; height: 25px; border-radius: 50%;
  background: var(--weiss); border: 5px solid var(--gruen);
}
.timeline .time {
  display: inline-flex; gap: 8px; align-items: center; font-weight: 700;
  background: var(--gruen); color: var(--weiss); padding: 4px 14px; border-radius: 999px; margin-bottom: 10px;
}
.timeline h3 { margin-bottom: .35em; }

/* Karten */
.cards { display: grid; gap: 24px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); max-width: 940px; margin: 32px auto 0; }
.card {
  background: var(--weiss); border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 28px; border: 1px solid var(--basalt-15);
}
.notice {
  margin-top: 40px; background: var(--basalt-15); border-left: 6px solid var(--basalt);
  border-radius: var(--radius); padding: 28px 32px;
}
.notice h3, .notice h4 { color: var(--text); }

/* Anmelde-Band in Uni-Grün (weiße Schrift laut CD zulässig) */
.band { background: var(--gruen); color: var(--weiss); }
.band h2 { color: var(--weiss); }
.band-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.band-inner > div { max-width: 720px; }
.band .deadline {
  display: inline-block; font-weight: 700; background: var(--weiss); color: var(--gruen-dunkel);
  padding: 6px 14px; border-radius: 8px; margin: 0;
}

/* Fotoalben */
.album {
  display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--schatten);
  text-decoration: none; color: var(--text); background: var(--weiss);
  transition: transform .2s, box-shadow .2s;
}
.album { position: relative; }
.album img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .4s; }
.album:hover img { transform: scale(1.03); }
.album picture { display: block; overflow: hidden; }
.album-badge {
  position: absolute; top: 14px; left: 14px; z-index: 1;
  background: var(--gruen); color: var(--weiss); font-weight: 700;
  padding: 4px 12px; border-radius: 999px; font-size: .95rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.album:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.12); }
.album-caption { display: block; padding: 16px 20px; font-weight: 700; color: var(--gruen-dunkel); }
.album-caption .ext { display: block; font-weight: 400; color: var(--basalt); font-size: .95rem; }
.album-caption .ext::after { content: " ↗"; }

/* Veranstalter */
.partners {
  list-style: none; padding: 0; margin: 32px 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.partners a {
  display: flex; flex-direction: column; gap: 16px; height: 100%;
  background: var(--weiss); border-radius: var(--radius); padding: 24px; box-shadow: var(--schatten);
  text-decoration: none; color: var(--text); font-weight: 700;
}
.partners a:hover span { color: var(--gruen); text-decoration: underline; }
.partners img { height: 110px; width: 100%; object-fit: contain; }
.sponsor-call {
  margin: 48px auto 0; max-width: 820px; background: var(--weiss); border-radius: var(--radius);
  border-left: 6px solid var(--gruen); padding: 28px 32px; box-shadow: var(--schatten);
}

/* Orgateam */
.team {
  list-style: none; padding: 0; margin: 32px 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; text-align: center;
}
.team a { text-decoration: none; color: var(--gruen-dunkel); display: inline-block; }
.team img {
  width: 160px; height: 160px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px;
  box-shadow: 0 0 0 6px var(--gruen-15); transition: box-shadow .2s;
}
.team a:hover img { box-shadow: 0 0 0 6px var(--gruen-50); }
.team .name { display: block; font-weight: 700; font-size: 1.1rem; }
.team a:hover .name { text-decoration: underline; }
.team .role { display: block; color: var(--basalt); }

/* Kontakt */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 760px; margin: 24px auto 0;
}
.contact-grid address, .contact-list {
  background: var(--weiss); border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--schatten);
  font-style: normal; margin: 0;
}
.contact-grid address { display: flex; gap: 12px; }
.contact-grid address .icon { color: var(--gruen); margin-top: 4px; }
.contact-list { list-style: none; display: grid; gap: 10px; align-content: center; }
.contact-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.contact-list .icon { color: var(--gruen); }

/* Fußzeile */
.site-footer { border-top: 1px solid var(--basalt-15); padding: 40px 0; color: var(--basalt); font-size: .95rem; }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: 8px 40px; align-items: center; }
.footer-logo { grid-row: span 2; }
.footer-logo img { width: 220px; }
.site-footer p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--basalt); }
.footer-links a:hover { color: var(--gruen); }

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
  .intro-grid, .cards-3, .partners, .contact-grid { grid-template-columns: 1fr; }
  .team { grid-template-columns: repeat(2, 1fr); }
  .band-inner { flex-direction: column; align-items: flex-start; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-logo { grid-row: auto; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .cards-2 { grid-template-columns: 1fr; }
  .hero { min-height: 0; padding: 56px 0 64px; }
  .hero-bg::after { background: linear-gradient(180deg, rgba(22,52,46,.70), rgba(22,52,46,.62)); }
  .btn { width: 100%; }
  .team img { width: 128px; height: 128px; }
  .notice, .sponsor-call { padding: 22px; }
}

/* Bewegung reduzieren */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
