/* Central layout values. Components below use these rather than page-specific colors. */
:root {
  --site-navy: #122342;
  --site-accent: #d0f05a;
  --site-paper: #ffffff;
  --site-background: #f3f5f8;
  --site-text: #172b47;
  --site-muted: #617089;
  --site-line: #d3dce7;
  --site-radius: 10px;
  --site-width: 1120px;
  --site-space: clamp(16px, 3vw, 36px);
  --control-height: 34px;
}

[hidden] {
  display: none !important;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
}
.skip-link:focus {
  top: 12px;
  padding: 12px;
  background: white;
}
.eyebrow {
  color: var(--site-muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
}
.cms-text {
  margin: 1em 0;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.cms-content h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.18;
}
.cms-content h2 {
  margin-top: 1.5em;
}
.cms-content blockquote {
  padding: 12px 20px;
  margin: 24px 0;
  border-left: 4px solid var(--site-accent);
  background: var(--site-background);
}
.cms-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 20px;
  margin: 24px 0;
}
.cms-gallery.single-image {
  display: block;
}
.cms-gallery figure {
  margin: 0;
}
.cms-gallery img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--site-radius);
}
.cms-gallery figcaption {
  margin-top: 7px;
  font-size: 0.9rem;
  color: var(--site-muted);
}
.download-link {
  display: inline-block;
  padding: 12px 16px;
  border: 1px solid var(--site-line);
  border-radius: 6px;
}

/* Public website shell. */
.public-site {
  margin: 0;
  color: var(--site-text);
  background: var(--site-background);
}
.public-header,
.public-navigation,
.public-main,
.public-footer {
  max-width: var(--site-width);
  margin: 0 auto;
}
.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px var(--site-space);
  background: var(--site-navy);
  color: white;
}
.public-header .brand {
  color: white;
  margin: 0;
  min-width: 0;
}
.public-header .brand-name {
  white-space: nowrap;
  font-weight: 700;
  font-size: clamp(0.9rem, 2.6vw, 1.3rem);
}
.public-header .button {
  background: white;
  color: var(--site-navy);
}
.public-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px var(--site-space);
  background: var(--site-navy);
  border-top: 1px solid #ffffff20;
}
.public-navigation > a,
.public-navigation summary {
  display: block;
  color: white;
  padding: 10px 12px;
  text-decoration: none;
  border-radius: 5px;
}
.public-navigation [aria-current],
.public-navigation a:hover,
.public-navigation summary:hover {
  background: #ffffff18;
}
.public-navigation details {
  position: relative;
}
.public-navigation details[open] {
  padding-bottom: 8px;
}
.public-navigation details > a {
  display: block;
  padding: 10px 16px;
  color: white;
}
.public-main {
  min-height: 55vh;
  background: var(--site-paper);
  padding: var(--site-space);
}
.public-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 24px var(--site-space);
  color: var(--site-muted);
  font-size: 0.9rem;
}
.public-footer > span {
  margin-right: auto;
}
.public-site .public-main h2 {
  font-size: 1.3rem;
}
.cms-entries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr));
  gap: 18px;
  margin: 24px 0;
}
.cms-entries article,
.public-events article {
  padding: 18px;
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
}
.cms-entries h2 {
  margin: 4px 0 16px;
}
.public-events {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}
.public-events h2 {
  margin: 8px 0;
}
.public-events time {
  font-size: 0.9rem;
  color: var(--site-muted);
}
.preview-strip {
  margin: -8px 0 24px;
  padding: 12px 16px;
  background: #fff6cd;
  border: 1px solid #dfc67d;
  border-radius: 5px;
}
.preview-notice {
  border-left: 4px solid #a45b00;
}

/* Content management components. */
.cms-preview-switch {
  margin: 18px 0;
  padding: 16px;
  background: #eef2f8;
  border-radius: var(--site-radius);
}
.cms-page-list {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.cms-page-list > article {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  background: white;
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
}
.cms-page-list h2 {
  font-size: 1.1rem;
  margin: 3px 0;
}
.cms-page-list p {
  margin: 6px 0;
}
.cms-row-actions,
.cms-row-actions form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cms-row-actions details {
  flex-basis: 100%;
}
.cms-settings {
  margin: 16px 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 14px;
}
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 12px 0;
}
.cms-editor-block {
  padding: 16px;
  margin: 16px 0;
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
  background: white;
}
.cms-editor-block legend {
  padding: 0 6px;
  color: var(--site-muted);
  font-size: 0.9rem;
}
.cms-block-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.cms-block-tools > label:first-child {
  flex: 1;
  min-width: 140px;
}
.cms-editor-block textarea,
.cms-editor-block select[multiple] {
  width: 100%;
}
.cms-save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px -4px;
  padding: 12px 4px;
  background: #f3f5f8f5;
  border-top: 1px solid var(--site-line);
  z-index: 2;
}
.cms-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 16px;
}
.cms-media-grid img {
  max-width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
}
.cms-media-grid h2 {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

/* Logo dimensions come from the validated branding stylesheet, loaded last. */
.brand-logo {
  object-fit: contain;
  flex-shrink: 0;
  color: transparent;
  font-size: 0;
}
.sidebar .brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
}
.sidebar .brand > .brand-logo,
.sidebar .brand > .brand-mark {
  grid-column: 1;
  grid-row: 1;
  max-width: 100%;
  max-height: none;
}
.sidebar .brand > .brand-heading {
  grid-column: 2;
  grid-row: 1;
}
.sidebar .brand > .club-name {
  grid-column: 1 / -1;
  white-space: nowrap;
  color: #acc3e6;
  font-size: 0.8rem;
}
.sidebar .brand {
  min-width: 0;
}
.sidebar {
  min-width: 0;
}
.site-layout > .sidebar .brand-logo {
  max-width: 100%;
  max-height: none;
}
.logo-pending {
  color: transparent;
}

/* Equal-size response controls, including native time inputs. */
.overview-response input[type="time"],
.overview-response select {
  height: var(--control-height);
  min-height: var(--control-height);
  box-sizing: border-box;
  line-height: normal;
  padding-top: 3px;
  padding-bottom: 3px;
}
.overview-response [data-row-time] {
  white-space: nowrap;
  flex-wrap: nowrap;
  align-items: center;
}
.overview-response [data-row-time] > span {
  white-space: nowrap;
}
.overview-response input[type="time"] {
  width: 112px;
  min-width: 100px;
}
.own-team {
  font-weight: 800;
  color: inherit;
  background: none;
}
.planning-hint {
  font-size: 0.8rem;
  color: #854a00;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.planning-hint .new-marker {
  display: inline-block;
  margin-right: 4px;
  font-weight: 700;
  color: var(--blue);
}
.lineup-conflict {
  border-left: 3px solid #c17300;
  padding: 8px 12px;
  background: #fff8e5;
}
.standings-scroll {
  overflow-x: auto;
}
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.standings-table th,
.standings-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--site-line);
  text-align: left;
}
.standings-table .number {
  text-align: right;
  white-space: nowrap;
}
.team-competition {
  margin: 24px 0 40px;
}
.team-competition > h2 {
  margin-bottom: 12px;
}

@media (max-width: 720px) {
  :root {
    --control-height: 44px;
  }
  .sidebar .brand {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .sidebar .brand > .club-name {
    font-size: 0.8rem;
  }
  .public-header {
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .public-header .brand {
    max-width: 100%;
    flex-wrap: wrap;
  }
  .public-header .brand-name {
    flex-basis: 100%;
  }
  .public-navigation {
    gap: 0;
  }
  .public-navigation > a,
  .public-navigation summary {
    padding: 10px;
  }
  .cms-save-bar > button {
    flex: 1 1 auto;
  }
  .cms-row-actions {
    width: 100%;
  }
  .cms-row-actions button {
    min-height: 40px;
  }
}

@media print {
  .public-navigation,
  .public-header > .button,
  .preview-strip,
  .cms-save-bar {
    display: none;
  }
  .public-main {
    padding: 0;
  }
}

/* Keep the complete club name readable at every browser zoom level. */
.sidebar .brand {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.sidebar .brand > .club-name {
  flex: 0 0 100%;
  white-space: nowrap;
}
.auth .brand {
  display: flex;
  flex-wrap: wrap;
}
.auth .club-name {
  white-space: nowrap;
  flex-basis: 100%;
}
.event-title,
.event-detail-title {
  font-weight: 400;
}
.event-detail-title .own-team {
  font-weight: 800;
}
@media (pointer: coarse) {
  .overview-response input[type="time"],
  .overview-response select {
    min-height: 44px;
    height: 44px;
  }
}

.own-team {
  background: #e8edf3;
  border-radius: 0.2em;
  padding: 0 0.16em;
  box-decoration-break: clone;
}

.lineup-mobile-label {
  display: none;
}
.lineup-table small {
  display: block;
}

@media (max-width: 720px) {
  .lineup-editor .lineup-table,
  .lineup-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .lineup-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
  }
  .lineup-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
    margin-block-end: 8px;
    border: 1px solid var(--site-line);
    border-radius: var(--site-radius);
  }
  .lineup-table td {
    display: block;
    min-width: 0;
    border: 0;
  }
  .lineup-table td:first-child,
  .lineup-table td:last-child {
    grid-column: 1 / -1;
  }
  .lineup-mobile-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 650;
  }
  .lineup-table select {
    max-width: 100%;
    min-width: 0;
  }
  .lineup-table select,
  .lineup-table [data-lineup-move] {
    min-height: 44px;
  }
  .lineup-table [data-lineup-move] {
    min-width: 44px;
  }
}
