/* ==========================================================================
   Layout — container, header, footer, buttons
   ========================================================================== */
html,body {
    overflow-x: hidden;
}
.container {
    width: 100%;
    max-width: max(var(--container-max), calc(100% - 200px));
    margin: 0 auto;
    padding: 0 var(--container-pad);
}
.container--narrow { max-width: var(--container-narrow); }

/* ----- Buttons ----- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 25px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    text-align: center;
    transition: background var(--transition), color var(--transition), transform var(--transition);
    line-height: 1.25;
    cursor: pointer;
    white-space: nowrap;
}
.btn--accent {
    background: var(--color-accent);
    color: var(--color-fg);
}
.btn--accent:hover {
    background: var(--color-accent-dark);
    color: var(--color-fg);
}
.btn--ghost {
    background: transparent;
    color: var(--color-fg);
    border: 1px solid var(--color-line);
}
.btn--ghost:hover {
    background: var(--color-fg);
    color: var(--color-fg-invert);
}
.btn--dark {
    background: var(--color-bg-dark);
    color: var(--color-fg-invert);
}
.btn--dark:hover { background: #000; color: var(--color-accent); }
.btn--outline-white {
    background: transparent;
    color: var(--color-fg-invert);
    border: 1px solid rgba(255, 255, 255, .55);
}
.btn--outline-white:hover {
    background: rgba(255, 255, 255, .12);
    color: var(--color-fg-invert);
    border-color: var(--color-fg-invert);
}
.btn--lg { padding: 16px 30px; font-size: 1rem; }
.btn--block { display: flex; width: 100%; }
.btn svg{
    transition: all .4s;
}
.btn:hover svg{
    transform: translateX(5px);
}
/* ----- Header ----- */

.site-header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    background: #000;
    border-bottom: 1px solid var(--color-line);
    transition: box-shadow var(--transition);
}
.site-header.is-scrolled { box-shadow: 0 4px 18px rgba(0, 0, 0, .06); }
body.menu-is-open { overflow: hidden; }

/* When the page starts with a hero, slide the header over the image. */
body:not(.has-hero) .site-main { padding-top: var(--header-h); }
body.has-hero .site-header {
    border-bottom: 1px solid rgba(195, 190, 182, 0.2);
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.01);
    box-shadow: none;
    color: var(--color-fg-invert);
}
body .site-header__logo,
body .site-header__logo-text,
body .site-header__nav-link,
body .site-header__phone { color: var(--color-fg-invert); }
body .site-header__phone svg { color: var(--color-accent); }
body .site-header__nav-link.is-active::after,
body .site-header__nav-link:hover::after { background: var(--color-accent); }
body .site-header__burger span { background: var(--color-fg-invert); }

body .site-header.is-scrolled {
    background: #000;
    border-bottom-color: var(--color-line);
}
/*body.has-hero .site-header.is-scrolled .site-header__logo,
body.has-hero .site-header.is-scrolled .site-header__logo-text,
body.has-hero .site-header.is-scrolled .site-header__nav-link,
body.has-hero .site-header.is-scrolled .site-header__phone { color: var(--color-fg); }
body.has-hero .site-header.is-scrolled .site-header__phone svg { color: var(--color-accent-dark); }
body.has-hero .site-header.is-scrolled .site-header__burger span { background: var(--color-fg); }*/
.site-header__inner {
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: var(--header-h);
}
.site-header__logo {
    flex: 0 0 auto;
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--color-fg);
    line-height: 1;
}
.site-header__logo img { max-height: 44px; width: auto; }
.site-header__logo-text { font-size: 1.5rem; letter-spacing: .02em; }

.site-header__nav {
    display: flex;
    gap: 40px;
    flex: 1 1 auto;
    justify-content: center;
}
.site-header__nav-link {
    color: var(--color-fg);
    font-weight: 500;
    position: relative;
    padding: 6px 0;
}
.site-header__nav-link.is-active::after,
.site-header__nav-link:hover::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--color-accent);
}

.site-header__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}
.site-header__phone {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-fg);
    font-weight: 500;
    font-size: 1.125rem;
}
.site-header__phone svg { color: var(--color-accent-dark); }

.site-header__burger {
    display: none;
    width: 36px;
    height: 36px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.site-header__burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-fg);
    transition: transform var(--transition), opacity var(--transition);
}
.site-header__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-header__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-header__mobile {
    border-top: 1px solid var(--color-line);
    background: var(--color-bg);
    padding: 18px 0 24px;
}
.site-header__mobile[hidden] { display: none; }
.site-header__mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 18px;
}
.site-header__mobile-link {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-line);
    font-size: 1.05rem;
    font-weight: 500;
}
.site-header__mobile-phone {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 14px;
}

/* ----- Footer ----- */

.site-footer {
    background: var(--color-bg-dark);
    color: var(--color-fg-invert);
    padding: 100px 0;
    margin-top: 0;
    overflow: hidden;
}
.site-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr 1.2fr;
    gap: 40px 60px;
    padding-bottom: 40px;
}
.site-footer__brand .site-footer__logo-text {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--color-accent);
    display: inline-block;
    margin: 0 0 10px;
}
.site-footer__about {
    color: rgba(255, 255, 255, .65);
    font-size: .95rem;
    line-height: 1.55;
    margin: 0;
    max-width: 280px;
}

.site-footer__title {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-d-white);
    margin: 0 0 10px;
}
.site-footer__nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.site-footer__nav a, .site-footer__list a, .site-footer__list li {
    color: var(--color-accent-badge);
    font-size: 1.125rem;
    line-height: 1.2;
    font-weight: 500;
}
.site-footer__nav a:hover,
.site-footer__list a:hover { color: var(--color-accent); }
.site-footer__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.site-footer__sep {
    border: 0;
    border-top: 1px solid rgba(195, 190, 182, 0.2);
    margin: 0;
}

.site-footer__bottom {
    padding: 50px 0;
    color: var(--color-accent-badge);
    font-size: .875rem;
}
.site-footer__brandmark img {
    width: 100%;
}
.site-footer__copy { margin: 0; }

/* ----- Default page-content (fallback for posts/pages without flex) ----- */

.page-content {
    padding: 60px 0;
}
.page-content__header { margin-bottom: 32px; }
.page-content__title { margin-bottom: 12px; }
.page-content__meta {
    color: var(--color-fg-muted);
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-content__meta .dot {
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--color-fg-muted);
    display: inline-block;
}
.page-content__cats { margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.page-content__cats a {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--color-accent-dark);
    font-weight: 500;
}
.page-content__thumb {
    margin: 0 0 32px;
    border-radius: var(--radius);
    overflow: hidden;
}
.page-content__body img { border-radius: var(--radius); }
.page-content__empty { color: var(--color-fg-muted); }
.page-content__tags { margin-top: 20px; font-size: .85rem; color: var(--color-fg-muted); }

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
    margin-bottom: 40px;
}
.post-card {
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition);
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card__thumb { display: block; aspect-ratio: 3 / 2; overflow: hidden; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card__thumb img { transform: scale(1.04); }
.post-card__body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.post-card__title { font-family: var(--font-serif); font-size: 1.2rem; margin: 0 0 8px; }
.post-card__title a { color: var(--color-fg); }
.post-card__title a:hover { color: var(--color-accent-dark); }
.post-card__meta { font-size: .8rem; color: var(--color-fg-muted); margin-bottom: 10px; }
.post-card__excerpt { color: var(--color-fg-muted); flex: 1; }
.post-card__more { margin-top: 12px; font-weight: 500; color: var(--color-accent-dark); }

.pagination {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.pagination li a, .pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
}
.pagination li.is-active span,
.pagination li a:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--color-line);
    font-weight: 500;
}
.site-header__burger[aria-expanded="false"] .b_close{
    display: none !important;
}
.site-header__burger[aria-expanded="true"] .b_open{
    display: none !important;
}

@media (max-width: 1200px) {
    .site-header__nav{
        gap: 20px
    }
}
@media (max-width: 1024px) {
    .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 36px 40px; }
    .site-header__phone svg {
        display: none;
    }
    .site-header__logo img{
        max-width: 130px;
    }
    .site-header__nav{
        gap: 10px
    }
    .site-header__inner{
        gap: 15px
    }
}

@media (max-width: 900px) and (min-width: 769px) {
    a.site-header__phone {
        display: none;
    }
}
@media (max-width: 768px) {
    :root {
        --header-h: 72px;
        --container-pad: 20px;
    }

    .site-header__inner { position: relative; gap: 12px; min-width: 0; }
    .site-header__nav { display: none; }
    .site-header__cta { display: none; }
    .site-header__burger { display: inline-flex; }

    .site-header__logo { min-width: 0; }
    .site-header__logo-text { font-size: 1.25rem; white-space: nowrap; }
    body .site-header__logo-text { color: var(--color-accent); }

    .site-header__phone svg { display: none; }
    .site-header__phone span { font-size: .95rem; white-space: nowrap; }

    .site-header__actions { margin-left: auto; gap: 12px; min-width: 0; }

    body .site-header__burger {
        width: 42px;
        height: 42px;
        border: 1px solid rgba(195, 190, 182, 0.2);
        border-radius: 5px;
        background: rgba(24, 24, 27, 0.1);
        padding: 10px 8px
    }
    body .site-header__burger span { background: var(--color-accent); }

    .site-header__mobile {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        bottom: 0;
        border-top: none;
        padding: 24px 20px;
        -webkit-backdrop-filter: blur(44px);
        display: flex;
        flex-direction: column;
        height: calc(100vh - var(--header-h));
        backdrop-filter: blur(44px);
        background: rgba(19, 19, 19, 0.8);
        z-index: 99;
    }
    .site-header__mobile .container {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    .site-header__mobile-nav {
        flex: 1;
        align-items: center;
        justify-content: center;
        gap: 30px;
        margin-bottom: 0;
    }
    .site-header__mobile-link {
        padding: 0;
        border-bottom: none;
        font-size: 1.5rem;
        color: var(--color-fg-invert);
    }
    .site-header__mobile-link.is-active { color: var(--color-accent); }
    .site-header__mobile-phone { display: none; }

    .site-footer { padding: 70px 0 }
    .site-footer__grid { grid-template-columns: 1fr; gap: 40px; }
    .site-footer__bottom { justify-content: flex-start; }
    .site-footer__nav {
        gap: 10px;
    }
}
@media (max-width: 480px) {
    .site-header__logo img {
        max-width: 130px;
    }
}
@media (max-width: 375px) {
    .site-header__logo img {
        max-width: 100px;
    }
    .site-header__logo-text { font-size: 1.1rem; }
    .site-header__phone span { font-size: .85rem; }
    .site-header__inner { gap: 8px; }
    .site-header__actions { gap: 8px; }
}