/* Shared stylesheet for every page. */

:root {
    --panel-sub: rgba(0, 0, 0, 0.4);   /* original panel darkness — keep */
    --panel-home: rgba(0, 0, 0, 0.3);  /* original panel darkness — keep */
    --line: rgba(255, 255, 255, 0.22);
    --line-strong: rgba(255, 255, 255, 0.45);
    --green: #1b5e20;                  /* white on this green is ~8:1 */
    --green-hover: #2e7d32;
    --green-current: #0d3311;
    --accent: #a5d6a7;
    --link: #cfe8ff;
    --radius: 18px;
    --radius-sm: 12px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;   /* no text inflation when a phone is rotated */
    text-size-adjust: 100%;
    background-color: #2b2b2b; /* shown while the photo loads */
    background-image: url('ecmc2.jpg');
    background-image: image-set(url('ecmc2.webp') type('image/webp'), url('ecmc2.jpg') type('image/jpeg'));
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Smaller photo on phones; fixed backgrounds are janky/ignored on mobile browsers. */
@media (max-width: 700px) {
    body {
        background-image: url('ecmc2-small.jpg');
        background-image: image-set(url('ecmc2-small.webp') type('image/webp'), url('ecmc2-small.jpg') type('image/jpeg'));
        background-attachment: scroll;
    }
}
@supports (-webkit-touch-callout: none) { /* iOS/iPadOS */
    body { background-attachment: scroll; }
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: clamp(16px, 4vw, 40px) 16px 32px;
}

/* Floating panel behind the text. A soft text shadow keeps white text legible
   without darkening the panel. */
.main-message {
    width: 100%;
    max-width: 56rem;
    padding: clamp(20px, 4vw, 40px) clamp(18px, 5vw, 48px);
    background-color: var(--panel-sub);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    text-align: left;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.home .main-message { text-align: center; background-color: var(--panel-home); }

/* ---------- Header ---------- */
.site-header {
    text-align: center;
    padding-bottom: 20px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.clinic-name, .home h1 {
    font-size: clamp(1.7rem, 4.5vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 14px;
}
.contact {
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0 0 8px;
}
.contact [data-hotdoc-button] { display: inline-block; margin: 4px 0 4px 12px; }
.contact-detail {
    font-weight: 500;
    font-size: 0.95rem;
    margin: 4px 0;
    opacity: 0.95;
}

/* ---------- Headings ---------- */
h1 { font-size: 2rem; line-height: 1.2; margin: 0.6em 0; }
h2 { font-size: 1.25rem; line-height: 1.3; }

.page-title {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: left;
    width: fit-content;   /* so the bar below spans exactly the title text */
    max-width: 100%;
    margin: 20px 0 22px;
}
.page-title::after {
    content: "";
    display: block;
    width: 100%;
    height: 4px;
    margin-top: 10px;
    border-radius: 2px;
    background: var(--accent);
}

/* ---------- Links ---------- */
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #ffffff; text-decoration-thickness: 2px; }

/* ---------- Home page ---------- */
.notice {
    display: inline-block;
    margin: 20px 0 8px;
    padding: 14px 24px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-sm);
    font-size: clamp(1.1rem, 2.6vw, 1.4rem);
    font-weight: 700;
    font-style: italic;
    line-height: 1.45;
}
.home main h2 {
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    margin: 24px 0 6px;
}
.note { font-style: italic; margin: 10px auto; max-width: 40rem; }

/* ---------- Content items (cards) ---------- */
.item-info {
    margin-bottom: 14px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.item-name {
    font-weight: 700;
    font-size: 1.12rem;
    letter-spacing: 0.01em;
    margin: 0 0 6px;
}
.item-qualification { font-style: italic; font-weight: 400; font-size: 0.95rem; opacity: 0.9; }
.item_discription, .item-experience { margin: 0; }

/* Health information list */
main > ul:not(.fee-notes) { list-style: none; padding: 0; margin: 0; }
main > ul:not(.fee-notes) > li.item-name {
    font-size: 1.02rem;
    font-weight: 600;
    margin: 0 0 10px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow-wrap: anywhere;
}

.fee-notes { font-weight: 600; padding-left: 1.2em; margin: 0 0 8px; }
.fee-notes li { margin-bottom: 6px; }
.fee-notes li::marker { color: var(--accent); }

/* Grouped listings (e.g. abc.html): section heading > item cards > detail lines. */
.section-title {
    font-size: 1.2rem;
    letter-spacing: 0.01em;
    color: var(--accent);
    margin: 28px 0 12px;
}
.item-info h3.item-name { font-size: 1.1rem; }
.detail { margin: 3px 0; overflow-wrap: anywhere; }
.detail-label { font-weight: 600; opacity: 0.85; }

/* ---------- Navigation ---------- */
nav { width: 100%; max-width: 56rem; }
.sub-pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}
.sub-page-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 20px;
    color: #ffffff;
    background-color: var(--green);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    font-size: 0.98rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.sub-page-link:hover { background-color: var(--green-hover); color: #ffffff; }
@media (hover: hover) { /* lift only with a real pointer, so taps don't leave buttons "stuck" */
    .sub-page-link:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3); }
}
.sub-page-link[aria-current="page"] { background-color: var(--green-current); }

a:focus-visible, button:focus-visible {
    outline: 3px solid #ffd54f;
    outline-offset: 2px;
}

/* ---------- Fees table ---------- */
.table-wrap {
    overflow-x: auto;
    margin: 20px 0 4px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
}
table {
    border-collapse: collapse;
    width: 100%;
    min-width: 32rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
}
th, td {
    text-align: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}
thead th, thead td {
    font-size: 0.95rem;
    border-bottom: 1px solid var(--line-strong);
}
tbody th { font-weight: 500; text-align: left; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background-color: rgba(255, 255, 255, 0.05); }

/* ---------- Skip link ---------- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 10;
}
.skip-link:focus { left: 8px; }

/* ---------- Phones and small tablets ---------- */
@media (max-width: 700px) {
    .container { padding: 12px 10px 0; }
    .main-message { padding: 20px 16px 22px; border-radius: 14px; }
    .site-header { padding-bottom: 16px; }

    /* Phone number becomes an easy-to-tap call button. */
    .contact a[href^="tel:"] {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 16px;
        margin: 2px 0;
        border: 1px solid var(--line-strong);
        border-radius: 999px;
        font-size: 1.1rem;
        text-decoration: none;
    }
    .contact [data-hotdoc-button] { margin-left: 6px; }

    .page-title { margin: 16px 0 18px; }
    .item-info { padding: 12px 14px; margin-bottom: 10px; }
    main > ul:not(.fee-notes) > li.item-name { padding: 12px 14px; }
    .section-title { margin: 22px 0 10px; }
    .detail a[href^="http"] { font-size: 0.85em; }

    /* Site navigation stays within reach: a slim bar pinned to the bottom of
       the screen. Buttons wrap onto extra rows so every one is always visible. */
    nav {
        position: sticky;
        bottom: 0;
        z-index: 5;
        width: calc(100% + 20px);
        max-width: none;
        margin: 16px -10px 0;
        padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
        background-color: rgba(0, 0, 0, 0.55);
        border-top: 1px solid var(--line);
    }
    .sub-pages {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        margin: 0;
        padding: 0 8px;
    }
    .sub-page-link {
        min-height: 40px;
        padding: 6px 11px;
        font-size: 0.875rem;
        white-space: nowrap;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    .notice { padding: 12px 16px; }
    table { font-size: 0.8rem; min-width: 0; }
    thead th, thead td { font-size: 0.72rem; }
    th, td { padding: 7px 4px; }
}

@media (prefers-reduced-motion: reduce) {
    .sub-page-link { transition: none; }
    .sub-page-link:hover { transform: none; }
}
