/* ==========================================================================
   Frederick Healthcare — components
   Buttons, forms, cards, chips, tables, accordion, dialog, header, footer.
   ========================================================================== */

/* ---------- buttons ---------- */
.btn {
    --btn-h: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: var(--btn-h);
    padding-inline: var(--space-6);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .18s var(--ease), border-color .18s var(--ease),
                color .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-xs); }
.btn--primary:hover { background: var(--brand-700); color: #fff; }

.btn--secondary { background: #fff; color: var(--brand-700); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--brand-600); color: var(--brand-700); background: var(--brand-50); }

.btn--ghost { background: transparent; color: var(--brand-600); padding-inline: var(--space-3); }
.btn--ghost:hover { background: var(--brand-50); }

.btn--on-brand { background: #fff; color: var(--brand-700); }
.btn--on-brand:hover { background: var(--brand-50); color: var(--brand-800); }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn--outline-light:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: #fff; }

.btn--sm { --btn-h: 38px; padding-inline: var(--space-4); font-size: var(--text-caption); }
.btn--lg { --btn-h: 54px; padding-inline: var(--space-8); font-size: var(--text-base); }
.btn--block { width: 100%; }

/* text link with chevron */
.link-arrow {
    display: inline-flex; align-items: center; gap: var(--space-2);
    font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm);
    color: var(--brand-600);
}
.link-arrow svg { width: 16px; height: 16px; transition: transform .18s var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field > label, .label {
    font-family: var(--font-heading);
    font-size: var(--text-caption);
    font-weight: 700;
    color: var(--navy-800);
    letter-spacing: .01em;
}
.label .req { color: var(--danger); }
.input, .select, .textarea {
    width: 100%;
    min-height: 48px;
    padding: 0 var(--space-4);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--navy-800);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.textarea { min-height: 148px; padding: var(--space-3) var(--space-4); resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--brand-300); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px rgba(0, 88, 176, .14);
}
.select {
    appearance: none;
    padding-right: var(--space-10);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M5 7.5l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right var(--space-4) center;
    background-size: 18px;
    cursor: pointer;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: var(--space-10); }
.input-group > svg {
    position: absolute; left: var(--space-4);
    width: 18px; height: 18px; color: var(--ink-400); pointer-events: none;
}

.check { display: flex; align-items: center; gap: var(--space-3); cursor: pointer; font-size: var(--text-sm); color: var(--ink-600); }
.check input {
    appearance: none; flex: none;
    width: 18px; height: 18px;
    border: 1.5px solid var(--line-strong);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.check:hover input { border-color: var(--brand-500); }
.check input:checked {
    background: var(--brand-600) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3.5 8.4l3 3 6-6.6' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 80% no-repeat;
    border-color: var(--brand-600);
}

/* ---------- cards ---------- */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
.card--pad { padding: var(--space-6); }
.card--hover { transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
.card--hover:hover { border-color: var(--brand-200); box-shadow: var(--shadow-md); transform: translateY(-3px); }

.icon-circle {
    display: grid; place-items: center; flex: none;
    width: 56px; height: 56px;
    border-radius: var(--radius-pill);
    background: var(--brand-50);
}
.icon-circle img { width: 30px; height: 30px; object-fit: contain; }
.icon-circle--lg { width: 72px; height: 72px; }
.icon-circle--lg img { width: 38px; height: 38px; }

/* feature / value card */
.feature { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6); }
.feature h3 { font-size: var(--text-xl); }
.feature p { color: var(--ink-600); font-size: var(--text-sm); }

/* stat */
.stat { display: flex; align-items: center; gap: var(--space-4); }
.stat-value { font-family: var(--font-heading); font-size: var(--text-3xl); font-weight: 700; color: var(--brand-700); line-height: 1.1; letter-spacing: -0.02em; }
.stat-label { font-size: var(--text-sm); color: var(--ink-600); }

/* badge / tag */
.tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: var(--text-caption);
    font-weight: 700;
}
.tag--new { background: var(--brand-600); color: #fff; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; }

/* ---------- chips (filters) ---------- */
.chip {
    display: inline-flex; align-items: center; gap: var(--space-2);
    height: 40px; padding-inline: var(--space-5);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: #fff;
    color: var(--brand-700);
    font-family: var(--font-heading); font-weight: 700; font-size: var(--text-sm);
    cursor: pointer; white-space: nowrap;
    transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.chip:hover { border-color: var(--brand-500); background: var(--brand-50); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

.chip--letter { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: var(--radius-pill); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.table { min-width: 640px; }
.table th, .table td { text-align: left; padding: var(--space-4) var(--space-5); }
.table thead th {
    font-family: var(--font-heading); font-size: var(--text-caption); font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em; color: var(--ink-500);
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table tbody tr + tr td { border-top: 1px solid var(--line); }
.table tbody tr { transition: background-color .15s var(--ease); }
.table tbody tr:hover { background: var(--brand-50); }
.table td { font-size: var(--text-sm); color: var(--ink-700); }
.table td:first-child { font-weight: 700; color: var(--navy-800); }

/* ---------- accordion ---------- */
.accordion { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }
.accordion-item + .accordion-item { border-top: 1px solid var(--line); }
.accordion-trigger {
    width: 100%;
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    background: none; border: 0; cursor: pointer; text-align: left;
    font-family: var(--font-heading); font-weight: 700; font-size: var(--text-base); color: var(--navy-800);
    transition: background-color .15s var(--ease);
}
.accordion-trigger:hover { background: var(--bg-subtle); }
.accordion-trigger svg { width: 20px; height: 20px; color: var(--brand-600); transition: transform .2s var(--ease); flex: none; }
.accordion-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.accordion-panel { padding: 0 var(--space-6) var(--space-5); color: var(--ink-600); font-size: var(--text-sm); max-width: 78ch; }

/* ---------- dialog ---------- */
.dialog { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-start; justify-content: center; padding: var(--space-6); overflow-y: auto; }
.dialog-backdrop { position: fixed; inset: 0; background: rgba(11, 31, 63, .55); backdrop-filter: blur(2px); }
.dialog-panel {
    position: relative;
    width: min(960px, 100%);
    margin-top: clamp(0px, 5vh, 72px);
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}
.dialog-close {
    position: absolute; top: var(--space-5); right: var(--space-5);
    width: 40px; height: 40px; display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: var(--radius-pill);
    background: #fff; color: var(--navy-800); cursor: pointer;
    transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.dialog-close:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
body.is-locked { overflow: hidden; }

/* ---------- header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: var(--space-6); height: var(--header-h); }

.brand { display: flex; align-items: center; gap: var(--space-3); flex: none; }
.brand__mark { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; }
.brand__text { display: flex; flex-direction: column; gap: 3px; }
.brand__name { font-family: var(--font-heading); font-weight: 700; font-size: 1.0625rem; color: var(--navy-900); line-height: 1.1; letter-spacing: -0.01em; }
.brand__tagline {
    align-self: flex-start;
    background: var(--teal-700); color: #fff;
    font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    padding: 2px 8px; border-radius: var(--radius-pill); line-height: 1.5;
}

.site-nav { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.site-nav__link {
    position: relative;
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-heading); font-weight: 600; font-size: var(--text-sm);
    color: var(--ink-700);
    border-radius: var(--radius-sm);
    transition: color .18s var(--ease);
}
.site-nav__link::after {
    content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: 2px;
    height: 2px; border-radius: 2px; background: var(--brand-600);
    transform: scaleX(0); transform-origin: 50%;
    transition: transform .2s var(--ease);
}
.site-nav__link:hover { color: var(--brand-700); }
.site-nav__link:hover::after, .site-nav__link[aria-current="page"]::after { transform: scaleX(1); }
.site-nav__link[aria-current="page"] { color: var(--brand-700); }

.header-actions { display: flex; align-items: center; gap: var(--space-3); flex: none; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
.nav-toggle__bar { display: block; width: 18px; height: 2px; margin: 3px auto; background: var(--navy-800); border-radius: 2px; transition: transform .2s var(--ease), opacity .2s var(--ease); }
.site-header.is-open .nav-toggle__bar:nth-of-type(2) { transform: translateY(5px) rotate(45deg); }
.site-header.is-open .nav-toggle__bar:nth-of-type(3) { opacity: 0; }
.site-header.is-open .nav-toggle__bar:nth-of-type(4) { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 1024px) {
    :root { --header-h: 68px; }
    .nav-toggle { display: block; }
    .site-nav {
        position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: 0;
        background: #fff; border-bottom: 1px solid var(--line);
        padding: var(--space-3) var(--gutter) var(--space-5);
        box-shadow: var(--shadow-md);
        display: none;
    }
    .site-header.is-open .site-nav { display: flex; }
    .site-nav__link { padding: var(--space-4) var(--space-2); font-size: var(--text-base); border-bottom: 1px solid var(--line); border-radius: 0; }
    .site-nav__link::after { display: none; }
    .site-nav__link[aria-current="page"] { color: var(--brand-700); }
    /* keep the lockup from pushing the actions off-screen on narrow phones */
    .site-header__inner { gap: var(--space-3); }
    .brand { flex: 0 1 auto; min-width: 0; }
    .brand__text { min-width: 0; }
    .brand__name { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .header-actions { margin-left: auto; }
    .header-actions .btn span { display: none; }
    .header-actions .btn { padding-inline: 0; width: 44px; }
}
@media (max-width: 430px) {
    .brand__mark { width: 36px; height: 36px; }
    .brand__name { font-size: 0.8125rem; }
    .brand__tagline { font-size: 8px; padding: 1px 6px; letter-spacing: .08em; }
    .nav-toggle, .header-actions .btn { width: 40px; --btn-h: 40px; height: 40px; padding-inline: 0; }
}

/* ---------- footer ---------- */
.site-footer { background: var(--navy-900); color: #c3d0e2; font-size: var(--text-sm); }
.site-footer a { color: #c3d0e2; }
.site-footer a:hover { color: #fff; }
.site-footer__top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: var(--space-10); padding-block: var(--space-16) var(--space-12); }
.site-footer h4 { color: #fff; font-size: var(--text-caption); text-transform: uppercase; letter-spacing: .12em; margin-bottom: var(--space-4); }
.site-footer .brand__name { color: #fff; }
.site-footer li + li { margin-top: var(--space-2); }
.footer-contact li { display: flex; gap: var(--space-3); align-items: flex-start; }
.footer-contact svg { width: 16px; height: 16px; flex: none; margin-top: 4px; color: var(--brand-300); }
.footer-social { display: flex; gap: var(--space-3); margin-top: var(--space-5); }
.footer-social a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, .08); transition: background-color .18s var(--ease), transform .18s var(--ease); }
.footer-social a:hover { background: var(--brand-600); transform: translateY(-2px); }
.footer-social img { width: 18px; height: 18px; object-fit: contain; }
.site-footer__bottom {
    display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: center;
    padding-block: var(--space-5);
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: var(--text-caption);
}
.site-footer__legal { display: flex; flex-wrap: wrap; gap: var(--space-5); }
@media (max-width: 960px) {
    .site-footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); padding-block: var(--space-12) var(--space-8); }
}
@media (max-width: 600px) {
    .site-footer__top { grid-template-columns: 1fr; }
}

/* ---------- page header (inner pages) ---------- */
.page-header { background: var(--bg-brand-subtle); border-bottom: 1px solid var(--line); padding-block: clamp(2.5rem, 1.5rem + 3vw, 4rem); }
.page-header .breadcrumb { display: flex; flex-wrap: wrap; gap: var(--space-2); font-size: var(--text-caption); color: var(--ink-500); margin-bottom: var(--space-4); }
.page-header .breadcrumb a { color: var(--ink-500); }
.page-header .breadcrumb a:hover { color: var(--brand-700); }
.page-header h1 { max-width: 20ch; }
.page-header .lead { margin-top: var(--space-4); max-width: 65ch; }
