/* Theme Name: ZeroY Starter */

/* ---------------------------------------------------------------
   Base — food-safe neutral canvas, brand type scale, 8pt rhythm.
   Palette and elevation come from assets/css/tokens.css, which mirrors
   the Workspace DESIGN.md brand spec.
   --------------------------------------------------------------- */

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

html {
  background: var(--color-surface-muted);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-surface-muted);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

p {
  line-height: 1.7;
  max-width: 65ch;
}

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

h1,
h2,
h3,
h4 {
  color: var(--color-brand-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}

h3 {
  font-size: 1.5rem;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

/* Shared container */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Blog and other default templates */
.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

/* Buttons — Electric Anchor for the primary action, hairline ghost for the
   secondary one (DESIGN.md §2.1, §4.1). */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  background: var(--color-brand-cta);
  border: 1px solid var(--color-brand-cta);
  border-radius: var(--radius-control);
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.button:hover {
  background: var(--color-brand-secondary);
  border-color: var(--color-brand-secondary);
}

.button--ghost {
  color: var(--color-brand-primary);
  background: transparent;
  border-color: var(--color-border);
}

.button--ghost:hover {
  color: var(--color-brand-cta);
  background: var(--color-surface);
  border-color: var(--color-brand-cta);
}

/* ---------------------------------------------------------------
   Site header — brand, page navigation, quote action.
   The navigation stays visible at every size; no drawers, no JS.
   --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.site-brand__mark {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--color-brand-kraft);
}

.site-brand__name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-brand-primary);
}

.site-brand__tagline {
  padding-left: 12px;
  border-left: 1px solid var(--color-border);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}

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

.site-nav__list a {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.site-nav__list a:hover {
  color: var(--color-brand-cta);
}

.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a,
.site-nav__list .current_page_parent > a {
  color: var(--color-brand-primary);
  box-shadow: inset 0 -2px 0 var(--color-brand-kraft);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

@media (max-width: 560px) {
  .site-nav__list {
    gap: 16px;
  }

  .site-header__actions .button {
    padding: 12px 18px;
  }
}

/* ---------------------------------------------------------------
   Site footer — Industrial Navy slab, factual production notes.
   --------------------------------------------------------------- */

.site-footer {
  margin-top: 64px;
  background: var(--color-brand-primary);
  color: #cbd5e1;
}

.site-footer__inner {
  display: grid;
  gap: 32px;
  padding-top: 48px;
  padding-bottom: 32px;
}

@media (min-width: 860px) {
  .site-footer__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px;
  }
}

.site-footer__brand {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.site-footer__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #cbd5e1;
}

.site-footer__note {
  margin: 12px 0 0;
  max-width: 42ch;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #94a3b8;
}

.site-footer__legal-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer__heading {
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
}

.site-footer__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.site-footer__list li {
  margin-bottom: 8px;
  max-width: 32ch;
  color: #cbd5e1;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
  text-underline-offset: 3px;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer__bottom {
  padding-top: 16px;
  padding-bottom: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.site-footer__legal {
  margin: 0;
  font-size: 0.8125rem;
  color: #94a3b8;
}

/* Narrow screens: brand and quote action share the first row, the
   navigation keeps its own row and stays visible. */
@media (max-width: 560px) {
  .site-header__inner {
    gap: 12px 16px;
  }

  .site-brand {
    order: 1;
  }

  .site-header__actions {
    order: 2;
    margin-left: auto;
  }

  .site-nav {
    order: 3;
    flex-basis: 100%;
  }

  .site-nav__list {
    gap: 18px;
  }
}

/* Mega menu — built on the WP Behaviors dropdown contract
   (data-behavior="dropdown" + data-trigger + data-panel + data-menu-item).
   The header and the footer render the same component, so one set of type,
   surface and hover rules serves both. The runtime owns open/close, keyboard
   support and placement. */
.mega-menu {
  --dropdown-duration: 140ms;
  position: relative;
  display: inline-block;
}

/* The trigger is a navigation item, not a button: it carries the same face,
   weight and colour as the page links beside it, and opens with the same
   kraft underline the current page link uses. */
.mega-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 120ms ease;
}

.mega-menu__trigger:hover {
  color: var(--color-brand-cta);
}

.mega-menu__trigger[aria-expanded="true"] {
  color: var(--color-brand-primary);
  box-shadow: inset 0 -2px 0 var(--color-brand-kraft);
}

.mega-menu__caret {
  width: 0;
  height: 0;
  margin-top: 2px;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform 140ms ease;
}

.mega-menu__trigger[aria-expanded="true"] .mega-menu__caret {
  transform: rotate(180deg);
}

.mega-menu__panel {
  position: absolute;
  left: 0;
  z-index: 50;
  min-width: min(560px, 88vw);
  max-height: 70vh;
  overflow-y: auto;
  padding: 20px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-raised);
}

.mega-menu__groups {
  display: grid;
  gap: 24px;
}

@media (min-width: 560px) {
  .mega-menu__groups {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 24px 40px;
  }
}

.mega-menu__heading {
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.mega-menu__empty {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.mega-menu__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mega-menu__list li {
  margin: 0;
}

.mega-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
}

.mega-menu__item:hover {
  color: var(--color-brand-cta);
  background: #eff6ff;
}

.mega-menu__item.is-current {
  font-weight: 600;
  color: var(--color-brand-primary);
  background: var(--color-surface-muted);
}

.mega-menu__count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* The footer paints its links white; the panel is a white surface, so its
   entries have to win that rule back. */
.site-footer .mega-menu__item {
  color: var(--color-text);
}

@media (min-width: 1024px) {
  .site-footer__inner {
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
  }
}

/* The navigation row holds the page links and the mega menu trigger on one
   line, with the same gap as the links use between themselves. */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

/* On the navy footer the trigger is plain text too, so it needs light ink. */
.site-footer .mega-menu__trigger {
  color: #fff;
}

.site-footer .mega-menu__trigger:hover {
  color: rgba(255, 255, 255, 0.75);
}

.site-footer .mega-menu__trigger[aria-expanded="true"] {
  color: #fff;
}
