/*
Theme Name: Школа 179
Description: Тема для сайта Школы №179 — три колонки (разделы / контент / новости), графит и бронза.
Version: 1.2
*/

:root {
    --ink: #1c2430;
    --ink-soft: #465363;
    --ink-faint: #7c8798;
    --paper: #eef1ec;
    --panel: #ffffff;
    --rule: #dde2d8;
    --rule-soft: #e7eae2;
    --accent: #a9792f;
    --accent-deep: #7e5a22;
    --accent-ink: #fff8ec;
    --nav-active: #f4ede0;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

a { color: var(--accent-deep); text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }

.mono {
    font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
    font-variant-numeric: tabular-nums;
}

/* ---------- masthead ---------- */

#masthead {
    background: var(--ink);
    color: var(--paper);
    padding: 1.3rem 1.5rem 1.1rem;
}

.masthead-inner {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.site-mark {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    text-decoration: none;
    color: inherit;
}

.site-mark .num {
    font-family: Georgia, "PT Serif", "Times New Roman", serif;
    font-weight: 700;
    font-size: 2.1rem;
    letter-spacing: -0.02em;
    color: var(--accent);
    line-height: 1;
}

.site-mark .wordmark {
    font-family: Georgia, "PT Serif", "Times New Roman", serif;
    font-size: 1.05rem;
    color: var(--paper);
    max-width: 30ch;
    line-height: 1.25;
}

.masthead-search {
    font-size: 0.85rem;
    color: var(--ink-faint);
}

.masthead-search input[type="text"] {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--paper);
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    width: 140px;
}

/* ---------- breadcrumb ---------- */

#breadcrumb {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0.6rem 1.5rem;
    font-size: 0.82rem;
    color: var(--ink-faint);
}
#breadcrumb a { color: var(--ink-soft); }

/* ---------- layout ---------- */

#layout {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) 280px;
    gap: 2rem;
    align-items: start;
}

/* узкое окно: новости уходят под контент, затем всё в одну колонку */
@media (max-width: 1100px) {
    #layout { grid-template-columns: 190px minmax(0, 1fr); }
    #sidebar-news { grid-column: 2; }
}

@media (max-width: 760px) {
    #layout { grid-template-columns: 1fr; }
    #sidebar-news { grid-column: auto; }
}

/* ---------- left nav ---------- */

#sidebar-nav {
    font-size: 0.92rem;
}

#sidebar-nav h2 {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 0 0 0.6rem;
}

#sidebar-nav ul { list-style: none; margin: 0 0 1.4rem; padding: 0; }
#sidebar-nav li { border-bottom: 1px solid var(--rule-soft); }
#sidebar-nav li:last-child { border-bottom: none; }

#sidebar-nav a {
    display: block;
    padding: 0.55rem 0.1rem;
    color: var(--ink-soft);
    text-decoration: none;
}
#sidebar-nav a:hover { color: var(--accent-deep); }
#sidebar-nav li.current > a {
    color: var(--accent-deep);
    font-weight: 600;
}

#sidebar-nav .external a::after {
    content: " \2197";
    color: var(--ink-faint);
    font-size: 0.8em;
}

/* ---------- main content ---------- */

#content {
    min-width: 0;
}

.entry-header h1 {
    font-family: Georgia, "PT Serif", "Times New Roman", serif;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.2;
    margin: 0 0 1.1rem;
    text-wrap: balance;
}

.entry-meta {
    font-size: 0.78rem;
    color: var(--ink-faint);
    margin: -0.6rem 0 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.entry-content { font-size: 1rem; }
.entry-content p { margin: 0 0 1rem; }
.entry-content img { max-width: 100%; height: auto; border-radius: 4px; }
.entry-content figure { margin: 0 0 1.1rem; }
.entry-content h2, .entry-content h3 {
    font-family: Georgia, "PT Serif", "Times New Roman", serif;
    color: var(--ink);
    margin: 1.6rem 0 0.7rem;
}
.entry-content ul, .entry-content ol { padding-left: 1.3rem; }
.entry-content table { border-collapse: collapse; width: 100%; margin: 0 0 1.1rem; font-size: 0.92rem; }
.entry-content table td, .entry-content table th {
    border: 1px solid var(--rule); padding: 0.4rem 0.6rem; text-align: left;
}
.entry-content .documents ul { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.entry-content .documents li {
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    margin-bottom: 0.4rem;
    background: var(--panel);
}
.entry-content .documents li::before { content: "\1F4C4  "; }
.entry-content .gallery {
    display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0;
}
.entry-content .gallery img { width: 150px; height: 110px; object-fit: cover; }

/* child pages grid (for section landing pages) */
.child-pages {
    list-style: none; margin: 2rem 0 0; padding: 1.3rem 0 0;
    border-top: 1px solid var(--rule);
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.8rem;
}
.child-pages li a {
    display: block; padding: 0.7rem 0.9rem; background: var(--panel);
    border: 1px solid var(--rule); border-radius: 6px; text-decoration: none; color: var(--ink);
    font-size: 0.9rem;
}
.child-pages li a:hover { border-color: var(--accent); color: var(--accent-deep); }

/* news list on archive/category pages */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { padding: 1rem 0; border-bottom: 1px solid var(--rule-soft); }
.news-list time { display: block; font-size: 0.76rem; color: var(--ink-faint); margin-bottom: 0.2rem; }
.news-list a { font-size: 1.02rem; color: var(--ink); text-decoration: none; }
.news-list a:hover { color: var(--accent-deep); }

/* ---------- right sidebar: latest news ---------- */

#sidebar-news {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 1.1rem 1.2rem 1.3rem;
}

#sidebar-news h2 {
    font-family: Georgia, "PT Serif", "Times New Roman", serif;
    font-size: 1rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
}

#sidebar-news ul { list-style: none; margin: 0; padding: 0; }
#sidebar-news li { padding: 0.75rem 0; border-bottom: 1px solid var(--rule-soft); }
#sidebar-news li:last-child { border-bottom: none; }
#sidebar-news time {
    display: block; font-size: 0.72rem; color: var(--accent-deep);
    text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.2rem;
}
#sidebar-news a { font-size: 0.9rem; color: var(--ink); text-decoration: none; line-height: 1.35; display: block; }
#sidebar-news a:hover { color: var(--accent-deep); }
#sidebar-news .more { display: block; margin-top: 1rem; font-size: 0.82rem; text-align: right; }

/* ---------- footer ---------- */

#colophon {
    border-top: 1px solid var(--rule);
    margin-top: 2rem;
    padding: 1.3rem 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--ink-faint);
}

/* ---------- статьи папки (как список в папке eZ) ---------- */

.child-posts article {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--rule-soft);
}
.child-posts article:first-child { padding-top: 0; }
.child-posts h2 {
    font-family: Georgia, "PT Serif", "Times New Roman", serif;
    font-size: 1.2rem;
    line-height: 1.3;
    margin: 0 0 0.3rem;
}
.child-posts h2 a { color: var(--ink); text-decoration: none; }
.child-posts h2 a:hover { color: var(--accent-deep); }
.child-posts time { font-size: 0.78rem; color: var(--ink-faint); }
.child-posts .excerpt { margin-top: 0.5rem; }
.child-posts .excerpt p { margin: 0 0 0.5rem; }
.child-posts .more { font-size: 0.85rem; }
