/*
Theme Name: dds_accordeurspiano.com
Author: Лаптев Лев
Description: Тема для информационного сайта о настройке и ремонте пианино. Сочетает классическую эстетику инструментов с современной типографикой и удобной читаемостью.
Version: 1.1
Text Domain: dds_accordeurspiano
*/

/* === БАЗА === */
:root {
    --bg-ivory: #FDF8F0;
    --bg-lacquer: #1A120E;
    --ink: #2A2A28;
    --ink-soft: #4a4642;
    --gold: #BF8F5A;
    --gold-deep: #9b6e3e;
    --string: #C0B6A8;
    --soundboard: #D9B48B;
    --key-white: #FFFFFF;
    --key-black: #1E1E1E;
    --hairline: rgba(26, 18, 14, 0.12);
    --shadow-lacquer: 0 6px 18px rgba(26, 18, 14, 0.18), 0 1px 2px rgba(26, 18, 14, 0.08);
    --radius: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--ink);
    background: var(--bg-ivory);
    line-height: 1.65;
    font-size: 17px;
}

p {
    margin: 0 0 1em;
}

a {
    color: var(--gold-deep);
    text-decoration: none;
    transition: color 0.18s ease, background-color 0.18s ease;
}

a:hover { color: var(--bg-lacquer); }

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

/* === ТИПОГРАФИКА === */
h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--bg-lacquer);
    line-height: 1.25;
    margin: 1.4em 0 0.6em;
    font-weight: 700;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

.entry-title::first-letter,
.page-title::first-letter,
.section-title::first-letter {
    font-size: 1.35em;
    color: var(--gold);
    font-style: italic;
    padding-right: 0.04em;
}

/* === КЛАВИШНЫЙ ХЕДЕР === */
.site-header {
    background: var(--bg-ivory);
    border-bottom: 1px solid var(--hairline);
}

.header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 24px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
    min-width: 240px;
}

.brand a {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
}

.brand-logo,
.brand svg {
    width: 56px;
    height: 56px;
    flex: none;
    border-radius: 4px;
    background: var(--bg-lacquer);
    color: var(--gold);
    padding: 6px;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--bg-lacquer);
    letter-spacing: 0.01em;
}
.brand-desc {
    font-size: 0.86rem;
    color: var(--ink-soft);
    line-height: 1.4;
}

/* Клавишное меню */
.keyboard-nav {
    width: 100%;
    border-top: 1px solid var(--hairline);
    margin-top: 18px;
    padding: 0;
    background: linear-gradient(to bottom, transparent, rgba(26,18,14,0.025));
}

.keyboard-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
}

.keyboard-nav li {
    flex: 1 1 0;
    border-right: 1px solid var(--hairline);
    position: relative;
    background: var(--key-white);
}

.keyboard-nav li:last-child { border-right: none; }

.keyboard-nav li:nth-child(2n) { background: #faf3e6; }

.keyboard-nav a {
    display: block;
    padding: 18px 14px 22px;
    text-align: center;
    color: var(--ink);
    font-size: 0.98rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: Georgia, serif;
    transition: transform 0.12s ease, background 0.18s ease;
}

.keyboard-nav a:hover,
.keyboard-nav .current-menu-item > a {
    background: var(--gold);
    color: var(--bg-lacquer);
    transform: translateY(1px);
}

.keyboard-nav .current-menu-item > a {
    box-shadow: inset 0 -3px 0 var(--gold-deep);
}

/* Бургер */
.menu-toggle {
    display: none;
    background: var(--bg-lacquer);
    color: var(--gold);
    border: none;
    padding: 10px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* === ГЛАВНЫЙ КОНТЕЙНЕР === */
.site-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 36px 24px 48px;
}

.layout {
    display: grid;
    gap: 36px;
    grid-template-columns: minmax(0, 1fr);
}

.layout.has-sidebar {
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
}

.layout.no-sidebar {
    max-width: 85%;
    margin: 0 auto;
}

@media (max-width: 960px) {
    .layout.has-sidebar { grid-template-columns: minmax(0, 1fr); }
    .layout.no-sidebar { max-width: 100%; }
}

/* === ХЛЕБНЫЕ КРОШКИ === */
.breadcrumbs {
    font-size: 0.88rem;
    color: var(--ink-soft);
    margin: 0 0 24px;
    padding: 10px 14px;
    background: rgba(217, 180, 139, 0.12);
    border-left: 3px solid var(--gold);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.breadcrumbs a { color: var(--gold-deep); }
.breadcrumbs a:hover { color: var(--bg-lacquer); }
.breadcrumbs .sep { margin: 0 8px; color: var(--string); }
.breadcrumbs .current { color: var(--ink); font-weight: 600; }

/* === КАРТОЧКИ ЗАПИСЕЙ === */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin: 0 0 28px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--key-white);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lacquer);
}

.card-thumb {
    display: block;
    overflow: hidden;
    background: var(--bg-lacquer);
}

.card-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.card:hover .card-thumb img { transform: scale(1.04); }

.card-body {
    flex: 1;
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-title {
    margin: 0;
    font-size: 1.18rem;
    line-height: 1.3;
}
.card-title a { color: var(--bg-lacquer); }
.card-title a:hover { color: var(--gold-deep); }

.card-meta {
    font-size: 0.82rem;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
}

.card-excerpt { color: var(--ink); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }

.card-more {
    margin-top: auto;
    align-self: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid var(--gold);
    color: var(--gold-deep);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.card-more:hover {
    color: var(--bg-lacquer);
    border-bottom-color: var(--bg-lacquer);
}

/* === КНОПКИ === */
.btn-primary {
    display: inline-block;
    padding: 12px 22px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #e6c79a 0%, var(--soundboard) 100%);
    color: var(--bg-lacquer);
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid var(--gold-deep);
    box-shadow: 0 3px 8px rgba(26, 18, 14, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.18s ease;
}

.btn-primary:hover {
    color: var(--bg-lacquer);
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(26, 18, 14, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    display: inline-block;
    padding: 6px 0;
    color: var(--gold-deep);
    border-bottom: 1px solid var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.92rem;
}

.btn-secondary:hover {
    color: var(--bg-lacquer);
    border-bottom-color: var(--bg-lacquer);
}

/* === САЙДБАР === */
.sidebar {
    font-size: 0.95rem;
}

.widget {
    margin-bottom: 28px;
    padding: 18px 20px;
    background: var(--key-white);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
}

.widget-title,
.widget h2,
.widget h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: var(--bg-lacquer);
    border-bottom: 1px solid var(--gold);
    padding-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget li {
    padding: 6px 0;
    border-bottom: 1px dotted var(--hairline);
}

.widget li:last-child { border-bottom: none; }

/* === ПАГИНАЦИЯ — КЛАВИШИ === */
.pagination {
    margin: 36px 0 12px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 56px;
    padding: 0 14px;
    background: var(--key-white);
    color: var(--ink);
    border: 1px solid var(--hairline);
    border-right: none;
    font-family: Georgia, serif;
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.pagination .page-numbers:nth-child(2n) {
    background: var(--bg-lacquer);
    color: var(--bg-ivory);
    height: 40px;
    align-self: flex-start;
    margin-top: 0;
}

.pagination .page-numbers:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.pagination .page-numbers:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-right: 1px solid var(--hairline); }

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--gold);
    color: var(--bg-lacquer);
    border-color: var(--gold-deep);
}

/* === ПОИСК === */
.search-form {
    display: flex;
    gap: 8px;
    align-items: stretch;
    max-width: 480px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--key-white);
}

.search-form input[type="search"]:focus {
    outline: 2px solid var(--gold);
    outline-offset: -1px;
}

.search-form button { white-space: nowrap; }

/* === КОНТЕНТ ЗАПИСИ === */
.entry-content {
    font-size: 1.02rem;
}

.entry-content img {
    border-radius: var(--radius);
    margin: 1em 0;
}

.entry-content blockquote {
    margin: 1.4em 0;
    padding: 14px 18px;
    border-left: 3px solid var(--gold);
    background: rgba(217, 180, 139, 0.1);
    color: var(--ink-soft);
    font-style: italic;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid var(--hairline);
}

.entry-content th,
.entry-content td {
    padding: 10px 14px;
    border: 1px solid var(--hairline);
    text-align: left;
}

.entry-content th {
    background: var(--bg-lacquer);
    color: var(--bg-ivory);
}

.entry-content code {
    background: rgba(26, 18, 14, 0.06);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.92em;
}

.entry-meta {
    font-size: 0.86rem;
    color: var(--ink-soft);
    margin: 0 0 18px;
}

/* === ГЛАВНАЯ === */
.front-section {
    margin: 0 0 48px;
    padding: 36px 32px;
    background: var(--key-white);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    position: relative;
}

.front-section.dark {
    background: var(--bg-lacquer);
    color: var(--bg-ivory);
}

.front-section.dark h2,
.front-section.dark h3 { color: var(--soundboard); }
.front-section.dark a { color: var(--soundboard); }
.front-section.dark a:hover { color: var(--bg-ivory); }

.front-section h2 { margin-top: 0; }

.front-section .columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 18px;
}

.front-section .col {
    padding: 18px;
    background: rgba(217, 180, 139, 0.12);
    border-radius: var(--radius);
}

.front-section.dark .col {
    background: rgba(217, 180, 139, 0.1);
    color: var(--bg-ivory);
}

.front-section .col h3 {
    margin-top: 0;
    color: var(--bg-lacquer);
}

.front-section.dark .col h3 { color: var(--soundboard); }

.repair-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0;
    margin: 22px 0 6px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--hairline);
}

.repair-step {
    padding: 18px 16px;
    background: var(--key-white);
    border-right: 1px solid var(--hairline);
    position: relative;
}

.repair-step:last-child { border-right: none; }

.repair-step:nth-child(2n) { background: #faf3e6; }

.repair-step .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--gold);
    color: var(--bg-lacquer);
    border-radius: 50%;
    font-weight: 700;
    margin-bottom: 8px;
}

.repair-step strong { display: block; margin-bottom: 4px; color: var(--bg-lacquer); }

@media (max-width: 600px) {
    .repair-steps { grid-template-columns: 1fr; }
    .repair-step { border-right: none; border-bottom: 1px solid var(--hairline); }
    .repair-step:last-child { border-bottom: none; }
}

.section-title {
    margin: 0 0 22px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gold);
}

/* === ПОДВАЛ === */
.site-footer {
    background: var(--bg-lacquer);
    color: #cdc4b6;
    margin-top: 60px;
    padding: 44px 0 0;
}

.footer-grid {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px 36px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}

@media (max-width: 800px) {
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

.footer-col .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: #cdc4b6;
}

.footer-col .widget-title,
.footer-col .widget h2,
.footer-col .widget h3 {
    color: var(--soundboard);
    border-bottom-color: var(--gold-deep);
}

.footer-col a { color: #e8dcc6; }
.footer-col a:hover { color: var(--soundboard); }

.footer-col li { border-bottom-color: rgba(217, 180, 139, 0.15); }

.site-copy {
    border-top: 1px solid rgba(217, 180, 139, 0.15);
    padding: 18px 24px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--string);
}

/* === COOKIE-БАННЕР === */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 999;
    background: var(--bg-lacquer);
    color: var(--bg-ivory);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    max-width: 1148px;
    margin: 0 auto;
}

.cookie-banner p {
    margin: 0;
    flex: 1;
    min-width: 240px;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--bg-ivory);
}

.cookie-banner a { color: var(--soundboard); text-decoration: underline; }
.cookie-banner button {
    background: var(--gold);
    color: var(--bg-lacquer);
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.cookie-banner button:hover { background: var(--soundboard); }

/* === КОММЕНТАРИИ === */
.comments-area { margin-top: 40px; }
.comments-title {
    border-bottom: 2px solid var(--gold);
    padding-bottom: 8px;
}

.comment-list { list-style: none; padding: 0; margin: 0; }

.comment-list .comment {
    background: var(--key-white);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 14px;
}

.comment-list .children {
    list-style: none;
    margin-top: 14px;
    padding-left: 18px;
    border-left: 2px solid var(--soundboard);
}

.comment-meta { font-size: 0.86rem; color: var(--ink-soft); margin-bottom: 8px; }
.comment-author { font-weight: 700; color: var(--bg-lacquer); }

.comment-form {
    background: var(--key-white);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-top: 28px;
}

.comment-form p { margin-bottom: 14px; }

.comment-form label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--ink);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-ivory);
}

.comment-form textarea { min-height: 120px; resize: vertical; }

.comment-form input:focus,
.comment-form textarea:focus {
    outline: 2px solid var(--gold);
    outline-offset: -1px;
}

.comment-form .submit {
    display: inline-block;
    padding: 12px 22px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #e6c79a 0%, var(--soundboard) 100%);
    color: var(--bg-lacquer);
    font-weight: 600;
    border: 1px solid var(--gold-deep);
    cursor: pointer;
    font-family: inherit;
}

/* === 404 === */
.error-404 {
    text-align: center;
    padding: 40px 20px;
}

.error-404 h1 {
    font-size: 5rem;
    color: var(--gold);
    margin: 0;
    line-height: 1;
}

.error-404 p { font-size: 1.1rem; max-width: 580px; margin: 12px auto 24px; }
.error-404 .search-form { margin: 24px auto; }

/* === АДАПТИВ === */
@media (max-width: 960px) {
    .keyboard-nav a { padding: 14px 10px 16px; font-size: 0.9rem; letter-spacing: 0.04em; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.35rem; }

    .header-inner { padding: 16px 16px 0; gap: 12px; }
    .brand-logo, .brand svg { width: 48px; height: 48px; }
    .brand-name { font-size: 1.1rem; }
    .brand-desc { font-size: 0.8rem; }

    .menu-toggle { display: inline-block; margin-left: auto; }

    .keyboard-nav { margin-top: 14px; }

    .keyboard-nav ul {
        display: none;
        flex-direction: column;
        background: var(--key-white);
    }

    .keyboard-nav.is-open ul { display: flex; }

    .keyboard-nav li {
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--hairline);
        background: var(--key-white) !important;
    }
    .keyboard-nav a { text-align: left; padding: 14px 18px; min-height: 48px; }

    .site-main { padding: 24px 16px 36px; }
    .front-section { padding: 24px 18px; }
    .layout.no-sidebar { max-width: 100%; }
    .posts-grid { grid-template-columns: 1fr; gap: 18px; }
    .pagination .page-numbers { min-width: 38px; height: 48px; padding: 0 10px; }
    .pagination .page-numbers:nth-child(2n) { height: 36px; }
    .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
}
