/*
Theme Name: dds_8studios.ru
Author: Мария Лебедева
Description: Тема для информационного сайта онлайн-школы арт-менеджмента и кураторства 8studios. Редакционная галерейная эстетика, адаптивная вёрстка, собственные иллюстрации.
Version: 1.1
Text Domain: studios8
*/

/* ============================ Переменные ============================ */
:root {
    --ink: #1a1714;
    --paper: #f7f4ee;
    --verm: #c8462e;
    --verm-dk: #a8371f;
    --slate: #3a4856;
    --sand: #e0d2bc;
    --ochre: #cea04a;
    --stone: #b4a896;
    --line: #ddd3c2;
    --foot-bg: #1f1c19;
    --foot-tx: #e6ddcf;
    --foot-mut: #aa9f8d;
    --maxw: 1180px;
    --rad: 4px;
    --serif: Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ============================ База ============================ */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

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

a { color: var(--verm-dk); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    font-family: var(--serif);
    line-height: 1.18;
    color: var(--ink);
    margin: 0 0 .5em;
    font-weight: 700;
}
h1 { font-size: 2.3rem; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

/* Контейнер ширины — единственный источник */
.shell {
    width: min(92%, var(--maxw));
    margin-inline: auto;
}

/* ============================ Шапка ============================ */
.site-header {
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    text-decoration: none;
    color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 52px; width: auto; }
.brand-text { min-width: 0; }
.brand-name {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.2;
    display: block;
    max-width: 46ch;
}
.brand-desc {
    display: block;
    font-size: .82rem;
    color: var(--slate);
    margin-top: 2px;
    max-width: 60ch;
}

/* Навигация */
.main-nav { min-width: 0; }
.nav-toggle {
    display: none;
    background: var(--ink);
    color: var(--paper);
    border: 0;
    border-radius: var(--rad);
    padding: 10px 14px;
    font-size: .95rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 8px 14px;
    color: var(--ink);
    font-weight: 600;
    font-size: .98rem;
    border-radius: var(--rad);
}
.main-nav a:hover { background: var(--sand); text-decoration: none; }
.main-nav .current-menu-item > a { background: var(--ink); color: var(--paper); }

/* ============================ Каркас контента ============================ */
.site-main { padding: 36px 0 52px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 44px;
    align-items: start;
}
.layout-single .content-area { width: 85%; margin-left: auto; margin-right: auto; }
@media (max-width: 960px) {
    .layout-single .content-area { width: 100%; }
}

/* ============================ Хлебные крошки ============================ */
.crumbs {
    font-size: .86rem;
    color: var(--slate);
    margin-bottom: 22px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.crumbs a { color: var(--verm-dk); }
.crumbs .sep { margin: 0 7px; color: var(--stone); }
.crumbs span:last-child { color: var(--ink); }

/* ============================ Карточки записей ============================ */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }

.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--rad);
    overflow: hidden;
}
.card-thumb {
    display: block;
    overflow: hidden;
    background: var(--sand);
}
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-body { flex: 1; display: flex; flex-direction: column; padding: 20px 22px 22px; }
.card-title { font-size: 1.22rem; margin: 0 0 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--verm-dk); text-decoration: none; }
.card-meta { font-size: .8rem; color: var(--slate); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em; }
.card-excerpt { flex: 1; color: #2c2823; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-more {
    align-self: flex-start;
    margin-top: 14px;
    font-weight: 700;
    color: var(--verm-dk);
    border-bottom: 2px solid var(--verm);
    padding-bottom: 2px;
}
.card-more:hover { text-decoration: none; color: var(--ink); border-color: var(--ink); }

/* Горизонтальная карточка (последние записи на главной) */
.card-row { flex-direction: row; }
.card-row .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    background: var(--sand);
}
.card-row .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-row .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@media (max-width: 600px) {
    .card-row { flex-direction: column; }
    .card-row .card-thumb-wrap { flex: none; width: 100%; position: static; }
    .card-row .card-thumb-wrap a { position: static; }
    .card-row .card-thumb-wrap img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
}

/* ============================ Запись / страница ============================ */
.entry { background: #fff; border: 1px solid var(--line); border-radius: var(--rad); padding: 30px 34px 36px; }
.entry-header { margin-bottom: 18px; }
.entry-title { font-size: 2.1rem; }
.entry-meta { font-size: .85rem; color: var(--slate); text-transform: uppercase; letter-spacing: .04em; }
.entry-thumb { margin: 0 0 22px; border-radius: var(--rad); overflow: hidden; }
.entry-thumb img { display: block; width: 100%; object-fit: cover; }
.entry-content { font-size: 1.05rem; }
.entry-content img { border-radius: var(--rad); margin: 1em 0; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }
.entry-content blockquote {
    margin: 1.4em 0;
    padding: 6px 22px;
    border-left: 4px solid var(--verm);
    background: #faf6ee;
    font-family: var(--serif);
    font-style: italic;
}
@media (max-width: 600px) { .entry { padding: 22px 18px 26px; } .entry-title { font-size: 1.6rem; } }

/* Таблицы */
.entry-content table { border-collapse: collapse; width: 100%; margin: 1.4em 0; }
.entry-content table, .entry-content th, .entry-content td { border: 1px solid var(--ink); }
.entry-content th, .entry-content td { padding: 9px 12px; text-align: left; }
.entry-content th { background: var(--sand); }

/* ============================ Сайдбар ============================ */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--rad);
    padding: 20px 22px;
    margin-bottom: 24px;
    color: var(--ink);
}
.sidebar .widget-title {
    font-size: 1.1rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--verm);
    color: var(--ink);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: var(--ink); }
.sidebar a:hover { color: var(--verm-dk); }
.sidebar .post-date { display: block; font-size: .78rem; color: var(--slate); }

/* ============================ Пагинация ============================ */
.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 38px 0 8px; }
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 9px 13px;
    border: 1px solid var(--ink);
    border-radius: var(--rad);
    color: var(--ink);
    font-weight: 600;
    background: #fff;
    line-height: 1;
}
.pager a.page-numbers:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.pager .page-numbers.current { background: var(--verm); border-color: var(--verm); color: #fff; }
.pager .page-numbers.dots { border: 0; background: none; }

/* ============================ Главная ============================ */
.home-section { padding: 52px 0; }
.home-section + .home-section { border-top: 1px solid var(--line); }
.section-eyebrow { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--verm-dk); font-weight: 700; margin-bottom: 8px; }
.section-lead { font-size: 1.05rem; color: #2c2823; max-width: 70ch; }

/* Слайдер (hero) */
.slider { position: relative; background: var(--ink); overflow: hidden; }
.slide { display: none; position: relative; }
.slide.is-active { display: block; }
.slide img { display: block; width: 100%; height: clamp(320px, 46vw, 560px); object-fit: cover; }
.slide-caption {
    position: absolute; left: 0; bottom: 0;
    padding: 26px 30px;
    background: linear-gradient(0deg, rgba(20,18,16,.82), rgba(20,18,16,0));
    color: var(--paper);
    width: 100%;
}
.slide-caption h2 { color: #fff; margin: 0 0 4px; font-size: 1.8rem; }
.slide-caption p { color: var(--sand); margin: 0; max-width: 56ch; }
.slider-controls { position: absolute; top: 50%; transform: translateY(-50%); width: 100%; display: flex; justify-content: space-between; pointer-events: none; }
.slider-btn {
    pointer-events: auto;
    background: rgba(247,244,238,.9);
    border: 0; color: var(--ink);
    width: 46px; height: 46px; margin: 0 14px;
    border-radius: 50%; cursor: pointer; font-size: 1.3rem; line-height: 1;
}
.slider-btn:hover { background: #fff; }
.slider-dots { position: absolute; bottom: 16px; right: 24px; display: flex; gap: 8px; }
.slider-dot { width: 11px; height: 11px; border-radius: 50%; border: 0; background: rgba(247,244,238,.5); cursor: pointer; padding: 0; }
.slider-dot.is-active { background: var(--verm); }

/* Сетка направлений (иконки) */
.dir-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 26px; }
@media (max-width: 960px) { .dir-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .dir-grid { grid-template-columns: 1fr; } }
.dir-card { background: #fff; border: 1px solid var(--line); border-radius: var(--rad); padding: 26px 24px; }
.dir-icon { width: 54px; height: 54px; margin-bottom: 14px; }
.dir-card h3 { font-size: 1.18rem; }
.dir-card p { margin: 0; color: #2c2823; font-size: .96rem; }

/* Пошаговый блок */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin-top: 26px; counter-reset: step; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 28px 22px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--rad); }
.step::before {
    counter-increment: step;
    content: counter(step);
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; margin-bottom: 12px;
    background: var(--verm); color: #fff;
    font-family: var(--serif); font-weight: 700; font-size: 1.2rem;
    border-radius: 50%;
}
.step h3 { font-size: 1.1rem; }
.step p { margin: 0; font-size: .94rem; color: #2c2823; }

/* Галерея */
.gallery-mosaic { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 26px; }
@media (max-width: 600px) { .gallery-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gallery-mosaic figure { margin: 0; border-radius: var(--rad); overflow: hidden; background: var(--sand); }
.gallery-mosaic img { display: block; width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }

/* Лента последних записей на главной */
.latest-list { display: flex; flex-direction: column; gap: 22px; margin-top: 26px; }

/* ============================ Поиск / 404 ============================ */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
    flex: 1; min-width: 0;
    padding: 10px 14px; border: 1px solid var(--ink); border-radius: var(--rad);
    font-size: 1rem; background: #fff; color: var(--ink);
}
.search-form button {
    background: var(--ink); color: var(--paper); border: 0;
    padding: 10px 18px; border-radius: var(--rad); cursor: pointer; font-weight: 600;
}
.search-form button:hover { background: var(--verm); }

.notfound { text-align: center; padding: 40px 0; }
.notfound .big404 { font-family: var(--serif); font-size: 5rem; color: var(--verm); line-height: 1; margin: 0 0 10px; }
.notfound .search-form { max-width: 460px; margin: 22px auto; }

/* ============================ Комментарии ============================ */
.comments-area { margin-top: 36px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 28px; padding: 0; }
.comment-item { margin-bottom: 18px; }
.comment-inner { background: #fff; border: 1px solid var(--line); border-radius: var(--rad); padding: 16px 18px; }
.comment-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: .85rem; }
.comment-author { font-weight: 700; }
.comment-date { color: var(--slate); }
.comment-reply a { font-size: .85rem; font-weight: 600; }
.comment-form-comment textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%; padding: 10px 12px; border: 1px solid var(--ink); border-radius: var(--rad);
    font-family: inherit; font-size: 1rem; background: #fff;
}
.comment-form p { margin: 0 0 14px; }
.comment-form .submit {
    background: var(--ink); color: var(--paper); border: 0; padding: 11px 22px;
    border-radius: var(--rad); cursor: pointer; font-weight: 600;
}
.comment-form .submit:hover { background: var(--verm); }

/* ============================ Подвал ============================ */
.site-footer { background: var(--foot-bg); color: var(--foot-tx); margin-top: 40px; }
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding: 48px 0 32px;
}
@media (max-width: 960px) { .footer-cols { grid-template-columns: 1fr; gap: 28px; } }
.site-footer .widget { color: var(--foot-tx); }
.site-footer .widget-title { color: #fff; font-size: 1.1rem; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--verm); }
.site-footer .widget p { color: var(--foot-mut); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.site-footer li:last-child { border-bottom: 0; }
.site-footer a { color: var(--foot-tx); }
.site-footer a:hover { color: var(--ochre); }
.site-footer .post-date { display: block; font-size: .78rem; color: var(--foot-mut); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 18px 0;
    font-size: .85rem;
    color: var(--foot-mut);
    text-align: center;
}

/* ============================ Cookie-баннер ============================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--ink);
    color: var(--paper);
    padding: 16px 0;
    box-shadow: 0 -6px 24px rgba(0,0,0,.22);
}
.cookie-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
.cookie-inner p { margin: 0; font-size: .9rem; max-width: 80ch; }
.cookie-inner a { color: var(--ochre); }
.cookie-accept {
    background: var(--verm); color: #fff; border: 0;
    padding: 11px 24px; border-radius: var(--rad); cursor: pointer; font-weight: 700; white-space: nowrap;
}
.cookie-accept:hover { background: var(--verm-dk); }

/* ============================ Адаптив навигации ============================ */
@media (max-width: 760px) {
    .nav-toggle { display: inline-block; }
    .main-nav ul { display: none; width: 100%; flex-direction: column; gap: 0; margin-top: 12px; }
    .main-nav.is-open ul { display: flex; }
    .main-nav a { padding: 12px 6px; border-bottom: 1px solid var(--line); border-radius: 0; }
    .header-inner { flex-wrap: wrap; }
    .main-nav { width: 100%; }
}
