:root {
    --page: #f4f5f7;
    --surface: #ffffff;
    --surface-muted: #f8f9fb;
    --text: #202631;
    --muted: #667085;
    --border: #d9dee7;
    --border-strong: #b9c1cf;
    --accent: #d71920;
    --accent-dark: #9f1118;
    --accent-soft: #fff1f1;
    --ink: #111827;
    --footer: #20242c;
    --radius: 4px;
    --shadow: 0 10px 22px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    background: var(--page);
    color: var(--text);
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

p { margin: 0 0 14px; }
ul, ol { margin-top: 0; padding-left: 22px; }
img { max-width: 100%; height: auto; }

.container {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 8px;
    z-index: 10;
    padding: 8px 12px;
    background: var(--ink);
    color: #fff;
}
.skip-link:focus { left: 8px; }

.site-header {
    background: var(--surface);
    border-top: 4px solid var(--accent);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    padding: 16px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.brand::before {
    content: "";
    width: 9px;
    height: 34px;
    background: var(--accent);
    display: inline-block;
}
.brand:hover { color: var(--accent-dark); text-decoration: none; }

.brand-subtitle {
    margin: 6px 0 0 19px;
    max-width: 410px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.top-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.top-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 3px;
    color: #303946;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
}
.top-nav a:hover {
    background: var(--surface-muted);
    border-color: var(--border);
    color: var(--accent-dark);
    text-decoration: none;
}
.top-nav .nav-search {
    border-color: var(--border);
    background: var(--surface-muted);
}

.page-shell { flex: 1 0 auto; padding-top: 28px; }

.site-footer {
    margin-top: 56px;
    background: var(--footer);
    border-top: 4px solid var(--accent);
    color: #eef2f6;
}
.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: start;
    padding: 24px 0;
}
.site-footer p { color: #b8c0cc; margin: 6px 0 0; }
.footer-links { display: flex; gap: 12px; flex-wrap: wrap; }
.footer-links a { color: #eef2f6; }

.hero,
.page-head,
.content-main,
.content-side,
.contact-form,
.home-panel,
.template-section,
.map-card,
.card,
.news-card,
.quick-card,
.info-card,
.side-box,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    min-height: 330px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.hero-copy {
    padding: 38px 38px 34px;
    border-left: 6px solid var(--accent);
}
.hero-note {
    padding: 30px 30px 28px;
    background: var(--surface-muted);
    border-left: 1px solid var(--border);
}
.hero-note ul { margin-bottom: 0; }

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent-dark);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.hero h1,
.page-head h1,
.content-main h1 {
    margin: 0 0 16px;
    color: var(--ink);
    line-height: 1.08;
    letter-spacing: -0.03em;
}
.hero h1 { max-width: 850px; font-size: clamp(32px, 4vw, 48px); }
.page-head h1,
.content-main h1 { font-size: clamp(28px, 3.2vw, 40px); }

.hero-note h2,
.home-panel h2,
.template-section h2,
.map-card h2,
.contact-form h2,
.info-card h2,
.side-box h2,
.empty-state h2 {
    margin: 0 0 12px;
    color: #202631;
    font-size: 19px;
    line-height: 1.25;
}

.lead {
    margin-bottom: 20px;
    color: #4b5563;
    font-size: 18px;
    line-height: 1.55;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button-link,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--accent);
    border-radius: 3px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.button-link:hover,
button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; text-decoration: none; }
.button-link-secondary { background: #fff; color: var(--accent-dark); }
.button-link-secondary:hover { background: var(--accent-soft); color: var(--accent-dark); }

.quick-grid,
.card-grid,
.news-list,
.template-grid,
.contact-info-grid {
    display: grid;
    gap: 16px;
}
.quick-grid { margin-top: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick-card { padding: 20px; border-top: 3px solid var(--accent); }
.quick-card h2,
.card h2,
.card h3,
.news-card h2,
.news-card h3,
.template-card h3 { margin: 0 0 10px; color: #202631; line-height: 1.25; }
.quick-card p:last-child,
.card p:last-child,
.news-card p:last-child,
.template-card p:last-child { margin-bottom: 0; }
.quick-card a,
.text-link,
.card-link { display: inline-flex; margin-top: 6px; font-weight: 700; color: var(--accent-dark); }

.cards-section,
.home-columns,
.news-list,
.card-grid { margin-top: 28px; }
.cards-section > h2,
.section-title { margin: 0 0 14px; font-size: 24px; color: #202631; }
.card-grid,
.news-list { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.section-material-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
}
.card,
.news-card { padding: 20px; }

.card {
    min-width: 0;
}

.card h2 {
    font-size: 20px;
    line-height: 1.22;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: auto;
}

.card h2 a {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: auto;
}

.card:hover,
.news-card:hover,
.quick-card:hover { border-color: var(--border-strong); }

.card-meta {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.home-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    gap: 22px;
}
.home-panel { padding: 24px; }
.news-compact-item + .news-compact-item { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.news-date { margin-bottom: 6px; color: var(--muted); font-size: 14px; }
.news-compact-item h3 { margin: 0 0 8px; line-height: 1.28; }

.page-head,
.content-main,
.content-side,
.contact-form,
.template-section,
.map-card { padding: 26px; }
.page-head { margin-bottom: 22px; border-left: 5px solid var(--accent); box-shadow: var(--shadow); }
.content-layout,
.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.8fr);
    gap: 22px;
    align-items: start;
}
.content-main { border-top: 3px solid var(--accent); }
.content-side { background: var(--surface-muted); }
.side-box { padding: 18px; background: var(--surface); }
.side-box + .side-box { margin-top: 14px; }
.single-column { max-width: 860px; }

.richtext p:first-child { margin-top: 0; }
.richtext h2,
.richtext h3 { margin: 28px 0 12px; line-height: 1.25; color: #202631; }
.richtext img { border-radius: var(--radius); border: 1px solid var(--border); }
.richtext a { font-weight: 700; }
.richtext table { width: 100%; border-collapse: collapse; }
.richtext th,
.richtext td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.richtext th { background: var(--surface-muted); }

.document-list { margin: 0; padding-left: 18px; }
.document-list li + li { margin-top: 8px; }
.document-category {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 7px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--surface-muted);
    color: #3b4654;
    font-size: 12px;
    font-weight: 700;
}

.template-section { margin-top: 22px; }
.template-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.template-card { padding: 18px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap { overflow-x: auto; }
.branch-table { width: 100%; border-collapse: collapse; background: #fff; }
.branch-table th,
.branch-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.branch-table th { background: #eef1f5; color: #202631; font-weight: 700; }

.contact-info-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 22px; }
.info-card { padding: 18px; background: var(--surface-muted); }
.map-card { margin-top: 22px; }
.map-card iframe { width: 100%; min-height: 320px; border: 0; border-radius: 3px; }
.preline { white-space: pre-line; }
.contact-summary p { margin: 0 0 12px; }

.form-row { display: grid; gap: 7px; margin-bottom: 15px; }
label { font-weight: 700; color: #303946; }
input,
textarea,
select { width: 100%; padding: 11px 12px; border-radius: 3px; border: 1px solid var(--border-strong); background: #fff; color: var(--text); font: inherit; }
input:focus,
textarea:focus,
select:focus { outline: 2px solid rgba(215, 25, 32, 0.18); border-color: var(--accent); }
textarea { min-height: 130px; resize: vertical; }
.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.form-error { margin: 0; color: #b42318; font-weight: 600; }
small { color: var(--muted); }
.empty-state { margin-top: 22px; padding: 22px; background: var(--surface-muted); }

.breadcrumbs {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 14px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { color: var(--text); }

@media (max-width: 960px) {
    .header-inner,
    .footer-grid,
    .hero,
    .content-layout,
    .contact-layout,
    .home-columns { grid-template-columns: 1fr; }
    .top-nav { justify-content: flex-start; }
    .hero-note { border-left: 0; border-top: 1px solid var(--border); }
    .quick-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .container { width: min(100% - 24px, 1160px); }
    .page-shell { padding-top: 18px; }
    .hero-copy,
    .hero-note,
    .page-head,
    .content-main,
    .content-side,
    .contact-form,
    .home-panel,
    .template-section,
    .map-card { padding: 20px; }
    .search-form { grid-template-columns: 1fr; }
    .brand { font-size: 19px; }
    .brand-subtitle { margin-left: 0; }
}

/* Расписание профориентационных мероприятий */
.schedule-section {
    margin-top: 22px;
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.schedule-section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: end;
    margin-bottom: 18px;
}

.schedule-section-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(22px, 2.4vw, 30px);
    line-height: 1.15;
}

.schedule-hint {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    text-align: right;
    white-space: nowrap;
}

.schedule-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.schedule-table {
    width: 100%;
    min-width: 1000px;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff;
}

.schedule-table th:nth-child(1) {
    width: 14%;
}

.schedule-table th:nth-child(2) {
    width: 19%;
}

.schedule-table th:nth-child(3) {
    width: 37%;
}

.schedule-table th:nth-child(4) {
    width: 18%;
}

.schedule-table th:nth-child(5) {
    width: 12%;
}

.schedule-table th,
.schedule-table td {
    padding: 14px 15px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.schedule-table th {
    background: #eef1f5;
    color: #303946;
    font-size: 13px;
    line-height: 1.3;
}

.schedule-table tbody tr:last-child td { border-bottom: 0; }
.schedule-table tbody tr:hover { background: #fafbfc; }
.schedule-row-cancelled { background: #fff8f8; }

.schedule-date-cell { width: 132px; }
.schedule-date-cell time { display: grid; gap: 2px; white-space: nowrap; }
.schedule-date-cell time strong { color: var(--ink); }
.schedule-date-cell time span { color: var(--muted); }

.schedule-event-cell {
    min-width: 185px;
}

.schedule-event-title {
    display: block;
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 750;
    line-height: 1.35;
}

.schedule-event-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.schedule-event-meta span + span::before {
    content: "•";
    margin: 0 8px;
    color: var(--accent);
}
.schedule-event-title { margin-bottom: 4px; color: var(--ink); }
.schedule-format { margin-bottom: 5px; color: var(--muted); font-size: 14px; }
.schedule-table td > small { margin-top: 4px; line-height: 1.4; }

.schedule-note {
    margin: 9px 0 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-line;
}

.schedule-action {
    display: inline-flex;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 700;
}

.schedule-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: #f5f6f8;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.schedule-status--confirmed {
    border-color: #9cc8ae;
    background: #edf8f1;
    color: #24633b;
}

.schedule-status--changed {
    border-color: #e9c36f;
    background: #fff8e7;
    color: #805b0c;
}

.schedule-status--cancelled {
    border-color: #e2a5a5;
    background: #fff0f0;
    color: #9f1118;
}

.schedule-mobile-list { display: none; }

.schedule-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    background: #fff;
}

.schedule-card + .schedule-card { margin-top: 14px; }
.schedule-card-cancelled { border-left-color: #9f1118; background: #fff8f8; }
.schedule-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.schedule-card-top time { display: grid; }
.schedule-card-top time span { color: var(--muted); }
.schedule-card h3 { margin: 15px 0 12px; color: var(--ink); font-size: 20px; line-height: 1.25; }

.schedule-details { display: grid; gap: 9px; margin: 0; }
.schedule-details > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
.schedule-details dt { color: var(--muted); font-size: 13px; font-weight: 700; }
.schedule-details dd { margin: 0; color: var(--text); }
.schedule-card-action { margin-top: 15px; }
.schedule-empty { margin-top: 0; }

.schedule-section-past { background: var(--surface-muted); }
.past-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 14px;
}

.past-event-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.past-event-card h3 { margin: 6px 0 10px; line-height: 1.25; }
.past-event-card p:last-child { margin-bottom: 0; }
.past-event-date { margin: 0; color: var(--accent-dark); font-size: 13px; font-weight: 800; }
.past-event-responsible { color: var(--muted); font-size: 14px; }

@media (max-width: 760px) {
    .schedule-section { padding: 20px; }
    .schedule-section-head { display: block; }
    .schedule-hint { margin-top: 9px; text-align: left; white-space: normal; }
    .schedule-table-wrap { display: none; }
    .schedule-mobile-list { display: block; }
}

@media (max-width: 460px) {
    .schedule-card-top { display: grid; }
    .schedule-card-top .schedule-status { justify-self: start; }
    .schedule-details > div { grid-template-columns: 1fr; gap: 1px; }
}

.home-news-section {
    margin-top: 28px;
}

.home-news-section .home-panel {
    width: 100%;
}

.home-news-section .news-compact-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    column-gap: 28px;
}

.home-news-section .news-compact-item {
    min-width: 0;
}

.home-news-section .news-compact-item + .news-compact-item {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

@media (max-width: 700px) {
    .home-news-section .news-compact-list {
        grid-template-columns: 1fr;
    }

    .home-news-section .news-compact-item + .news-compact-item {
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--border);
    }
}
