/* SPDX-License-Identifier: GPL-3.0-only
 * Copyright (c) 2026 AethelisDEV / Aeon Platform. All rights reserved.
 *
 * Layout layer — page scaffolding: containers, the frosted navigation bar, the footer and the
 * generic section/grid primitives every page composes from.
 */

/* ---------------------------------------------------------------------------------------------
 * Containers
 * ------------------------------------------------------------------------------------------- */
.container {
  inline-size: 100%;
  max-inline-size: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-inline-size: var(--container-narrow);
}

.container--wide {
  max-inline-size: 1480px;
}

/* ---------------------------------------------------------------------------------------------
 * Sections
 * ------------------------------------------------------------------------------------------- */
.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: calc(var(--section-y) * 0.55);
}

/* The wide periwinkle band that separates one block of content from the next. */
.section--sunken {
  background-color: var(--surface-sunken);
}

.section--surface {
  background-color: var(--surface);
}

/* A full-bleed navy band. Its contents are inverted wholesale rather than per-element, so any
 * component can be dropped inside without needing an "-on-ink" modifier of its own. */
.section--ink {
  background-color: var(--ink);
  color: var(--on-ink);
}

.section--ink .section__subtitle,
.section--ink .lede,
.section--ink .muted {
  color: var(--on-ink-secondary);
}

.section--ink .subtle {
  color: var(--on-ink-tertiary);
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-block-end: var(--space-8);
}

.section__head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-block-end: var(--space-12);
}

.section__title {
  font-size: var(--text-display-s);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-display);
}

.section__subtitle {
  margin-block-start: var(--space-3);
  color: var(--label-secondary);
  font-size: var(--text-subhead);
  line-height: var(--leading-relaxed);
  max-inline-size: 60ch;
}

.section__head--center .section__subtitle {
  margin-inline: auto;
}

/* ---------------------------------------------------------------------------------------------
 * Grids
 * ------------------------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--space-6);
}

/* Auto-fitting card grid: the minimum column width is the only thing that changes per context. */
.grid--cards {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.grid--tiles {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

.grid--halves {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: var(--space-10);
}

.grid--thirds {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

/* ---------------------------------------------------------------------------------------------
 * Site header — a navy bar, white type, one orange action.
 *
 * Two states, and the difference is only paint:
 *   • Default (every inner page): solid navy, sticky, in flow.
 *   • `.site-header--overlay` (the home page): transparent, laid over the hero photograph, and
 *     dropped back to solid navy by `.is-scrolled` once the hero has been scrolled past. The class
 *     is added by app.js, so with scripting off the bar simply stays transparent over a hero that
 *     is dark by design — legible either way.
 *
 * The whole bar is a fixed dark surface in both colour schemes: it is brand paint, not a neutral,
 * so it does not flip with the theme toggle.
 * ------------------------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 100;
  background-color: var(--ink);
  color: var(--on-ink);
  border-block-end: 1px solid var(--ink-line);
  transition: background-color var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

/* Home page: the bar floats on the hero rather than sitting above it. `position: absolute` (not
 * sticky) keeps it out of flow so the hero starts at the very top of the viewport. */
.site-header--overlay {
  position: absolute;
  inset-inline: 0;
  background-color: transparent;
  border-block-end-color: transparent;
}

/* Scrolled past the hero: the overlay bar re-materialises, this time fixed to the viewport. */
.site-header--overlay.is-scrolled {
  position: fixed;
  background-color: var(--ink);
  border-block-end-color: var(--ink-line);
  box-shadow: var(--shadow-m);
  animation: header-drop var(--duration-base) var(--ease-out);
}

@keyframes header-drop {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.site-header.is-scrolled:not(.site-header--overlay) {
  box-shadow: var(--shadow-m);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  block-size: var(--nav-height);
}

@media (min-width: 768px) {
  .site-header__inner {
    block-size: var(--nav-height-lg);
  }
}

/* Brand lockup */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-title-3);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-title);
  color: inherit;
  white-space: nowrap;
}

.brand__mark {
  display: grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  border-radius: var(--radius-s);
  background-color: var(--brand);
  color: var(--brand-contrast);
  font-size: var(--text-footnote);
  font-weight: var(--weight-extrabold);
  letter-spacing: 0;
}

/* Primary navigation */
.nav {
  display: none;
  align-items: center;
  gap: var(--space-1);
  margin-inline-start: var(--space-8);
}

@media (min-width: 1024px) {
  .nav {
    display: flex;
  }
}

.nav__link {
  position: relative;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-subhead);
  font-weight: var(--weight-bold);
  color: rgba(255, 255, 255, 0.78);
  transition: color var(--duration-fast) var(--ease-out);
}

.nav__link::after {
  content: "";
  position: absolute;
  inset-block-end: -2px;
  inset-inline: var(--space-3);
  block-size: 2px;
  background-color: var(--brand);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--duration-fast) var(--ease-out);
}

.nav__link:hover {
  color: #fff;
}

.nav__link:hover::after,
.nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav__link[aria-current="page"] {
  color: #fff;
}

/* Right-hand actions */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: auto;
}

/*
 * Below 900px the bar cannot hold the brand, both switchers, the theme toggle, two buttons and a
 * hamburger without overflowing. The two buttons are the ones that give way, because the mobile
 * panel repeats them; the switchers do not appear there and so have to stay.
 */
@media (max-width: 899px) {
  /* Scoped through `.site-header` to outrank `.btn { display: inline-flex }`, which lives in
   * components.css and is therefore later in the cascade at the same specificity. */
  .site-header .site-header__cta {
    display: none;
  }
}

/* Narrower still, the currency code goes too — the language switcher is the one that changes what
 * a visitor can read, rather than only how a price is written. */
@media (max-width: 479px) {
  .site-header__actions .menu:nth-of-type(2) {
    display: none;
  }
}

/* The header sits on navy in every state, so its inline controls are inverted here rather than
 * carrying "-on-ink" modifiers through the markup. */
.site-header .menu > summary {
  color: rgba(255, 255, 255, 0.78);
}

.site-header .menu > summary:hover,
.site-header .menu[open] > summary {
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.site-header .btn--ghost {
  color: rgba(255, 255, 255, 0.85);
}

.site-header .btn--ghost:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.site-header .btn--secondary {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.site-header .btn--secondary:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

/* Mobile menu toggle. */
.nav-toggle {
  display: inline-grid;
  place-items: center;
  inline-size: 38px;
  block-size: 38px;
  border-radius: var(--radius-s);
  color: #fff;
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.mobile-nav {
  display: none;
  border-block-start: 1px solid var(--ink-line);
  background-color: var(--ink);
  padding-block: var(--space-3);
}

.site-header--overlay .mobile-nav {
  background-color: var(--ink);
}

.mobile-nav[data-open="true"] {
  display: block;
}

@media (min-width: 1024px) {
  .mobile-nav {
    display: none !important;
  }
}

.mobile-nav__link {
  display: block;
  padding: var(--space-3) 0;
  font-size: var(--text-body);
  font-weight: var(--weight-bold);
  color: rgba(255, 255, 255, 0.85);
  border-block-end: 1px solid var(--ink-line);
}

.mobile-nav__link:hover {
  color: var(--brand-hover);
}

.mobile-nav__link:last-child {
  border-block-end: 0;
}

/* ---------------------------------------------------------------------------------------------
 * Main
 * ------------------------------------------------------------------------------------------- */
.site-main {
  display: block;
  min-block-size: 60vh;
}

/* ---------------------------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------------------------- */
.site-footer {
  padding-block: var(--space-16) var(--space-8);
  background-color: var(--ink);
  color: var(--on-ink-secondary);
  font-size: var(--text-subhead);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--space-10);
}

.site-footer__brand {
  grid-column: span 1;
  max-inline-size: 34ch;
}

.site-footer__heading {
  margin-block-end: var(--space-5);
  font-size: var(--text-footnote);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: #fff;
}

.site-footer__list {
  display: grid;
  gap: var(--space-3);
}

/* A small orange chevron in front of every footer link, as in the reference footer. */
.site-footer__list .site-footer__link {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
}

.site-footer__list .site-footer__link::before {
  content: "›";
  color: var(--brand);
  font-weight: var(--weight-extrabold);
  line-height: 1;
}

[dir="rtl"] .site-footer__list .site-footer__link::before {
  content: "‹";
}

.site-footer__link {
  color: var(--on-ink-secondary);
  transition: color var(--duration-fast) var(--ease-out);
}

.site-footer__link:hover {
  color: #fff;
}

/* The quiet-text utilities resolve to dark ink by default, which disappears on the navy footer. */
.site-footer .subtle,
.site-footer .muted {
  color: var(--on-ink-tertiary);
}

/* The contact block's headline number — the one warm note in an otherwise cool footer. */
.site-footer__phone {
  display: inline-block;
  font-size: var(--text-title-2);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-title);
  color: #fff;
}

.site-footer__phone span {
  color: var(--brand-hover);
}

.site-footer__socials {
  display: flex;
  gap: var(--space-2);
}

.site-footer__social {
  display: inline-grid;
  place-items: center;
  min-inline-size: 34px;
  block-size: 34px;
  padding-inline: var(--space-3);
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.08);
  font-size: var(--text-caption-1);
  font-weight: var(--weight-bold);
  color: var(--on-ink-secondary);
  transition: background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.site-footer__social:hover {
  background-color: var(--brand);
  color: #fff;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-block-start: var(--space-12);
  padding-block-start: var(--space-6);
  border-block-start: 1px solid var(--ink-line);
  font-size: var(--text-caption-1);
  color: var(--on-ink-tertiary);
}

/* ---------------------------------------------------------------------------------------------
 * Breadcrumbs
 * ------------------------------------------------------------------------------------------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-footnote);
  color: var(--label-tertiary);
}

.breadcrumbs a {
  color: var(--label-secondary);
}

.breadcrumbs a:hover {
  color: var(--label);
}

.breadcrumbs__separator {
  color: var(--label-quaternary);
}

/* The chevron must point the other way in Arabic. */
[dir="rtl"] .breadcrumbs__separator {
  transform: scaleX(-1);
}
