/* ==========================================================================
   AH CORE — base design system
   Tokens · type · buttons · topbar/header · mobile drawer · footer · cursor ·
   section seams. Section styles ship with their widgets (project plugin) and
   load only on pages that use them.
   ========================================================================== */

/* --------------------------------------------------------------------------
   00. TYPEFACES
   Brand: Helvetica Neue LT Arabic (licensed). Used when installed locally; drop
   the licensed web fonts into /assets/fonts and the theme adds them (see
   inc/assets.php). Fallback: IBM Plex Sans Arabic, self-hosted (SIL OFL 1.1),
   Arabic + Latin subsets, 400/700 only.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Helvetica Neue LT Arabic';
  font-weight: 400;
  font-display: swap;
  src: local('HelveticaNeueLTArabic-Roman'), local('Helvetica Neue LT Arabic Roman');
}

@font-face {
  font-family: 'Helvetica Neue LT Arabic';
  font-weight: 700;
  font-display: swap;
  src: local('HelveticaNeueLTArabic-Bold'), local('Helvetica Neue LT Arabic Bold');
}

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/plex-arabic-400-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/plex-arabic-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/plex-arabic-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/plex-arabic-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   01. DESIGN TOKENS — sourced from "Ain Al-Hadath Brand Guidelines"
       Brand values (exact, read from the PDF swatches):
         Midnight Navy #1E2738 · Deep Navy ink #151C30 · Antique Gold #C2A75A
         Beige #ECDCCF · White #FFFFFF · Gradient Antique Gold → Midnight Navy
       Everything else below is a shade/tint of those, derived only where
       contrast or depth needs it.
   -------------------------------------------------------------------------- */
:root {
  /* Brand primaries */
  --brand-navy: #1E2738;          /* Midnight Navy (swatch value; the PDF label "#124131" is a typo) */
  --brand-navy-deep: #151C30;     /* Deep navy used in the guide for text and dark bands */
  --brand-gold: #C2A75A;          /* Antique Gold */
  --brand-beige: #ECDCCF;         /* Beige (secondary) */
  --brand-white: #FFFFFF;         /* White (secondary) */
  --brand-gradient: linear-gradient(115deg, #E4D3A4 0%, #C2A75A 22%, #6E6748 48%, #1E2738 82%); /* Gold → Navy (stops approximated from the guide) */

  /* Dark canvases — navy family */
  --bg-dark: #151C30;             /* Deep navy anchor: hero, services, footer */
  --surface-dark-slate: #1E2738;  /* Midnight Navy: panels, controls */
  --surface-dark-card: #232D42;   /* navy +4% — raised card */
  --surface-dark-elevated: #2A3449;/* navy +8% — elevated */

  /* Light canvases — beige / white */
  --bg-light-alabaster: #ECDCCF;  /* Beige section canvas */
  --surface-light-card: #FFFFFF;  /* White cards / alternating sections */
  --surface-light-elevated: #F6EEE7;/* beige 40% on white — soft fills */

  /* Antique Gold + shades */
  --accent-gold: #C2A75A;         /* Antique Gold — lines, icons, CTA fill, gold on navy */
  --accent-gold-bright: #D4BF85;  /* gold tint — hover */
  --accent-gold-dark: #9C8443;    /* gold shade — pencil lead, pressed */
  --accent-gold-deep: #8C722F;    /* gold shade — LARGE gold text on light (≥3:1 on beige) */
  --accent-gold-ink: #735D22;     /* gold shade — SMALL gold text on light (≥4.5:1 on beige) */
  --accent-gold-muted: rgba(194, 167, 90, 0.12); /* Tint for badges */
  --accent-gold-border: rgba(194, 167, 90, 0.35); /* Accent Border */

  /* Structural Lines & Technical Dividers */
  --border-dark: #2E384F;         /* navy divider */
  --border-dark-subtle: rgba(255, 255, 255, 0.08);
  --border-light: #E2D2C4;        /* beige shade divider */
  --border-light-subtle: rgba(10, 14, 28, 0.06);

  /* Text on light (navy ink) */
  --text-dark-primary: #151C30;   /* Deep navy */
  --text-dark-muted: #4F576B;     /* navy-grey, 5.4:1 on beige */
  --text-dark-dim: #596073;       /* navy-grey, 4.7:1 on beige */

  /* Text on dark */
  --text-light-pure: #FFFFFF;
  --text-light-primary: #F1F2F5;
  --text-light-muted: #A3A9B8;    /* 7.2:1 on deep navy */
  --text-light-dim: #7D8498;      /* 4.5:1 on deep navy */

  /* Paper canvas (cards, forms on light sections) */
  --canvas-paper: #FFFFFF;

  /* Typography — one family, per the brand guide (Light 300 / Roman 400 / Bold 700) */
  --font-brand: 'Helvetica Neue LT Arabic', 'IBM Plex Sans Arabic', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: var(--font-brand);
  --font-arabic: var(--font-brand);
  /* Latin technical labels (codes, coordinates, indices) — same brand family, tabular figures */
  --font-mono: 'Helvetica Neue LT Arabic', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);

  /* Layout & Transitions */
  --header-height: 80px;
  --topbar-height: 38px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   02. RESET & BASE ELEMENTS
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: auto; /* Lenis handles smooth scroll */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-dark);
  color: var(--text-light-primary);
  font-family: var(--font-arabic);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-light-primary);
  font-family: var(--font-arabic);
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
  direction: rtl;
  text-align: right;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img, video {
  max-width: 100%;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* Utility Containers */
.container {
  width: 100%;
  max-width: 1360px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Structural Section Contrast Themes */
.section-dark-anchor {
  background-color: var(--bg-dark);
  color: var(--text-light-primary);
}

.section-light-alabaster {
  /* Antique Gold is only 1.75:1 on beige — inside light sections, "gold as ink"
     (text, icons, rules) uses the deep gold shade. Fills that carry navy text
     (.btn-gold, active filters) use --brand-gold explicitly. */
  --accent-gold: var(--accent-gold-deep);
  background-color: var(--bg-light-alabaster);
  color: var(--text-dark-primary);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

/* Alternate light sections on White so the beige canvas keeps a rhythm */
.section-light-alabaster.section-light-white {
  background-color: var(--surface-light-card);
}

/* Dark islands inside light sections keep the true Antique Gold */
.curtain-container,
.project-overlay {
  --accent-gold: var(--brand-gold);
}

/* --------------------------------------------------------------------------
   03. TYPOGRAPHY & TECHNICAL BADGES
   -------------------------------------------------------------------------- */
/* Arabic is a connected script: never apply letter-spacing to it (breaks joins). */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
}

h1, h2 {
  font-family: var(--font-display);
}

.section-dark-anchor h1,
.section-dark-anchor h2,
.section-dark-anchor h3 {
  color: var(--text-light-pure);
}

.section-light-alabaster h1,
.section-light-alabaster h2,
.section-light-alabaster h3,
.text-dark-primary {
  color: var(--text-dark-primary);
}

.text-dark-muted {
  color: var(--text-dark-muted);
}

.gold-text, .text-gold {
  color: var(--accent-gold);
}

/* Latin technical labels — brand family with tabular figures (no monospace in the brand) */
.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  display: inline-block;
}

/* Technical Section Tag */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-arabic); /* tags are Arabic — no mono, no tracking */
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--accent-gold);
  background: var(--accent-gold-muted);
  border: 1px solid var(--accent-gold-border);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  margin-bottom: 16px;
  width: fit-content; /* never stretched by a flex-column parent */
  max-width: 100%;
}

.section-tag-light {
  background: rgba(194, 167, 90, 0.12);
  border-color: rgba(194, 167, 90, 0.3);
  color: var(--accent-gold-ink);
}

.section-tag .dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-gold);
  border-radius: 50%;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.3); }
}

.section-title {
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  font-weight: 700;
  margin-bottom: 20px;
}

.section-title-dark {
  color: var(--text-dark-primary);
}

.section-title span.highlight {
  position: relative;
  color: var(--accent-gold);
  display: inline-block;
}

.section-title span.highlight::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-gold), transparent);
}

.section-desc {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  max-width: 680px;
  line-height: 1.8;
}

.section-desc-dark {
  color: var(--text-dark-muted);
}

/* Technical Icon Box */
.icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface-dark-slate);
  border: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-size: 1.2rem;
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.icon-box-light {
  background: var(--surface-light-card);
  border-color: var(--border-light);
  box-shadow: 0 4px 12px rgba(10, 14, 28, 0.04);
}

.icon-box-light:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

/* Aspect Ratio Utilities */
.aspect-16-10 {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 28px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn-gold {
  background: var(--brand-gold);
  color: var(--brand-navy-deep);
  border-color: var(--brand-gold);
}

.btn-gold:hover {
  background: var(--accent-gold-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(194, 167, 90, 0.25);
}

.btn-outline {
  background: rgba(30, 39, 56, 0.6);
  backdrop-filter: blur(8px);
  border-color: var(--border-dark);
  color: var(--text-light-pure);
}

.btn-outline:hover {
  background: var(--surface-dark-slate);
  border-color: var(--accent-gold-border);
  color: var(--accent-gold);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   04. ARCHITECTURAL TOPBAR & HEADER
   -------------------------------------------------------------------------- */
.topbar {
  background: #10162A;
  border-bottom: 1px solid var(--border-dark-subtle);
  font-size: 0.78rem;
  color: var(--text-light-dim);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  position: relative;
  z-index: 100;
}

.topbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-item i {
  color: var(--accent-gold);
  font-size: 0.75rem;
}

.header-main {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  /* Near-opaque fill instead of backdrop-filter: a 16px blur behind a 92% fill was
     invisible, but it was re-rendered on every scroll frame across the whole page */
  background: rgba(21, 28, 48, 0.96);
  border-bottom: 1px solid var(--border-dark-subtle);
  z-index: 99;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.header-main.scrolled {
  background: rgba(21, 28, 48, 0.98);
  border-bottom-color: var(--border-dark);
  box-shadow: 0 10px 30px rgba(10, 14, 28, 0.4);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Official horizontal logo — height keeps ≥ 11px clear space inside the 80px header */
.brand-logo-img {
  display: block;
  height: 58px;
  width: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-light-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  position: relative;
}

.nav-link .nav-idx {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-gold);
  opacity: 0.8;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gold);
  transition: width var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-light-pure);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  width: 100%;
}

.nav-link[aria-current="page"] { color: var(--text-light-pure); }
.mobile-nav-link[aria-current="page"] { color: var(--accent-gold); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-dark);
  color: var(--text-light-pure);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.footer-main {
  background: var(--bg-dark);
  color: var(--text-light-primary);
  padding: 40px 0;
  border-top: 1px solid var(--border-dark);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-light-dim);
  flex-wrap: wrap;
  gap: 20px;
}

.footer-compliance {
  display: flex;
  align-items: center;
  gap: 24px;
}

.compliance-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-light-muted);
}

.compliance-badge i {
  color: var(--accent-gold);
}

.back-to-top-btn {
  background: var(--surface-dark-slate);
  border: 1px solid var(--border-dark);
  color: var(--accent-gold);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.back-to-top-btn:hover {
  background: var(--accent-gold);
  color: #151C30;
  border-color: var(--accent-gold);
  transform: translateY(-3px);
}

/* Mobile Drawer */
.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  background: rgba(21, 28, 48, 0.98); /* near-opaque: a backdrop blur here would be invisible */
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 30px;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

.mobile-nav-drawer.active {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-dark);
}

.mobile-close-btn {
  background: transparent;
  border: 1px solid var(--border-dark);
  color: var(--text-light-pure);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  cursor: pointer;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 40px 0;
}

.mobile-nav-links a {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-light-pure);
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-nav-links a span {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-gold);
}

/* --------------------------------------------------------------------------
   13. ARCHITECTURAL CURSOR (fine pointers only — enabled by app.js)
   -------------------------------------------------------------------------- */
html.has-cursor,
html.has-cursor * {
  cursor: none !important;
}

html.has-cursor :is(input, textarea, select) {
  cursor: auto !important;
}

.cursor {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.cursor.is-hidden { opacity: 0; }

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  will-change: transform;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-gold);
  transition: opacity 0.2s ease;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(194, 167, 90, 0.75);
  display: grid;
  place-items: center;
  transition: width 0.4s var(--ease-out-expo), height 0.4s var(--ease-out-expo),
              background-color 0.3s ease, border-color 0.3s ease, opacity 0.25s ease;
}

.cursor-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light-pure);
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s ease, transform 0.35s var(--ease-out-expo);
}

.cursor-label i { color: var(--accent-gold); font-size: 0.7rem; }

.cursor--link .cursor-ring {
  width: 58px;
  height: 58px;
  background-color: rgba(194, 167, 90, 0.14);
}
.cursor--link .cursor-dot { opacity: 0; }

.cursor--view .cursor-ring,
.cursor--drag .cursor-ring,
.cursor--scroll .cursor-ring {
  width: 86px;
  height: 86px;
  background-color: rgba(21, 28, 48, 0.86);
  border-color: var(--accent-gold);
}
.cursor--view .cursor-label,
.cursor--drag .cursor-label,
.cursor--scroll .cursor-label { opacity: 1; transform: scale(1); }
.cursor--view .cursor-dot,
.cursor--drag .cursor-dot,
.cursor--scroll .cursor-dot { opacity: 0; }

.cursor--lens .cursor-ring { opacity: 0; }
.cursor--text .cursor-ring,
.cursor--text .cursor-dot { opacity: 0; }

/* --------------------------------------------------------------------------
   14. SECTION SEAMS — drafting ruler between dark and light canvases
   -------------------------------------------------------------------------- */
.ruler-seam {
  --seam: rgba(115, 93, 34, 0.45);
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 14px;
  pointer-events: none;
  z-index: 2;
  background-image:
    repeating-linear-gradient(to left, var(--seam) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(to left, var(--seam) 0 1px, transparent 1px 120px);
  background-size: 100% 6px, 100% 14px;
  background-repeat: no-repeat;
}

.ruler-seam--dark {
  --seam: rgba(194, 167, 90, 0.35);
  top: var(--header-height);
}

/* --------------------------------------------------------------------------
   15. ICONS (inline SVG from inc/icon-set.php — no icon font)
   -------------------------------------------------------------------------- */
.ah-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.ah-i svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  display: block;
}

/* --------------------------------------------------------------------------
   16. WORDPRESS BASICS (accessibility, fallback templates)
   -------------------------------------------------------------------------- */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 100000;
  width: auto;
  height: auto;
  clip: auto;
  padding: 12px 18px;
  background: var(--brand-gold);
  color: var(--brand-navy-deep);
  font-weight: 700;
  border-radius: var(--radius-sm);
}

:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 3px;
}

/* Elementor pages: sections are full-bleed, no gaps between widgets.
   `.ah-stack` is the wrapper container the demo import creates. */
.elementor-page .site-main { display: block; }

.e-con.ah-stack,
.elementor-section.ah-stack {
  --padding-top: 0px;
  --padding-bottom: 0px;
  --padding-left: 0px;
  --padding-right: 0px;
  --gap: 0px;
  --row-gap: 0px;
  --column-gap: 0px;
  --widgets-spacing: 0px;
  --container-max-width: 100%;
  padding: 0;
  gap: 0;
}

.ah-stack .elementor-widget,
.elementor-widget[class*="elementor-widget-el7-"] {
  margin: 0;
  width: 100%;
  --widgets-spacing: 0px;
}

/* Fallback templates (pages, posts, archives without an Elementor template) */
.ah-page {
  padding: clamp(56px, 9vw, 120px) 0;
  min-height: 50vh;
}

.ah-page-header { margin-bottom: 36px; }

.ah-page-title {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--text-dark-primary);
}

.ah-entry {
  max-width: 72ch;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-dark-muted);
}

.ah-entry > * + * { margin-top: 1em; }
.ah-entry h2, .ah-entry h3 { color: var(--text-dark-primary); margin-top: 1.6em; }
.ah-entry a { color: var(--accent-gold-ink); text-decoration: underline; }
.ah-entry img { height: auto; border-radius: var(--radius-md); }
.ah-entry ul, .ah-entry ol { padding-inline-start: 1.4em; }

.ah-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 28px;
}

.ah-pagination { margin-top: 48px; display: flex; gap: 8px; flex-wrap: wrap; }

.ah-pagination .page-numbers {
  min-width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface-light-card);
  color: var(--text-dark-primary);
  font-weight: 700;
}

.ah-pagination .page-numbers.current {
  background: var(--brand-gold);
  border-color: var(--brand-gold);
}

.ah-single-media { margin: 0 0 36px; }
.ah-single-media img { width: 100%; height: auto; border-radius: var(--radius-lg); }

/* Generic archive card (post types without a project card) */
.ah-card {
  background: var(--surface-light-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.ah-card:hover { transform: translateY(-4px); border-color: var(--accent-gold); }
.ah-card-link { display: block; color: inherit; }
.ah-card-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.ah-card-body { padding: 20px 22px 24px; }
.ah-card-title { font-size: 1.2rem; color: var(--text-dark-primary); margin-bottom: 6px; }
.ah-card-excerpt { font-size: 0.92rem; color: var(--text-dark-muted); }

/* Search form (404, empty archives) */
.search-form { display: flex; gap: 8px; max-width: 520px; }

.search-form .search-field {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-dark-primary);
  font-size: 0.95rem;
}

.search-form .search-submit {
  padding: 12px 20px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand-gold);
  color: var(--brand-navy-deep);
  font-weight: 700;
  cursor: pointer;
}

.ah-empty { display: grid; gap: 20px; justify-items: start; }

.ah-404 { min-height: 60vh; display: flex; align-items: center; position: relative; overflow: hidden; }
.ah-404 > .container { position: relative; }
.ah-404-code {
  display: block;
  font-size: clamp(5rem, 16vw, 11rem);
  line-height: 1;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px var(--accent-gold-border);
  margin-bottom: 8px;
}
.ah-404-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 32px; }
.ah-404 .search-form .search-field { background: var(--surface-dark-slate); border-color: var(--border-dark); color: var(--text-light-pure); }

/* Chrome bits rendered by inc/template-tags.php */
.brand-logo-text { font-weight: 700; font-size: 1.25rem; color: var(--text-light-pure); }
.topbar-item a { color: inherit; }
.topbar-item a:hover { color: var(--accent-gold); }

.mobile-drawer-cta {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-dark);
}

.mobile-drawer-cta .btn { width: 100%; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-dark);
  font-size: 0.9rem;
  font-weight: 600;
}

.footer-nav a:hover { color: var(--accent-gold); }

.footer-brand-info { display: grid; gap: 2px; }

/* --------------------------------------------------------------------------
   16. INNER-PAGE HERO — ah_core_page_hero() (fallback templates + page-hero widget)
   Navy band with the blueprint grid, a CAD dimension line along the bottom and
   an optional photo under a directional shade. No JS: it paints with the CSS.
   -------------------------------------------------------------------------- */
.page-hero {
  --ph-min: clamp(380px, 58vh, 620px);
  --ph-shade: 0.86;
  --ph-grid: 0.07;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: var(--ph-min);
  padding: clamp(48px, 7vw, 96px) 0 clamp(56px, 7vw, 88px);
  border-bottom: 1px solid var(--border-dark);
}

.page-hero--compact { --ph-min: clamp(280px, 38vh, 400px); }

.page-hero-media,
.page-hero-shade,
.page-hero-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.page-hero-media { z-index: -3; }

.page-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--ph-focus, 50% 50%);
}

/* Text sits on the start (right) side: shade is heaviest there */
.page-hero-shade {
  z-index: -2;
  background:
    linear-gradient(to left, rgba(21, 28, 48, var(--ph-shade)) 0%, rgba(21, 28, 48, calc(var(--ph-shade) * 0.82)) 45%, rgba(21, 28, 48, calc(var(--ph-shade) * 0.35)) 100%),
    linear-gradient(to top, rgba(21, 28, 48, 0.9) 0%, rgba(21, 28, 48, 0) 45%);
}

.page-hero:not(.has-media) .page-hero-shade {
  background: radial-gradient(ellipse 80% 90% at 85% 100%, rgba(194, 167, 90, 0.10), transparent 60%);
}

.page-hero-grid {
  z-index: -1;
  opacity: var(--ph-grid);
  background-image:
    linear-gradient(var(--accent-gold) 1px, transparent 1px),
    linear-gradient(90deg, var(--accent-gold) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center bottom;
  -webkit-mask-image: linear-gradient(to top, #000 20%, transparent 95%);
  mask-image: linear-gradient(to top, #000 20%, transparent 95%);
}

.ah-404 .page-hero-grid { opacity: 0.06; }

.page-hero-inner { position: relative; }
.page-hero-content { max-width: 820px; }

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  list-style: none;
  font-size: 0.82rem;
  color: var(--text-light-dim);
  margin-bottom: 22px;
}

.breadcrumbs li { display: inline-flex; align-items: center; gap: 10px; }
.breadcrumbs li + li::before { content: ''; width: 14px; height: 1px; background: var(--accent-gold-border); }
.breadcrumbs a { color: var(--text-light-muted); }
.breadcrumbs a:hover { color: var(--accent-gold); }
.breadcrumbs [aria-current] span { color: var(--text-light-primary); }

.page-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--accent-gold);
  margin-bottom: 14px;
}

.page-hero-eyebrow .eyebrow-rule {
  flex: 0 0 56px;
  height: 1px;
  background: linear-gradient(to left, var(--accent-gold), transparent);
}

.page-hero-title {
  font-size: clamp(2.1rem, 4.6vw, 3.9rem);
  line-height: 1.25;
  margin-bottom: 18px;
  color: var(--text-light-pure);
}

.page-hero-title .highlight { color: var(--accent-gold); }

.page-hero-lede {
  max-width: 640px;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.85;
  color: var(--text-light-muted);
}

.page-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin-top: 26px;
}

.page-hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 0.85rem;
  color: var(--text-light-primary);
  background: rgba(30, 39, 56, 0.7);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
}

.page-hero-meta .ah-i { color: var(--accent-gold); font-size: 0.85rem; }

.page-hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

/* CAD dimension line: |<—— label ——>| along the bottom edge */
.page-hero-dim {
  position: absolute;
  inset-inline: 24px;
  bottom: 18px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-inline: 1px solid var(--accent-gold-border);
}

.page-hero-dim::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 1px;
  background: var(--accent-gold-border);
}

.page-hero-dim span {
  position: relative;
  padding: 0 12px;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--text-light-dim);
  background: var(--bg-dark);
}

.page-hero.has-media .page-hero-dim span { background: transparent; text-shadow: 0 0 8px var(--bg-dark); }

/* Generic inner-page section spacing used by the project widgets */
.ah-inner-section { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.ah-inner-section .section-head { margin-bottom: clamp(32px, 5vw, 56px); }
.ah-inner-section .section-head .section-desc { margin-inline: var(--head-desc-mi, 0); }
.ah-inner-section .section-title { margin-bottom: 14px; }
.ah-inner-section .section-head .section-title:last-child { margin-bottom: 0; }

/* Shown in the Elementor editor only, when a widget has nothing to show yet */
.ah-editor-notice {
  margin: 0;
  padding: 18px 22px;
  border: 1px dashed var(--brand-gold);
  border-radius: var(--radius-md);
  background: rgba(194, 167, 90, 0.08);
  color: #8C722F;
  font-size: 0.9rem;
  text-align: center;
}

/* Magnetic buttons ease back to rest (core.js sets the offset) */
.magnetic { transition: transform 0.6s var(--ease-out-expo), background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast); }

/* --------------------------------------------------------------------------
   17. RESPONSIVE (core parts)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .nav-menu { display: none; }
  .mobile-toggle-btn { display: flex; }
}

@media (max-width: 768px) {
  .topbar { display: none; }
  .section-title { font-size: 2.1rem; }
  #headerCtaBtn { display: none; }
  .brand-logo-img { height: 46px; }
  .footer-bottom { justify-content: center; text-align: center; }
  .footer-compliance { flex-wrap: wrap; justify-content: center; gap: 12px 24px; }
  .page-hero { --ph-min: 420px; padding-bottom: 64px; }
  .page-hero--compact { --ph-min: 300px; }
  .page-hero-shade { background: linear-gradient(to top, rgba(21, 28, 48, 0.96) 15%, rgba(21, 28, 48, 0.72) 70%, rgba(21, 28, 48, 0.5) 100%); }
  .page-hero-dim { inset-inline: 16px; }
  .page-hero-ctas .btn { flex: 1 1 auto; }
  .breadcrumbs ol { margin-bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .section-tag .dot { animation: none; }
}
