/* One scroll = one screen */
html {
  scroll-snap-type: y mandatory;
  scroll-padding-top: var(--header-h);
  scroll-behavior: smooth;
}

.snap-section {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem clamp(1.5rem, 8vw, 6rem);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: var(--bg, #f6f7f9);
  color: #13233f;
}

.site-footer {
  scroll-snap-align: end;
}

/* Difficulty colors */
.beginners   { --bg: #dff3e4; --accent: #2e7d4f; }
.intermediate { --bg: #fff0c9; --accent: #8a5a00; }
.advanced   { --bg: #fbdad6; --accent: #b23a30; }

/* Summary screen */
.summary h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  margin: 0 0 0.5rem;
}

.summary-intro {
  max-width: 40rem;
  margin: 0 0 2rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.summary-level {
  background: var(--bg);
  border-left: 8px solid var(--accent);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}

.summary-level h2 {
  margin: 0 0 0.75rem;
  color: var(--accent);
}

.summary-level ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.summary-level li {
  margin-bottom: 0.5rem;
}

.summary-level a {
  color: #13233f;
  font-size: 1.2rem;
  font-weight: 600;
}

.scroll-hint {
  margin-top: 2rem;
  color: #55627a;
}

/* Full-screen committee sections: photo background + text box */
.committee-screen {
  justify-content: center;
  align-items: flex-start;
  background-color: #4a86d8;      /* shows if a photo can't be found */
  background-size: cover;
  background-position: center;
}

.name-box {
  max-width: 36rem;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  background: rgba(255, 255, 255, 0.92);
  color: #13233f;
  border-left: 10px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.badge {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  background: var(--accent);
  color: #ffffff;
  border-radius: 999px;
  font-weight: 600;
}

.committee-name {
  margin: 0.75rem 0;
  font-size: clamp(2rem, 6vw, 3.75rem);
  line-height: 1.05;
}

.committee-desc {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.55;
}

/* Final screen with buttons */
.finale h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: start;
}

.committee-card {
  background: #ffffff;
  border: 1px solid #d9dee7;
  border-left: 8px solid var(--accent);
  border-radius: 6px;
}

.committee-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.75rem 1.25rem;
  background: none;
  border: 0;
  font: inherit;
  color: #13233f;
  text-align: left;
  cursor: pointer;
}

.committee-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.btn-name {
  font-size: 1.3rem;
  font-weight: 700;
}

.btn-level {
  color: var(--accent);
  font-weight: 600;
}

.committee-card.open {
  grid-column: 1 / -1;
  order: -1;             
  background: var(--bg);
}

.committee-card.open .btn-name {
  font-size: 2.2rem;
}

.card-panel {
  padding: 0 1.25rem 1.5rem;
}

.card-panel h3 {
  margin: 1.25rem 0 0.4rem;
}

.card-panel ul {
  margin: 0;
  padding-left: 1.2rem;
}

.dl {
  display: inline-block;
  margin: 1.25rem 0.6rem 0 0;
  padding: 0.65rem 1.2rem;
  background: #13233f;
  color: #ffffff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}

.dl:hover {
  background: #2c5fa8;
}

/* Phones */
@media (max-width: 800px) {
  .summary-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Country matrix popup */
.matrix-dialog {
  width: min(52rem, 92vw);
  max-height: 85vh;
  padding: 2rem;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  color: #13233f;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.matrix-dialog::backdrop {
  background: rgba(19, 35, 63, 0.65);
}

.matrix-dialog h2 {
  margin: 0 3rem 1.5rem 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.matrix-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  background: #eef4fb;
  border: 0;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
  color: #13233f;
  cursor: pointer;
}

.matrix-close:hover {
  background: #13233f;
  color: #ffffff;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.75rem;
}

.country-box {
  padding: 1rem 0.5rem;
  background: #eef4fb;
  border: 1px solid #d9dee7;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
}

/* Stop the page scrolling behind the popup */
html:has(dialog[open]) {
  overflow: hidden;
}

/* The popup button should look like the other download buttons */
button.dl {
  font: inherit;
  font-weight: 600;
  border: 0;
  cursor: pointer;
}