/* ==========================================================================
   CNG Bangladesh — global stylesheet (Phase 3)
   Blue-and-white clean-energy theme. Organised as:
   1) Design tokens  2) Reset & base  3) Layout  4) Components
   5) Header & navigation  6) Pages  7) Footer  8) Forms
   9) Directory  10) Responsive
   ========================================================================== */

/* 1) Design tokens ---------------------------------------------------------- */
:root {
    --blue:        #0756A5;
    --blue-dark:   #054788;
    --navy:        #092C4C;
    --accent:      #20A4F3;
    --pale:        #EFF7FF;
    --white:       #FFFFFF;
    --text:        #243447;
    --muted:       #5B6B7C;
    --border:      #D9E7F5;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --radius:      10px;
    --radius-sm:   6px;
    --shadow:      0 4px 18px rgba(9, 44, 76, 0.08);
    --shadow-lg:   0 12px 32px rgba(9, 44, 76, 0.14);

    --container:   1140px;
    --gutter:      clamp(1rem, 4vw, 2rem);
    --section-y:   clamp(3rem, 7vw, 5rem);
}

/* 2) Reset & base ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Comfortable reading measure on wide screens */
@media (min-width: 900px) {
    main p, main li { max-width: 68ch; }
}

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

h1, h2, h3, h4 {
    color: var(--navy);
    line-height: 1.22;
    margin: 0 0 0.6em;
    font-weight: 700;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.005em; }

p { margin: 0 0 1em; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }

ul, ol { padding-left: 1.25rem; }

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Accessibility helpers */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0); overflow: hidden;
}

.skip-link {
    position: absolute;
    left: 1rem; top: -4rem;
    z-index: 100;
    background: var(--navy);
    color: var(--white);
    padding: 0.6rem 1rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    transition: top 0.2s ease;
}
.skip-link:focus { top: 0; color: var(--white); }

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

.section { padding-block: var(--section-y); }
.section-pale { background: var(--pale); }
.section-navy { background: var(--navy); color: #D6E4F2; }
.section-navy h2, .section-navy h3 { color: var(--white); }

.section-head {
    max-width: 46rem;
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}
.section-head.center { margin-inline: auto; text-align: center; }
.section-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 0.5rem;
}
.section-navy .section-eyebrow { color: var(--accent); }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.section-navy .section-head p { color: #B9CCE0; }

.grid { display: grid; gap: clamp(1rem, 3vw, 1.75rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Two-column intro with image placeholder */
.split {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(1.5rem, 5vw, 3.5rem);
    align-items: center;
}

/* 4) Components ------------------------------------------------------------- */

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.98rem;
    line-height: 1.4;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); color: var(--white); }

.btn-outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: var(--white); }

.btn-light { background: var(--white); color: var(--blue); }
.btn-light:hover { background: var(--pale); color: var(--blue-dark); }

.btn-ghost-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.65); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.12); color: var(--white); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1.25rem, 3vw, 1.75rem);
    box-shadow: var(--shadow);
}
.card h3 a { color: var(--navy); }
.card h3 a:hover { color: var(--blue); }
.card p:last-child { margin-bottom: 0; }
.card-eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    display: block;
    margin-bottom: 0.5rem;
}

/* Simple icon disc used on feature cards (CSS-only, no icon font needed) */
.card-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--pale);
    border: 1px solid var(--border);
    color: var(--blue);
    display: grid; place-items: center;
    font-weight: 800;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Content photograph with attribution caption.
   Credits are required for CC-licensed images — see docs/image-manifest.md. */
.content-image { margin: 0; }
.content-image img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}
.content-image figcaption {
    font-size: 0.76rem;
    color: var(--muted);
    margin-top: 0.5rem;
    line-height: 1.5;
}
.content-image figcaption a { color: var(--muted); text-decoration: underline; }
.content-image figcaption a:hover { color: var(--blue); }

.image-placeholder {
    background: linear-gradient(135deg, var(--pale) 0%, #DCEEFB 100%);
    border: 1px dashed #A9CBEC;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    text-align: center;
    padding: 1.5rem;
    color: var(--blue);
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 220px;
    aspect-ratio: 16 / 10;
}
.image-placeholder span { max-width: 20rem; }

/* Badges / tags */
.badge {
    display: inline-block;
    background: var(--pale);
    border: 1px solid var(--border);
    color: var(--blue);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.75rem;
}

/* Empty-state notice (used when data arrays have no records yet) */
.empty-state {
    background: var(--pale);
    border: 1px dashed #A9CBEC;
    border-radius: var(--radius);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    text-align: center;
    color: var(--muted);
}
.empty-state p:last-child { margin-bottom: 0; }

/* Ordered steps (conversion process etc.) */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
    counter-increment: step;
    position: relative;
    padding: 0 0 1.5rem 3.25rem;
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0; top: 0;
    width: 2.25rem; height: 2.25rem;
    border-radius: 50%;
    background: var(--blue);
    color: var(--white);
    font-weight: 700;
    display: grid; place-items: center;
    font-size: 0.95rem;
}
.steps li::after {
    content: "";
    position: absolute;
    left: 1.1rem; top: 2.4rem; bottom: 0.3rem;
    width: 2px;
    background: var(--border);
}
.steps li:last-child::after { display: none; }
.steps strong { display: block; color: var(--navy); }

/* Checklist */
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.6rem;
}
.check-list li::before {
    content: "\2713";
    position: absolute;
    left: 0; top: 0;
    color: var(--blue);
    font-weight: 800;
}

/* Cross-list (limitations / "not suitable for" — same shape, minus tick) */
.cross-list { list-style: none; padding: 0; margin: 0; }
.cross-list li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.6rem;
}
.cross-list li::before {
    content: "\2715";
    position: absolute;
    left: 0.15rem; top: 0;
    color: var(--muted);
    font-weight: 800;
    font-size: 0.85rem;
}

/* Category card media (Products & Services cards) */
.card-media {
    margin: -1.25rem -1.25rem 1.1rem;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}
.card .card-media img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.card:hover .card-media img { transform: scale(1.03); }

/* Provider directory cards */
.provider-card { display: flex; flex-direction: column; }
.provider-card p:last-child { margin-top: auto; }

/* Card action row (kept at the card's bottom edge) */
.card-actions { margin-top: auto; padding-top: 1rem; }

/* Editorial timeline (history sections) */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li {
    position: relative;
    padding: 0 0 1.6rem 2.5rem;
    border-left: 2px solid var(--border);
    margin-left: 0.6rem;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
    content: "";
    position: absolute;
    left: -0.55rem; top: 0.35rem;
    width: 0.9rem; height: 0.9rem;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--blue);
}
.timeline .tl-when {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--blue);
    margin-bottom: 0.15rem;
}
.timeline strong { color: var(--navy); }

/* Key-figures row (values are configurable — see FIGURES in includes/config.php) */
.figure-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1rem, 3vw, 1.75rem);
}
.figure-tile {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow);
}
.figure-tile dt {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.35rem;
}
.figure-tile dd {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.4;
}
/* Honest placeholder for figures that have not been verified yet */
.figure-pending {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--pale);
    border: 1px dashed #A9CBEC;
    border-radius: var(--radius-sm);
    padding: 0.1rem 0.5rem;
    white-space: normal;
}

/* Note / caveat callout */
.note {
    background: var(--pale);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 1.1rem 1.35rem;
    margin: 1.5rem 0;
}
.note > :last-child { margin-bottom: 0; }
.note strong { color: var(--navy); }

/* Simple data table (equipment comparisons etc.) */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin: 0.5rem 0 1rem;
}
.data-table caption {
    text-align: left;
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
}
.data-table th,
.data-table td {
    text-align: left;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.data-table thead th {
    background: var(--pale);
    color: var(--navy);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td { border-bottom: 0; }

/* Spacing utilities (replace one-off inline styles) */
.mt-lg { margin-top: clamp(2rem, 5vw, 3rem); }
.mt { margin-top: 1.5rem; }
.section-tight-bottom { padding-bottom: 0; }
.grid-start { align-items: start; }
.text-left { text-align: left; }

/* 5) Header & navigation ---------------------------------------------------- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 0 rgba(9, 44, 76, 0.04);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 68px;
}

/* Temporary text logo */
.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--navy); }
.brand-accent {
    background: var(--blue);
    color: var(--white);
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
}
.brand-name { color: var(--navy); }

.nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item { position: relative; }

.nav-row { display: flex; align-items: center; }

.nav-link {
    display: block;
    padding: 0.55rem 0.8rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.nav-link:hover { color: var(--blue); background: var(--pale); text-decoration: none; }
.is-active > .nav-row > .nav-link { color: var(--blue); }

/* Contact button in the menu */
.nav-item-cta .nav-link {
    background: var(--blue);
    color: var(--white);
    margin-left: 0.5rem;
    padding-inline: 1.15rem;
}
.nav-item-cta .nav-link:hover { background: var(--blue-dark); color: var(--white); }

/* Dropdown */
.dropdown-toggle {
    border: 0;
    background: transparent;
    padding: 0.35rem 0.3rem;
    cursor: pointer;
    color: var(--muted);
    display: grid;
    place-items: center;
}
.chevron {
    width: 0.55rem; height: 0.55rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.18s ease;
}
.dropdown-toggle[aria-expanded="true"] .chevron { transform: rotate(-135deg) translateY(-2px); }

.dropdown {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    min-width: 250px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    list-style: none;
    margin: 0;
    padding: 0.4rem;
    display: none;
    z-index: 60;
}
.dropdown a {
    display: block;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.94rem;
    font-weight: 500;
}
.dropdown a:hover,
.dropdown a[aria-current="page"] { background: var(--pale); color: var(--blue); text-decoration: none; }

/* Desktop open states: hover and keyboard focus */
.has-children:hover > .dropdown,
.has-children:focus-within > .dropdown,
.has-children.open > .dropdown { display: block; }
.has-children:hover .chevron,
.has-children:focus-within .chevron { transform: rotate(-135deg) translateY(-2px); }

/* Mobile toggle button (hidden on desktop) */
.nav-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: var(--pale);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--navy);
    cursor: pointer;
}
.nav-toggle-bars { display: grid; gap: 3px; }
.nav-toggle-bars span {
    display: block;
    width: 18px; height: 2px;
    background: var(--navy);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
body.nav-open .nav-toggle-bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
body.nav-open .nav-toggle-bars span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle-bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* 6) Pages ------------------------------------------------------------------ */

/* Hero (home) — optional photograph behind the gradient */
.hero {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(1000px 420px at 85% -10%, rgba(32, 164, 243, 0.25), transparent 60%),
        linear-gradient(160deg, var(--navy) 0%, var(--blue) 100%);
    color: var(--white);
    padding-block: clamp(3.5rem, 9vw, 6.5rem);
}
.hero h1 { color: var(--white); margin-bottom: 0.5rem; }
.hero p.lead {
    color: #CFE3F6;
    font-size: clamp(1.05rem, 2vw, 1.22rem);
    max-width: 42rem;
    margin-bottom: 1.75rem;
}
.hero .section-eyebrow { color: var(--accent); }
.hero .hero-note {
    display: block;
    margin-top: 1.5rem;
    font-size: 0.82rem;
    color: #9FC3E6;
    max-width: 40rem;
}
.hero .hero-note a { color: #CFE3F6; text-decoration: underline; }

/* When a photograph is used, sit it behind a deep gradient so text stays
   readable (WCAG contrast) no matter how bright the photo is. */
.hero-media::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center 40%;
}
.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(100deg, rgba(9, 44, 76, 0.92) 0%, rgba(9, 44, 76, 0.78) 45%, rgba(7, 86, 165, 0.45) 100%);
}

/* Quick-link tiles (home: About / Automotive / Industry) */
.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 3vw, 1.75rem); }
.quick-link {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1.25rem, 3vw, 1.6rem);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.quick-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: #A9CBEC;
    text-decoration: none;
}
.quick-link .ql-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
}
.quick-link:hover .ql-title { color: var(--blue); }
.quick-link p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.quick-link .ql-more { font-weight: 600; font-size: 0.9rem; color: var(--blue); margin-top: 0.35rem; }

/* Page banner (inner pages) */
.page-banner {
    background: linear-gradient(150deg, var(--navy) 0%, var(--blue) 100%);
    color: var(--white);
    padding-block: clamp(2.5rem, 6vw, 4rem);
}
.page-banner h1 { color: var(--white); margin-bottom: 0.35rem; }
.page-banner p {
    color: #CFE3F6;
    max-width: 44rem;
    margin-bottom: 0;
    font-size: 1.05rem;
}
.breadcrumb {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0;
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: #9FC3E6;
}
.breadcrumb a { color: #CFE3F6; }
.breadcrumb a:hover { color: var(--white); text-decoration: none; }

/* Feature cards grid on home */
.feature-card { display: flex; flex-direction: column; height: 100%; }
.feature-card .card-link { margin-top: auto; padding-top: 1rem; font-weight: 600; }

/* News list */
.news-list { display: grid; gap: 1.25rem; }
.news-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    align-items: start;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1.1rem, 3vw, 1.5rem);
    box-shadow: var(--shadow);
}
.news-item h3 { margin-bottom: 0.35rem; }
.news-thumb img {
    width: 160px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

/* CTA band */
.cta-band {
    background: var(--blue);
    color: var(--white);
    border-radius: var(--radius);
    padding: clamp(1.75rem, 5vw, 3rem);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}
.cta-band h2 { color: var(--white); margin-bottom: 0.25rem; }
.cta-band p { color: #D9ECFC; margin-bottom: 0; }

/* Data-section anchors on products page */
.service-block { scroll-margin-top: 90px; }

/* 7) Footer ------------------------------------------------------------------ */
.site-footer {
    background: var(--navy);
    color: #B9CCE0;
    margin-top: var(--section-y);
    font-size: 0.95rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: clamp(1.5rem, 4vw, 3rem);
    padding-block: clamp(2.25rem, 5vw, 3.5rem);
}
.footer-logo { font-size: 1.2rem; font-weight: 800; color: var(--white); margin-bottom: 0.5rem; }
.footer-logo .brand-accent { background: var(--accent); color: var(--navy); }
.footer-tagline { color: #9FC3E6; max-width: 26rem; }
.footer-heading {
    color: var(--white);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.9rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: #B9CCE0; }
.footer-col a:hover { color: var(--white); text-decoration: underline; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-block: 1.1rem;
    font-size: 0.85rem;
    color: #8FB1D2;
}
.footer-bottom p { margin: 0; }

/* 8) Forms -------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.form-field { display: flex; flex-direction: column; gap: 0.35rem; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-weight: 600; color: var(--navy); font-size: 0.93rem; }
.form-field .req { color: var(--blue); }
.form-field input,
.form-field select,
.form-field textarea {
    font: inherit;
    color: var(--text);
    background: var(--white);
    border: 1px solid #B9CCE0;
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.8rem;
    width: 100%;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(32, 164, 243, 0.25);
}
.form-field textarea { min-height: 150px; resize: vertical; }
.form-hint { font-size: 0.85rem; color: var(--muted); }

.form-notice {
    display: none;
    background: var(--pale);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.1rem;
    margin-top: 1rem;
    color: var(--navy);
    font-size: 0.95rem;
}
.form-notice.is-visible { display: block; }

/* 9) Directory: filters, autocomplete, provider cards, pagination --------- */

/* Filter/search form on directory pages (GET — works without JavaScript) */
.directory-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1rem, 3vw, 1.5rem);
    box-shadow: var(--shadow);
    margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}
.directory-form .form-actions { display: flex; align-items: end; }

/* Autocomplete */
.ac-container { position: relative; }
.ac-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    z-index: 40;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    list-style: none;
    margin: 0;
    padding: 0.25rem;
    max-height: 320px;
    overflow-y: auto;
}
.ac-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.94rem;
    color: var(--text);
}
.ac-item:hover,
.ac-item.is-active { background: var(--pale); color: var(--blue); }
.ac-label { font-weight: 600; }
.ac-hint {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Provider card details */
.provider-logo { max-height: 48px; width: auto; margin-bottom: 0.9rem; }
.provider-address { font-size: 0.92rem; color: var(--muted); }
.contact-label {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--navy);
    margin-right: 0.3rem;
}
.provider-contact {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    font-size: 0.92rem;
}
.provider-contact li { margin-bottom: 0.25rem; }
.badge-primary {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
    font-size: 0.66rem;
    padding: 0.08rem 0.5rem;
    vertical-align: 1px;
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: center;
    margin-top: 2.25rem;
}
.page-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--blue);
    font-weight: 600;
    font-size: 0.92rem;
}
.page-link:hover {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
    text-decoration: none;
}
.page-current { font-size: 0.92rem; color: var(--muted); padding: 0.5rem 0.4rem; }

@media (max-width: 1024px) {
    .directory-form { grid-template-columns: 1fr 1fr; }
    .directory-form .form-actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .directory-form { grid-template-columns: 1fr; }
    .directory-form .form-actions .btn { width: 100%; }
}

/* 10) Responsive ---------------------------------------------------------------- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .figure-row { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    /* Mobile navigation: panel drops down under the header bar */
    .nav-toggle { display: inline-flex; }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        max-height: calc(100vh - 68px);
        overflow-y: auto;
    }
    body.nav-open .site-nav { display: block; }

    .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: 0.75rem var(--gutter) 1.25rem; }
    .nav-link { padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--pale); }
    .nav-item-cta .nav-link { margin: 0.75rem 0 0; text-align: center; }

    .nav-row { justify-content: space-between; }
    .dropdown-toggle { padding-inline: 1rem; }

    .dropdown {
        position: static;
        display: none;
        box-shadow: none;
        border: 0;
        border-left: 3px solid var(--accent);
        border-radius: 0;
        margin: 0 0 0.5rem;
        background: var(--pale);
        min-width: 0;
    }
    .has-children.open > .dropdown { display: block; }
    .has-children:hover > .dropdown,
    .has-children:focus-within > .dropdown { display: none; }
    .has-children.open:hover > .dropdown,
    .has-children.open:focus-within > .dropdown { display: block; }

    .split { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .quick-links { grid-template-columns: 1fr; }
    .figure-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .news-item { grid-template-columns: 1fr; }
    .news-thumb img { width: 100%; }
    .cta-band { flex-direction: column; align-items: flex-start; }
    .btn-row .btn { width: 100%; }
    .data-table { font-size: 0.88rem; }
    .data-table th, .data-table td { padding: 0.55rem 0.6rem; }
}

/* Motion preferences: keep the site calm and accessible */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
