/* =====================================================================
   ПГИ „Проф. д-р Димитър Табаков“ – Сливен
   Основен стил
   ===================================================================== */

:root {
    --navy:      #14284b;
    --navy-2:    #1d3a6b;
    --navy-3:    #0c1a33;
    --gold:      #c9a227;
    --gold-2:    #e2c25a;
    --paper:     #f7f5f0;
    --white:     #ffffff;
    --ink:       #1c2230;
    --muted:     #5b6475;
    --line:      #e3dfd5;
    --ok:        #1f7a4d;
    --err:       #b3261e;

    --radius:    14px;
    --shadow:    0 10px 30px rgba(20, 40, 75, .08);
    --shadow-lg: 0 20px 50px rgba(20, 40, 75, .16);

    --font-serif: "Georgia", "Cambria", "Times New Roman", serif;
    --font-sans:  "Segoe UI", system-ui, -apple-system, "Roboto", "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--navy-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold); }

h1, h2, h3 {
    font-family: var(--font-serif);
    color: var(--navy);
    line-height: 1.2;
    margin: 0 0 .6em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); }
h3 { font-size: 1.22rem; }

p { margin: 0 0 1em; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow    { max-width: 780px; }
.narrow-sm { max-width: 460px; }
.center    { text-align: center; }
.small     { font-size: .86rem; color: var(--muted); }
.muted     { color: var(--muted); }

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

.skip-link {
    position: absolute; left: -999px; top: 8px;
    background: var(--gold); color: var(--navy); padding: 8px 14px; z-index: 999; border-radius: 6px;
}
.skip-link:focus { left: 8px; }

/* ---------- Горна лента ---------- */
.topbar { background: var(--navy-3); color: #cfd6e4; font-size: .85rem; }
.topbar__inner { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; flex-wrap: wrap; }
.topbar a { color: #cfd6e4; text-decoration: none; margin-left: 18px; }
.topbar a:hover { color: var(--gold-2); }

/* ---------- Хедър ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .25s;
}
.site-header.scrolled { box-shadow: var(--shadow); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 0; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-family: var(--font-serif); font-size: 1.25rem; }
.brand__text small { color: var(--muted); font-size: .82rem; }

.main-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
    display: block; padding: 9px 13px; border-radius: 8px;
    text-decoration: none; color: var(--ink); font-weight: 500; font-size: .96rem;
}
.main-nav a:hover { background: var(--paper); color: var(--navy); }
.main-nav a.active { color: var(--navy); background: #efe7cc; }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--navy); margin: 5px 0; transition: .25s; }
.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); }

/* ---------- Бутони ---------- */
.btn {
    display: inline-block; padding: 12px 24px; border-radius: 999px;
    font-weight: 600; text-decoration: none; cursor: pointer; border: 2px solid transparent;
    font-size: 1rem; font-family: inherit; transition: transform .15s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--gold    { background: var(--gold); color: var(--navy-3); }
.btn--gold:hover { background: var(--gold-2); color: var(--navy-3); }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-2); color: #fff; }
.btn--ghost   { border-color: rgba(255,255,255,.6); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn--ghost-dark { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn--ghost-dark:hover { background: var(--navy); color: #fff; }
.btn--block { display: block; text-align: center; margin-top: 10px; }

.link-arrow { font-weight: 600; text-decoration: none; color: var(--navy-2); }

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(circle at 85% 20%, rgba(201,162,39,.25), transparent 40%),
        linear-gradient(135deg, var(--navy-3) 0%, var(--navy) 55%, var(--navy-2) 100%);
    color: #fff;
    padding: clamp(56px, 9vw, 110px) 0;
    position: relative; overflow: hidden;
}
.hero::after {   /* фина мрежа – „графика“ */
    content: ""; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 40px 40px; pointer-events: none;
}
.hero__inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.hero h1 { color: #fff; }
.hero h1 span { color: var(--gold-2); }
.hero .lead { color: #d9e0ee; font-size: 1.15rem; max-width: 600px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }

.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 700; color: var(--gold); margin-bottom: .8em; }

.hero__card {
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
    border-radius: var(--radius); padding: 28px; backdrop-filter: blur(6px);
}
.hero__card h2 { color: #fff; font-size: 1.35rem; }
.hero__card .link-arrow { color: var(--gold-2); }

.timeline { list-style: none; padding: 0; margin: 0 0 18px; }
.timeline li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dashed rgba(255,255,255,.18); color: #e6ebf4; }
.timeline time { min-width: 86px; font-weight: 700; color: var(--gold-2); }

/* ---------- Секции ---------- */
.section { padding: clamp(48px, 7vw, 84px) 0; }
.section--flush { padding-top: 0; }
.section--alt { background: var(--white); border-block: 1px solid var(--line); }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 26px; }

.page-hero {
    background: linear-gradient(135deg, var(--navy-3), var(--navy));
    color: #fff; padding: 52px 0 46px;
}
.page-hero--small { padding: 40px 0 34px; }
.page-hero h1 { color: #fff; margin-bottom: .3em; }
.page-hero .lead { color: #d3dbea; margin: 0; max-width: 720px; }
.breadcrumbs { font-size: .88rem; color: #aab6cc; margin-bottom: 10px; }
.breadcrumbs a { color: var(--gold-2); text-decoration: none; }

/* ---------- Решетки и карти ---------- */
.cards { display: grid; gap: 24px; }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--4 { grid-template-columns: repeat(4, 1fr); }

.quick, .news-card, .spec, .value, .project, .doc-group {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 26px; box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}
.quick { text-decoration: none; color: var(--ink); margin-top: -70px; position: relative; z-index: 2; }
.quick:hover, .news-card:hover, .spec:hover, .project:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--ink); }
.quick p { color: var(--muted); margin: 0; font-size: .95rem; }

.news-card { display: flex; flex-direction: column; }
.news-card h3 a { text-decoration: none; color: var(--navy); }
.news-card h3 a:hover { color: var(--gold); }
.news-card p { color: var(--muted); flex: 1; }
.news-card__meta { display: flex; gap: 10px; align-items: center; font-size: .84rem; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.news-card__meta--light { color: #c6cfe0; }
.news-card.is-hidden { display: none; }

.tag {
    display: inline-block; background: #efe7cc; color: #6d5610;
    font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    padding: 3px 10px; border-radius: 999px;
}

/* ---------- Split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split--top { align-items: start; grid-template-columns: 1.5fr 1fr; }

.stem-graphic {
    aspect-ratio: 1; max-width: 420px; margin-inline: auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.stem-graphic span {
    display: grid; place-items: center; border-radius: 22px;
    font-family: var(--font-serif); font-size: clamp(3rem, 8vw, 5rem); font-weight: 700;
    background: var(--navy); color: var(--gold-2); box-shadow: var(--shadow-lg);
}
.stem-graphic span:nth-child(2), .stem-graphic span:nth-child(3) { background: var(--gold); color: var(--navy); }

.info-box {
    background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--gold);
    border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); position: sticky; top: 100px;
}

.checklist { list-style: none; padding: 0; margin: 0 0 1em; }
.checklist li { padding: 7px 0 7px 30px; position: relative; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before { content: "✓"; position: absolute; left: 4px; color: var(--gold); font-weight: 800; }

.value h3 { color: var(--navy); }
.value { border-top: 4px solid var(--navy); }

/* ---------- Специалности ---------- */
.spec__prof { font-size: .9rem; color: var(--muted); }
.spec.is-hidden { display: none; }
.chips { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: .82rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.filter-bar input[type="search"] { max-width: 420px; }
.chip-btn {
    border: 1px solid var(--line); background: var(--white); padding: 8px 16px; border-radius: 999px;
    cursor: pointer; font: inherit; font-size: .92rem; color: var(--ink);
}
.chip-btn:hover { border-color: var(--navy); }
.chip-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.note { margin-top: 28px; padding: 16px 20px; background: #efe7cc; border-radius: 10px; }

/* ---------- Прием ---------- */
.exam-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 36px; }
.exam { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px; }
.exam__date { display: block; font-family: var(--font-serif); font-size: 1.5rem; color: var(--gold-2); }
.exam__name { color: #d6deec; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: var(--navy); color: #fff; font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:nth-child(even) { background: #faf8f3; }

.calc { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; background: var(--paper); padding: 26px; border-radius: var(--radius); }
.calc__result {
    grid-column: 1 / -1; font-size: 1.4rem; font-family: var(--font-serif);
    background: var(--navy); color: #fff; padding: 16px 22px; border-radius: 10px;
}
.calc__result strong { color: var(--gold-2); font-size: 1.8rem; }
.calc .small { grid-column: 1 / -1; margin: 0; }

/* ---------- Проекти ---------- */
.project .tag { margin-bottom: 12px; }
.project-list {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 28px;
}
.project-list li { padding: 12px 0 12px 32px; border-bottom: 1px solid var(--line); position: relative; }
.project-list li::before {
    content: ""; position: absolute; left: 6px; top: 21px; width: 10px; height: 10px;
    background: var(--gold); transform: rotate(45deg);
}

/* ---------- Документи ---------- */
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list a {
    display: flex; gap: 12px; justify-content: flex-start; align-items: center; padding: 12px 10px; border-radius: 8px;
    text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line);
}
.doc-list a:hover { background: var(--paper); color: var(--navy); }

/* ---------- Форми ---------- */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 16px; color: var(--navy); position: relative; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input[type="date"], input[type="url"], select, textarea {
    display: block; width: 100%; margin-top: 6px; padding: 11px 14px;
    border: 1px solid #cfc9bb; border-radius: 10px; font: inherit; font-weight: 400;
    background: var(--white); color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(29,58,107,.15); }
input.invalid, textarea.invalid { border-color: var(--err); }
textarea { resize: vertical; }
.counter { position: absolute; right: 10px; bottom: 8px; font-size: .75rem; color: var(--muted); font-weight: 400; }

.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-card, .contact-card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 30px; box-shadow: var(--shadow);
}
.contact-card h2 { font-size: 1.25rem; margin-top: 0; }
.phones { margin: 0; }
.phones dt { font-weight: 700; color: var(--navy); margin-top: 10px; }
.phones dd { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.map { margin-top: 24px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map iframe { width: 100%; height: 320px; border: 0; display: block; }

.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 18px; }
.alert ul { margin: 0; padding-left: 18px; }
.alert--ok  { background: #e4f4ea; color: var(--ok); border: 1px solid #b5dfc5; }
.alert--err { background: #fbe6e4; color: var(--err); border: 1px solid #f0bcb7; }

/* ---------- CTA ---------- */
.cta-band { background: var(--gold); padding: 44px 0; }
.cta-band__inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.cta-band h2 { margin: 0; color: var(--navy-3); }
.cta-band .btn--gold { background: var(--navy); color: #fff; }

/* ---------- Деца в риск ---------- */
.safety-strip { background: #fff8e6; border-top: 1px solid #f0dfaa; padding: 30px 0; }
.safety-strip__inner { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; align-items: center; }
.safety-strip h2 { font-size: 1.25rem; margin-bottom: .2em; }
.safety-strip p { margin: 0; color: var(--muted); }
.safety-strip ul { margin: 0; padding-left: 18px; font-size: .95rem; }

/* ---------- Футър ---------- */
.site-footer { background: var(--navy-3); color: #b8c3d8; font-size: .94rem; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; padding: 54px 0 40px; }
.site-footer h3 { color: #fff; font-family: var(--font-sans); font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #dfe5f0; text-decoration: none; }
.site-footer a:hover { color: var(--gold-2); }
.site-footer .muted { color: #8e9bb3; }
.footer__logo { margin-bottom: 14px; }
.footer__name { color: #fff; font-family: var(--font-serif); font-size: 1.05rem; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; font-size: .85rem; color: #8e9bb3; }

.to-top {
    position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; border-radius: 50%;
    border: 0; background: var(--navy); color: #fff; font-size: 1.2rem; cursor: pointer;
    box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transition: .25s; z-index: 40;
}
.to-top.show { opacity: 1; visibility: visible; }
.to-top:hover { background: var(--gold); color: var(--navy); }

/* ---------- Новина (prose) ---------- */
.prose { font-size: 1.08rem; }
.prose p { margin-bottom: 1.2em; }

/* ---------- Страниране ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.pagination a {
    min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px;
    border: 1px solid var(--line); background: var(--white); text-decoration: none; color: var(--ink);
}
.pagination a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Грешки ---------- */
.error-code { font-family: var(--font-serif); font-size: 7rem; line-height: 1; color: var(--gold); margin: 0; }

/* ---------- Админ ---------- */
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.tabs { display: flex; gap: 8px; border-bottom: 2px solid var(--line); margin-bottom: 24px; }
.tabs a { padding: 10px 18px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--navy); border-color: var(--gold); }
.admin-list { list-style: none; padding: 0; margin: 0; }
.admin-list li {
    display: flex; justify-content: space-between; gap: 12px; align-items: center;
    padding: 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px;
}
.admin-list li > div { display: flex; flex-direction: column; }
.admin-list form { margin: 0; }
.btn-del { border: 0; background: #fbe6e4; color: var(--err); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 1rem; }
.btn-del:hover { background: var(--err); color: #fff; }
.message { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px; margin-bottom: 14px; }
.message header { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }

/* ---------- Анимация при скрол ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ---------- SVG икони (Lucide) ---------- */
.icon { width: 1.1em; height: 1.1em; vertical-align: -0.17em; flex-shrink: 0; stroke-width: 2; }
.topbar .icon { width: 14px; height: 14px; color: var(--gold-2); margin-right: 3px; }
.to-top .icon { width: 20px; height: 20px; }
.to-top { display: grid; place-items: center; }

.badge-ico {
    display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
    background: var(--navy); color: var(--gold-2); margin-bottom: 14px;
    transition: background .2s, color .2s, transform .2s;
}
.badge-ico .icon { width: 24px; height: 24px; stroke-width: 1.75; }
.quick:hover .badge-ico, .spec:hover .badge-ico { background: var(--gold); color: var(--navy); transform: rotate(-6deg); }

.doc-ico { width: 20px; height: 20px; color: var(--gold); }
.doc-list a span { flex: 1; }
.doc-ext { width: 15px; height: 15px; color: var(--muted); opacity: 0; transition: opacity .2s; }
.doc-list a:hover .doc-ext { opacity: 1; }

/* ---------- Снимки ---------- */
.hero--photo {
    background:
        linear-gradient(100deg, rgba(12,26,51,.96) 0%, rgba(20,40,75,.88) 45%, rgba(20,40,75,.55) 100%),
        url("../img/photos/uchilishte.jpg") center 35% / cover no-repeat;
}
.hero--photo::after { opacity: .5; }

.page-hero--photo { position: relative; background-size: cover; background-repeat: no-repeat; }
.page-hero--school {
    background-image: linear-gradient(100deg, rgba(12,26,51,.95) 25%, rgba(20,40,75,.6)), url("../img/photos/uchilishte.jpg");
    background-position: center, center 30%;
}
.page-hero--class {
    background-image: linear-gradient(100deg, rgba(12,26,51,.95) 25%, rgba(20,40,75,.6)), url("../img/photos/klasna-staya.jpg");
    background-position: center, center 40%;
}
.page-hero--conf {
    background-image: linear-gradient(100deg, rgba(12,26,51,.95) 25%, rgba(20,40,75,.55)), url("../img/photos/konferentsiya.jpg");
    background-position: center, center 30%;
}

.photo-frame { margin: 0; position: relative; }
.photo-frame img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.photo-frame::before {      /* златна рамка зад снимката */
    content: ""; position: absolute; inset: 18px -18px -18px 18px;
    border: 3px solid var(--gold); border-radius: var(--radius); z-index: -1;
}
.split__media.photo-frame { isolation: isolate; margin-right: 18px; }

.photo-card {
    margin: 0; background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.photo-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-card figcaption { padding: 16px 20px; color: var(--muted); font-size: .95rem; }
.photo-card figcaption strong { color: var(--navy); }

/* ---------- Галерия + lightbox ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery__item {
    position: relative; display: block; overflow: hidden; border-radius: var(--radius);
    box-shadow: var(--shadow); aspect-ratio: 4 / 3; background: var(--navy);
}
.gallery__item:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.gallery__item:nth-child(4) { grid-column: span 2; aspect-ratio: auto; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .3s; }
.gallery__item:hover img { transform: scale(1.05); opacity: .85; }
.gallery__cap {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 12px;
    background: linear-gradient(transparent, rgba(12,26,51,.9)); color: #fff;
    font-size: .88rem; line-height: 1.35; transform: translateY(100%); transition: transform .3s;
}
.gallery__item:hover .gallery__cap, .gallery__item:focus-visible .gallery__cap { transform: none; }

.lightbox {
    border: 0; padding: 0; background: transparent; max-width: min(1100px, 94vw); max-height: 92vh;
    overflow: visible;
}
.lightbox::backdrop { background: rgba(8,16,32,.9); }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 10px; margin-inline: auto; }
.lightbox p { color: #e6ebf4; text-align: center; margin: 12px 0 0; }
.lightbox button {
    position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center;
}
.lightbox button:hover { background: var(--gold); color: var(--navy); }
.lightbox button .icon { width: 22px; height: 22px; }
.lightbox .lb-close { top: -54px; right: 0; }
.lightbox .lb-prev  { left: -58px; top: 40%; }
.lightbox .lb-next  { right: -58px; top: 40%; }

/* ---------- Галерия: страница ---------- */
.masonry { columns: 3 280px; column-gap: 16px; }
.masonry__item { break-inside: avoid; margin-bottom: 16px; aspect-ratio: auto !important; }
.masonry__item img { height: auto; }
.masonry__item.is-hidden, .gallery__item.is-hidden { display: none; }

.page-hero--trakai {
    background-image: linear-gradient(100deg, rgba(12,26,51,.95) 25%, rgba(20,40,75,.45)), url("../img/photos/trakai.jpg");
    background-position: center, center 60%;
}

/* Мобилности: 1 голяма + 4 малки */
.gallery--mob { grid-template-columns: repeat(4, 1fr); }
.gallery--mob .gallery__item:first-child { grid-column: span 2; grid-row: span 2; }
.gallery--mob .gallery__item:nth-child(5) { grid-column: span 4; aspect-ratio: 32 / 9; }
.gallery--mob .gallery__item:nth-child(5) img { object-position: center 45%; }

.section__intro { color: var(--muted); max-width: 760px; margin-bottom: 28px; }
.mt-l { margin-top: 40px; }
.photo-card figcaption { font-size: .9rem; }

/* Ученически разработки (инфографики) */
.works {
    display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 24px; align-items: center;
    margin-top: 56px; padding: 32px; background: var(--white);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.works__img { aspect-ratio: 7 / 10 !important; background: var(--paper); }
.works__img img { object-fit: contain; }

/* ---------- Професии (по брошурата) ---------- */
.spec-facts {
    display: flex; flex-wrap: wrap; gap: 10px 26px; margin-bottom: 28px;
    padding: 16px 22px; background: var(--navy); color: #d9e0ee; border-radius: var(--radius);
}
.spec-facts .icon { color: var(--gold-2); margin-right: 4px; }
.spec-facts strong { color: #fff; }

.spec-grid { align-items: stretch; }
.spec { display: flex; flex-direction: column; border-top: 4px solid var(--gold); }
.spec h3 { min-height: 2.4em; }
.spec__meta { list-style: none; padding: 0 0 14px; margin: 0 0 14px; border-bottom: 1px dashed var(--line); font-size: .86rem; color: var(--muted); }
.spec__meta li { margin-bottom: 4px; }
.spec__meta .icon { color: var(--gold); width: 15px; height: 15px; margin-right: 4px; }
.spec__can-title { font-family: var(--font-sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--navy-2); margin: 0 0 10px; }
.spec__can { list-style: none; padding: 0; margin: 0; }
.spec__can li { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; font-size: .95rem; }
.spec__can .icon { color: var(--gold); margin-top: 4px; flex-shrink: 0; }

.why {
    background: linear-gradient(160deg, var(--navy-2), var(--navy-3)); color: #e6ebf4;
    border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-lg);
}
.why h3 { color: #fff; font-size: 1.3rem; }
.why ul { list-style: none; padding: 0; margin: 0; }
.why li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: .95rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.why li:last-child { border-bottom: 0; }
.why .icon { color: var(--gold-2); margin-top: 3px; flex-shrink: 0; }

.why--wide { margin-top: 24px; padding: 30px 34px; }
.why--wide ul { columns: 3 240px; column-gap: 32px; }
.why--wide li { break-inside: avoid; }

.slogan {
    margin-top: 40px; padding: 30px; text-align: center; border-radius: var(--radius);
    background: var(--gold); color: var(--navy-3);
}
.slogan p { font-family: var(--font-serif); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; margin: 0 0 6px; }
.slogan span { display: block; margin-bottom: 18px; font-weight: 600; }
.slogan .btn--gold { background: var(--navy); color: #fff; }

/* ---------- Лого ---------- */
.brand__logo { width: 58px; height: 58px; flex-shrink: 0; transition: transform .4s ease; }
.brand:hover .brand__logo { transform: rotate(-8deg) scale(1.04); }
.footer__logo { background: #fff; border-radius: 50%; padding: 3px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.info-box__logo { display: block; margin: 0 auto 18px; width: 150px; height: 150px; }

.mail-info { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 16px; }
.mail-info dt { font-weight: 700; color: var(--navy); }
.mail-info dd { margin: 0; }
.text-err { color: var(--err); }

/* ---------- Документи: тип файл ---------- */
.doc-badge {
    flex-shrink: 0; min-width: 46px; padding: 5px 6px; border-radius: 6px; text-align: center;
    font: 700 .7rem/1 var(--font-sans); letter-spacing: .04em; color: #fff; background: var(--navy-2);
}
.doc-list a .doc-badge { flex: 0 0 auto; width: 46px; }
.doc-badge--pdf   { background: #c0392b; }
.doc-badge--word  { background: #2b5797; }
.doc-badge--excel { background: #1e7145; }
.doc-badge--ppt   { background: #c75c2c; }
.doc-badge--img   { background: #6b5b95; }
.doc-name { flex: 1; display: flex; flex-direction: column; }
.doc-name small { color: var(--muted); font-size: .8rem; margin-top: 2px; }

/* ---------- Документи: празно състояние и съдържание ---------- */
.empty-state { text-align: center; max-width: 560px; margin: 20px auto; padding: 44px 28px;
    background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state .icon { width: 48px; height: 48px; color: var(--gold); margin-bottom: 12px; stroke-width: 1.5; }
.empty-state p { color: var(--muted); }
.doc-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.doc-toc a { padding: 7px 14px; border-radius: 999px; background: var(--white); border: 1px solid var(--line);
    text-decoration: none; color: var(--ink); font-size: .92rem; }
.doc-toc a:hover { border-color: var(--navy); color: var(--navy); }
.doc-toc span { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px;
    background: var(--paper); font-size: .78rem; text-align: center; }
.doc-grid { align-items: start; }

/* ---------- Проекти: снимка, връзки, описание ---------- */
.project--img { padding-top: 0; overflow: hidden; }
.project__img { display: block; margin: 0 -26px 18px; aspect-ratio: 16 / 9; border-radius: 0; box-shadow: none; }
.project__img img { width: 100%; height: 100%; object-fit: cover; }
.project p { color: var(--muted); }
.project-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .9rem; }
.project-links a { text-decoration: none; font-weight: 600; }
.project-list li { display: flex; flex-direction: column; gap: 2px; }
.project-list__title small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.project-list__desc { color: var(--muted); font-size: .9rem; }

/* ---------- Админ: документи и проекти ---------- */
.admin-group { font-family: var(--font-sans); font-size: 1rem; margin: 22px 0 8px; color: var(--navy-2); }
.admin-list li > div:first-child a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.admin-list .doc-badge { min-width: 40px; font-size: .62rem; padding: 4px; }
.admin-list li.is-editing { border-color: var(--gold); box-shadow: 0 0 0 2px #efe7cc; }
.admin-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.admin-list li > .admin-actions { flex-direction: row; flex-shrink: 0; }
.admin-list li > div:first-child { flex: 1; min-width: 0; }
.admin-actions form { margin: 0; }
.btn-edit { display: inline-grid; place-items: center; border: 0; background: #e6ecf6; color: var(--navy-2);
    width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 1rem; text-decoration: none; }
.btn-edit:hover { background: var(--navy); color: #fff; }
.admin-inline-edit { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.admin-inline-edit .admin-actions { grid-column: 1 / -1; }
.admin-current { display: flex; align-items: center; gap: 14px; margin: -6px 0 16px; padding: 10px;
    background: var(--paper); border-radius: 10px; }
.admin-current img { border-radius: 6px; }
label.check { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
label.check input { width: auto; margin: 0; }
.radio-row { border: 0; padding: 0; margin: 0 0 16px; display: flex; gap: 20px; }
.radio-row legend { font-weight: 600; font-size: .92rem; color: var(--navy); margin-bottom: 6px; }
.radio-row label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.radio-row input { width: auto; margin: 0; }
input[type="file"] { display: block; width: 100%; margin-top: 6px; padding: 10px; border: 1px dashed #cfc9bb;
    border-radius: 10px; background: var(--paper); font: inherit; font-weight: 400; }
.file-too-big { color: var(--err); font-size: .85rem; font-weight: 600; }

/* ---------- Адаптивност ---------- */
@media (max-width: 1240px) and (min-width: 901px) {
    .main-nav a { padding: 8px 9px; font-size: .9rem; }
    .brand__text small { display: none; }
}

@media (max-width: 1080px) {
    .cards--4 { grid-template-columns: repeat(2, 1fr); }
    .quick { margin-top: 0; }
    .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .gallery { grid-template-columns: 1fr 1fr; }
    .gallery--mob { grid-template-columns: 1fr 1fr; }
    .gallery--mob .gallery__item:nth-child(5) { grid-column: span 2; aspect-ratio: 16 / 9; }
    .works { grid-template-columns: 1fr 1fr; }
    .works__text { grid-column: 1 / -1; }
    .admin-inline-edit { grid-template-columns: 1fr; }
    .gallery__item:nth-child(4) { grid-column: span 2; aspect-ratio: 16 / 9; }
    .lightbox .lb-prev { left: 4px; } .lightbox .lb-next { right: 4px; }
    .split__media.photo-frame { margin-right: 18px; margin-bottom: 18px; }
    .nav-toggle { display: block; }
    .main-nav {
        position: absolute; left: 0; right: 0; top: 100%;
        background: var(--white); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
        max-height: 0; overflow: hidden; transition: max-height .3s ease;
    }
    .main-nav.open { max-height: 520px; }
    .main-nav ul { flex-direction: column; padding: 10px 16px 18px; }
    .main-nav a { padding: 12px; }

    .hero__inner, .split, .split--top { grid-template-columns: 1fr; }
    .cards--3, .cards--2 { grid-template-columns: 1fr 1fr; }
    .info-box { position: static; }
    .safety-strip__inner { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    body { font-size: 16px; }
    .brand__logo { width: 48px; height: 48px; }
    .gallery__cap { transform: none; }
    .topbar__inner > span:first-child { display: none; }
    .cards--4, .cards--3, .cards--2 { grid-template-columns: 1fr; }
    .exam-grid, .calc, .project-list { grid-template-columns: 1fr; }
    .footer__grid { grid-template-columns: 1fr; }
    .brand__text small { display: none; }
    .section__head { flex-direction: column; }
}

@media print {
    .topbar, .site-header, .site-footer, .safety-strip, .to-top, .cta-band { display: none; }
    body { background: #fff; }
}
