/*!
 * Jeugdhuis Tveldeke - homepage styles
 * Hand-written CSS, no framework.
 */

:root {
  --navbar-height: 56px;
  --container-width: 1140px;
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 150ms ease;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.1);

  /* Colours (light) */
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #212529;
  --muted: rgba(0, 0, 0, 0.5);
  --muted-strong: rgba(0, 0, 0, 0.7);
  --muted-active: rgba(0, 0, 0, 0.9);
  --link: #007bff;
  --link-hover: #0056b3;
  --border: #e8e7e7;
  --hairline: rgba(0, 0, 0, 0.1);
  --table-row-border: #e0d9d9;
  --row-highlight-bg: #f5f5f5;
  --tab-bg: rgba(0, 0, 0, 0.1);
  --tab-border: rgba(0, 0, 0, 0.1);
  --tab-hover-bg: #bbbbbb;
  --accordion-border: rgba(0, 0, 0, 0.125);
  --accordion-summary-bg: rgba(0, 0, 0, 0.03);
  --green: #32cd32;
  --must: #c41e3a;
  --embed-bg: #fbfcfe;
  --navbar-scroll-shadow: 0 1px 20px rgba(0, 0, 0, 0.4);
  --footer-bg: #263238;
  --footer-copyright-bg: #292f33;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #121417;
  --surface: #1a1d21;
  --text: #e9ecef;
  --muted: rgba(255, 255, 255, 0.6);
  --muted-strong: rgba(255, 255, 255, 0.8);
  --muted-active: #ffffff;
  --link: #6ea8fe;
  --link-hover: #9ec5fe;
  --border: #2c3036;
  --hairline: rgba(255, 255, 255, 0.12);
  --table-row-border: #2c3036;
  --row-highlight-bg: rgba(255, 255, 255, 0.06);
  --tab-bg: rgba(255, 255, 255, 0.08);
  --tab-border: rgba(255, 255, 255, 0.12);
  --tab-hover-bg: rgba(255, 255, 255, 0.18);
  --accordion-border: rgba(255, 255, 255, 0.12);
  --accordion-summary-bg: rgba(255, 255, 255, 0.04);
  --must: #ff7b8a;
  --navbar-scroll-shadow: 0 1px 20px rgba(0, 0, 0, 0.8);
  --footer-bg: #0d0f11;
  --footer-copyright-bg: #111417;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding-top: var(--navbar-height);
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
  line-height: 1.5;
  accent-color: var(--link);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 0.15em;
  transition: color var(--transition);
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

::selection {
  background-color: var(--link);
  color: var(--bg);
}

[id] {
  scroll-margin-top: calc(var(--navbar-height) + 1rem);
}

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 15px;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}

.navbar.is-scrolled {
  box-shadow: var(--navbar-scroll-shadow);
}

.navbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-height: var(--navbar-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1rem;
  padding-block: 0.3125rem;
  color: var(--text);
  font-size: 1rem;
  line-height: inherit;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand img {
  height: 40px;
  width: auto;
}

:root[data-theme="dark"] .brand img {
  filter: brightness(0) invert(1);
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  order: 1;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background-color: var(--tab-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.theme-switch__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 36px;
  padding: 0 0.5rem;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition),
    box-shadow var(--transition);
}

.theme-switch__option:hover {
  color: var(--muted-active);
}

.theme-switch__option[aria-pressed="true"] {
  background-color: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.theme-switch__option svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-switch__label {
  display: none;
}

@media (min-width: 992px) {
  .theme-switch__label {
    display: inline;
  }
}

@media (max-width: 399px) {
  .brand {
    margin-right: 0.5rem;
  }

  .navbar__actions {
    gap: 0.375rem;
  }

  .theme-switch__option {
    padding: 0 0.375rem;
  }
}

@media (max-width: 359px) {
  .brand span {
    display: none;
  }
}

.navbar__toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 40px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  cursor: pointer;
}

.navbar__toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--muted);
}

.navbar__collapse {
  display: none;
  order: 2;
  flex-basis: 100%;
  flex-grow: 1;
}

.navbar__collapse.is-open {
  display: block;
}

.navbar__nav {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.navbar__link {
  display: block;
  padding: 0.5rem 0.6rem;
  color: var(--muted);
}

.navbar__link:hover {
  color: var(--muted-strong);
  text-decoration: none;
}

.navbar__link.is-active {
  color: var(--muted-active);
}

@media (min-width: 992px) {
  .navbar__toggle {
    display: none;
  }

  .navbar__collapse {
    display: flex;
    order: 1;
    flex-basis: auto;
    align-items: center;
  }

  .navbar__actions {
    order: 2;
  }

  .navbar__nav {
    flex-direction: row;
    margin-left: auto;
  }
}

/* --------------------------------------------------------------------------
   Header image
   -------------------------------------------------------------------------- */

.hero {
  height: 300px;
  margin-bottom: 15px;
  background-image: url("../images/party.jpg");
  background-position: center;
  background-size: cover;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* --------------------------------------------------------------------------
   Page content
   -------------------------------------------------------------------------- */

.page {
  flex: 1 0 auto;
  margin-bottom: 30px;
}

.notice {
  margin-bottom: 1rem;
  padding: 10px 10px 0 12px;
  background-color: var(--surface);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.notice p {
  margin-bottom: 10px;
}

.columns {
  display: flex;
  flex-wrap: wrap;
  margin-inline: -15px;
}

.column {
  width: 100%;
  padding-inline: 15px;
}

.column--flush {
  padding-inline: 0;
}

@media (min-width: 992px) {
  .column--main {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
  }

  .column--side {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }

  .column--half {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (min-width: 768px) {
  .column--md-7 {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
  }

  .column--md-5 {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
  }

  .column--md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
  }

  .column--md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.9rem, 1.5rem + 1.4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1:not(:first-child) {
  margin-top: 1.75rem;
}

p {
  margin: 0 0 1rem;
}

hr {
  height: 1px;
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid var(--hairline);
  background-color: var(--bg);
}

.must {
  color: var(--must);
  font-weight: 700;
}

.price-list,
.group-photo {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.group-photo {
  width: 100%;
}

/* Opening hours */

.opening-hours {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.opening-hours tr {
  border-bottom: 1px solid var(--table-row-border);
}

.opening-hours th {
  padding-right: 10px;
  text-align: left;
}

.opening-hours td {
  padding-block: 0.25rem;
}

.opening-hours .row-highlight {
  background-color: var(--row-highlight-bg);
}

@media (max-width: 598px) {
  .members-table {
    font-size: 19px;
  }
}

/* Map */

.map {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius);
}

.map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --------------------------------------------------------------------------
   Carousel
   -------------------------------------------------------------------------- */

.carousel {
  position: relative;
  margin-top: 10px;
}

.carousel__viewport {
  position: relative;
}

.carousel__slide {
  display: none;
  margin: 0;
}

.carousel__slide.is-active {
  display: block;
}

.carousel__slide img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.carousel__control {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.35);
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
}

.carousel__control:hover {
  background: rgba(0, 0, 0, 0.55);
}

.carousel__control svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.carousel__control--prev {
  left: 10px;
}

.carousel__control--next {
  right: 10px;
}

.carousel__indicators {
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.carousel__indicator {
  width: 12px;
  height: 12px;
  padding: 0;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  cursor: pointer;
}

.carousel__indicator.is-active {
  background: #fff;
}

/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */

.tabs__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
}

.tabs__tab {
  padding: 0.5rem 1rem;
  margin: 0 2px -1px 0;
  background: var(--tab-bg);
  border: 1px solid var(--tab-border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
}

.tabs__tab:hover {
  background: var(--tab-hover-bg);
}

.tabs__tab.is-active {
  background: #4caf50;
  border-color: #4caf50;
  color: #fff;
}

.tabs__panel[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   Accordion
   -------------------------------------------------------------------------- */

.accordion {
  border: 1px solid var(--accordion-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.accordion details {
  border-bottom: 1px solid var(--accordion-border);
}

.accordion details:last-child {
  border-bottom: 0;
}

.accordion summary {
  position: relative;
  padding: 0.75rem 2.5rem 0.75rem 1.25rem;
  background: var(--accordion-summary-bg);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  transition: background-color var(--transition);
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 1.25rem;
  transform: translateY(-50%);
}

.accordion details[open] summary::after {
  content: "\2212";
}

.accordion__body {
  padding: 0.75rem 1.25rem;
}

.accordion__body ul {
  margin: 0;
  padding-left: 1.25rem;
}

/* --------------------------------------------------------------------------
   Embedded n8n form
   -------------------------------------------------------------------------- */

/*
 * The n8n form is a cross-origin page, so its height cannot be measured from
 * here. 1600px fits the first (tallest) step without an inner scrollbar at
 * every width down to 320px. Bump this if fields are added to the form.
 *
 * The iframe inherits `color-scheme` from :root, so the form's own
 * `@media (prefers-color-scheme: dark)` rules follow the site theme.
 */
.form-embed {
  display: block;
  width: 100%;
  height: 1600px;
  border: 0;
  border-radius: var(--radius);
  background-color: var(--embed-bg);
}

/* --------------------------------------------------------------------------
   Agenda
   -------------------------------------------------------------------------- */

.agenda iframe {
  width: 100%;
  height: 600px;
  border: 0;
  border-radius: var(--radius);
  /* Google Calendar's embed has no dark mode, so keep it light and invert it
     below. Forcing the scheme also keeps the inversion predictable. */
  color-scheme: light;
}

:root[data-theme="dark"] .agenda iframe {
  filter: invert(1) hue-rotate(180deg);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  width: 100%;
  background-color: var(--footer-bg);
}

.footer-copyright {
  padding: 1rem 15px;
  background-color: var(--footer-copyright-bg);
  color: #fff;
  text-align: center;
}

.icon {
  display: inline-block;
  margin-inline: 20px;
  color: #fff;
  vertical-align: middle;
}

.icon:hover {
  color: #fff;
}

.icon svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: currentColor;
}
