/* Site public – Școala Gimnazială nr. 23 Sibiu
   Paleta preluată din site-ul existent: turcoaz #2AB7B1, bleumarin #344D67, crem #F3ECB0 */

:root {
    --teal: #2ab7b1;
    --teal-dark: #17807b;
    --teal-light: #e3f6f5;
    --navy: #344d67;
    --navy-dark: #24374b;
    --cream: #f3ecb0;
    --cream-light: #fbf8e4;
    --green: #ade792;
    --text: #3f4a55;
    --muted: #6e6e6e;
    --line: #e2e6ea;
    --bg: #ffffff;
    --bg-alt: #f6f6f6;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(52, 77, 103, .10);
    --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal-dark); }
a:hover { color: var(--navy); }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; font-weight: 600; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff; padding: 8px 16px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* Butoane */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 24px; border-radius: 999px; border: 2px solid var(--teal-dark);
    background: var(--teal-dark); color: #fff; font: inherit; font-weight: 500;
    text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-outline { background: transparent; color: var(--teal-dark); }
.btn-outline:hover { background: var(--teal-dark); color: #fff; border-color: var(--teal-dark); }
.btn-small { padding: 6px 16px; font-size: .9rem; }

/* Bara de sus */
.topbar { background: var(--navy); color: #dfe7ef; font-size: .85rem; }
.topbar-inner { display: flex; justify-content: space-between; gap: 16px; padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; margin-left: 18px; }
.topbar a:hover { text-decoration: underline; color: #fff; }
.topbar-motto { font-style: italic; }

/* Antet și meniu */
.site-header { background: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .06); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 84px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); flex-shrink: 0; }
.brand img { width: 64px; height: 64px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.1rem; font-weight: 600; }
.brand-text small { color: var(--teal-dark); font-size: .95rem; font-weight: 500; }

.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; align-items: center; }
.main-nav li { position: relative; }
.main-nav > ul > li > a, .main-nav .sub-toggle { white-space: nowrap; }
.main-nav > ul > li > a,
.main-nav .sub-toggle {
    display: block; padding: 10px 12px; border-radius: 8px; border: 0; background: none;
    color: var(--navy); text-decoration: none; font: inherit; font-size: .95rem; font-weight: 500; cursor: pointer;
}
.main-nav .sub-toggle::after { content: ""; display: inline-block; vertical-align: middle; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.main-nav > ul > li > a:hover, .main-nav .sub-toggle:hover,
.main-nav > ul > li.active > a, .main-nav > ul > li.active > .sub-toggle { background: var(--teal-light); color: var(--teal-dark); }
.submenu {
    list-style: none; margin: 0; padding: 8px; position: absolute; top: 100%; left: 0; min-width: 260px;
    background: #fff; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--line);
    opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s;
}
.has-sub:hover > .submenu, .has-sub:focus-within > .submenu, .has-sub.open > .submenu { opacity: 1; visibility: visible; transform: none; }
.submenu a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--navy); text-decoration: none; font-size: .95rem; }
.submenu a:hover, .submenu a[aria-current] { background: var(--teal-light); color: var(--teal-dark); }

.nav-toggle { display: none; width: 46px; height: 46px; border: 0; background: var(--teal-light); border-radius: 10px; cursor: pointer; padding: 12px 11px; }
.nav-toggle span { display: block; height: 2px; background: var(--navy); margin: 5px 0; border-radius: 2px; transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1100px) {
    .nav-toggle { display: block; }
    .main-nav {
        position: absolute; left: 0; right: 0; top: 100%; background: #fff; box-shadow: 0 12px 24px rgba(0, 0, 0, .1);
        max-height: calc(100vh - 84px); overflow-y: auto; display: none; padding: 8px 16px 16px;
    }
    .main-nav.open { display: block; }
    .main-nav > ul { flex-direction: column; align-items: stretch; }
    .main-nav > ul > li > a, .main-nav .sub-toggle { width: 100%; text-align: left; padding: 12px; }
    .submenu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 16px; display: none; min-width: 0; }
    .has-sub:hover > .submenu, .has-sub:focus-within > .submenu { display: none; }
    .has-sub.open > .submenu { display: block; }
}

/* Prima pagină */
.hero { background: linear-gradient(135deg, var(--teal-light) 0%, var(--cream-light) 100%); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; padding-top: 56px; padding-bottom: 56px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: .85rem; color: var(--teal-dark); margin: 0 0 8px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0 0 16px; }
.hero-lead { font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-logo { justify-self: center; width: min(320px, 80%); filter: drop-shadow(0 12px 28px rgba(42, 183, 177, .3)); }

.quick-links { margin-top: -28px; position: relative; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quick-card {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
    text-decoration: none; color: var(--navy); display: flex; flex-direction: column; gap: 2px;
    border-top: 4px solid var(--teal); transition: transform .15s;
}
.quick-card:nth-child(2) { border-top-color: var(--green); }
.quick-card:nth-child(3) { border-top-color: var(--cream); }
.quick-card:nth-child(4) { border-top-color: var(--navy); }
.quick-card:hover { transform: translateY(-3px); color: var(--navy); }
.quick-icon { font-size: 1.6rem; }
.quick-card small { color: var(--muted); }

.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
.section-tight { margin-top: 48px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; font-size: 1.7rem; }
.link-more { font-weight: 500; text-decoration: none; }

.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }

/* Carduri noutăți */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card-media { display: block; aspect-ratio: 16 / 10; background: var(--teal-light); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; }
.card-placeholder img { width: 40%; height: auto; opacity: .6; object-fit: contain; }
.card-body { padding: 18px 20px 22px; }
.card-body time { font-size: .85rem; color: var(--teal-dark); font-weight: 500; }
.card-body h3 { margin: 4px 0 8px; font-size: 1.15rem; }
.card-body h3 a { color: var(--navy); text-decoration: none; }
.card-body h3 a:hover { color: var(--teal-dark); }
.card-body p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Casetă informații */
.info-box { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); border-left: 5px solid var(--teal); }
.info-box h2 { margin-top: 0; font-size: 1.3rem; }
.info-box h3 { font-size: 1.05rem; margin: 18px 0 6px; }
.plain-list { list-style: none; margin: 0 0 12px; padding: 0; }
.plain-list li { padding: 2px 0; }
.map { width: 100%; height: 260px; border: 0; border-radius: 10px; margin-top: 12px; }

/* Pagini interioare */
.page-header { background: linear-gradient(135deg, var(--navy) 0%, #3f6b85 100%); color: #fff; padding: 40px 0 36px; }
.page-header h1 { color: #fff; margin: 0; font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
.breadcrumb { margin: 0 0 6px; }
.breadcrumb a { color: var(--cream); text-decoration: none; font-weight: 500; }
.header-date { display: inline-block; margin-top: 8px; color: #d6e2ec; }
.page-body { padding-top: 40px; padding-bottom: 64px; }
.page-body.narrow { max-width: 820px; }

.prose { max-width: 820px; }
.prose h2 { font-size: 1.5rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.5em; }
.prose img { border-radius: 10px; display: block; margin: 16px 0; }
.prose iframe { max-width: 100%; border: 0; border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--teal-light); color: var(--navy); }
.prose blockquote { margin: 16px 0; padding: 12px 20px; border-left: 4px solid var(--teal); background: var(--cream-light); border-radius: 0 10px 10px 0; }
.prose figure { margin: 16px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.prose figure a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 10px; }
.prose figure img { width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; }
.article-cover { width: 100%; max-height: 520px; object-fit: cover; }

.child-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 32px; max-width: 820px; }
.child-link { display: flex; justify-content: space-between; padding: 16px 20px; background: var(--teal-light); border-radius: 12px; text-decoration: none; color: var(--navy); font-weight: 500; }
.child-link:hover { background: var(--teal); color: #fff; }

/* Galerie */
.gallery { margin-top: 40px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery-item { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 10px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery-item:hover img { transform: scale(1.06); }
.lightbox { position: fixed; inset: 0; background: rgba(15, 25, 35, .94); z-index: 200; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 92vw; max-height: 88vh; text-align: center; }
.lightbox img { max-width: 92vw; max-height: 80vh; border-radius: 6px; }
.lightbox figcaption { color: #fff; margin-top: 8px; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; font-size: 2.2rem; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; line-height: 1; }
.lightbox button:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* Paginare */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 40px; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 8px; text-decoration: none; border: 1px solid var(--line); color: var(--navy); }
.pagination a:hover { background: var(--teal-light); }
.pagination span[aria-current] { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.pagination .gap { border: 0; }

/* Documente */
.doc-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--bg-alt); padding: 20px; border-radius: var(--radius); }
.doc-filters .grow { flex: 1 1 260px; }
.filter-actions { display: flex; gap: 8px; }
.result-count { margin: 16px 0 8px; }
.doc-group h2 { font-size: 1.35rem; margin: 32px 0 12px; padding-bottom: 8px; border-bottom: 3px solid var(--teal-light); }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-row { display: flex; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.doc-info { flex: 1; min-width: 0; }
.doc-title { display: block; font-weight: 500; color: var(--navy); text-decoration: none; overflow-wrap: anywhere; }
.doc-title:hover { color: var(--teal-dark); text-decoration: underline; }
.doc-desc { margin: 2px 0; font-size: .95rem; }
.doc-meta { font-size: .85rem; color: var(--muted); }
.file-badge { flex-shrink: 0; width: 48px; height: 56px; border-radius: 6px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font-size: .7rem; font-weight: 700; color: #fff; background: #8a96a3; position: relative; }
.file-badge::before { content: ""; position: absolute; top: 0; right: 0; border-width: 0 12px 12px 0; border-style: solid; border-color: #fff rgba(255,255,255,.5) rgba(255,255,255,.5) #fff; }
.file-pdf { background: #d6453d; }
.file-doc { background: #2b6cc4; }
.file-xls { background: #1f8a4c; }
.file-ppt { background: #d0782a; }
.file-img { background: var(--teal-dark); }

/* Formulare */
.form-card { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); margin-top: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-weight: 500; color: var(--navy); font-size: .95rem; }
.field input, .field select, .field textarea {
    font: inherit; font-weight: 400; color: var(--text); padding: 11px 14px;
    border: 1.5px solid #cfd6dd; border-radius: 10px; background: #fff; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(42, 183, 177, .2); }
.doc-filters .field { margin-bottom: 0; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; font-size: .95rem; }
.checkbox input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--teal-dark); }
.field-error { color: #b42318; font-size: .875rem; font-weight: 400; display: block; margin-top: -8px; margin-bottom: 12px; }
.field .field-error { margin: 0; }
.hp { position: absolute; left: -9999px; }
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 16px; }
.alert-success { background: #e6f6ec; color: #135c32; border: 1px solid #b4e2c5; }
.alert-error { background: #fdecea; color: #8c1d18; border: 1px solid #f5c2bd; }

/* Pagina de eroare */
.error-page { text-align: center; padding: 80px 16px; }
.error-code { font-size: 5rem; font-weight: 700; color: var(--teal); margin: 0; line-height: 1; }

/* Subsol */
.site-footer { background: var(--navy-dark); color: #c9d4de; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1.2fr 1fr; gap: 32px; padding-top: 48px; padding-bottom: 40px; }
.site-footer h2 { color: #fff; font-size: 1.1rem; margin: 0 0 12px; }
.site-footer h3 { color: #fff; font-size: 1rem; margin: 16px 0 6px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--cream); text-decoration: underline; }
.footer-logo { background: #fff; border-radius: 50%; }
.footer-motto { font-style: italic; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { padding: 3px 0; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 16px 0; font-size: .85rem; }

/* Notificare cookies */
.cookie-notice {
    position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 560px; margin: 0 auto; z-index: 150;
    background: var(--navy); color: #fff; border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow);
    display: flex; gap: 16px; align-items: center; justify-content: space-between;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice p { margin: 0; font-size: .9rem; }
.cookie-notice .btn { white-space: nowrap; flex-shrink: 0; }
.cookie-notice a { color: var(--cream); }

/* Responsive */
@media (max-width: 960px) {
    .hero-inner, .two-col { grid-template-columns: 1fr; }
    .hero-logo { width: 200px; grid-row: 1; }
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    body { font-size: 16px; }
    .topbar-motto { display: none; }
    .topbar a { margin: 0 14px 0 0; }
    .brand img { width: 52px; height: 52px; }
    .brand-text strong { font-size: 1rem; }
    .hero-inner { padding-top: 32px; padding-bottom: 48px; }
    .quick-grid, .card-grid, .form-row, .footer-grid { grid-template-columns: 1fr; }
    .doc-row { flex-wrap: wrap; }
    .doc-info { flex: 1 1 calc(100% - 64px); }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .doc-download { margin-left: 64px; }
    .form-card { padding: 20px; }
    .cookie-notice { flex-direction: column; align-items: stretch; }
}

@media print {
    .topbar, .site-header, .site-footer, .cookie-notice, .doc-filters { display: none; }
    .page-header { background: none; color: #000; }
    .page-header h1 { color: #000; }
}
