/* =========================================================
   GPACal — site chrome (header, mega menu, mobile menu,
   search dialog, footer) + shared design tokens & primitives.
   Loaded on every public page. Everything is prefixed gc-
   so it never collides with the legacy classes in app.css.
   Home page sections live in home.css.
   ========================================================= */

:root {
  /* Colour */
  --gc-bg: #f3f2f2;
  --gc-surface: #eae9e9;
  --gc-text: #201e1d;
  --gc-divider: rgba(32, 30, 29, 0.40);
  --gc-neutral-100: #f8f4f4;
  --gc-neutral-300: #d7d3d3;
  --gc-neutral-700: #605d5d;
  --gc-neutral-800: #444141;
  --gc-accent: #0A3782;
  --gc-accent-100: #eef3fc;
  --gc-accent-400: #8fb0e6;
  --gc-accent-600: #082f70;
  --gc-accent-700: #06255a;
  --gc-accent-800: #051d47;
  --gc-accent-a10: rgba(10, 55, 130, 0.10);
  --gc-accent-a18: rgba(10, 55, 130, 0.18);
  --gc-ink-a07: rgba(32, 30, 29, 0.07);
  --gc-ink-a14: rgba(32, 30, 29, 0.14);
  --gc-backdrop: rgba(45, 43, 43, 0.5);

  /* Rules */
  --gc-rule: 2px solid var(--gc-divider);
  --gc-rule-ink: 2px solid var(--gc-text);

  /* Spacing */
  --gc-space-1: 4px;
  --gc-space-2: 8px;
  --gc-space-3: 12px;
  --gc-space-4: 16px;
  --gc-space-6: 24px;
  --gc-space-8: 32px;

  /* Elevation */
  --gc-shadow-sm: 0 1px 2px rgba(45, 43, 43, 0.14);
  --gc-shadow-md: 0 3px 10px rgba(45, 43, 43, 0.16);
  --gc-shadow-lg: 0 12px 32px rgba(45, 43, 43, 0.22);

  /* Type & layout */
  --gc-font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gc-container: 1240px;
  --gc-gutter: clamp(16px, 4vw, 40px);
  --gc-section-y: clamp(56px, 8vw, 96px);
  --gc-header-h: 68px;
  --gc-dur: 160ms;
}

/* ---------- Scope base ---------- */
.gc {
  font-family: var(--gc-font);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--gc-text);
}

.gc *,
.gc *::before,
.gc *::after {
  border-radius: 0;
}

.gc h1,
.gc h2,
.gc h3,
.gc h4 {
  font-family: var(--gc-font);
  font-weight: 800;
  color: inherit;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.gc [hidden] {
  display: none !important;
}

.gc :focus {
  outline: none;
}

.gc :focus-visible {
  outline: 2px solid var(--gc-accent);
  outline-offset: 2px;
}

.gc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gc-icon {
  display: block;
  flex: none;
}

.gc-container {
  max-width: var(--gc-container);
  margin: 0 auto;
  padding-inline: var(--gc-gutter);
}

/* ---------- Kicker & tags ---------- */
.gc-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gc-accent-700);
}

.gc-kicker--sm {
  font-size: 11px;
}

.gc-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 3px 10px;
}

.gc-tag--accent {
  background: var(--gc-accent-100);
  color: var(--gc-accent-800);
}

.gc-tag--neutral {
  background: var(--gc-neutral-100);
  color: var(--gc-neutral-800);
}

/* ---------- Buttons ----------
   Labels sit flush-left at the padding edge; a trailing icon is
   pushed right by space-between. Labels never wrap. Every state
   sets its own colour so global a:hover rules never leak in. */
.gc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 40px;
  padding: 0 16px;
  font-family: var(--gc-font);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--gc-text);
  transition: background-color var(--gc-dur), color var(--gc-dur), border-color var(--gc-dur);
}

.gc-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.gc-btn--md {
  height: 48px;
  padding: 0 20px;
  gap: 24px;
  font-size: 15px;
}

.gc-btn--lg {
  height: 52px;
  padding: 0 20px;
  gap: 24px;
  font-size: 16px;
}

.gc-btn--primary,
.gc-btn--primary:visited,
.gc-btn--primary:hover,
.gc-btn--primary:active {
  color: var(--gc-bg);
}

.gc-btn--primary {
  background: var(--gc-accent);
}

.gc-btn--primary:hover {
  background: var(--gc-accent-600);
}

.gc-btn--primary:active {
  background: var(--gc-accent-700);
}

.gc-btn--secondary,
.gc-btn--secondary:visited,
.gc-btn--secondary:hover,
.gc-btn--secondary:active {
  color: var(--gc-text);
}

.gc-btn--secondary {
  border-color: var(--gc-divider);
}

.gc-btn--secondary:hover {
  background: var(--gc-ink-a07);
}

.gc-btn--secondary:active {
  background: var(--gc-ink-a14);
}

.gc-btn--ghost,
.gc-btn--ghost:visited,
.gc-btn--ghost:hover,
.gc-btn--ghost:active {
  color: var(--gc-accent);
}

.gc-btn--ghost {
  padding-inline: var(--gc-space-1);
}

.gc-btn--ghost:hover {
  background: var(--gc-accent-a10);
}

.gc-btn--ghost:active {
  background: var(--gc-accent-a18);
}

/* On accent bands */
.gc-btn--inverted,
.gc-btn--inverted:visited,
.gc-btn--inverted:hover,
.gc-btn--inverted:active {
  color: var(--gc-text);
}

.gc-btn--inverted {
  background: var(--gc-bg);
}

.gc-btn--inverted:hover {
  background: var(--gc-accent-100);
}

.gc-btn--outline-light,
.gc-btn--outline-light:visited,
.gc-btn--outline-light:hover,
.gc-btn--outline-light:active {
  color: var(--gc-bg);
}

.gc-btn--outline-light {
  border: 2px solid var(--gc-bg);
}

.gc-btn--outline-light:hover {
  background: var(--gc-accent-600);
}

.gc-btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
}

/* ---------- Logo ---------- */
.gc-logo {
  display: flex;
  align-items: center;
  flex: none;
  text-decoration: none;
}

.gc-logo img {
  display: block;
  height: 36px;
  width: auto;
}

/* ---------- Header ---------- */
.gc-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--gc-bg);
  border-bottom: var(--gc-rule);
}

.gc-header__bar {
  height: var(--gc-header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.gc-header__bar .gc-logo {
  margin-right: auto;
}

.gc-header__desktop {
  display: none;
  align-items: center;
  gap: 20px;
}

.gc-header__mobile {
  display: flex;
  gap: 4px;
}

.gc-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gc-nav__link {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  font-family: var(--gc-font);
  font-size: 14px;
  font-weight: 600;
  color: var(--gc-text);
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--gc-dur);
}

.gc-nav__link:hover,
.gc-nav__link[aria-current="page"],
.gc-nav__link[aria-expanded="true"] {
  color: var(--gc-accent);
}

.gc-nav__link .gc-icon {
  transition: transform var(--gc-dur);
}

.gc-nav__link[aria-expanded="true"] .gc-icon {
  transform: rotate(180deg);
}

.gc-search-trigger {
  min-width: 210px;
  justify-content: flex-start;
  font-weight: 400;
}

.gc-search-trigger,
.gc-search-trigger:hover,
.gc-search-trigger:active {
  color: var(--gc-neutral-700);
}

.gc-kbd {
  margin-left: auto;
  font-family: var(--gc-font);
  font-size: 11px;
  line-height: 1.5;
  border: 1px solid var(--gc-divider);
  padding: 1px 6px;
  color: var(--gc-neutral-700);
}

/* Mobile menu toggle swaps icon on aria-expanded */
.gc-menu-toggle .gc-icon--close {
  display: none;
}

.gc-menu-toggle[aria-expanded="true"] .gc-icon--open {
  display: none;
}

.gc-menu-toggle[aria-expanded="true"] .gc-icon--close {
  display: block;
}

@media (min-width: 960px) {
  .gc-header__desktop {
    display: flex;
  }

  .gc-header__mobile,
  .gc-mobile-nav {
    display: none !important;
  }
}

@media (max-width: 959.98px) {
  .gc-mega {
    display: none !important;
  }
}

/* ---------- Mega menu ---------- */
.gc-mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--gc-bg);
  border-bottom: var(--gc-rule);
  box-shadow: var(--gc-shadow-lg);
}

.gc-mega__grid {
  padding-block: 32px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 24px;
}

.gc-mega__col {
  border-top: var(--gc-rule-ink);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gc-mega__col .gc-kicker {
  margin-bottom: 8px;
}

.gc-mega__link {
  font-size: 14px;
  color: var(--gc-text);
  text-decoration: none;
  padding: 5px 0;
  transition: color var(--gc-dur);
}

.gc-mega__link:hover {
  color: var(--gc-accent);
}

.gc-mega__foot {
  padding-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.gc-mega__foot > span {
  font-size: 13px;
  color: var(--gc-neutral-700);
}

.gc-mega__foot .gc-btn {
  margin-left: auto;
}

/* ---------- Mobile full-screen menu ---------- */
.gc-mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: calc(100vh - var(--gc-header-h));
  height: calc(100dvh - var(--gc-header-h));
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--gc-bg);
  border-top: var(--gc-rule);
}

.gc-mobile-nav__inner {
  padding: 8px var(--gc-gutter) 32px;
  display: flex;
  flex-direction: column;
}

.gc-mobile-nav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  font-size: 20px;
  font-weight: 800;
  color: var(--gc-text);
  text-decoration: none;
  border-bottom: var(--gc-rule);
}

.gc-mobile-nav__row:hover,
.gc-mobile-nav__row[aria-current="page"] {
  color: var(--gc-accent);
}

.gc-mobile-nav__cats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 16px;
  padding: 24px 0;
}

.gc-mobile-nav__cat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: var(--gc-text);
}

.gc-mobile-nav__cat span:first-child {
  font-size: 15px;
  font-weight: 600;
}

.gc-mobile-nav__cat span:last-child {
  font-size: 13px;
  color: var(--gc-neutral-700);
}

.gc-mobile-nav__cat:hover span:first-child {
  color: var(--gc-accent);
}

.gc-mobile-nav .gc-btn {
  width: 100%;
  padding: 0 18px;
}

html.gc-lock,
html.gc-lock body {
  overflow: hidden;
}

/* ---------- Search dialog ---------- */
.gc-search {
  width: min(600px, calc(100% - 32px));
  max-width: 600px;
  max-height: none;
  margin: 12vh auto auto;
  padding: 0;
  border: 0;
  background: var(--gc-bg);
  color: var(--gc-text);
  box-shadow: var(--gc-shadow-lg);
  overflow: visible;
}

.gc-search::backdrop {
  background: rgba(45, 43, 43, 0.5);
}

.gc-search__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: var(--gc-rule);
}

.gc-search__input {
  flex: 1;
  min-width: 0;
  height: 60px;
  border: 0;
  background: transparent;
  font-family: var(--gc-font);
  font-size: 17px;
  color: var(--gc-text);
  caret-color: var(--gc-accent);
}

.gc-search__input::placeholder {
  color: var(--gc-neutral-700);
}

.gc .gc-search__input:focus-visible {
  outline: none;
}

.gc-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.gc-search__results {
  max-height: 52vh;
  overflow: auto;
  padding: 8px 0;
}

.gc-search__group {
  padding: 12px 16px 4px;
}

.gc-search__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--gc-text);
}

.gc-search__item:hover,
.gc-search__item:focus-visible {
  background: var(--gc-accent-100);
  color: var(--gc-accent-800);
}

.gc .gc-search__item:focus-visible {
  outline-offset: -2px;
}

.gc-search__item span:first-child {
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
}

.gc-search__item span:last-child {
  flex: none;
  font-size: 12px;
  color: var(--gc-neutral-700);
}

.gc-search__empty {
  padding: 24px 16px;
  font-size: 14px;
  color: var(--gc-neutral-700);
}

/* ---------- Footer ---------- */
.gc-footer {
  background: var(--gc-bg);
  border-top: var(--gc-rule);
}

/* Pages that end on the accent CTA band need no rule above the footer. */
main:has(> .gc-home) + .gc-footer,
main:has(> .gc-page > .gc-cta:last-child) + .gc-footer {
  border-top: 0;
}

.gc-footer__grid {
  padding-top: clamp(48px, 6vw, 72px);
  padding-bottom: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 40px 32px;
}

.gc-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gc-footer__brand p {
  margin: 0;
  font-size: 14px;
  color: var(--gc-neutral-700);
  max-width: 30ch;
}

.gc-footer__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: var(--gc-rule-ink);
  padding-top: 14px;
}

.gc-footer__col .gc-kicker {
  margin-bottom: 4px;
}

.gc-footer__col a {
  font-size: 14px;
  color: var(--gc-text);
  text-decoration: none;
  transition: color var(--gc-dur);
}

.gc-footer__col a:hover {
  color: var(--gc-accent);
}

.gc-footer__bottom {
  padding-top: 20px;
  padding-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 13px;
  color: var(--gc-neutral-700);
  border-top: var(--gc-rule);
}

.gc-footer__legal {
  display: flex;
  gap: 20px;
}

.gc-footer__legal a {
  color: var(--gc-neutral-700);
  text-decoration: none;
  transition: color var(--gc-dur);
}

.gc-footer__legal a:hover {
  color: var(--gc-accent);
}

@media (prefers-reduced-motion: reduce) {
  .gc *,
  .gc *::before,
  .gc *::after {
    transition-duration: 0.01ms !important;
  }
}
