/* Shared header and footer for all Jayam Hospital pages. */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --frame-teal: #087c70;
    --frame-ink: #183f43;
    --frame-orange: #fb7f20;
}

body {
    color: var(--frame-ink);
    background: #fff;
    font-family: Arial, Helvetica, sans-serif;
}

html { scroll-padding-top: 100px; }

nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    height: 80px;
    padding: 0 clamp(16px, 2vw, 40px);
    background: #fff;
    border-bottom: 1px solid #deece8;
    box-shadow: 0 4px 24px rgb(24 63 67 / 7%);
}

nav > div:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

nav > div > img {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 12px;
}

.hline { min-width: 0; }

.hline h1 {
    color: var(--frame-teal);
    font-size: 25px;
    line-height: 1.2;
    letter-spacing: -0.6px;
}

.hline h2 {
    max-width: 280px;
    margin-top: 5px;
    color: #586e71;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
}

nav .popbox { flex-shrink: 0; }

nav .popbox > ul {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

nav .popbox li { list-style: none; }

nav .popbox li > a {
    display: block;
    padding: 13px 10px;
    border-radius: 9px;
    color: #29494b;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 160ms ease, color 160ms ease;
}

nav .popbox li > a:hover {
    background: #edf8f4;
    color: #07685e;
}

nav .popbox li > a.active {
    background: #fff0e2;
    color: #913e08;
}

nav :is(#book, #booking-nav) {
    margin-left: 8px;
    padding: 14px 18px;
    background: var(--frame-teal);
    color: #fff;
    box-shadow: 0 4px 12px rgb(8 124 112 / 16%);
}

nav :is(#book, #booking-nav):hover { background: #065e55; }

nav .menu,
nav .close {
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1px solid #d7e9e3;
    border-radius: 10px;
    background: #eff8f5;
    color: var(--frame-teal);
    font: inherit;
    font-size: 26px;
    cursor: pointer;
}

nav .menu:hover,
nav .close:hover { background: #dff1eb; }

nav a:focus-visible,
nav button:focus-visible,
footer a:focus-visible,
.band a:focus-visible {
    outline: 3px solid var(--frame-orange);
    outline-offset: 4px;
}

footer {
    display: grid;
    grid-template-columns: 1.2fr 0.65fr 1fr 1fr;
    gap: clamp(24px, 3vw, 48px);
    padding: 56px max(24px, calc((100% - 1240px) / 2));
    background: linear-gradient(120deg, #124942, #083a37);
    border-top: 4px solid #029e90;
    color: #e2f0ec;
    font-size: 14px;
    line-height: 1.8;
}

footer > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

footer h3 {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 12px;
    color: #fff;
    font-size: 19px;
    line-height: 1.4;
}

footer h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 32px;
    height: 3px;
    border-radius: 3px;
    background: #ffad6e;
}

footer > div > img {
    width: 88px;
    height: auto;
    margin-bottom: 20px;
    padding: 6px;
    background: #fff;
    border-radius: 14px;
}

footer p { line-height: 1.9; }
footer li { list-style: none; margin-bottom: 6px; }

footer a {
    display: inline-block;
    padding-block: 4px;
    color: #e2f0ec;
    text-decoration: none;
    overflow-wrap: anywhere;
}

footer a:hover {
    color: #ffc393;
    text-decoration: underline;
    text-underline-offset: 4px;
}

footer address {
    margin-bottom: 14px;
    font-style: normal;
}

footer address ~ h3 { margin-top: 24px; }

footer iframe {
    display: block;
    width: 100%;
    height: 240px;
    border: 0;
    border-radius: 14px;
    background: #e2f0ec;
}

footer .soc {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

footer .soc a {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 8px;
    background: #fff;
    border-radius: 10px;
}

footer .soc a:hover { background: #ffead9; }
footer .soc img { display: block; width: 26px; height: 26px; object-fit: contain; }

.band {
    padding: 18px 24px;
    border-top: 1px solid #315955;
    background: #072f2c;
    color: #d3e4df;
    text-align: center;
    font-size: 13px;
    line-height: 1.7;
}

.band a { color: #ffc393; text-decoration: none; }
.band a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Override frame.js's inline display after resizing from a closed mobile menu. */
@media (min-width: 1201px) {
    nav .popbox { display: block !important; }
}

@media (max-width: 1200px) {
    nav .menu { display: flex; }

    nav .popbox {
        display: none;
        position: absolute;
        top: 88px;
        right: 16px;
        width: min(360px, calc(100% - 32px));
        max-height: calc(100vh - 104px);
        max-height: calc(100dvh - 104px);
        overflow-y: auto;
        padding: 64px 18px 18px;
        background: #fff;
        border: 1px solid #d7e9e3;
        border-radius: 18px;
        box-shadow: 0 16px 48px rgb(24 63 67 / 18%);
    }

    nav .popbox > ul { flex-direction: column; align-items: stretch; gap: 4px; }
    nav .popbox li > a { padding: 14px 16px; }
    nav :is(#book, #booking-nav) { margin: 8px 0 0; text-align: center; }

    nav .close {
        display: flex;
        position: absolute;
        top: 12px;
        right: 18px;
        font-size: 18px;
    }
}

@media (max-width: 1000px) {
    footer { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }
}

@media (max-width: 600px) {
    nav { gap: 10px; padding-inline: 12px; }
    nav > div:first-child { gap: 8px; }
    nav > div > img { flex-basis: 48px; width: 48px; height: 48px; }
    .hline h1 { font-size: 20px; letter-spacing: -0.4px; }
    .hline h2 { max-width: 240px; font-size: 10px; line-height: 1.3; }
    footer { grid-template-columns: minmax(0, 1fr); padding: 36px 20px; gap: 32px; }
    footer iframe { height: 220px; }
    .band { padding: 16px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    nav .popbox li > a { transition: none; }
}
