/* ==========================================================================
   GSW Transport — layout.css
   Page shell: containers, section rhythm, grid, header, footer.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Containers + sections
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
.container--wide { max-width: var(--container-wide); }
.container--text { max-width: var(--container-text); }

.section { padding-block: var(--sp-9); }
.section--tight { padding-block: var(--sp-7); }
.section--alt { background: var(--c-surface-alt); }
.section--dark { background: var(--c-dark); color: rgba(255, 255, 255, 0.72); }
.section--dark h1, .section--dark h2, .section--dark h3 { color: #fff; }
.section--dark .lead { color: rgba(255, 255, 255, 0.72); }

@media (max-width: 640px) {
  .section { padding-block: var(--sp-8); }
}

/* Section headers are centred and narrow — the main source of calm. */
.section-head {
  max-width: 640px;
  margin: 0 auto var(--sp-7);
  text-align: center;
}
.section-head p { margin-bottom: 0; }
.section-head--left { margin-inline: 0; text-align: left; }

/* --------------------------------------------------------------------------
   2. Grid
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-8); align-items: center; }
.grid--aside { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--sp-8); align-items: start; }

@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--split, .grid--aside { grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }
}
@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   3. Header — translucent, quiet, 56px tall
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), background var(--t);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
  }
}
.site-header.is-stuck { border-bottom-color: var(--c-line); }

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; flex: none; min-height: 44px; }
.brand:hover { color: inherit; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__name {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--c-ink);
}
.brand__name span { color: var(--c-accent-text); }

.nav { display: flex; align-items: center; gap: var(--sp-5); }
.nav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__list li { margin: 0; }
.nav__link {
  position: relative;
  display: inline-block;
  padding: var(--sp-2) 0;
  font-size: var(--fs-sm);
  color: var(--c-body);
  white-space: nowrap;
}
.nav__link:hover { color: var(--c-ink); }
.nav__link[aria-current="page"] { color: var(--c-ink); font-weight: 500; }
.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--c-accent);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 0.4rem 0.5rem;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--c-ink);
  cursor: pointer;
}
.nav-toggle__bars { position: relative; width: 17px; height: 1.5px; background: currentColor; }
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 17px;
  height: 1.5px;
  background: currentColor;
}
.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after  { top: 5px; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    left: calc(-1 * var(--sp-5));
    right: calc(-1 * var(--sp-5));
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-4);
    padding: var(--sp-5);
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line);
    box-shadow: var(--sh-2);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .nav.is-open { display: flex; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__link {
    display: block;
    padding: var(--sp-3) 0;
    font-size: var(--fs-lg);
    border-bottom: 1px solid var(--c-line-soft);
  }
  .nav__link[aria-current="page"]::after { display: none; }
  .nav__cta .btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   4. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--c-surface-alt);
  color: var(--c-muted);
  font-size: var(--fs-xs);
  padding-top: var(--sp-7);
}
.site-footer a { color: var(--c-muted); }
.site-footer a:hover { color: var(--c-ink); }

.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-6);
  padding-bottom: var(--sp-6);
}
@media (max-width: 860px) { .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--sp-5); } }

.footer__title {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-ink);
  margin-bottom: var(--sp-3);
}
.footer__list { list-style: none; padding: 0; margin: 0; }
.footer__list li { margin-bottom: var(--sp-2); }
.footer__list a { display: inline-block; padding-block: 0.3rem; }

.footer__bottom {
  border-top: 1px solid var(--c-line);
  padding-block: var(--sp-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  align-items: center;
  justify-content: space-between;
}
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer__legal li { margin: 0; }

/* Back to top */
.to-top {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(29, 29, 31, 0.8);
  color: #fff;
  box-shadow: var(--sh-2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--t), transform var(--t), visibility var(--t), background var(--t);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .to-top { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--c-ink); }
.to-top svg { width: 18px; height: 18px; }
