/* ============================================================
   All Things New — reusable components
   ============================================================ */

/* ---------- Language switcher ---------- */
.lang-switcher {
  position: relative;
}

.lang-switcher__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.lang-switcher__toggle .icon {
  width: 15px;
  height: 15px;
}

.lang-switcher__toggle:hover,
.lang-switcher.is-open .lang-switcher__toggle {
  border-color: var(--accent-gold);
  color: var(--text-primary);
}

.lang-switcher__menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 10px);
  z-index: 120;
  min-width: 168px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.lang-switcher.is-open .lang-switcher__menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-switcher__form {
  margin: 0;
}

.lang-switcher__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  text-align: start;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.lang-switcher__option:hover {
  background: var(--wash-gold);
  color: var(--text-primary);
}

.lang-switcher__option.is-active {
  color: var(--accent-terracotta);
  font-weight: 600;
}

.lang-switcher__option .icon {
  width: 14px;
  height: 14px;
  color: var(--accent-terracotta);
}

@media (max-width: 860px) {
  .lang-switcher__toggle span {
    display: none;
  }
}

/* ---------- Top banner ---------- */
/* Collapses smoothly via the grid-template-rows "fr" trick (animating to
   0fr is jank-free, unlike animating max-height) plus an opacity fade —
   both are cheap, compositor-only properties. */
.top-banner-wrap {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.72s var(--ease);
}

.top-banner-wrap__inner {
  overflow: hidden;
}

.top-banner-wrap.is-collapsed {
  grid-template-rows: 0fr;
}

.top-banner {
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-terracotta));
  color: #fff;
  opacity: 1;
  transition: opacity 0.8s var(--ease);
}

.top-banner-wrap.is-collapsed .top-banner {
  opacity: 0;
}

.top-banner__row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 11px 48px;
  text-align: center;
  font-size: 0.86rem;
}

.top-banner__row .icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.top-banner__row p {
  margin: 0;
  font-weight: 500;
}

.top-banner__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  flex-shrink: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.34s var(--ease);
}

.top-banner__link:hover {
  opacity: 0.82;
}

.top-banner__link .icon {
  width: 13px;
  height: 13px;
}

.top-banner__dismiss {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.34s var(--ease);
}

.top-banner__dismiss:hover {
  background: rgba(255, 255, 255, 0.32);
}

.top-banner__dismiss .icon {
  width: 11px;
  height: 11px;
}

@media (prefers-reduced-motion: reduce) {
  .top-banner-wrap,
  .top-banner {
    transition: none;
  }
}

/* ---------- Navigation ---------- */
/* Sticky full-bleed bar flush to the viewport top (or under the top
   announcement banner while that is still open). Negative margin cancels
   the wrapper's layout height so page banners/heroes sit flush at the top
   and run underneath the glass — the bar overlays content and stays sticky
   while banners scroll away. */
.site-nav-float {
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: calc(-1 * var(--nav-h, 72px));
}

.site-nav {
  position: relative;
  padding: 14px 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--nav-glass-bg);
  /* No top border — glass edge only on sides + bottom */
  border: none;
  border-left: 1px solid var(--nav-glass-border);
  border-right: 1px solid var(--nav-glass-border);
  border-bottom: 1px solid var(--nav-glass-border);
  box-shadow: var(--nav-glass-shadow);
  /* backdrop-filter is deliberately NOT transitioned — animating a blur
     filter is expensive on scroll frames. Blur stays on; only cheap
     properties (background, border, shadow) ease with .is-scrolled. */
  backdrop-filter: blur(18px) saturate(155%);
  -webkit-backdrop-filter: blur(18px) saturate(155%);
  transition:
    background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.site-nav.is-scrolled {
  background: var(--nav-glass-bg-scrolled);
  border-left-color: var(--nav-glass-border-scrolled);
  border-right-color: var(--nav-glass-border-scrolled);
  border-bottom-color: var(--nav-glass-border-scrolled);
  box-shadow: var(--nav-glass-shadow-scrolled);
}

.site-nav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.brand .icon {
  width: 22px;
  height: 22px;
  color: var(--accent-gold);
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.34s var(--ease);
}

.site-nav__links a:hover {
  color: var(--text-primary);
}

.site-nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-nav__auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-nav__auth form {
  margin: 0;
}

/* Desktop: equal side columns keep the link group at the true center. */
@media (min-width: 861px) {
  .site-nav__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 24px;
  }

  .brand {
    justify-self: start;
  }

  .site-nav__panel {
    justify-self: center;
  }

  .site-nav__auth--panel {
    display: none;
  }

  .site-nav__actions {
    justify-self: end;
  }
}

.nav-toggle {
  display: none;
  border: none;
  background: none;
  padding: 6px;
  color: var(--text-primary);
  cursor: pointer;
}

.nav-toggle .icon {
  width: 24px;
  height: 24px;
}

@media (max-width: 860px) {
  .site-nav__panel {
    display: none;
  }

  .site-nav__auth--bar {
    display: none;
  }

  .nav-toggle { display: inline-flex; }

  .site-nav__panel.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 8px);
    z-index: 110;
    padding: 20px;
    background: var(--nav-glass-bg-scrolled);
    border: 1px solid var(--nav-glass-border-scrolled);
    border-radius: var(--radius-md);
    box-shadow: var(--nav-glass-shadow-scrolled);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
  }

  .site-nav__panel.is-open .site-nav__links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
  }

  .site-nav__panel.is-open .site-nav__auth {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding-top: 4px;
    border-top: 1px solid var(--hairline);
  }

  .site-nav__panel.is-open .site-nav__auth .btn {
    width: 100%;
  }

  .site-nav__panel.is-open .site-nav__auth form {
    width: 100%;
  }
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.34s var(--ease), background 0.34s var(--ease), border-color 0.34s var(--ease);
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--text-primary);
  color: #fff;
}

/* Shadow crossfades via opacity on a pseudo-layer instead of animating
   box-shadow directly — animating box-shadow forces a repaint on every
   frame; opacity is compositor-only and stays smooth. */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transition: opacity 0.34s var(--ease);
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-primary:hover::after {
  opacity: 1;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--hairline);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 13px 18px;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- Glass surface ---------- */
.glass {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

/* Same shadow-crossfade-via-opacity technique as .btn-primary — keeps
   card-grid hovers smooth even with many cards on screen at once. */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.card:hover {
  transform: translateY(-4px);
}

.card:hover::after {
  opacity: 1;
}

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--wash-gold);
  color: var(--text-primary);
  border: 1px solid transparent;
}

.chip--outline {
  background: transparent;
  border-color: var(--hairline);
  color: var(--text-secondary);
}

.chip--active {
  background: var(--text-primary);
  color: #fff;
}

a.chip {
  transition: background 0.34s var(--ease), color 0.34s var(--ease), border-color 0.34s var(--ease);
}

a.chip:hover {
  border-color: var(--accent-gold);
}

/* ---------- Forms ---------- */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.field .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.field .errors {
  font-size: 0.82rem;
  color: #b3492f;
  margin-top: 6px;
}

.field--consent {
  margin-top: 4px;
  margin-bottom: 24px;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 0;
}

.consent-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.2em;
  accent-color: var(--accent-terracotta);
  cursor: pointer;
}

.consent-label a {
  color: var(--accent-gold);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-label a:hover {
  color: var(--accent-terracotta);
}

.input,
textarea.input,
select.input,
main input[type="text"],
main input[type="email"],
main input[type="password"],
main input[type="search"],
main input[type="tel"],
main textarea,
main select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.34s var(--ease), box-shadow 0.34s var(--ease);
}

.input:focus,
textarea.input:focus,
select.input:focus,
main input[type="text"]:focus,
main input[type="email"]:focus,
main input[type="password"]:focus,
main input[type="search"]:focus,
main input[type="tel"]:focus,
main textarea:focus,
main select:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(184, 131, 74, 0.18);
}

.auth-card {
  max-width: 440px;
  margin: 64px auto;
  padding: 40px;
}

/* ---------- Messages ---------- */
.site-messages {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.site-message {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);
  font-size: 0.88rem;
}

.site-message--success { border-left: 3px solid var(--accent-terracotta); }
.site-message--error { border-left: 3px solid #d9765a; }

/* ---------- Footer ---------- */
.site-footer {
  /* No margin-top here on purpose — every page's own closing section
     (cards, .section padding, the closing-cta photo band, etc.) already
     provides its own bottom breathing room. Adding a blanket margin here
     on top of that created a large redundant gap on pages ending in a
     section with generous padding of its own. */
  border-top: 1px solid var(--hairline);
  padding: 48px 0 32px;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-footer a:hover {
  color: var(--text-primary);
}

/* ---------- Focus visibility (a11y) ---------- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}
