:root {
  --max-width: 720px;
  --fg: #1a1a1a;
  --bg: #ffffff;
  --muted: #666666;
  --accent: #1a5fb4;
}

* { box-sizing: border-box; }

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

/* ── Standard header (inner pages) ─────────────────────────── */

main {
  /*max-width: var(--max-width);*/
  margin: 0 auto;
  padding: 1.5rem;
}

/* ── Unified header ─────────────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid #e0e0e0;
  background: #fff;
}

.menu-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.4rem;
  border: 1px solid #d2d2d2;
  border-radius: 0.45rem;
  background: #fff;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--fg);
}

.menu-toggle span + span {
  margin-top: 0.38rem;
}

.submenu-toggle {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--fg);
}

.brand-logo {
  height: 2.5rem;
  width: auto;
  display: block;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

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

.site-header nav a {
  text-decoration: none;
  color: var(--fg);
  font-size: 0.9rem;
}

.site-header nav a:hover { color: var(--accent); }

/* dropdown */
.site-header nav .has-children { position: relative; }

.site-header nav .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 0.5rem 0;
  min-width: 200px;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  z-index: 100;
}

.site-header nav .has-children:hover .submenu { display: flex; }

.site-header nav .submenu li { padding: 0; }

.site-header nav .submenu a {
  display: block;
  padding: 0.45rem 1.1rem;
  white-space: nowrap;
}

@media (min-width: 761px) {
  body.is-home .site-nav > ul > li:not(:last-child) {
    display: none;
  }
}

/* ── Home page ──────────────────────────────────────────────── */

body.is-home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.is-home main {
  flex: 0 0 calc(100vh - 61px);
  width: 100%;
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr;
  flex: 1;
}

.home-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
  background-color: #111;
  background-image: var(--card-bg);
  background-size: cover;
  background-position: center;
}

.home-card__main-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.home-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.38);
  transition: background 0.35s ease;
}

.home-card:hover::after {
  background: rgba(0, 0, 0, 0.18);
}

.home-card__title {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
  padding: 0 1.5rem;
  transition: transform 0.35s ease, letter-spacing 0.35s ease;
}

.home-card:hover .home-card__title {
  transform: scale(1.04);
  letter-spacing: 0.08em;
}

.home-card__ribbon {
  position: absolute;
  top: 3.9rem;
  left: -5.9rem;
  z-index: 2;
  display: inline-block;
  padding: 0.55rem 6.6rem;
  background: #c01818;
  color: #fff;
  font-size: 1.08rem;
  line-height: 1.2;
  white-space: normal;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  transform-origin: center;
  transform: rotate(-45deg);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease;
}

.home-card__ribbon:hover {
  background: #a51111;
}

.home-card__corner-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 3;
  display: block;
}

.home-card__corner-image {
  width: clamp(30px, 3.7vw, 57px);
  height: auto;
  display: block;
  filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.35));
}

/* ── Inner pages ────────────────────────────────────────────── */

a { color: var(--accent); }

.news-list {
  list-style: none;
  padding: 0;
}

.news-list li { margin-bottom: 1rem; }

.news-list time {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.page-legal {
  margin: 3rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  color: var(--muted);
  font-size: 0.85rem;
}

.page-legal a {
  color: inherit;
}

.contact-person {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.contact-person__image {
  display: block;
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border: 2px solid white;
  border-radius: 50%;
  object-fit: cover;
}

.contact-person__details {
  min-width: 0;
}

.contact-person__name {
  font-weight: 700;
}

body.is-home .page-legal {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 0;
  color: var(--muted);
  text-align: center;
}

/* ── Split layout (pages with image) ────────────────────────── */

body.has-image main {
  max-width: none;
  width: 100%;
  padding: 0;
  display: flex;
}

.page-split {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 61px); /* fill below header */
}

.page-split__image {
  flex: 0 0 36%;
  position: relative;
  background-size: cover;
  background-position: center;
  clip-path: polygon(0 0, 100% 0, 65% 100%, 0 100%);
  max-height: 150vh;
}

.page-split__content {
  flex: 1;
  padding: 3rem 3rem 3rem 1rem;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin: 0 auto;
}

@media (min-width: 761px) {
  .page-split__image {
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    max-height: none;
  }
}

/* ── Thumbnail grid ────────────────────────────────────────────── */

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.thumbnail-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  text-decoration: none;
  background-color: #eee;
  background-image: var(--thumb-bg);
  background-size: cover;
  background-position: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  transition: box-shadow 0.3s ease;
}

.thumbnail-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

.thumbnail-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  transition: background 0.3s ease;
}

.thumbnail-card:hover::after {
  background: rgba(0, 0, 0, 0.15);
}

.thumbnail-card__title {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* ── Vorstand Tooltips ────────────────────────────────────────── */

.vorstand-member {
  position: relative;
}

.vorstand-member img,
.vorstand-member > div:first-child {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.vorstand-member:hover img,
.vorstand-member:hover > div:first-child {
  box-shadow: 0 0 15px rgba(26, 95, 180, 0.6);
  transform: scale(1.05);
}

.vorstand-member::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
  display: none;
}

.vorstand-member:hover::after {
  opacity: 1;
}

.vorstand-grid {
  max-width: 100%;
}

.vorstand-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 2rem;
  margin: 0.75rem 0 1.25rem;
  align-items: start;
}

.vorstand-meta strong {
  display: inline-block;
  margin-bottom: 0.2rem;
}

.vorstand-contact {
  display: block;
  margin: 2.5rem auto 2.5rem;
  max-width: 24rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--fg);
  min-height: 2.9rem;
}

/* Nikolausregatta results table */
.regatta-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

.regatta-table thead th {
  background: #4a4a4a;
  color: #ffffff;
  font-weight: 700;
  text-align: center;
  padding: 0.7rem 0.85rem;
  border-bottom: 2px solid #2f2f2f;
}

.regatta-table tbody td {
  text-align: right;
  vertical-align: top;
  padding: 0.62rem 0.85rem;
  border-bottom: 1px solid #d2d2d2;
}

.regatta-table tbody tr:nth-child(odd) {
  background: #f3f3f3;
}

.regatta-table tbody tr:nth-child(even) {
  background: #e6e6e6;
}

.regatta-table summary {
  cursor: pointer;
  font-weight: 600;
}

.regatta-table details[open] summary {
  margin-bottom: 0.35rem;
}

.regatta-table .regatta-review-row td {
  text-align: left;
  padding: 0.55rem 0.85rem 0.75rem;
  background: #efefef;
}

.regatta-table .regatta-review-row details {
  text-align: left;
}

.regatta-table .regatta-review-row details[open] {
  max-width: 96ch;
}

.regatta-table .regatta-review-row summary,
.regatta-table .regatta-review-row p,
.regatta-table .regatta-review-row ul,
.regatta-table .regatta-review-row ol,
.regatta-table .regatta-review-row li {
  text-align: left;
}

.regatta-table .regatta-review-row img {
  float: right;
  width: min(44%, 24rem);
  max-width: 100%;
  height: auto;
  margin: 0.2rem 0 0.9rem 1rem;
}

.regatta-table .regatta-review-row details[open]::after {
  content: "";
  display: block;
  clear: both;
}

@media (max-width: 760px) {
  .site-header {
    padding: 0.65rem 1rem;
    flex-wrap: wrap;
  }

  .brand-name {
    font-size: 0.95rem;
  }

  .brand-logo {
    height: 2.2rem;
  }

  .menu-toggle {
    display: inline-block;
    margin-left: auto;
  }

  .site-nav {
    display: none;
    width: 100%;
    margin-top: 0.65rem;
    border-top: 1px solid #e7e7e7;
    padding-top: 0.55rem;
  }

  .site-header.is-menu-open .site-nav {
    display: block;
  }

  .site-header nav ul {
    flex-direction: column;
    gap: 0;
  }

  .site-header nav li {
    border-bottom: 1px solid #f1f1f1;
  }

  .site-header nav a {
    display: block;
    padding: 0.7rem 0.1rem;
    font-size: 1rem;
  }

  .site-header nav .has-children {
    position: relative;
    padding-right: 2.2rem;
  }

  .submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0;
    top: 0.34rem;
    width: 1.9rem;
    height: 1.9rem;
    border: 1px solid #d8d8d8;
    border-radius: 999px;
    background: #fff;
    color: var(--fg);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
  }

  .site-header nav .submenu {
    position: static;
    display: none;
    border: none;
    box-shadow: none;
    padding: 0 0 0.45rem 0.85rem;
    min-width: 0;
    background: transparent;
  }

  .site-header nav .has-children:hover .submenu {
    display: none;
  }

  .site-header nav .has-children.is-open .submenu {
    display: flex;
  }

  .site-header nav .submenu a {
    padding: 0.45rem 0.1rem;
    font-size: 0.95rem;
    color: #3f3f3f;
  }

  body.is-home {
    min-height: auto;
  }

  body.is-home main {
    flex: 1 1 auto;
    min-height: 0;
  }

  .home-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, minmax(33vh, 1fr));
  }

  .home-card {
    min-height: 33vh;
  }

  .home-card__title {
    font-size: clamp(1.2rem, 7vw, 1.8rem);
  }

  .home-card__ribbon {
    top: 2.65rem;
    left: -6.35rem;
    font-size: 0.95rem;
  }

  .home-card__corner-image {
    width: clamp(26px, 8vw, 44px);
  }

  body.has-image main {
    display: block;
    padding: 0;
  }

  .page-split {
    flex-direction: column;
    min-height: auto;
  }

  .page-split__image {
    flex: 0 0 auto;
    width: 100%;
    height: clamp(88px, 16vh, 140px);
    clip-path: none;
    max-height: none;
  }

  .page-split__content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.25rem 1rem 1.5rem;
  }

  .vorstand-grid {
    gap: 0.75rem 0 !important;
    padding: 0 0.25rem;
  }

  .vorstand-meta {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .vorstand-grid .vorstand-member {
    margin-left: -0.55rem !important;
    margin-bottom: 1.35rem;
  }

  .vorstand-grid .vorstand-member:first-child {
    margin-left: 0 !important;
  }

  .vorstand-grid .vorstand-member.is-active img,
  .vorstand-grid .vorstand-member.is-active > div:first-child {
    box-shadow: 0 0 15px rgba(26, 95, 180, 0.6);
    transform: scale(1.05);
  }

  .vorstand-contact {
    max-width: 22rem;
    font-size: 0.92rem;
  }

  .regatta-table {
    font-size: 0.88rem;
  }

  .regatta-table thead th,
  .regatta-table tbody td {
    padding: 0.5rem 0.55rem;
  }

  .regatta-table .regatta-review-row img {
    float: none;
    width: 100%;
    margin: 0.5rem 0 0.9rem;
  }
}
