/* ========== Nursing Study Vault v1.1 ========== */
:root {
    --bg: #f4f8fb;
    --surface: #ffffff;
    --text: #1f2937;
    --text-secondary: #4b5563;
    --primary: #0b5ed7;
    --primary-dark: #063f91;
    --primary-light: #eaf3ff;
    --accent: #ffd43b;
    --border: #d7e2ee;
    --shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 10px 28px rgba(11, 94, 215, 0.18);
    --sidebar-bg: #082f73;
    --footer-bg: #082f73;
    --disclaimer-bg: #fff8db;
    --disclaimer-border: #facc15;
    --disclaimer-text: #5c4300;
    --radius: 16px;
    --transition: all 0.25s ease;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #111827;
    --text: #f8fafc;
    --text-secondary: #d1d5db;
    --primary: #60a5fa;
    --primary-dark: #93c5fd;
    --primary-light: #1e293b;
    --accent: #fde047;
    --border: #334155;
    --shadow: 0 4px 18px rgba(0,0,0,0.35);
    --shadow-hover: 0 10px 28px rgba(96,165,250,0.25);
    --sidebar-bg: #020617;
    --footer-bg: #020617;
    --disclaimer-bg: #2b2400;
    --disclaimer-border: #a16207;
    --disclaimer-text: #fde68a;
}

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

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

.skip-link {
    position: absolute;
    left: -999px;
    top: 10px;
    background: #fff;
    color: #000;
    padding: 10px 14px;
    z-index: 9999;
    border-radius: 8px;
}

.skip-link:focus {
    left: 10px;
}

/* Disclaimer */
.medical-disclaimer-top {
    background: var(--disclaimer-bg);
    color: var(--disclaimer-text);
    text-align: center;
    padding: 10px 14px;
    font-size: 0.9rem;
    border-bottom: 2px solid var(--disclaimer-border);
}

.medical-disclaimer-top a {
    color: #0645ad;
    font-weight: 700;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 3px 14px rgba(0,0,0,0.18);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
}

.site-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #ffffff;
    padding: 4px;
}

.logo {
    font-size: clamp(1.15rem, 3vw, 1.55rem);
    font-weight: 800;
    letter-spacing: 0.3px;
}

.logo span {
    color: var(--accent);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle,
.hamburger {
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    cursor: pointer;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    font-size: 1.1rem;
}

.hamburger {
    width: 42px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.hamburger span {
    width: 24px;
    height: 3px;
    background: #ffffff;
    border-radius: 3px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: -310px;
    width: 290px;
    height: 100vh;
    background: var(--sidebar-bg);
    color: #ffffff;
    padding: 82px 22px 25px;
    transition: right 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    box-shadow: -6px 0 22px rgba(0,0,0,0.35);
}

.sidebar.active {
    right: 0;
}

.sidebar h3 {
    color: var(--accent);
    margin: 18px 0 10px;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255,255,255,0.25);
    padding-bottom: 6px;
}

.sidebar a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    padding: 10px 8px;
    border-radius: 8px;
    font-size: 0.96rem;
}

.sidebar a:hover {
    background: rgba(255,255,255,0.12);
    color: var(--accent);
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 998;
    display: none;
}

.overlay.active {
    display: block;
}

/* Bars */
.tagline-bar {
    background: var(--primary-dark);
    color: #ffffff;
    text-align: center;
    padding: 10px 12px;
    font-size: 0.92rem;
    font-weight: 600;
}

.breadcrumb {
    max-width: 1050px;
    margin: 18px auto;
    padding: 0 18px;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

/* Main */
.page-container {
    max-width: 1050px;
    margin: 20px auto 40px;
    padding: 0 18px;
}

.content-area {
    background: var(--surface);
    border-radius: var(--radius);
    padding: clamp(20px, 5vw, 36px);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.content-area h1 {
    color: var(--primary);
    font-size: clamp(1.55rem, 5vw, 2.25rem);
    line-height: 1.25;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 14px;
    margin-bottom: 22px;
}

.content-area h2 {
    color: var(--primary-dark);
    font-size: clamp(1.25rem, 3.5vw, 1.6rem);
    margin: 30px 0 15px;
    padding-left: 12px;
    border-left: 5px solid var(--primary);
}

.content-area h3 {
    color: var(--primary);
    margin: 24px 0 10px;
}

.content-area p {
    margin-bottom: 15px;
}

.content-area ul,
.content-area ol {
    margin: 12px 0 18px 24px;
}

.content-area li {
    margin-bottom: 8px;
}

/* Category */
.category-header {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    text-align: center;
    border: 1px solid var(--border);
    border-top: 5px solid var(--primary);
}

.category-header .cat-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.category-header h1 {
    color: var(--primary);
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.category-header .cat-desc {
    color: var(--text-secondary);
    max-width: 720px;
    margin: 8px auto 0;
}

/* Cards */
.post-list {
    display: grid;
    gap: 16px;
}

.post-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.post-info h3 {
    color: var(--primary);
    font-size: 1.1rem;
}

.post-meta,
.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn,
.post-card .btn {
    background: var(--primary);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    white-space: nowrap;
}

.btn:hover,
.post-card .btn:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin: 18px 0;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.table-wrapper table,
.content-area table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.content-area th {
    background: var(--primary);
    color: #ffffff;
    padding: 12px;
    text-align: left;
}

.content-area td {
    padding: 11px;
    border: 1px solid var(--border);
}

.content-area tr:nth-child(even) {
    background: var(--primary-light);
}

/* Quote */
blockquote {
    background: var(--disclaimer-bg);
    color: var(--disclaimer-text);
    padding: 16px 18px;
    border-left: 5px solid var(--disclaimer-border);
    border-radius: 10px;
    margin: 18px 0;
}

/* Related */
.related-posts {
    margin-top: 34px;
}

.related-posts h2 {
    color: var(--primary-dark);
    border-left: 5px solid var(--primary);
    padding-left: 12px;
    margin-bottom: 18px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.related-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    color: var(--text);
    text-decoration: none;
}

.related-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.related-card h3 {
    color: var(--primary);
    font-size: 1rem;
}

.related-card .meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Bottom disclaimer */
.medical-disclaimer-bottom {
    background: var(--disclaimer-bg);
    color: var(--disclaimer-text);
    border: 1px solid var(--disclaimer-border);
    border-radius: 14px;
    padding: 20px;
    margin: 30px auto;
    text-align: center;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: #ffffff;
    text-align: center;
    padding: 26px 18px;
    margin-top: 40px;
}

.footer a {
    color: #fff176;
    font-weight: 700;
}

.footer-links {
    margin: 14px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.footer-bottom {
    font-size: 0.88rem;
    opacity: 0.95;
}

.version {
    margin-top: 6px;
    color: #fff176;
}

/* Accessibility focus */
a:focus,
button:focus {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

/* Mobile */
@media (max-width: 768px) {
    body {
        font-size: 15.5px;
    }

    .header {
        padding: 12px 14px;
    }

    .site-logo {
        width: 38px;
        height: 38px;
    }

    .logo {
        font-size: 1.08rem;
    }

    .content-area {
        padding: 18px;
    }

    .post-card {
        flex-direction: column;
        align-items: stretch;
    }

    .post-card .btn {
        text-align: center;
        width: 100%;
    }

    .footer-links {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .medical-disclaimer-top {
        font-size: 0.78rem;
    }

    .tagline-bar {
        font-size: 0.82rem;
    }

    .theme-toggle,
    .hamburger {
        width: 38px;
        height: 38px;
    }

    .sidebar {
        width: 280px;
    }
}
