/* =====================================================================
   Buttons
   ===================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  margin: 0.4rem var(--space-xs);
  padding: var(--space-sm) var(--space-xl);
  border: var(--border-button) solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-button);
  text-align: center;
  cursor: pointer;
  transition: all var(--duration-base) var(--easing);
}

.btn--sm {
  padding: 0.4rem 1.5rem;
  line-height: 1;
}

.btn--lg {
  font-size: var(--font-size-subtitle);
}

.btn--primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  box-shadow: var(--shadow-button);
  color: var(--color-text-inverse);
}

.btn--ghost {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  background-color: var(--color-surface-muted);
  color: var(--color-text);
}

.btn--uppercase {
  text-transform: uppercase;
}

.btn-row {
  margin-inline: -0.25rem;
  text-align: center;
}

/* =====================================================================
   Site header / navigation
   ===================================================================== */

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: var(--z-navbar);
  background-color: var(--color-surface);
}

.nav {
  display: flex;
  align-items: center;
  min-height: 77px;
  padding-block: var(--space-2xs);
  transition: min-height var(--duration-fast) var(--easing);
}

.nav__panel {
  min-width: 0;
}

.nav__brand {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  margin-right: auto;
  margin-left: var(--space-sm);
  color: var(--color-text-strong);
}

.nav__brand:hover,
.nav__brand:focus-visible {
  color: var(--color-text-strong);
}

.nav__logo {
  width: auto;
  height: 3.8rem;
  margin-right: var(--space-xs);
  transition: height var(--duration-base) var(--easing);
}

.nav__title {
  padding-right: var(--space-md);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
}

/* 44x44 pointer target (WCAG 2.5.8); the offsets keep the 31x18 bar stack
   at the exact position the design places it. */
.nav__toggle {
  position: absolute;
  top: calc(1.5rem - 13px);
  right: calc(var(--space-sm) - 6.5px);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav__bars {
  position: relative;
  display: block;
  width: 31px;
  height: 18px;
}

.nav__bars span {
  position: absolute;
  right: 0;
  width: 30px;
  height: 2px;
  background-color: var(--color-text);
  transition: all var(--duration-fast) var(--easing);
}

.nav__bars span:nth-child(1) {
  top: 0;
}

.nav__bars span:nth-child(2),
.nav__bars span:nth-child(3) {
  top: 8px;
  transition-duration: 0.15s;
}

.nav__bars span:nth-child(4) {
  top: 16px;
}

.nav__toggle[aria-expanded="true"] .nav__bars span:nth-child(1),
.nav__toggle[aria-expanded="true"] .nav__bars span:nth-child(4) {
  top: 8px;
  right: 50%;
  width: 0;
  opacity: 0;
}

.nav__toggle[aria-expanded="true"] .nav__bars span:nth-child(2) {
  transform: rotate(45deg);
}

.nav__toggle[aria-expanded="true"] .nav__bars span:nth-child(3) {
  transform: rotate(-45deg);
}

.nav__list {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__link {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.65rem;
  padding: 0.7rem 0;
  color: var(--color-text-strong);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  transition: color var(--duration-fast) var(--easing);
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--color-nav-hover);
}

.nav__cta {
  flex-shrink: 0;
}

/* Theme toggle (shared pattern with the SoCraTes Conference site). */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  margin: 0.4rem 0.8rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-circle);
  background: none;
  color: var(--color-text-strong);
  cursor: pointer;
  transition: color var(--duration-fast) var(--easing);
}

.theme-toggle:hover,
.theme-toggle:focus {
  color: var(--color-nav-hover);
}

.theme-toggle__icon {
  width: 1.4rem;
  height: 1.4rem;
  fill: currentcolor;
}

/* Moon shown in light mode (switches to dark), sun in dark mode. */
.theme-toggle__icon--sun {
  display: none;
}

[data-theme="dark"] .theme-toggle__icon--sun {
  display: block;
}

[data-theme="dark"] .theme-toggle__icon--moon {
  display: none;
}

/* Scrim behind the open mobile menu. */
.nav-scrim {
  position: fixed;
  inset: var(--navbar-height) 0 0;
  z-index: var(--z-menu-backdrop);
  background-color: var(--color-scrim-soft);
  border: 0;
  cursor: pointer;
}

/* Lock background scrolling while the mobile menu is open. */
.has-open-menu {
  overflow: hidden;
}

/* --- Desktop navigation (>= 992px) --- */
@media (min-width: 992px) {
  .nav__brand {
    margin-left: var(--space-2xl);
  }

  .nav__logo {
    height: 4rem;
  }

  .nav__panel-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--space-2xl);
  }

  .nav__toggle,
  .nav-scrim {
    display: none;
  }

  /* Compact state once the page is scrolled. */
  .site-header.is-compact .nav {
    min-height: 60px;
  }

  .site-header.is-compact .nav__logo {
    height: 3rem;
  }
}

/* Tighten the horizontal rhythm on narrower desktops so the bar stays one row. */
@media (min-width: 992px) and (max-width: 1399.98px) {
  .nav__brand {
    margin-left: var(--space-sm);
  }

  .nav__panel-inner {
    padding-right: var(--space-sm);
  }

  .nav__link {
    margin: 0 0.45rem;
  }

  .nav__title {
    padding-right: var(--space-sm);
  }
}

/* Below 1200px the brand wraps to two lines, which keeps the bar a single row. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .nav__title {
    max-width: 14rem;
  }

  .nav__link {
    margin: 0 0.35rem;
  }
}

/* --- Mobile navigation (< 992px) --- */
@media (max-width: 991.98px) {
  .nav {
    flex-direction: column;
    align-items: stretch;
  }

  .nav__brand {
    margin-right: 0;
    /* Clears the hamburger + theme toggle (two 44px buttons) so a long
       title wraps instead of running underneath them. */
    padding-right: 6.5rem;
  }

  /* The toggle lives in the bar itself, next to the hamburger — it must
     stay reachable while the menu is closed. */
  .nav > .theme-toggle {
    position: absolute;
    top: calc(1.5rem - 13px);
    right: calc(var(--space-sm) - 6.5px + 44px);
    width: 44px;
    height: 44px;
    margin: 0;
  }

  .nav__panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--duration-fast) ease-out;
  }

  .nav__panel-inner {
    overflow: hidden;
    text-align: center;
  }

  .nav__panel.is-open {
    grid-template-rows: 1fr;
  }

  .nav__list {
    display: block;
    padding-top: var(--space-2xs);
  }

  .nav__link {
    display: block;
  }

  .nav__cta {
    margin-bottom: var(--space-sm);
  }
}

/* Without JavaScript the menu cannot be toggled, so show it permanently. */
@media (scripting: none) and (max-width: 991.98px) {
  .nav__panel {
    grid-template-rows: 1fr;
  }

  .nav__toggle {
    display: none;
  }
}

/* =====================================================================
   Hero (family variant)
   ===================================================================== */

/* Consent-free YouTube background video over a static poster image. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: var(--space-2xl);
  overflow: hidden;
  background-color: var(--color-hero-fallback);
  color: var(--color-text-inverse);
  text-align: center;
}

.hero__backdrop,
.hero__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__backdrop {
  z-index: 0;
  overflow: hidden;
  background-image: url("../images/hero-brigels-landscape.webp");
  background-position: center;
  background-size: cover;
}

/* 16:9 video sized to cover the hero box, whatever its aspect ratio.
   Transparent until the player reports "playing" (media-embeds.js), so
   YouTube's spinner/play-button chrome never shows over the poster. */
.hero__video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  min-width: 177.78vh;
  height: 56.25vw;
  min-height: 100%;
  border: 0;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.hero__video.is-playing {
  opacity: 1;
}

.hero__overlay {
  background-color: var(--color-hero-overlay);
}

.hero__content {
  position: relative;
  z-index: 1;
  margin-inline: auto;
}

.hero__title {
  margin-bottom: 0.5rem;
  padding-block: var(--space-md) var(--space-sm);
  font-size: var(--font-size-hero);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-title);
}

.hero__lead {
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  font-size: var(--font-size-subtitle);
  font-weight: var(--font-weight-light);
  line-height: var(--line-height-text);
}

.hero__scroll-hint {
  position: absolute;
  bottom: 45px;
  left: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background-color: var(--color-scrim);
  border-radius: var(--radius-circle);
  color: var(--color-text-inverse);
  transform: translateX(-50%);
  animation: hero-bob 1.7s var(--easing) infinite;
}

.hero__scroll-hint:hover,
.hero__scroll-hint:focus-visible {
  color: var(--color-text-inverse);
}

.hero__scroll-hint svg {
  width: 2rem;
  height: 2rem;
}

@keyframes hero-bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-5px);
  }
}

@media (min-width: 768px) {
  .hero__content {
    max-width: 83.3333%;
  }
}

@media (max-width: 767.98px) {
  .hero__scroll-hint {
    display: none;
  }

  .hero__title,
  .hero__lead {
    line-height: 1.4;
  }
}

/* =====================================================================
   Family-specific section variants and vertical rhythm helpers
   ===================================================================== */

.section--intro,
.section--location {
  padding-block: var(--section-padding-md) var(--section-padding-sm);
}

.section--conduct {
  padding-block: var(--section-padding-lg) var(--section-padding-md);
}

.section__body {
  margin-top: var(--space-md);
}

.section__body--tight {
  margin-top: var(--space-sm);
}

.section__body--spaced {
  margin-top: var(--space-xl);
}

/* =====================================================================
   Unconference explainer: do/don't contrast cards
   ===================================================================== */

.contrast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--space-md);
  margin: var(--space-md) 0 0;
  padding: 0;
  list-style: none;
}

.contrast__card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-text-muted);
  box-shadow: var(--shadow-card);
  padding: var(--space-md);
}

.contrast__card--yes {
  border-top-color: var(--color-primary);
}

.contrast__title {
  margin: 0 0 var(--space-2xs);
  font-size: var(--font-size-subtitle);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-subtitle);
}

.contrast__text {
  margin: 0;
  color: var(--color-text-muted);
  line-height: var(--line-height-text);
}

/* =====================================================================
   Unconference explainer: numbered principle cards
   ===================================================================== */

.principles {
  margin: var(--space-md) 0 0;
  padding: 0;
  counter-reset: principle;
  list-style: none;
  display: grid;
  gap: var(--space-sm);
}

.principles li {
  counter-increment: principle;
  position: relative;
  padding: var(--space-sm) var(--space-sm) var(--space-sm) 72px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
}

.principles li::before {
  content: counter(principle);
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  width: 40px;
  height: 40px;
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  line-height: 40px;
  text-align: center;
}

.principles h3 {
  margin: 0 0 var(--space-2xs);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-subtitle);
}

.principles p {
  margin: 0;
  color: var(--color-text-muted);
  line-height: var(--line-height-text);
}

/* =====================================================================
   Conference day schedule diagram
   ===================================================================== */

.schedule__image {
  display: block;
  width: 100%;
  height: auto;
  margin-inline: auto;
}

/* Dark mode: invert the flat-colour diagram (white ground -> ~#141414,
   matching the dark surface); hue-rotate restores the brand blues. */
[data-theme="dark"] .schedule__image {
  filter: invert(0.92) hue-rotate(180deg);
}

/* =====================================================================
   Facilities
   ===================================================================== */

.facility-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--space-md);
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}

/* Card treatment matching the explainer's contrast cards. */
.facility {
  padding: var(--space-md);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-primary);
  text-align: center;
}

.facility__icon {
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-sm);
  fill: var(--color-primary);
}

.facility__title {
  margin: 0 0 0.75rem;
  padding-block: var(--space-sm);
  font-size: var(--font-size-subtitle);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-subtitle);
}

.facility__text {
  color: var(--color-text-muted);
  line-height: var(--line-height-text);
}

/* =====================================================================
   Map
   ===================================================================== */

.map {
  position: relative;
  height: 25rem;
  background-color: var(--color-surface-muted);
}

.map__frame,
.map__placeholder {
  width: 100%;
  height: 100%;
  border: 0;
}

.map__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  text-align: center;
  gap: var(--space-2xs);
}

.map__placeholder p {
  max-width: 40rem;
  color: var(--color-text-muted);
}

/* =====================================================================
   Site footer
   ===================================================================== */

.site-footer {
  padding-block: var(--section-padding-md);
  background-color: var(--color-surface);
  color: var(--color-text);
}

.footer__columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.footer__heading {
  padding-bottom: var(--space-sm);
  color: var(--color-text);
  font-size: var(--font-size-footer-heading);
  font-weight: var(--font-weight-medium);
  line-height: 1;
}

.footer__text {
  font-style: normal;
  line-height: var(--line-height-text);
}

.footer__text a {
  color: var(--color-primary);
}

.footer__logo {
  width: auto;
  height: 6rem;
}

.footer__rule {
  border-top-color: var(--color-surface);
  opacity: 0.05;
}

.footer__legal {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: var(--space-sm);
}

.footer__social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__social li {
  margin: 0 0.4rem;
}

.footer__social a {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--color-text);
  opacity: 0.5;
  transition: opacity var(--duration-fast) linear;
}

.footer__social a:hover,
.footer__social a:focus-visible {
  color: var(--color-text);
  opacity: 1;
}

.footer__social svg {
  width: 1.3rem;
  height: 1.3rem;
}

@media (max-width: 767.98px) {
  .footer__columns,
  .footer__legal {
    text-align: center;
  }
}

@media (min-width: 768px) {
  .footer__columns {
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
  }

  .footer__columns > * {
    padding-inline: var(--container-gutter);
  }

  .footer__legal {
    grid-template-columns: 1fr 1fr;
  }

  .footer__social {
    justify-content: flex-end;
  }
}

/* =====================================================================
   Cookie consent
   ===================================================================== */

.consent {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: var(--z-consent);
  padding: var(--space-sm) var(--container-gutter);
  background-color: var(--color-surface);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
  color: var(--color-text);
  font-size: var(--font-size-fineprint);
  text-align: center;
}

.consent[hidden] {
  display: none;
}

.consent__text {
  margin-bottom: var(--space-2xs);
}

.consent__text a {
  color: var(--color-text);
  text-decoration: underline;
}

.consent__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2xs);
}

.consent .btn {
  margin: 0;
  font-size: var(--font-size-fineprint);
}

/* =====================================================================
   Accent blockquote (Law of Mobility)
   ===================================================================== */

/* Upright, because the italic Rubik file renders every weight the same,
   which makes <strong> invisible. */
.blockquote--accent {
  color: var(--color-text);
  font-size: var(--font-size-subtitle);
  font-style: normal;
}

/* =====================================================================
   Inline links in running text
   ===================================================================== */

.prose a,
.section__subtitle a,
.map__placeholder a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.prose a:hover,
.section__subtitle a:hover,
.map__placeholder a:hover {
  text-decoration-thickness: 2px;
}

