:root {
  --accent: #1a5fb4;
  --text: #222;
  --muted: #666;
  --bg: #f6f7f9;
  --nav-height: 104px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* keeps #news anchor from hiding under the sticky nav */
  scroll-padding-top: var(--nav-height);
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* ---------- Navigation (stays at top while scrolling) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.nav {
  max-width: 1000px;
  height: var(--nav-height);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
  text-decoration: none;
}

.logo img {
  display: block;
  height: 88px; /* fits inside the nav bar (see --nav-height) */
  width: auto;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  border-bottom-color: var(--accent);
}

/* ---------- Banner ---------- */
.banner {
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #4e4d4d;
  background: url("../imgs/MainzSkylineDrawing.png") center / cover no-repeat;
}

.banner-content {
  padding: 3rem 4rem;
  /* dark centre fading out to transparent at the edges */
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 70%);
}

.banner h1 { font-size: 2.8rem; margin: 0 0 0.5rem; }
.banner p  { font-size: 1.2rem; margin: 0; }

/* ---------- Content ---------- */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.page { min-height: 60vh; }

.news-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden; /* image corners follow the card's rounded corners */
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.news-body { padding: 1.25rem 1.5rem; }

/* ---------- News images ---------- */
.news-media {
  height: 600px;
  background: #e5e5e5;
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #d8d8d8;
  cursor: zoom-in;
}

.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

.media-gallery {
  display: grid;
  gap: 2px;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr);
}
.media-gallery.tiles-3 { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.media-gallery.tiles-3 .tile:first-child { grid-row: span 2; }
.media-gallery.tiles-4 { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }

.tile-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 3rem;
  font-weight: 600;
}

/* ---------- Overlay ---------- */
body.lightbox-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000; /* above the sticky navigation */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}
.lightbox[hidden] { display: none; }

.lb-figure {
  margin: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lb-img {
  max-width: min(92vw, 1600px);
  max-height: 86vh;
  object-fit: contain;
  display: block;
}

.lb-caption { color: #ddd; margin-top: 0.5rem; font-size: 0.9rem; min-height: 1.3em; }

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, 0.3); }
.lb-close:focus-visible, .lb-prev:focus-visible, .lb-next:focus-visible { outline: 3px solid #fff; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-prev[hidden], .lb-next[hidden] { display: none; }

.news-item h3 { margin: 0 0 0.25rem; }
.news-item time { color: var(--muted); font-size: 0.9rem; }
.news-item p { margin: 0.75rem 0 0; white-space: pre-line; }

.muted { color: var(--muted); }

/* ---------- Team (Wer wir sind) ---------- */
.team {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.person {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.person-photo {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  object-fit: cover;
  background: #dfe5ec;
}

.person h3 { margin: 0; font-size: 1.15rem; }
.person-role { margin: 0.15rem 0 0.75rem; color: var(--accent); font-weight: 600; }
.person-meta { margin: 0.5rem 0 0; font-size: 0.95rem; }
.person-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.person-contact {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
}
.person-contact:hover { background: var(--accent); color: #fff; }
button.person-contact { background: transparent; font-family: inherit; cursor: pointer; }
button.person-contact:hover { background: var(--accent); color: #fff; }

/* ---------- Message dialog on the team page ---------- */
.contact-dialog {
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.contact-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.contact-dialog-body { position: relative; padding: 1.5rem; }
.contact-dialog-body h2 { margin: 0 2.5rem 0.5rem 0; font-size: 1.25rem; }
.contact-dialog-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: #eef1f5;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.contact-dialog-close:hover { background: #dde3ea; }

/* ---------- Contact form ---------- */
.contact-form label { display: block; font-weight: 600; margin: 1.1rem 0 0.25rem; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font: inherit;
  border: 1px solid #b9c0c9;
  border-radius: 6px;
  background: #fff;
}
.contact-form input:focus-visible,
.contact-form select:focus-visible,
.contact-form textarea:focus-visible { outline: 3px solid rgba(26, 95, 180, 0.35); border-color: var(--accent); }
.contact-form .hint { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--muted); }
.contact-form label.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: normal; }
.contact-form label.check input { margin-top: 0.35rem; }
.contact-form button {
  padding: 0.65rem 1.4rem;
  font: inherit;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.contact-form button:disabled { opacity: 0.5; cursor: default; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; font-weight: 600; }
.form-status.success { color: #1e6b3a; }
.form-status.error { color: #a4161a; }

/* ---------- Legal pages (Impressum, Datenschutz) ---------- */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }
.legal ul { padding-left: 1.25rem; }
.legal a { color: var(--accent); }

/* placeholder still to be filled in – search for "TODO" in the page source */
.todo { background: #fff3a3; padding: 0 0.25em; border-radius: 3px; }

.site-footer a { color: inherit; }

.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  border-top: 1px solid #ddd;
}

@media (max-width: 600px) {
  .banner h1 { font-size: 2rem; }
}

/* ---------- Phones: logo on top, links in a row below ---------- */
@media (max-width: 700px) {
  :root { --nav-height: 96px; } /* used for anchor scrolling under the sticky bar */

  html, body { overflow-x: hidden; }

  .nav {
    height: auto;
    padding: 0.5rem 1rem;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
  }
  .logo img { height: 48px; max-width: 100%; }

  .nav-links {
    width: 100%;
    justify-content: space-around;
    gap: 0.5rem;
    font-size: 0.95rem;
  }

  .banner { min-height: 40vh; }
  .banner-content { padding: 2rem 1.25rem; }
  .banner p { font-size: 1.05rem; }

  .container { padding: 1.5rem 1rem; }
  .news-body { padding: 1rem; }
}

/* 600px is too tall on phones */
@media (max-width: 700px) {
  .news-media { height: 320px; }
  .lb-prev { left: 0.25rem; }
  .lb-next { right: 0.25rem; }
}
