/* =====================================================
   ASWAR CIVIL V2 — DESIGN SYSTEM
   Dark mode = default (dark background, light text)
   Light mode = inverted palette (light background, dark text)
   --text-primary always gives readable text on --bg-page
   ===================================================== */
:root {
    /* --- Core palette --- */
    --ink: #111514;
    --ink-soft: #3d4541;
    --concrete: #f4f1e7;
    --paper: #fffdf5;
    --asphalt: #18201d;
    --asphalt-2: #0d1210;
    --blueprint: #2f6f95;
    --survey: #00a887;
    --signal: #c89b3c;
    --shade: rgba(17, 21, 20, 0.08);
    --shadow: 0 24px 70px rgba(17, 21, 20, 0.18);
    --radius: 8px;
    --content: 1180px;
    --ease: cubic-bezier(0.19, 1, 0.22, 1);
    --font-heading: 'Aref Ruqaa', serif;
    --font-body: 'IBM Plex Sans Arabic', sans-serif;
    --transition-smooth: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);

    /* --- Dark-mode semantic tokens (defaults) --- */
    --bg-page:    #0d1210;          /* Page / body background */
    --bg-surface: #18201d;          /* Cards, sections */
    --bg-surface-2: #1e2820;        /* Nested cards, table rows */
    --text-primary:   #fffdf5;      /* Main body text */
    --text-secondary: #9ab09d;      /* Muted / helper text */
    --border-subtle: rgba(255, 253, 245, 0.10); /* Dividers */
    --border-card:   rgba(255, 253, 245, 0.12); /* Card borders */
    --line: rgba(255, 253, 245, 0.10);
    --overlay-hero: rgba(13, 18, 16, 0.82); /* Hero image overlay */
    --hero-text: #fffdf5;           /* Text ON hero overlay */
}

html[data-theme="light"] {
    /* --- Light-mode overrides --- */
    --bg-page:    #f5f2e8;          /* Warm parchment background */
    --bg-surface: #ffffff;          /* Cards on light bg */
    --bg-surface-2: #f0ede3;        /* Nested cards */
    --text-primary:   #1a1f1c;      /* Dark readable text */
    --text-secondary: #4a5e52;      /* Muted helper text */
    --border-subtle: rgba(17, 21, 20, 0.10);
    --border-card:   rgba(17, 21, 20, 0.12);
    --line: rgba(17, 21, 20, 0.10);
    --signal: #9a7228;              /* Deeper gold for light bg contrast */
    --overlay-hero: rgba(245, 242, 232, 0.85); /* Hero overlay on light */
    --hero-text: #1a1f1c;          /* Text ON light hero overlay */
    --shadow: 0 24px 70px rgba(17, 21, 20, 0.10);

    /* Remap old variables used throughout */
    --ink: #1a1f1c;
    --ink-soft: #4a5e52;
    --concrete: #0d1210;
    --paper: #ffffff;
    --asphalt: #f0ede3;
    --asphalt-2: #f5f2e8;
    --shade: rgba(17, 21, 20, 0.05);
}

/* RESET */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body.civil-body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    /* Direction follows <html dir="…">, set by i18n.js */
    direction: inherit;
    text-align: start;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* English typography — Aref Ruqaa has no Latin design, so swap the stack */
html[lang="en"] {
    --font-heading: 'Barlow Condensed', 'Aref Ruqaa', serif;
    --font-body: 'Inter', 'IBM Plex Sans Arabic', sans-serif;
}

html[lang="en"] body.civil-body {
    line-height: 1.6;
}

/* English headings run a touch larger to match the Arabic optical size */
html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] .hero__title,
html[lang="en"] .site-hero__overlay h1 {
    letter-spacing: 0.005em;
}

/* Hide the page until the English pass has run, to avoid an Arabic flash */
html.i18n-pending body {
    visibility: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
}

/* Subpage wrapper shell */
.site-shell {
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* 1. SITE NAV SHELL (CIVIL 1 FLOATING BAR) */
.nav {
    position: fixed;
    inset: 18px 18px auto 18px;
    z-index: 1000;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.nav__inner {
    width: min(var(--content), calc(100vw - 36px));
    height: 66px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 0 20px;
    /* Rich deep forest slate green instead of pitch black */
    background: rgba(24, 32, 29, 0.90);
    border: 1px solid rgba(255, 253, 245, 0.10);
    border-radius: var(--radius);
    box-shadow: 0 18px 50px rgba(13, 18, 16, 0.25);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    pointer-events: auto;
    color: #fffdf5;
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

html[data-theme="light"] .nav__inner {
    /* Pure white instead of parchment cream */
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(17, 21, 20, 0.10);
    color: #1a1f1c;
    box-shadow: 0 18px 50px rgba(17, 21, 20, 0.06);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto; /* Ensure link is clickable */
    color: inherit;
    transition: opacity 0.25s ease;
}

.brand:hover {
    opacity: 0.85;
}

.brand-text {
    font-size: 0.98rem;
    font-weight: 700;
    font-family: var(--font-body);
    white-space: nowrap;
    color: inherit; /* Dynamically inherits light/dark color from navbar */
}

@media (max-width: 650px) {
    .brand-text {
        font-size: 0.8rem;
        font-weight: 700;
    }
}

html[data-theme="dark"] .logo-dark { display: block !important; }
html[data-theme="dark"] .logo-light { display: none !important; }
html[data-theme="light"] .logo-dark { display: none !important; }
html[data-theme="light"] .logo-light { display: block !important; }

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

.nav-menu a {
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
    padding: 6px 0;
    transition: color 0.3s ease;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--signal);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-menu a:hover {
    color: var(--signal);
}

.nav-menu a.active {
    color: var(--signal);
}

.nav-menu a.active::after {
    width: 100%;
}

.nav-cta {
    background: var(--ink);
    color: var(--paper) !important;
    padding: 8px 18px !important;
    border-radius: 6px;
    transition: var(--transition-smooth) !important;
}

html[data-theme="light"] .nav-cta {
    background: #1a1f1c;
    color: #ffffff !important;
}

.nav-cta:hover {
    background: var(--signal) !important;
    color: #fff !important;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-switch-btn {
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(17, 21, 20, 0.05);
    border: 1px solid rgba(17, 21, 20, 0.08);
    padding: 6px 12px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

html[data-theme="light"] .nav-switch-btn {
    background: rgba(255, 253, 245, 0.05);
    border-color: rgba(255, 253, 245, 0.08);
}

.nav-switch-btn:hover {
    background: var(--signal);
    color: #fff;
    border-color: var(--signal);
}

.theme-toggle {
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid rgba(17, 21, 20, 0.08);
    transition: var(--transition-smooth);
}

html[data-theme="light"] .theme-toggle {
    border-color: rgba(255, 253, 245, 0.08);
}

.theme-toggle:hover {
    border-color: var(--signal);
    color: var(--signal);
}

.theme-icon-sun, .theme-icon-moon { display: none; fill: currentColor; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
html[data-theme="light"] .theme-icon-moon { display: block; }

/* 2. HERO SECTION & CANVAS CITY */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 120px;
    padding-bottom: 60px;
    overflow: hidden;
    z-index: 1;
    background-color: #0d1210;
    transition: background-color 0.5s ease;
}

/* Light mode — fully bright warm hero */
html[data-theme="light"] .hero {
    background-color: #f5f2e8;
}

/* Dark mode overlay */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(13, 18, 16, 0.55) 0%,
        rgba(13, 18, 16, 0.80) 60%,
        rgba(13, 18, 16, 0.96) 100%
    );
    z-index: -1;
    pointer-events: none;
    transition: background 0.5s ease;
}

/* Light mode overlay — warm geometric pattern, no dark tint */
html[data-theme="light"] .hero::after {
    background:
        radial-gradient(ellipse 80% 60% at 20% 40%, rgba(200, 155, 60, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 60% 80% at 80% 60%, rgba(47, 111, 149, 0.06) 0%, transparent 60%),
        linear-gradient(160deg, #f5f2e8 0%, #ede9da 50%, #f0ead6 100%);
}

/* Canvas — hide in light mode */
#cityCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.65;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

html[data-theme="light"] #cityCanvas {
    opacity: 0;
    pointer-events: none;
}

.hero__inner {
    width: min(var(--content), calc(100vw - 40px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero__content {
    position: relative;
    z-index: 10;
}

.eyebrow {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--signal);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.8rem;
}

/* Hero title — white on dark, deep ink on light */
.hero__title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4.2rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #fffdf5;
    transition: color 0.4s ease;
}

html[data-theme="light"] .hero__title {
    color: #1a1f1c;
}

.hero__title span {
    color: var(--signal);
}

/* Hero lead — soft on dark, readable on light */
.hero__lead {
    font-size: 1.05rem;
    color: rgba(255, 253, 245, 0.78);
    margin-bottom: 2rem;
    max-width: 600px;
    transition: color 0.4s ease;
}

html[data-theme="light"] .hero__lead {
    color: #3d4541;
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 3rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.button--accent {
    background: var(--signal);
    color: #fff;
    border: 1px solid var(--signal);
}

.button--accent:hover {
    background: #fff;
    color: var(--asphalt-2);
    border-color: #fff;
    box-shadow: 0 10px 30px rgba(200, 155, 60, 0.3);
}

/* Light mode accent hover — dark bg for contrast */
html[data-theme="light"] .button--accent:hover {
    background: #1a1f1c;
    color: #fffdf5;
    border-color: #1a1f1c;
}

/* button--light: glassy on dark, outlined on light */
.button--light {
    background: rgba(255, 253, 245, 0.10);
    color: #fffdf5;
    border: 1px solid rgba(255, 253, 245, 0.28);
}

html[data-theme="light"] .button--light {
    background: rgba(26, 31, 28, 0.06);
    color: #1a1f1c;
    border: 1px solid rgba(26, 31, 28, 0.22);
}

.button--light:hover {
    background: rgba(255, 253, 245, 0.22);
    color: #fffdf5;
    border-color: rgba(255, 253, 245, 0.45);
}

html[data-theme="light"] .button--light:hover {
    background: #1a1f1c;
    color: #fffdf5;
    border-color: #1a1f1c;
}

/* 3. HERO PROJECT STACK (TILTED CARDS DECK) */
.hero__showcase {
    position: relative;
    height: 520px;
    display: flex;
    align-items: center;
}

.hero-project-stack {
    position: relative;
    width: 100%;
    height: 480px;
    isolation: isolate;
}

.hero-project-stack::before {
    content: '';
    position: absolute;
    inset: 10% 5% 5% 5%;
    z-index: -2;
    border: 1px solid rgba(214, 255, 63, 0.1);
    background: 
        linear-gradient(90deg, rgba(214, 255, 63, 0.05) 1px, transparent 1px),
        linear-gradient(180deg, rgba(214, 255, 63, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: skewY(-3deg);
    opacity: 0.6;
}

/* Hero cards — glass on dark, clean on light */
.hero-project-card {
    position: absolute;
    margin: 0;
    border: 1px solid rgba(255, 253, 245, 0.16);
    border-radius: var(--radius);
    background: rgba(13, 18, 16, 0.55);
    box-shadow: var(--shadow);
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

/* Light mode: light glass cards */
html[data-theme="light"] .hero-project-card {
    border-color: rgba(26, 31, 28, 0.12);
    background: rgba(255, 253, 245, 0.78);
    box-shadow: 0 16px 48px rgba(26, 31, 28, 0.14);
}

.hero-project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(0.9) contrast(1.02);
}

.hero-project-card figcaption {
    position: absolute;
    inset: auto 12px 12px 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 4px 10px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 253, 245, 0.12);
    border-radius: 6px;
    background: rgba(13, 18, 16, 0.84);
    color: var(--paper);
    font-size: 0.75rem;
    line-height: 1.35;
    font-weight: 700;
}

.hero-project-card figcaption span:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.hero-project-card figcaption span:last-child {
    flex: 0 0 auto;
    white-space: nowrap;
    color: var(--signal);
}

.hero-project-card--main {
    inset: 50px 0 auto auto;
    width: min(82%, 380px);
    height: 280px;
    z-index: 3;
}

.hero-project-card--side {
    inset: auto auto 20px 0;
    width: min(62%, 260px);
    height: 200px;
    z-index: 2;
}

.hero-project-card--top {
    inset: 0 auto auto 20px;
    width: min(52%, 220px);
    height: 150px;
    /* Above the main card: it slides under it horizontally, and at z-index 1
       the main card was cutting this card's caption in half */
    z-index: 4;
    transform: rotate(-3deg);
}

.hero-project-card:hover {
    transform: scale(1.03) translateY(-5px);
    z-index: 5;
    border-color: var(--signal);
}

/* Hero always dark, proof widget always white-on-dark */
.hero-project-proof {
    position: absolute;
    /* Anchored bottom-right so it never sits on top of the bottom-left card caption */
    left: auto;
    right: 0;
    bottom: -10px;
    display: flex;
    gap: 16px;
    z-index: 10;
}

.hero-project-proof div {
    background: rgba(24, 32, 29, 0.88);
    color: #fffdf5;
    border: 1px solid rgba(255, 253, 245, 0.14);
    border-radius: var(--radius);
    padding: 10px 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Light mode: bright clean proof widgets */
html[data-theme="light"] .hero-project-proof div {
    background: rgba(255, 253, 245, 0.92);
    color: #1a1f1c;
    border-color: rgba(26, 31, 28, 0.14);
    box-shadow: 0 8px 28px rgba(26, 31, 28, 0.12);
}

.hero-project-proof div strong {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--signal);
}

.hero-project-proof div span {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 253, 245, 0.65);
    white-space: nowrap;
}

/* Light mode: label was near-white on cream — unreadable */
html[data-theme="light"] .hero-project-proof div span {
    color: #3d4541;
}

/* 4. SECTIONS & CHECKERBOARD THEME */
.section {
    padding: 6rem 0;
    position: relative;
}

.section__inner {
    width: min(var(--content), calc(100vw - 40px));
    margin: 0 auto;
}

/* --- Section backgrounds always use semantic tokens --- */
.section--paper {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.section--ink {
    background: var(--bg-surface-2);
    color: var(--text-primary);
}

/* Section Headings */
.section-heading {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-bottom: 3.5rem;
    align-items: flex-start;
}

.section-kicker {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--signal);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.2rem;
}

.section-heading h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}

.section-lead {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 800px;
}

.section-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* 5. SOLUTIONS / SERVICES GRID */
.solutions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.solution-card {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 2.2rem;
    display: flex;
    gap: 24px;
    transition: var(--transition-smooth);
    color: var(--text-primary);
}

.solution-card__index {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--signal);
    opacity: 0.4;
    line-height: 1;
}

.solution-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.solution-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.solution-card:hover {
    transform: translateY(-5px);
    border-color: var(--signal);
    box-shadow: var(--shadow);
    background: var(--bg-surface);
}

/* Generic Card (Vertical Layout Card) */
.generic-card {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: var(--transition-smooth);
    color: var(--text-primary);
}

.generic-card h2, .generic-card h3, .generic-card h4 {
    color: var(--text-primary);
}

.generic-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.generic-card:hover {
    transform: translateY(-5px);
    border-color: var(--signal);
    box-shadow: var(--shadow);
    background: var(--bg-surface);
}

/* 6. PROJECTS SECTION & FILTER CONTROLS */
.section-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    padding: 8px 18px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--signal);
    color: #fff;
    border-color: var(--signal);
}

/* Projects grid and cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.project-visual {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.project-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.project-blueprint-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 18, 16, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: var(--transition-smooth);
}

.project-blueprint-overlay svg {
    width: 100%;
    height: 100%;
}

.project-card:hover .project-blueprint-overlay {
    opacity: 1;
}

.project-card:hover .project-photo-img {
    transform: scale(1.05);
}

.project-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-cat {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--signal);
    text-transform: uppercase;
    margin-bottom: 0.4rem;
    display: block;
}

.project-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.project-client {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.project-card:hover {
    border-color: var(--signal);
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

/* Glass card variant (generated by app.js) */
.glass-card {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Project card body — app.js uses .project-details (not .project-body) */
.project-body,
.project-details {
    padding: 1.4rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: space-between;
}

/* Status badge on photo */
.project-status {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-completed {
    background: var(--signal);
    color: #0d1210;
}

.status-ongoing {
    background: var(--survey, #00a887);
    color: #fff;
}

/* Bottom row: location + details button */
.project-meta-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
    padding-top: 0.7rem;
    border-top: 1px dashed var(--border-subtle);
}

.project-loc {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.project-loc svg {
    width: 14px;
    height: 14px;
    fill: var(--signal);
    flex-shrink: 0;
}

.project-more-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--signal);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.project-more-btn svg {
    fill: var(--signal);
    transform: rotate(180deg);
}

.project-more-btn:hover {
    opacity: 0.75;
}

/* 7. STATS & CERTIFICATES SHOWCASE */
.stats-showcase-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 50px;
    align-items: center;
}

.stats-numbers-block {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stats-lead-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.stats-tiles-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 1rem;
}

.stats-tile {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: var(--transition-smooth);
}

.stats-tile strong {
    font-size: 2rem;
    font-weight: 800;
    color: var(--signal);
    display: block;
    margin-bottom: 0.4rem;
}

.stats-tile span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.stats-tile:hover {
    background: var(--bg-surface);
    border-color: var(--signal);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

/* Generic Card (Premium Styled Vertical Card) */
.generic-card {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-card);
    border-right: 4px solid var(--signal); /* Brand gold accent bar */
    border-radius: var(--radius);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition-smooth);
    color: var(--text-primary);
}

.generic-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(200, 155, 60, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

html[data-theme="light"] .generic-card {
    background: #ffffff;
    box-shadow: 0 16px 45px rgba(17, 21, 20, 0.05);
}

.generic-card h2, .generic-card h3, .generic-card h4 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 0.6rem;
    margin-bottom: 0.4rem;
}

/* Elegant gold line under card headings */
.generic-card h2::after, .generic-card h3::after, .generic-card h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 48px;
    height: 2px;
    background: var(--signal);
}

.generic-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.generic-card:hover {
    transform: translateY(-4px);
    border-color: var(--signal);
    box-shadow: var(--shadow);
}

/* --- Premium Stat Badges Row --- */
.stat-badge-row {
    display: flex;
    gap: 1.2rem;
    margin-top: 1.5rem;
    border-top: 1px dashed var(--border-subtle);
    padding-top: 1.5rem;
    flex-wrap: wrap;
}

.stat-badge {
    flex: 1;
    min-width: 110px;
    background: var(--bg-page);
    border: 1px solid var(--border-card);
    border-radius: 6px;
    padding: 14px 10px;
    text-align: center;
    transition: var(--transition-smooth);
}

.stat-badge:hover {
    border-color: var(--signal);
    background: var(--bg-surface);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.stat-badge .num {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--signal);
    display: block;
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-badge .lbl {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* --- Styled Icon Lists --- */
.styled-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.styled-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.styled-list li::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(200, 155, 60, 0.12);
    color: var(--signal);
    font-size: 0.8rem;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 2px;
}

.bullet-grid {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.bullet-grid li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

.bullet-grid li::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--signal);
    flex-shrink: 0;
}

/* --- Premium Responsive Tables --- */
.premium-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-card);
    margin-top: 1rem;
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 0.88rem;
}

.premium-table th {
    background: var(--bg-surface-2);
    color: var(--signal);
    font-weight: 700;
    padding: 14px 16px;
    border-bottom: 2.5px solid var(--signal);
}

html[data-theme="light"] .premium-table th {
    background: #f7f5ef;
}

.premium-table td {
    padding: 13px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.2s ease;
}

.premium-table tr:last-child td {
    border-bottom: none;
}

.premium-table tr:hover td {
    background: var(--bg-page);
}

/* --- Modern Feature Tags for Workshops --- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 0.5rem;
}

.feature-tag {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-page);
    border: 1px solid var(--border-card);
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.feature-tag:hover {
    border-color: var(--signal);
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.feature-tag::before {
    content: '⚙';
    color: var(--signal);
    font-size: 1.1rem;
}

/* Certificates Dossier */
.certificates-dossier-block {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 2.5rem;
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

.dossier-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    border-bottom: 2px solid var(--signal);
    padding-bottom: 0.6rem;
}

.dossier-desc {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

.dossier-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dossier-list li {
    font-size: 0.85rem;
    display: flex;
    gap: 12px;
    align-items: center;
}

.dossier-list li span {
    color: var(--signal);
    font-weight: 800;
}

/* 8. CONTACT FORM & INPUTS */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 50px;
}

.contact-info-block {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-lead-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.contact-channels {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 1rem;
}

.channel-card {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 1.2rem;
    display: flex;
    gap: 16px;
    align-items: center;
}

.channel-icon {
    font-size: 1.5rem;
    color: var(--signal);
}

.channel-card div {
    display: flex;
    flex-direction: column;
}

.channel-card strong {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.channel-card span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Form Styling */
.contact-form-block {
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 2.5rem;
}

.civil-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--signal);
}

.civil-form input, .civil-form select, .civil-form textarea {
    background: var(--bg-surface-2);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-smooth);
}

.civil-form input:focus, .civil-form select:focus, .civil-form textarea:focus {
    border-color: var(--signal);
    box-shadow: 0 0 10px rgba(200, 155, 60, 0.2);
}

.civil-form select option {
    background: var(--bg-surface-2);
    color: var(--text-primary);
}

/* 9. FOOTER */
.footer {
    background: var(--bg-page);
    border-top: 1px solid var(--border-subtle);
    padding: 3rem 0;
    color: var(--text-primary);
}

.footer__inner {
    width: min(var(--content), calc(100vw - 40px));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-moto {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}

.footer-meta-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-top: 1px dashed var(--border-subtle);
    padding-top: 1.5rem;
    flex-wrap: wrap;
    gap: 12px;
}

/* 10. DETAIL MODAL VIEW */
.modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 18, 16, 0.88);
    backdrop-filter: blur(8px);
}

.modal-panel {
    position: relative;
    width: min(900px, 92vw);
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 10;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 100;
    color: var(--text-primary);
}

.modal-panel-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    height: 480px;
}

.modal-visual-area {
    position: relative;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.modal-tab {
    flex: 1;
    padding: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    border-bottom: 3px solid transparent;
    transition: var(--transition-smooth);
}

.modal-tab.active {
    border-bottom-color: var(--signal);
    color: var(--signal);
    background: rgba(255, 255, 255, 0.02);
}

.modal-view-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.modal-project-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-blueprint-overlay {
    position: absolute;
    inset: 0;
    background: #0d1210;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-blueprint-overlay.active {
    opacity: 1;
}

.modal-details-area {
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.modal-category {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--signal);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-specs-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border-subtle);
}

.spec-label {
    color: var(--text-secondary);
}

.spec-value {
    font-weight: 700;
    color: var(--text-primary);
}

/* 11. TOAST ALERT */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--signal);
    border-radius: var(--radius);
    padding: 14px 20px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 16px;
    align-items: center;
    z-index: 100000;
    transform: translateY(150px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.open {
    transform: translateY(0);
}

.toast-check {
    background: var(--signal);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.toast h4 {
    font-size: 0.85rem;
    font-weight: 700;
}

.toast p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 991px) {
    .hero__inner {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .hero__showcase {
        height: 420px;
        order: -1; /* Truss cards Stack first on tablet/mobile */
    }
    .hero-project-stack {
        height: 380px;
    }
    .hero-project-card--main {
        inset: 40px 0 auto auto;
        width: 80%;
        height: 220px;
    }
    .hero-project-card--side {
        width: 60%;
        height: 160px;
    }
    .hero-project-card--top {
        width: 50%;
        height: 120px;
    }
    .section-heading {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .solutions-grid {
        grid-template-columns: 1fr;
    }
    .stats-showcase-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .modal-panel-inner {
        grid-template-columns: 1fr;
        grid-template-rows: 240px 1fr;
        height: auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    .modal-visual-area {
        border-left: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
}

/* Hamburger Toggle Button Style */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
    color: inherit;
    pointer-events: auto;
}

.menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Toggle Active Animations */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 820px) {
    .nav__inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 96px;
        right: 18px;
        left: 18px;
        background: rgba(24, 32, 29, 0.98);
        border: 1px solid rgba(255, 253, 245, 0.12);
        border-radius: var(--radius);
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 24px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.3);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        transform: translateY(-20px);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
        z-index: 999;
    }

    html[data-theme="light"] .nav-menu {
        background: rgba(255, 255, 255, 0.98);
        border-color: rgba(17, 21, 20, 0.12);
        box-shadow: 0 20px 40px rgba(17, 21, 20, 0.08);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu a {
        font-size: 1rem !important;
        width: 100%;
        text-align: center;
        padding: 8px 0;
    }
    
    .nav-cta {
        width: 100% !important;
        text-align: center !important;
        margin-top: 4px;
    }
}

@media (max-width: 575px) {
    .stats-tiles-wrapper {
        grid-template-columns: 1fr;
    }
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* ===== V2 SUBPAGE HERO BANNER SYSTEM ===== */
.site-hero {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
    margin-top: 120px;
}

.site-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
    transition: var(--transition-smooth);
    display: block;
}

/* Hero overlay — always dark with white text for maximum readability */
.site-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 14, 12, 0.88) 0%, rgba(10, 14, 12, 0.40) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 5rem 0 2rem;
    transition: background 0.4s ease;
}

/* In light mode, hero still stays dark — for best text contrast over any photo */
html[data-theme="light"] .site-hero__overlay {
    background: linear-gradient(135deg, rgba(10, 14, 12, 0.82) 0%, rgba(10, 14, 12, 0.38) 100%);
}

/* Hero headings/text — always white regardless of theme */
.site-hero__overlay h1,
.site-hero__overlay h2,
.site-hero__overlay p {
    color: #fffdf5 !important;
}

.site-hero__overlay .stat-highlight {
    color: var(--signal) !important;
}

/* Stat highlight utility — always uses --signal */
.stat-highlight {
    color: var(--signal);
}

/* Reset letter-spacing for Arabic content */
[dir="rtl"], [dir="rtl"] * {
    letter-spacing: normal !important;
}

/* ===== V2 SUBPAGE HERO BANNER RESPONSIVE ===== */
@media (max-width: 900px) {
    .site-hero__overlay {
        padding: 0 2.5rem;
    }
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: 1.2fr 1fr"],
    [style*="grid-template-columns: 1fr 1.2fr"] {
        grid-template-columns: 1fr !important;
    }
    [style*="padding: 0 6rem"] {
        padding: 0 1.5rem !important;
    }
}

@media (max-width: 600px) {
    .site-hero {
        height: 260px !important;
    }
    /* Narrow screens: not enough width beside the bottom card — drop the proof
       widget fully below the stack instead of overlapping it */
    .hero__showcase {
        height: 470px;
        align-items: flex-start; /* reserve the extra height under the stack for the proof widget */
    }
    .hero-project-proof {
        left: 0;
        right: 0;
        bottom: -80px;
        justify-content: center;
    }
    .hero-project-card figcaption {
        font-size: 0.7rem;
        padding: 7px 10px;
    }
}

/* =====================================================
   LANGUAGE SWITCH (AR ⇄ EN)
   ===================================================== */
.lang-toggle {
    cursor: pointer;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    border-radius: 4px;
    border: 1px solid rgba(17, 21, 20, 0.08);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

html[data-theme="light"] .lang-toggle {
    border-color: rgba(255, 253, 245, 0.08);
}

.lang-toggle:hover {
    border-color: var(--signal);
    color: var(--signal);
}

.lang-toggle svg {
    fill: currentColor;
    flex: 0 0 auto;
}

.lang-toggle__label {
    /* Always rendered in the language it switches to */
    letter-spacing: normal !important;
}

@media (max-width: 1080px) {
    .lang-toggle__label {
        display: none;
    }
    .lang-toggle {
        width: 36px;
        padding: 0;
    }
}

/* =====================================================
   LTR (ENGLISH) MIRRORING
   Only the physical offsets that carry meaning in RTL are
   flipped; the decorative hero card deck stays as composed.
   ===================================================== */
html[dir="ltr"] .project-status {
    left: auto;
    right: 12px;
}

html[dir="ltr"] .generic-card {
    border-right: 1px solid var(--border-card);
    border-left: 4px solid var(--signal);
}

html[dir="ltr"] .generic-card::before {
    right: auto;
    left: 0;
}

html[dir="ltr"] .generic-card h2::after,
html[dir="ltr"] .generic-card h3::after,
html[dir="ltr"] .generic-card h4::after {
    right: auto;
    left: 0;
}

html[dir="ltr"] .premium-table {
    text-align: left;
}

html[dir="ltr"] .feature-tag:hover {
    transform: translateX(5px);
}

html[dir="ltr"] .modal-close {
    right: auto;
    left: 12px;
}

html[dir="ltr"] .modal-visual-area {
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

html[dir="ltr"] .toast {
    left: auto;
    right: 2rem;
}

@media (max-width: 900px) {
    html[dir="ltr"] .modal-visual-area {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* The logo carries width/height attributes for CLS; without this the
   presentational width (400px) survives the inline `height: 38px` and the
   mark renders stretched, blowing out the nav grid. */
.logo-dark,
.logo-light {
    width: auto;
}

/* =====================================================
   NAV FIT — the bar carries brand + menu + 3 action buttons,
   and English labels are wider than the Arabic ones. Let the
   brand column shrink instead of pushing the buttons out of
   the bar (which the body's overflow-x: hidden then clipped).
   ===================================================== */
.nav__inner {
    grid-template-columns: minmax(0, auto) 1fr auto;
}

.brand {
    min-width: 0;
}

.brand-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 560px) {
    /* Below this the wordmark alone carries the brand */
    .brand-text {
        display: none;
    }
    .nav__inner {
        gap: 12px;
    }
}

/* Grid/flex children default to min-width: auto, so the long phone and email
   strings in the channel cards pushed the contact column wider than its track
   and gave the page a horizontal scroll on narrow screens. */
.contact-info-block,
.contact-form-block,
.channel-card,
.channel-card div {
    min-width: 0;
}

.channel-card span,
.channel-card strong {
    overflow-wrap: anywhere;
}

/* Form controls carry an intrinsic default width (size=20), which set the
   min-content of their grid tracks and pushed the enquiry form past the
   viewport. Let them size to the column instead. */
.form-group {
    min-width: 0;
}

.civil-form input,
.civil-form select,
.civil-form textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}
