/* ==========================================================================
   NICE Ambulance Services – Stylesheet
   Sections: 1 Base · 2 Layout · 3 Buttons · 4 Header · 5 Hero · 6 Sections
             7 Services · 8 Why us · 9 Stats · 10 Process · 11 Gallery
             12 Testimonials · 13 FAQ · 14 CTA · 15 Contact · 16 Footer
             17 Floating UI · 18 Animations · 19 Responsive
   ========================================================================== */

/* ---------- 1. Base ---------- */
:root {
    --red: #D32F2F;
    --red-dark: #b71c1c;
    --blue: #1565C0;
    --blue-dark: #0f2744;
    --white: #FFFFFF;
    --gray: #F7F9FB;
    --text: #1F2937;
    --muted: #4b5563;
    --line: #e3e8ee;
    --green: #16A34A;
    --radius: 12px;
    --shadow: 0 6px 24px rgba(15, 39, 68, .08);
    --shadow-lg: 0 14px 36px rgba(15, 39, 68, .16);
    --header-h: 90px;
    --font: 'Poppins', Arial, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }

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

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

h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; color: var(--blue-dark); }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 700; color: var(--white); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1rem; }
a { color: var(--blue); }
ul, ol { margin: 0; padding: 0; list-style: none; }

.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

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

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 200;
    background: var(--blue-dark); color: var(--white); padding: 10px 16px; border-radius: 6px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- 2. Layout ---------- */
.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.container-narrow { width: min(820px, 100% - 40px); }

.section { padding: 84px 0; }
.section-alt { background: var(--gray); }

.section-head { max-width: 680px; margin: 0 auto 48px; text-align: center; }
.section-head p:last-child { color: var(--muted); margin-bottom: 0; }

.section-tag {
    display: inline-block; margin-bottom: .5rem;
    font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--red);
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split-media { position: relative; }
.split-media img { border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; }
.split-reverse .split-media { order: 0; }

/* ---------- 3. Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font: 600 .95rem/1 var(--font);
    padding: 12px 22px; border-radius: 8px; border: 2px solid transparent;
    text-decoration: none; cursor: pointer;
    transition: background-color .25s, color .25s, border-color .25s, transform .25s, box-shadow .25s;
}
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(211, 47, 47, .35); }
.btn-outline { border-color: rgba(255, 255, 255, .85); color: var(--white); background: transparent; }
.btn-outline:hover { background: var(--white); color: var(--blue-dark); transform: translateY(-2px); }
.btn-white { background: var(--white); color: var(--red-dark); }
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .25); }
.btn-link { padding: 0; color: var(--blue); font-size: .9rem; border-radius: 4px; }
.btn-link .icon { transition: transform .25s; }
.btn-link:hover .icon { transform: translateX(4px); }

/* ---------- 4. Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100; height: var(--header-h);
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .3s, height .3s;
}
.site-header.scrolled { box-shadow: 0 4px 18px rgba(15, 39, 68, .1); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 100%; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--blue-dark); margin-right: auto; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--red); color: var(--white); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { font-size: .95rem; font-weight: 500; line-height: 1.15; }
.brand-text strong { display: block; font-size: 1.2rem; font-weight: 700; letter-spacing: .04em; color: var(--red); }
.brand-light { color: var(--white); }
.brand-light .brand-text strong { color: var(--white); }
.brand-light .brand-mark { background: var(--red); }

.main-nav ul { display: flex; gap: 4px; }
.nav-link {
    position: relative; display: block; padding: 8px 12px;
    font-size: .88rem; font-weight: 500; color: var(--text); text-decoration: none; border-radius: 6px;
    transition: color .25s;
}
.nav-link::after {
    content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--red);
    transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.nav-link:hover, .nav-link.active { color: var(--red); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

.header-call {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--red); color: var(--white); font-weight: 600; font-size: .9rem;
    padding: 9px 16px; border-radius: 8px; text-decoration: none; transition: background-color .25s;
}
.header-call:hover { background: var(--red-dark); }

.nav-toggle { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; padding: 10px; flex-direction: column; justify-content: center; gap: 5px; }
.nav-toggle span { display: block; height: 2px; background: var(--blue-dark); border-radius: 2px; transition: transform .3s, opacity .3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 5. Hero ---------- */
.hero { position: relative; display: flex; align-items: center; min-height: min(86vh, 760px); padding: 72px 0; color: var(--white); overflow: hidden; background: var(--blue-dark); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(10, 25, 46, .92) 0%, rgba(10, 25, 46, .72) 55%, rgba(10, 25, 46, .55) 100%); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.4fr .8fr; gap: 56px; align-items: center; }

.eyebrow { display: inline-block; font-size: .85rem; font-weight: 500; letter-spacing: .04em; color: #ffd3d3; border-left: 3px solid var(--red); padding-left: 12px; margin-bottom: 1.1rem; }
.hero-lead { font-size: 1.05rem; max-width: 560px; color: #e5ecf5; margin: 1rem 0 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.emergency-card { background: var(--white); color: var(--text); border-radius: 16px; padding: 28px; box-shadow: var(--shadow-lg); border-top: 5px solid var(--red); }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; color: var(--red); margin-bottom: .2rem; }
.card-number { display: block; font-size: 2rem; font-weight: 700; color: var(--blue-dark); text-decoration: none; margin-bottom: 1rem; letter-spacing: .02em; }
.card-number:hover { color: var(--red); }
.tick-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-weight: 500; border-top: 1px solid var(--line); }
.tick-list .icon { color: var(--green); stroke-width: 2.6; }

/* ---------- 6. About ---------- */
.media-badge {
    position: absolute; right: -16px; bottom: -20px; background: var(--red); color: var(--white);
    border-radius: var(--radius); padding: 14px 22px; text-align: center; box-shadow: var(--shadow-lg);
}
.media-badge strong { display: block; font-size: 1.7rem; line-height: 1.1; }
.media-badge span { font-size: .8rem; }
.split-body > p { color: var(--muted); }
.about-points { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin-top: 1.4rem; }
.about-points li { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: .92rem; }
.about-points .icon { color: var(--green); stroke-width: 2.6; }

/* ---------- 7. Services ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.service-card {
    display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 26px 22px; transition: transform .3s, box-shadow .3s, border-color .3s;
}
.service-card p { color: var(--muted); font-size: .92rem; flex: 1; }
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(211, 47, 47, .35); }
.service-icon {
    display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 16px;
    border-radius: 12px; background: #fdecec; color: var(--red); transition: background-color .3s, color .3s, transform .3s;
}
.service-icon .icon { width: 26px; height: 26px; }
.service-card:hover .service-icon { background: var(--red); color: var(--white); transform: scale(1.06); }

/* ---------- 8. Why us ---------- */
.feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; margin-top: 1.6rem; }
.feature-list li, .contact-info li { display: flex; gap: 14px; align-items: flex-start; }
.feature-list h3 { font-size: .98rem; margin-bottom: .1rem; }
.feature-list p { font-size: .85rem; line-height: 1.5; color: var(--muted); margin: 0; }
.f-icon { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 10px; background: #e8f0fb; color: var(--blue); }

/* ---------- 9. Stats ---------- */
.stats { background: linear-gradient(120deg, var(--blue-dark), var(--blue)); color: var(--white); padding: 56px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; text-align: center; }
.stat-num { display: block; font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 700; line-height: 1.2; }
.stat-label { display: block; font-size: .88rem; color: #cfe0f5; }

/* ---------- 10. Process ---------- */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; position: relative; counter-reset: step; }
.timeline::before { content: ''; position: absolute; top: 28px; left: 12%; right: 12%; height: 2px; background: repeating-linear-gradient(90deg, #b9c6d6 0 8px, transparent 8px 16px); }
.timeline li { position: relative; text-align: center; padding: 0 8px; }
.timeline p { font-size: .9rem; color: var(--muted); }
.step-no {
    position: relative; display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 16px;
    border-radius: 50%; background: var(--red); color: var(--white); font-weight: 700; font-size: 1.2rem;
    box-shadow: 0 0 0 6px var(--gray);
}

/* ---------- 11. Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gallery-item { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--blue-dark); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s ease; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item figcaption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 16px 12px; color: var(--white); font-weight: 500; font-size: .92rem;
    background: linear-gradient(transparent, rgba(10, 25, 46, .85));
}

/* ---------- 12. Testimonials ---------- */
.testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.testimonial { margin: 0; display: flex; flex-direction: column; background: var(--white); border-radius: var(--radius); padding: 28px; border: 1px solid var(--line); transition: transform .3s, box-shadow .3s; }
.testimonial:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stars { display: flex; gap: 2px; color: #f59e0b; margin-bottom: 14px; }
.stars .icon { fill: currentColor; stroke: none; }
.stars .icon-off { color: #d1d5db; }
.testimonial blockquote { margin: 0 0 22px; font-size: .95rem; color: var(--muted); flex: 1; }
.testimonial figcaption { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.testimonial figcaption img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.testimonial figcaption strong { display: block; font-size: .95rem; color: var(--blue-dark); line-height: 1.3; }
.testimonial figcaption small { color: var(--muted); font-size: .8rem; }

/* ---------- 13. FAQ ---------- */
.acc-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; transition: border-color .3s, box-shadow .3s; }
.acc-item.open { border-color: rgba(21, 101, 192, .4); box-shadow: var(--shadow); }
.acc-item h3 { margin: 0; }
.acc-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%;
    padding: 18px 22px; background: none; border: 0; cursor: pointer; text-align: left;
    font: 600 1rem/1.4 var(--font); color: var(--blue-dark);
}
.acc-btn:hover { color: var(--red); }
.acc-icon { position: relative; flex: 0 0 20px; width: 20px; height: 20px; }
.acc-icon::before, .acc-icon::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; background: currentColor; transform: translate(-50%, -50%); transition: transform .3s; }
.acc-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.acc-btn[aria-expanded="true"] .acc-icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.acc-panel > div { overflow: hidden; }
.acc-panel p { padding: 0 22px 20px; margin: 0; color: var(--muted); }
.acc-item.open .acc-panel { grid-template-rows: 1fr; }

/* ---------- 14. CTA ---------- */
.cta-banner { background: var(--red); color: var(--white); padding: 52px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-banner h2 { color: var(--white); margin-bottom: .2rem; }
.cta-banner p { margin: 0; color: #ffe3e3; }

/* ---------- 15. Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contact-info ul { display: grid; gap: 22px; margin-bottom: 28px; }
.contact-info h3 { margin-bottom: .1rem; font-size: 1rem; }
.contact-info p { margin: 0; color: var(--muted); }
.contact-info a { text-decoration: none; color: var(--muted); }
.contact-info a:hover { color: var(--red); }
.map-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--gray); aspect-ratio: 16 / 10; }
.map-wrap iframe { width: 100%; height: 100%; border: 0; }

.contact-form { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.contact-form h3 { font-size: 1.3rem; margin-bottom: 1.2rem; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .88rem; font-weight: 500; margin-bottom: 6px; }
.field label small { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
    width: 100%; padding: 12px 14px; font: inherit; color: var(--text);
    border: 1.5px solid #cbd5e1; border-radius: 8px; background: var(--white); transition: border-color .25s, box-shadow .25s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21, 101, 192, .18); }
.field.invalid input, .field.invalid textarea { border-color: var(--red); }
.error { display: block; min-height: 1.2em; margin-top: 4px; font-size: .8rem; color: var(--red-dark); }
.form-status { margin: 14px 0 0; font-weight: 500; color: var(--green); }
.form-status:empty { display: none; }

/* ---------- 16. Footer ---------- */
.site-footer { background: #0b1d35; color: #c4d2e4; padding-top: 64px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 44px; }
.footer-brand p { margin-top: 16px; max-width: 280px; }
.site-footer h2 { font-size: 1rem; color: var(--white); margin-bottom: 1rem; }
.site-footer .mt { margin-top: 1.4rem; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #c4d2e4; text-decoration: none; transition: color .25s; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding: 20px 0; font-size: .85rem; }
.footer-bottom p { margin: 0; }

/* ---------- 17. Floating UI ---------- */
.float-call {
    position: fixed; left: 18px; bottom: 18px; z-index: 90; display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 18px; border-radius: 999px; background: var(--red); color: var(--white); font-weight: 600; font-size: .9rem;
    text-decoration: none; box-shadow: 0 8px 22px rgba(211, 47, 47, .45); transition: transform .25s, background-color .25s;
}
.float-call:hover { background: var(--red-dark); transform: translateY(-3px); }
.back-top {
    position: fixed; right: 18px; bottom: 18px; z-index: 90; width: 46px; height: 46px; display: grid; place-items: center;
    border: 0; border-radius: 50%; background: var(--blue); color: var(--white); cursor: pointer; box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .3s, transform .3s, visibility .3s, background-color .25s;
}
.back-top.show { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { background: var(--blue-dark); }

/* ---------- 18. Animations ---------- */
/* Content is visible by default; only hidden when JS is active so no-JS users still see everything. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
}

/* ---------- 19. Responsive ---------- */
@media (max-width: 1080px) {
    .header-call span { display: none; }
    .header-call { padding: 10px; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 960px) {
    .nav-toggle { display: flex; }
    .main-nav {
        position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--white);
        border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(15, 39, 68, .1);
        max-height: 0; overflow: hidden; visibility: hidden; transition: max-height .35s ease, visibility .35s;
    }
    .main-nav.open { max-height: 480px; visibility: visible; }
    .main-nav ul { flex-direction: column; padding: 10px 20px 18px; gap: 0; }
    .nav-link { padding: 12px 4px; border-bottom: 1px solid var(--line); }
    .nav-link::after { display: none; }

    .hero-grid, .split, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
    .hero { min-height: 0; }
    .gallery-grid, .testimonial-grid { grid-template-columns: repeat(2, 1fr); }
    .testimonial-grid .testimonial:last-child { grid-column: 1 / -1; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .media-badge { right: 12px; }
    .timeline { grid-template-columns: 1fr 1fr; row-gap: 36px; }
    .timeline::before { display: none; }
}

@media (max-width: 640px) {
    .section { padding: 60px 0; }
    .gallery-grid, .testimonial-grid, .feature-list, .about-points, .footer-grid, .timeline { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stats-grid .stat:last-child { grid-column: 1 / -1; }
    .hero-actions .btn { flex: 1 1 100%; }
    .contact-form { padding: 24px 20px; }
    .cta-inner { flex-direction: column; text-align: center; }
    .brand-text { font-size: .8rem; }
    .float-call span { display: none; }
    .float-call { padding: 14px; }
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.brand-logo {
    display: inline-block;
}

.logo-img {
    width: 180px;      /* Adjust according to your logo */
    height: auto;
    display: block;
    object-fit: contain;
}

.footer-brand p {
    margin: 0;
    color: #ccc;
    line-height: 1.6;
}
