/* ==========================================================================
   BenhVienTheme — root variables, reset and base layout.
   Component styles live in css/components/*.css, page styles in css/pages/*.css.
   ========================================================================== */

:root {
    --bv-primary: #0f766e;
    --bv-primary-dark: #0b5750;
    --bv-primary-light: #ccfbf1;
    --bv-secondary: #16a34a;
    --bv-secondary-light: #dcfce7;
    --bv-background: #f7faf9;
    --bv-surface: #ffffff;
    --bv-text: #0f2422;
    --bv-text-muted: #5b6b69;
    --bv-border: #dfe7e5;
    --bv-danger: #dc2626;
    --bv-danger-light: #fee2e2;
    --bv-success: #16a34a;
    --bv-radius-sm: 8px;
    --bv-radius-md: 14px;
    --bv-radius-lg: 22px;
    --bv-shadow-sm: 0 1px 2px rgba(15, 36, 34, 0.06);
    --bv-shadow-md: 0 8px 24px rgba(15, 36, 34, 0.08);
    --bv-max-width: 1200px;
    --bv-header-offset: 80px;
}

[data-pagination-results] {
    scroll-margin-top: calc(var(--bv-header-offset) + 16px);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bv-background);
    color: var(--bv-text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

img, svg {
    max-width: 100%;
    display: block;
}

a {
    color: var(--bv-primary-dark);
}

h1, h2, h3, h4 {
    line-height: 1.25;
    margin: 0 0 8px;
    color: var(--bv-text);
}

p {
    margin: 0 0 8px;
    color: var(--bv-text-muted);
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Accessibility ────────────────────────────────────────────────────── */

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

.bv-skip-link {
    position: absolute;
    top: -48px;
    left: 12px;
    z-index: 100;
    padding: 12px 18px;
    background: var(--bv-primary-dark);
    color: #fff;
    border-radius: var(--bv-radius-sm);
    text-decoration: none;
    transition: top 0.15s ease;
}

.bv-skip-link:focus {
    top: 12px;
}

:focus-visible {
    outline: 3px solid var(--bv-primary);
    outline-offset: 2px;
}

/* ── Layout ───────────────────────────────────────────────────────────── */

.bv-main {
    max-width: var(--bv-max-width);
    margin: 0 auto;
    padding: 24px 16px 64px;
}

.bv-section {
    margin-top: 40px;
}

.bv-section-title {
    margin-bottom: 20px;
}

.bv-section-title h2 {
    font-size: 1.5rem;
}

.bv-section-title__desc {
    max-width: 640px;
}

.bv-section__more {
    display: inline-block;
    margin-top: 16px;
    font-weight: 600;
    text-decoration: none;
}

.bv-eyebrow {
    margin: 0 0 6px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bv-primary);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.bv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: var(--bv-radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bv-btn--primary {
    background: var(--bv-primary);
    color: #fff;
}

.bv-btn--primary:hover {
    background: var(--bv-primary-dark);
}

.bv-btn--secondary {
    background: var(--bv-surface);
    border-color: var(--bv-border);
    color: var(--bv-text);
}

.bv-btn--secondary:hover {
    border-color: var(--bv-primary);
    color: var(--bv-primary-dark);
}

.bv-btn.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

/* ── Shared bits used across pages ───────────────────────────────────── */

.bv-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.bv-card-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.bv-tag-list, .bv-detail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bv-detail-list {
    flex-direction: column;
    gap: 6px;
}

.bv-tag-list li {
    background: var(--bv-primary-light);
    color: var(--bv-primary-dark);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.875rem;
}

.bv-flag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bv-secondary-light);
    color: #14532d;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 4px 8px 0 0;
}

.bv-flag--emergency {
    background: var(--bv-danger-light);
    color: var(--bv-danger);
}

.bv-emergency-alert {
    background: var(--bv-danger-light);
    border: 1px solid #fecaca;
    border-radius: var(--bv-radius-md);
    padding: 20px;
    margin-top: 24px;
}

.bv-emergency-alert h3 {
    color: var(--bv-danger);
}

.bv-emergency-alert--compact {
    margin: 24px 0;
}

.bv-seo-content {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--bv-border);
}

.bv-detail-block {
    margin-bottom: 28px;
}

.bv-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.bv-detail-table td, .bv-detail-table th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--bv-border);
    text-align: left;
}

.bv-not-found {
    text-align: center;
    padding: 64px 16px;
}

.bv-not-found__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .bv-main {
        padding: 16px 12px 48px;
    }
}
