/**
 * Emergency Dentist page - Ogilvie Dental
 *
 * Page-specific additions on top of services.css. Everything here reuses the
 * --svc-* tokens and the site palette; the only new colour is a single
 * warning red for the 911 panel, chosen for 4.5:1+ contrast on white and
 * on its own tint.
 *
 * Loaded only by /emergency-dentist-ottawa.
 */

.emg-hero,
.emg-911,
#dental-emergencies,
#what-to-expect,
#contact-details {
    --emg-red: #B42318;
    --emg-red-soft: #FEF3F2;
    --emg-red-line: #FECDCA;
    --emg-olive: #5F6B0E;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

/* The lime highlight is ~1.9:1 on white, below the 3:1 WCAG minimum for
   large text. Use the darker olive the service pages already use for labels. */
.emg-hero .text-highlight {
    color: var(--emg-olive);
}

.emg-hero .svc-hero__title {
    max-width: 18ch;
}

.emg-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: var(--svc-ink-muted);
}

.emg-breadcrumb li + li::before {
    content: "/";
    margin-right: 0.35rem;
    color: var(--svc-line);
}

.emg-breadcrumb a {
    color: var(--emg-olive);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.emg-hero-alert {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin: 1.5rem 0 0;
    padding: 0.9rem 1.1rem;
    max-width: 58ch;
    background: var(--emg-red-soft);
    border: 1px solid var(--emg-red-line);
    border-left: 4px solid var(--emg-red);
    border-radius: var(--svc-radius-sm);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--svc-ink);
}

.emg-hero-alert i {
    margin-top: 0.25em;
    color: var(--emg-red);
}

.emg-hero-alert a {
    color: var(--emg-red);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* The storefront photo is very wide (1920x680). A 4:3 crop loses the practice
   sign, so use a wider frame and keep the sign and entrance in view. */
.emg-media img {
    aspect-ratio: 16 / 10;
    object-position: 50% 40%;
}

/* --------------------------------------------------------------------------
   911 panel
   -------------------------------------------------------------------------- */

.emg-911 {
    padding-top: clamp(2.5rem, 5vw, 4rem);
    padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.emg-alert {
    max-width: 960px;
    margin: 0 auto;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    background: var(--emg-red-soft);
    border: 1px solid var(--emg-red-line);
    border-top: 5px solid var(--emg-red);
    border-radius: var(--svc-radius-md);
}

.emg-alert__head {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.emg-alert__icon {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--emg-red);
    color: #FFFFFF;
    font-size: 1.25rem;
}

.emg-alert h2 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.65rem);
    line-height: 1.3;
    letter-spacing: -0.4px;
    color: var(--svc-ink);
}

.emg-alert p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--svc-ink-soft);
}

.emg-alert__list {
    display: grid;
    gap: 0.6rem;
    margin: 1.5rem 0;
    padding: 0;
    list-style: none;
}

.emg-alert__list li {
    position: relative;
    padding-left: 1.6rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--svc-ink);
}

.emg-alert__list li::before {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 0.55em;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--emg-red);
}

.emg-alert__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: center;
    padding-top: 1.25rem;
    border-top: 1px solid var(--emg-red-line);
}

.emg-alert__actions p {
    flex: 1 1 320px;
    font-size: 0.95rem;
}

.emg-alert__actions a:not(.btn) {
    color: var(--emg-red);
    font-weight: 600;
    text-decoration: underline;
}

.btn.emg-btn-911 {
    background: var(--emg-red);
    border-color: var(--emg-red);
    color: #FFFFFF;
    border-radius: 999px;
    padding: 0.85rem 1.75rem;
    min-height: 48px;
}

.btn.emg-btn-911:hover {
    background: #912018;
    border-color: #912018;
}

@media (min-width: 900px) {
    .emg-alert__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 2rem;
    }
}

/* --------------------------------------------------------------------------
   Jump links + first-aid cards
   -------------------------------------------------------------------------- */

.emg-jump ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 clamp(1.75rem, 3vw, 2.5rem);
    padding: 0;
    list-style: none;
}

.emg-jump a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.45rem 1rem;
    border: 1px solid var(--svc-line);
    border-radius: 999px;
    background: var(--svc-surface);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--svc-ink);
    box-shadow: var(--svc-shadow-sm);
}

.emg-jump a:hover,
.emg-jump a:focus-visible {
    border-color: var(--svc-lime);
    background: var(--svc-lime-soft);
}

.emg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 1.25rem;
}

.emg-card {
    padding: clamp(1.4rem, 2.5vw, 1.85rem);
    background: var(--svc-surface);
    border: 1px solid var(--svc-line);
    border-radius: var(--svc-radius-md);
    box-shadow: var(--svc-shadow-sm);
    scroll-margin-top: 160px;
}

.emg-card--urgent {
    border-color: var(--emg-red-line);
    border-top: 4px solid var(--emg-red);
}

.emg-card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border-radius: 14px;
    background: var(--svc-lime-soft);
    border: 1px solid var(--svc-lime-line);
    color: #6E7D11;
    font-size: 1.2rem;
}

.emg-card--urgent .emg-card__icon {
    background: var(--emg-red-soft);
    border-color: var(--emg-red-line);
    color: var(--emg-red);
}

.emg-card .emg-card__icon--first-aid {
    background: var(--emergency-red, #DC2626);
    border-color: var(--emergency-red, #DC2626);
    color: #FFFFFF;
}

.emg-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.2px;
    color: var(--svc-ink);
}

.emg-card h4 {
    margin: 1.15rem 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--svc-ink-muted);
}

.emg-card p {
    margin: 0;
    font-size: 0.975rem;
    line-height: 1.7;
    color: var(--svc-ink-soft);
}

.emg-card__lead {
    color: var(--svc-ink-soft);
}

.emg-card a {
    color: var(--emg-olive);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.emg-steps,
.emg-avoid {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.emg-steps li,
.emg-avoid li {
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.975rem;
    line-height: 1.6;
    color: var(--svc-ink-soft);
}

/* Tick / cross drawn in CSS so meaning is carried by the "What to do" /
   "Avoid" headings, not by colour alone. */
.emg-steps li::before,
.emg-avoid li::before {
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
}

.emg-steps li::before {
    content: "\2713";
    color: #6E7D11;
}

.emg-avoid li::before {
    content: "\2715";
    color: var(--emg-red);
}

.emg-card__more {
    margin-top: 1.15rem !important;
    padding-top: 1rem;
    border-top: 1px solid var(--svc-line-soft);
}

.emg-card__warn i {
    color: var(--emg-red);
    margin-right: 0.3rem;
}

/* --------------------------------------------------------------------------
   Steps (h3 inside the shared step list) + inline links
   -------------------------------------------------------------------------- */

.emg-ol {
    list-style: none;
    padding: 0;
}

.emg-ol .step-item h3 {
    margin: 0.3rem 0 0.5rem;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--svc-ink);
}

.emg-ol .step-item a,
#what-to-expect .svc-note a,
#dental-emergencies .svc-note a {
    color: var(--emg-olive);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Contact panel
   -------------------------------------------------------------------------- */

.emg-contact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 1.25rem;
    max-width: 1000px;
    margin: 0 auto;
}

.emg-contact__list {
    display: grid;
    gap: 1.1rem;
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
}

.emg-contact__list li {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--svc-ink-soft);
}

.emg-contact__list i {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--svc-lime-soft);
    color: #6E7D11;
}

.emg-contact__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--svc-ink-muted);
}

.emg-contact__list address {
    font-style: normal;
    color: var(--svc-ink);
}

.emg-contact__list a,
.emg-contact__fine a {
    color: var(--emg-olive);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}

.emg-contact__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.emg-contact__actions .btn {
    border-radius: 999px;
}

.emg-contact__fine {
    margin: 1.25rem 0 0;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--svc-ink-soft);
}

.emg-hours {
    width: 100%;
    border-collapse: collapse;
}

.emg-hours th,
.emg-hours td {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--svc-line-soft);
    font-size: 1rem;
    text-align: left;
}

.emg-hours th {
    font-weight: 600;
    color: var(--svc-ink);
}

.emg-hours td {
    text-align: right;
    color: var(--svc-ink-soft);
}

.visually-hidden-emg {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Focus visibility for every link and button on this page
   -------------------------------------------------------------------------- */

main a:focus-visible,
main .btn:focus-visible,
.emg-callbar:focus-visible {
    outline: 3px solid #0A0A0A;
    outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Sticky call bar (phones only)
   -------------------------------------------------------------------------- */

.emg-callbar {
    display: none;
}

@media (max-width: 768px) {
    .emg-callbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 998;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.6rem;
        min-height: 56px;
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
        background: var(--primary-lime, #B6CC23);
        color: #000000;
        font-weight: 700;
        font-size: 1.05rem;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
    }

    /* Keep the footer and the back-to-top button clear of the bar. */
    body {
        padding-bottom: 56px;
    }

    .back-to-top {
        bottom: 76px !important;
    }

    .emg-contact__actions .btn {
        width: 100%;
        min-height: 52px;
    }

    .btn.emg-btn-911 {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .emg-alert__head {
        flex-direction: column;
    }

    .emg-hero-alert {
        font-size: 0.925rem;
    }
}

@media print {
    .emg-callbar,
    .emg-jump {
        display: none;
    }

    .emg-card,
    .emg-alert {
        break-inside: avoid;
        box-shadow: none;
    }
}
