/* ============================================================
   Public CSS — resurse.totalschimbat.ro
   ============================================================ */

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

/* ============================================================
   DESIGN TOKENS — Light (default) & Dark theme
   Dark mode: html[data-theme="dark"]
   System pref: @media (prefers-color-scheme: dark) fara preferinta salvata
   ============================================================ */
:root {
    /* ── Palette (nu se schimba) ─────────────────────────── */
    --primary:    #4F46E5;
    --primary-lt: #EEF2FF;
    --primary-dk: #3730A3;
    --accent:     #F59E0B;
    --accent-lt:  #FEF3C7;
    --green:      #059669;
    --green-lt:   #D1FAE5;
    --purple:     #7C3AED;
    --purple-lt:  #EDE9FE;
    --red:        #DC2626;
    --gray-50:    #F9FAFB;
    --gray-100:   #F3F4F6;
    --gray-200:   #E5E7EB;
    --gray-300:   #D1D5DB;
    --gray-400:   #9CA3AF;
    --gray-500:   #6B7280;
    --gray-600:   #4B5563;
    --gray-700:   #374151;
    --gray-800:   #1F2937;
    --gray-900:   #111827;
    --radius:     10px;
    --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:  0 4px 16px rgba(0,0,0,.1);
    --max-w:      1320px;
    --font-serif: Georgia, 'Times New Roman', serif;

    /* ── Semantic tokens — LIGHT ─────────────────────────── */
    --bg-body:       #F9FAFB;
    --bg-surface:    #ffffff;
    --bg-elevated:   #ffffff;
    --bg-subtle:     #F3F4F6;
    --border:        #E5E7EB;
    --border-subtle: #F3F4F6;
    --text:          #1F2937;
    --text-secondary:#4B5563;
    --text-muted:    #6B7280;
    --text-disabled: #9CA3AF;

    /* Toggle button */
    --toggle-bg:     #E5E7EB;
    --toggle-thumb:  #ffffff;
    --toggle-icon:   '☀️';

    /* Transition globala pentru tema */
    --theme-transition: background-color .25s ease, color .25s ease,
                        border-color .25s ease, box-shadow .25s ease;
}

/* ── DARK THEME — html[data-theme="dark"] ────────────────── */
[data-theme="dark"] {
    color-scheme: dark;

    /* Semantic tokens override */
    --bg-body:       #0B1120;   /* slate-950 — fundal corp */
    --bg-surface:    #172033;   /* slate-900 — carduri */
    --bg-elevated:   #1E2D45;   /* slate-800 — elemente ridicate */
    --bg-subtle:     #1A2540;   /* slate-850 — fundal subtil */
    --border:        #2D4163;   /* slate-700 — borduri */
    --border-subtle: #1E2D45;   /* slate-800 — borduri subtile */
    --text:          #E2E8F0;   /* slate-200 — text principal */
    --text-secondary:#94A3B8;   /* slate-400 — text secundar */
    --text-muted:    #64748B;   /* slate-500 — text estompat */
    --text-disabled: #475569;   /* slate-600 */

    /* Primary ajustat pentru fond inchis (contrast mai bun) */
    --primary:       #818CF8;   /* indigo-400 */
    --primary-lt:    rgba(129,140,248,.12);
    --primary-dk:    #6366F1;   /* indigo-500 */

    /* Shadows mai pronuntate pe dark */
    --shadow:    0 1px 4px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,.5);

    /* Toggle */
    --toggle-bg:    #334155;
    --toggle-thumb: #818CF8;
    --toggle-icon:  '🌙';

    /* Gray scale adaptat pentru dark */
    --gray-50:   #172033;
    --gray-100:  #1E2D45;
    --gray-200:  #2D4163;
    --gray-300:  #3D5478;
    --gray-400:  #64748B;
    --gray-500:  #94A3B8;
    --gray-600:  #CBD5E1;
    --gray-700:  #E2E8F0;
    --gray-800:  #F1F5F9;
    --gray-900:  #F8FAFC;
}

/* ── System preference (fara preferinta salvata in localStorage) ── */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        color-scheme: dark;
        --bg-body:       #0B1120;
        --bg-surface:    #172033;
        --bg-elevated:   #1E2D45;
        --bg-subtle:     #1A2540;
        --border:        #2D4163;
        --border-subtle: #1E2D45;
        --text:          #E2E8F0;
        --text-secondary:#94A3B8;
        --text-muted:    #64748B;
        --text-disabled: #475569;
        --primary:       #818CF8;
        --primary-lt:    rgba(129,140,248,.12);
        --primary-dk:    #6366F1;
        --shadow:    0 1px 4px rgba(0,0,0,.4);
        --shadow-md: 0 4px 20px rgba(0,0,0,.5);
        --toggle-bg:    #334155;
        --toggle-thumb: #818CF8;
        --gray-50:   #172033;
        --gray-100:  #1E2D45;
        --gray-200:  #2D4163;
        --gray-300:  #3D5478;
        --gray-400:  #64748B;
        --gray-500:  #94A3B8;
        --gray-600:  #CBD5E1;
        --gray-700:  #E2E8F0;
        --gray-800:  #F1F5F9;
        --gray-900:  #F8FAFC;
    }
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--theme-transition);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---- Container ------------------------------------------- */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Header ---------------------------------------------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 64px;             /* inaltime minima — creste cand logo e mai mare */
    padding: 10px 0;              /* respira sus-jos in jurul logo-ului */
}
.header-logo img {
    transition: max-width .25s ease;
}
.header-logo {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    flex-shrink: 0;
}
.header-logo .logo-main {
    font-size: 17px;
    font-weight: 800;
    color: var(--gray-900);
}
.header-logo .logo-main span { color: var(--primary); }
.header-logo .logo-sub {
    font-size: 11px;
    color: var(--gray-400);
}

/* Search bar in header */
.header-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}
.header-search input {
    width: 100%;
    padding: 9px 16px 9px 42px;
    border: 1.5px solid var(--gray-200);
    border-radius: 99px;
    font-size: 14px;
    background: var(--gray-50);
    transition: border-color .2s, box-shadow .2s;
}
.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.header-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 16px;
    pointer-events: none;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.nav-item {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.nav-item:hover { background: var(--gray-100); color: var(--gray-900); text-decoration: none; }
.nav-item.active { background: var(--primary-lt); color: var(--primary); }

/* Buton inapoi la site principal */
.back-to-main {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    white-space: nowrap;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.back-to-main:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--gray-600);
    padding: 4px;
}

/* ---- Hero / Banner --------------------------------------- */
.hero {
    position: relative;
    /* Background-ul vine din inline style (setat din admin) */
    color: #fff;
    padding: 56px 0 60px;
    text-align: center;
    overflow: hidden;
}
/* Overlay cu opacitate (doar pentru hero cu imagine) */
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
/* Lumina radiala subtila in centru sus */
.hero::before {
    content: '';
    position: absolute;
    top: -40%; left: 50%;
    width: 120%; height: 80%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center top,
                rgba(255,255,255,.4) 0%,
                rgba(255,255,255,0) 60%);
    pointer-events: none;
    z-index: 1;
}
.hero > .container { position: relative; z-index: 2; }
.hero h1 { text-shadow: 0 2px 16px rgba(0,0,0,.25); }
.hero h1 {
    font-size: clamp(26px, 5vw, 40px);
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
}
.hero p {
    font-size: 16px;
    opacity: .85;
    margin-bottom: 28px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}
.hero-search {
    display: flex;
    max-width: 560px;
    margin: 0 auto;
    gap: 0;
    background: #fff;
    border-radius: 99px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.hero-search input {
    flex: 1;
    padding: 14px 20px;
    border: none;
    font-size: 15px;
    color: var(--gray-800);
    background: transparent;
}
.hero-search input:focus { outline: none; }
.hero-search button {
    padding: 14px 24px;
    background: var(--accent);
    border: none;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
    border-radius: 0 99px 99px 0;
}
.hero-search button:hover { background: #D97706; }

/* ---- Main content ---------------------------------------- */
main.site-main {
    flex: 1;
    padding: 36px 0 60px;
}

/* ---- Category cards -------------------------------------- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 48px;
}
.cat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1.5px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    text-decoration: none;
    color: inherit;
}
.cat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    text-decoration: none;
}
.cat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.cat-icon-purple { background: #EDE9FE; }
.cat-icon-green  { background: #D1FAE5; }
.cat-icon-yellow { background: #FEF3C7; }
.cat-icon-red    { background: #FEE2E2; }

.cat-info {}
.cat-name  { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.cat-count { font-size: 13px; color: var(--gray-400); margin-top: 2px; }

/* ---- Section titles -------------------------------------- */
.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--gray-100);
    border-radius: 99px;
}

/* ---- Resource list cards --------------------------------- */
.resource-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.resource-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color .15s, transform .1s;
    text-decoration: none;
    color: inherit;
}
.resource-card:hover {
    border-color: var(--primary);
    transform: translateX(3px);
    text-decoration: none;
}
.resource-card-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}
.resource-card-body { flex: 1; min-width: 0; }
.resource-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.resource-card-meta {
    font-size: 12.5px;
    color: var(--gray-400);
    margin-top: 2px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.resource-card-meta span { display: flex; align-items: center; gap: 4px; }
.resource-card-right { flex-shrink: 0; text-align: right; }
.tonality-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    background: var(--purple-lt);
    color: var(--purple);
    font-family: monospace;
}

/* ---- Widget zones ---------------------------------------- */
.widget-zone { margin: 0; }
.widget-zone--global_banner { margin: 0; }
.banner-top-zone { margin-bottom: 24px; }

/* ---- Sidebar layout (WordPress-like: 1fr + 300px) -------- */
.site-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
    margin-top: 0;
}
.site-sidebar {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.site-sidebar .widget-zone { margin: 0; }

/* Widget box style in sidebar */
.sidebar-widget {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Resource page: nu mai are centering propriu cand e in grid */
.site-layout .resource-page {
    max-width: none;
    margin: 0;
}

@media (max-width: 960px) {
    .site-layout {
        grid-template-columns: 1fr;
    }
    .site-sidebar {
        position: static;
        order: 99; /* sidebar merge dupa continut pe mobil */
    }
}

/* ---- Single resource page -------------------------------- */
.resource-page { max-width: 760px; margin: 0 auto; }

/* ---- Layout intern resursa: text + panel actiuni ---------- */
.resource-content-grid {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 20px;
    align-items: start;
}

/* ---- Panel vertical cu butoane actiuni ------------------- */
.resource-actions-panel {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 14px 8px 12px;
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    color: var(--gray-600);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .01em;
    transition: all .18s;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.action-card:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-lt);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79,70,229,.14);
    text-decoration: none;
}
.action-card .ac-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-100);
    transition: background .18s;
    flex-shrink: 0;
}
.action-card:hover .ac-icon { background: var(--primary-lt); }

/* Culori individuale */
.action-card--print  .ac-icon { background: #EFF6FF; color: #2563EB; }
.action-card--pdf    .ac-icon { background: #FFF7ED; color: #EA580C; }
.action-card--proj   .ac-icon { background: #F5F3FF; color: #7C3AED; }
.action-card--proj { background: var(--primary); color: #fff; border-color: var(--primary); }
.action-card--proj .ac-icon { background: rgba(255,255,255,.2); color: #fff; }
.action-card--proj:hover { background: var(--primary-dk); border-color: var(--primary-dk); color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.3); }
.action-card--proj:hover .ac-icon { background: rgba(255,255,255,.25); }
.action-card--wa     .ac-icon { background: #ECFDF5; color: #059669; }
.action-card--wa:hover { border-color: #25D366; color: #059669; background: #ECFDF5; }
.action-card--share  .ac-icon { background: #F0F9FF; color: #0284C7; }

/* Stare incarcare PDF */
.action-card--loading { opacity: .6; pointer-events: none; }
.action-card--loading .ac-icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobil: butoane orizontale sub header */
@media (max-width: 640px) {
    .resource-content-grid {
        grid-template-columns: 1fr;
    }
    .resource-actions-panel {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        order: -1;
        gap: 8px;
    }
    .action-card {
        flex-direction: row;
        padding: 10px 14px;
        gap: 8px;
        font-size: 13px;
        flex: 1;
        min-width: 120px;
    }
    .action-card .ac-icon { width: 28px; height: 28px; border-radius: 8px; }
}

/* ---- Share toast ---------------------------------------- */
.share-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1F2937;
    color: #fff;
    padding: 10px 22px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    transition: opacity .4s;
    pointer-events: none;
}

/* ---- Overlay Proiectie ---------------------------------- */
.proj-overlay {
    position: fixed;
    inset: 0;
    background: #0F172A;
    z-index: 9999;
    display: none;
    flex-direction: column;
    color: #fff;
    font-family: inherit;
}
.proj-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: rgba(255,255,255,.06);
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.proj-header-title {
    font-size: 15px;
    font-weight: 700;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: .9;
}
.proj-header-meta {
    font-size: 13px;
    opacity: .5;
    white-space: nowrap;
}
.proj-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.proj-btn-icon {
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.proj-btn-icon:hover { background: rgba(255,255,255,.2); }
.proj-close-btn { font-size: 16px; }
.proj-counter {
    font-size: 13px;
    opacity: .6;
    min-width: 44px;
    text-align: center;
}
.proj-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 10%;
    overflow-y: auto;
    font-size: 2.4rem;
    line-height: 1.65;
    text-align: center;
}
.proj-body.proj-anim {
    animation: projFadeIn .25s ease;
}
@keyframes projFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.proj-slide p {
    margin-bottom: .6em;
    color: #fff;
}
.proj-slide--label p {
    font-size: .7em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #818CF8;
    margin-bottom: .3em;
}
.proj-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: rgba(255,255,255,.04);
    border-top: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.proj-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    min-width: 120px;
    justify-content: center;
}
.proj-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,.2); }
.proj-nav-btn:disabled { opacity: .25; cursor: default; }
.proj-nav-label { font-size: 14px; }
.proj-dots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 320px;
}
.proj-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.proj-dot.active {
    background: #818CF8;
    transform: scale(1.4);
}
.proj-dot:hover { background: rgba(255,255,255,.5); }

/* ---- Print styles --------------------------------------- */
@media print {
    .site-header,
    .site-sidebar,
    .resource-actions,
    .resource-nav,
    .widget-zone,
    .banner-top-zone,
    .breadcrumb,
    .back-to-main,
    .views-footer,
    .no-print { display: none !important; }

    body { background: #fff !important; }
    .site-main { padding: 0 !important; }
    .site-layout { display: block !important; }
    .resource-page { max-width: 100% !important; margin: 0 !important; }
    .resource-header {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        padding: 16px !important;
    }
    .resource-title { font-size: 20pt !important; }
    .resource-body  { font-size: 12pt !important; line-height: 1.8 !important; }
    .resource-body p { page-break-inside: avoid; }
    .tonality-badge, .tonality-large { border: 1px solid #999 !important; }
    a { color: inherit !important; text-decoration: none !important; }
}

.resource-header {
    background: #fff;
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}
.resource-type-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.resource-title {
    font-size: clamp(20px, 4vw, 30px);
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.3;
    margin-bottom: 18px;
}
.resource-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.resource-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.resource-meta-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--gray-400);
}
.resource-meta-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}
.tonality-large {
    font-size: 18px;
    font-weight: 800;
    font-family: monospace;
    color: var(--purple);
    background: var(--purple-lt);
    padding: 4px 14px;
    border-radius: 8px;
}

/* Continut (versuri/strofe) */
.resource-body {
    background: #fff;
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}
.resource-body .stanza {
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.9;
    color: var(--gray-800);
    margin-bottom: 22px;
}
.resource-body .section-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--primary);
    margin: 24px 0 10px;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
}

/* ── Conținut rich HTML (din editor: liste, headings, bold, etc.) ─── */
.resource-body p {
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.85;
    color: var(--gray-800);
    margin-bottom: 14px;
}
.resource-body p:last-child { margin-bottom: 0; }

/* Liste numerotate / cu buline */
.resource-body ol,
.resource-body ul {
    padding-left: 2em;
    margin: 8px 0 18px;
}
.resource-body ol           { list-style: decimal; }
.resource-body ul           { list-style: disc; }
.resource-body ol ol        { list-style: lower-alpha; }
.resource-body ul ul        { list-style: circle; }
.resource-body li {
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.8;
    color: var(--gray-800);
    margin-bottom: 8px;
    padding-left: 4px;
}
.resource-body li:last-child { margin-bottom: 0; }

/* Formatare inline */
.resource-body strong { font-weight: 700; }
.resource-body em     { font-style: italic; }
.resource-body u      { text-decoration: underline; }

/* Titluri în conținut */
.resource-body h2,
.resource-body h3,
.resource-body h4 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    color: var(--gray-900);
    margin: 24px 0 10px;
    line-height: 1.3;
}
.resource-body h2 { font-size: 20px; }
.resource-body h3 { font-size: 17px; }
.resource-body h4 { font-size: 15px; }

/* Citat */
.resource-body blockquote {
    border-left: 3px solid var(--primary);
    padding: 6px 0 6px 16px;
    margin: 16px 0;
    color: var(--gray-600);
    font-style: italic;
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.8;
}

/* Navigare prev/next */
.resource-nav {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.resource-nav a {
    flex: 1;
    padding: 14px 18px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: border-color .15s, color .15s;
    text-decoration: none;
}
.resource-nav a:hover { border-color: var(--primary); color: var(--primary); }
.resource-nav a.next { justify-content: flex-end; text-align: right; }

/* ---- Alphabet index (A-Z) -------------------------------- */
.alphabet-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 28px;
    background: #fff;
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.alpha-link {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    color: var(--gray-600);
    transition: background .15s, color .15s;
}
.alpha-link:hover, .alpha-link.active {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}
.alpha-link.empty { color: var(--gray-300); cursor: default; pointer-events: none; }

/* ---- Search results -------------------------------------- */
.search-header {
    margin-bottom: 24px;
}
.search-header h2 { font-size: 20px; font-weight: 700; }
.search-header p  { color: var(--gray-500); margin-top: 4px; }

.search-highlight { background: #FEF9C3; border-radius: 3px; padding: 0 2px; }

/* ---- Filters -------------------------------------------- */
.filters-row {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
    background: #fff;
    padding: 14px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.filters-row select,
.filters-row input[type="search"] {
    padding: 8px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: 7px;
    font-size: 13.5px;
    color: var(--gray-700);
    transition: border-color .15s;
    background: #fff;
}
.filters-row select:focus,
.filters-row input:focus {
    outline: none;
    border-color: var(--primary);
}
.filters-row .filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
}
.filter-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}
.filter-reset {
    padding: 8px 14px;
    background: var(--gray-100);
    color: var(--gray-600);
    border: none;
    border-radius: 7px;
    font-size: 13.5px;
    cursor: pointer;
    text-decoration: none;
}
.filter-reset:hover { background: var(--gray-200); text-decoration: none; }

/* ---- Paginare ------------------------------------------- */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}
.page-link {
    width: 38px; height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    background: #fff;
    text-decoration: none;
    transition: background .15s;
}
.page-link:hover { background: var(--gray-100); text-decoration: none; }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.dots { border: none; background: none; cursor: default; }

/* ---- Breadcrumb ----------------------------------------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-400);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--gray-500); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--gray-300); }

/* ---- Empty state ---------------------------------------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 14px; }
.empty-state h3 { font-size: 18px; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; }

/* ---- Footer --------------------------------------------- */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 28px 0;
    text-align: center;
    font-size: 13px;
    margin-top: auto;
}
.site-footer a { color: var(--gray-300); }
.site-footer a:hover { color: #fff; }
.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.footer-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid var(--gray-600);
    border-radius: 99px;
    color: var(--gray-300);
    font-size: 13px;
    font-weight: 600;
    transition: border-color .15s, color .15s;
    text-decoration: none;
}
.footer-back:hover { border-color: #fff; color: #fff; text-decoration: none; }

/* ============================================================
   DARK MODE — Component overrides
   Toate elementele cu background #fff hardcodat sau
   culori care nu folosesc inca semantic tokens
   ============================================================ */

/* Tranzitie globala la schimbarea temei */
*, *::before, *::after {
    transition: background-color .25s ease, border-color .25s ease,
                color .2s ease;
}
/* Exceptii (animatii speciale nu trebuie afectate) */
.proj-overlay *, .hero *, .action-card,
.hero-overlay { transition: none; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
    background: var(--bg-surface);
    border-bottom-color: var(--border);
}
.header-logo .logo-main { color: var(--text); }
.header-logo .logo-sub  { color: var(--text-muted); }
.nav-item               { color: var(--text-secondary); }
.nav-item:hover         { background: var(--bg-subtle); color: var(--text); }
.nav-item.active        { background: var(--primary-lt); color: var(--primary); }
.menu-toggle            { color: var(--text-secondary); }
.header-nav.open        { background: var(--bg-surface); border-color: var(--border); }

/* ── Cards ───────────────────────────────────────────────── */
.cat-card,
.resource-card,
.resource-header,
.resource-body,
.resource-nav a {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    color: var(--text);
}
.cat-card:hover,
.resource-card:hover { border-color: var(--primary); }

/* Cat icon backgrounds in dark */
[data-theme="dark"] .cat-icon-purple,
html:not([data-theme="light"]) .cat-icon-purple { background: rgba(124,58,237,.2); }
[data-theme="dark"] .cat-icon-green,
html:not([data-theme="light"]) .cat-icon-green  { background: rgba(5,150,105,.2); }
[data-theme="dark"] .cat-icon-yellow,
html:not([data-theme="light"]) .cat-icon-yellow { background: rgba(217,119,6,.2); }
[data-theme="dark"] .cat-icon-red,
html:not([data-theme="light"]) .cat-icon-red    { background: rgba(220,38,38,.2); }

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .cat-icon-purple { background: rgba(124,58,237,.2); }
    html:not([data-theme="light"]) .cat-icon-green  { background: rgba(5,150,105,.2); }
    html:not([data-theme="light"]) .cat-icon-yellow { background: rgba(217,119,6,.2); }
    html:not([data-theme="light"]) .cat-icon-red    { background: rgba(220,38,38,.2); }
}

.cat-name   { color: var(--text); }
.cat-count  { color: var(--text-muted); }
.section-title { color: var(--text); }
.section-title::after { background: var(--border); }

/* ── Resource page ───────────────────────────────────────── */
.resource-card-title   { color: var(--text); }
.resource-card-meta    { color: var(--text-secondary); }
.resource-type-label   { color: var(--primary); }
.resource-meta-label   { color: var(--text-muted); }
.resource-meta-value   { color: var(--text); }
.tonality-large,
.tonality-badge {
    background: var(--primary-lt);
    color: var(--primary);
    border-color: var(--border);
}
.resource-body p,
.resource-body li       { color: var(--text); }
.resource-body .stanza  { color: var(--text); }
.resource-body .section-label { color: var(--primary); }
.resource-body blockquote { color: var(--text-secondary); border-color: var(--primary); }
.resource-body h2,
.resource-body h3,
.resource-body h4       { color: var(--text); }

/* ── Action panel (dark glassmorphism) ───────────────────── */
[data-theme="dark"] .action-card,
html:not([data-theme="light"]) .action-card {
    background: var(--bg-elevated);
    border-color: var(--border);
    color: var(--text-secondary);
}
[data-theme="dark"] .action-card:hover,
html:not([data-theme="light"]) .action-card:hover {
    background: var(--bg-surface);
    border-color: var(--primary);
    color: var(--text);
}
/* Proj button ramine colorat */
.action-card--proj { background: var(--primary) !important; color: #fff !important; }

/* ── Hero search input ───────────────────────────────────── */
[data-theme="dark"] .hero-search,
html:not([data-theme="light"]) .hero-search {
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.15);
}
[data-theme="dark"] .hero-search input,
html:not([data-theme="light"]) .hero-search input {
    color: #fff;
    background: transparent;
}
[data-theme="dark"] .hero-search input::placeholder,
html:not([data-theme="light"]) .hero-search input::placeholder {
    color: rgba(255,255,255,.55);
}

/* ── Pagination ──────────────────────────────────────────── */
.page-link {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-secondary);
}
.page-link:hover { background: var(--bg-subtle); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Filters ─────────────────────────────────────────────── */
.filters-row,
.filters-bar {
    background: var(--bg-surface);
    border-color: var(--border);
}
.filter-btn {
    background: var(--primary);
    color: #fff;
}
.filter-reset {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border-color: var(--border);
}

/* ── Sidebar widgets ─────────────────────────────────────── */
.site-sidebar .widget-zone {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--text);
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb a      { color: var(--text-secondary); }
.breadcrumb a:hover{ color: var(--primary); }
.breadcrumb-sep    { color: var(--border); }

/* ── Resource nav ────────────────────────────────────────── */
.resource-nav a {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-secondary);
}
.resource-nav a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state h3 { color: var(--text-secondary); }
.empty-state p  { color: var(--text-muted); }

/* ── Share toast ─────────────────────────────────────────── */
[data-theme="dark"] .share-toast,
html:not([data-theme="light"]) .share-toast {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

/* ── Search results ──────────────────────────────────────── */
.search-header h2 { color: var(--text); }
.search-header p  { color: var(--text-muted); }

/* ── Alpha bar ───────────────────────────────────────────── */
.alpha-link {
    color: var(--text-secondary);
    border-color: var(--border);
    background: var(--bg-surface);
}
.alpha-link:hover,
.alpha-link.active { background: var(--primary); color: #fff; }
.alpha-link.empty  { color: var(--text-disabled); }

/* ── Dark mode toggle button ─────────────────────────────── */
.theme-toggle {
    background: var(--toggle-bg);
    border: none;
    border-radius: 99px;
    width: 52px;
    height: 28px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .25s ease;
    outline: none;
}
.theme-toggle::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--toggle-thumb);
    transition: transform .25s cubic-bezier(.34,1.56,.64,1),
                background .25s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
[data-theme="dark"] .theme-toggle::before,
html:not([data-theme="light"]) .theme-toggle::before {
    transform: translateX(24px);
}
/* Icon inside toggle */
.theme-toggle-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    pointer-events: none;
    user-select: none;
    transition: opacity .2s;
}
.theme-toggle-icon--sun  { left: 6px; }
.theme-toggle-icon--moon { right: 5px; }
/* Light: mostra soarele activ, dark: mostra luna activa */
[data-theme="dark"] .theme-toggle-icon--sun,
html:not([data-theme="light"]) .theme-toggle-icon--sun   { opacity: .4; }
[data-theme="dark"] .theme-toggle-icon--moon,
html:not([data-theme="light"]) .theme-toggle-icon--moon  { opacity: 1; }
.theme-toggle-icon--sun  { opacity: 1; }
.theme-toggle-icon--moon { opacity: .4; }

.theme-toggle:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

/* ============================================================
   ACCESIBILITATE & RESPONSIVE — WCAG 2.1 AA
   ============================================================ */

/* ── Landmarks semantice ─────────────────────────────────── */
/* <main> e deja semantic; adaugam stiluri de baza */
.site-main { flex: 1; }   /* ocupa spatiul ramas in flex column */

/* ── Prevent horizontal overflow pe toate ecranele ───────── */
html { overflow-x: hidden; }
body { overflow-x: hidden; max-width: 100vw; }

/* ── Focus vizibil (keyboard navigation) ─────────────────── */
/* Folosim :focus-visible pentru a nu afecta click-ul cu mouse */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}
/* Resetam outline-ul default inlocuit de stilul nostru */
:focus:not(:focus-visible) { outline: none; }

/* Focus special pe inputuri */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 0;
    box-shadow: 0 0 0 4px rgba(79,70,229,.15);
}

/* ── Touch targets ≥ 44×44px (WCAG 2.5.5) ─────────────────
   Orice element interactiv trebuie sa fie usor de apasat pe mobil */

/* Butoane de paginare: 38px → 44px */
.page-link {
    min-width: 44px;
    min-height: 44px;
}

/* Linkuri nav: asiguram inaltime minima */
.nav-item {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* Butonul de meniu mobil */
.menu-toggle {
    min-width: 44px;
    min-height: 44px;
    display: none;          /* afisat in breakpoint */
    align-items: center;
    justify-content: center;
}

/* Butonul back-to-main */
.back-to-main {
    min-height: 44px;
}

/* Butoanele de actiune (imprimare, PDF etc.) */
.action-card {
    min-height: 44px;
}

/* Butoanele de filtru */
.filter-btn,
.filter-reset,
.view-tab {
    min-height: 44px;
}

/* Hero search buton */
.hero-search button {
    min-height: 44px;
    min-width: 80px;
}

/* ── Contrast text — WCAG AA (4.5:1 pentru text normal) ────
   --gray-400 (#9CA3AF) pe alb are contrast 2.6:1 — sub limita.
   Folosim gray-500 (#6B7280 = 4.6:1) pentru text secundar. */
.resource-card-meta,
.cat-count,
.breadcrumb,
.breadcrumb a,
.resource-meta-label,
.tonality-badge {
    color: var(--gray-600); /* 7.0:1 pe fundal alb — WCAG AAA */
}

/* Text „helper" secundar minim acceptabil */
.form-hint,
.empty-state p,
.page-link:not(.active) {
    color: var(--gray-500); /* 4.6:1 — WCAG AA */
}

/* ── Reduced motion (respecta preferintele utilizatorului) ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Responsive breakpoints ─────────────────────────────── */
@media (max-width: 768px) {
    /* Mobile nav */
    .header-nav {
        display: none;
        /* Pozitia e setata de JS bazat pe inaltimea reala a header-ului */
    }
    .header-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        /* top setat in JS: header.offsetHeight */
        top: var(--header-height, 64px);
        left: 0; right: 0;
        background: #fff;
        border-bottom: 1px solid var(--gray-200);
        padding: 8px;
        gap: 2px;
        box-shadow: var(--shadow-md);
        z-index: 99;
    }
    /* Nav items in mobile: full-width, padding generoas */
    .header-nav.open .nav-item {
        width: 100%;
        padding: 12px 16px;
        border-radius: 8px;
        font-size: 15px;
    }

    .menu-toggle { display: flex; }
    .back-to-main { display: none; } /* ascuns pe mobil mic */
    .hero { padding: 36px 0 32px; }
    .hero-search { margin: 0 16px; }
    .resource-header, .resource-body { padding: 20px; }
    .resource-body .stanza { font-size: 15px; }
    .resource-nav { flex-direction: column; }
    .filters-row { flex-direction: column; align-items: stretch; }
    .categories-grid { grid-template-columns: 1fr 1fr; }

    /* Site layout: 2col → 1col */
    .site-layout {
        grid-template-columns: 1fr !important;
    }
    .site-sidebar {
        position: static !important;
    }
    /* Resource content grid: text + panel → stacked */
    .resource-content-grid {
        grid-template-columns: 1fr !important;
    }
    .resource-actions-panel {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .categories-grid { grid-template-columns: 1fr; }
    .resource-meta-grid { flex-direction: column; gap: 12px; }

    /* Container padding mai mic pe telefon mic */
    .container { padding: 0 12px; }

    /* Hero text mai mic */
    .hero h1 { font-size: clamp(20px, 6vw, 32px); }
    .hero p  { font-size: 14px; }

    /* Paginator: ascunde numerele si arata doar prev/next */
    .page-link:not(.active):not([href*="page=1"]) {
        /* Nu ascundem — dar asiguram wrap */
    }
    .pagination { gap: 4px; }

    /* Breadcrumb pe mai multe linii */
    .breadcrumb { font-size: 12px; }
}

/* ── Print styles ─────────────────────────────────────────── */
@media print {
    .site-header, .site-sidebar, .resource-actions-panel,
    .resource-nav, .widget-zone, .no-print,
    .header-nav, .back-to-main, .menu-toggle,
    #backToTop, .skip-to-main, .site-footer { display: none !important; }

    body { font-size: 12pt; color: #000; background: #fff; }
    .resource-body { font-size: 12pt !important; line-height: 1.8 !important; }
    .resource-body p { page-break-inside: avoid; }
    a[href]::after { content: ' (' attr(href) ')'; font-size: 9pt; }
    .container { max-width: 100%; padding: 0; }
}
