/* ==========================================================================
   Scandihome — скандинавский стиль интерьера
   Локальная таблица стилей. Современный «сканди» минимализм.
   ========================================================================== */

:root {
    /* Палитра: тёплый белый, природное дерево, приглушённый шалфей */
    --bg:        #f7f5f1;
    --surface:   #ffffff;
    --surface-2: #efece6;
    --ink:       #25221e;
    --ink-soft:  #4f4a43;
    --muted:     #8a8378;
    --line:      #e6e1d8;
    --line-2:    #d9d3c8;
    --accent:    #7d8c79;   /* шалфейный зелёный */
    --accent-d:  #5f6e5c;
    --wood:      #c8a87f;   /* светлое дерево */
    --shadow:    0 1px 2px rgba(37,34,30,.04), 0 12px 32px -16px rgba(37,34,30,.18);
    --shadow-sm: 0 1px 2px rgba(37,34,30,.05), 0 6px 18px -12px rgba(37,34,30,.16);
    --radius:    14px;
    --radius-sm: 10px;
    --maxw:      1200px;
    --ease:      cubic-bezier(.4, 0, .2, 1);

    --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-head: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ----- Reset / base ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-d); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--ink); }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: clamp(20px, 5vw, 48px);
}

.muted { color: var(--muted); }
.center { text-align: center; }

/* ----- Buttons ---------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    font-weight: 600;
    font-size: .95rem;
    padding: .85em 1.6em;
    border-radius: 100px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .25s var(--ease);
    white-space: nowrap;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent-d); color: #fff; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink); color: var(--ink); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(247, 245, 241, .82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 1.22rem;
    letter-spacing: -0.03em;
    color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--ink);
    color: #fff;
    display: grid; place-items: center;
    font-size: 1rem; font-weight: 800;
    flex: 0 0 auto;
}
.brand span small { display: block; font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: -2px; }

/* primary nav */
.nav { display: flex; align-items: center; gap: 4px; }
.nav > ul { list-style: none; padding: 0; display: flex; align-items: center; gap: 2px; }
.nav a.nav-link, .nav .nav-trigger {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 14px;
    font-weight: 600; font-size: .96rem;
    color: var(--ink-soft);
    border-radius: 9px;
    background: none; border: 0; cursor: pointer;
    font-family: inherit;
}
.nav a.nav-link:hover, .nav .nav-trigger:hover { color: var(--ink); background: var(--surface-2); }
.nav-link.is-active { color: var(--ink); }

/* dropdown mega menu */
.has-mega { position: relative; }
.nav-trigger svg { transition: transform .25s var(--ease); }
.has-mega:hover .nav-trigger svg, .has-mega:focus-within .nav-trigger svg { transform: rotate(180deg); }
.mega {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: min(760px, 86vw);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 28px;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.has-mega:hover .mega, .has-mega:focus-within .mega {
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.mega-col h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 10px; }
.mega-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.mega-col a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink-soft); font-weight: 500; font-size: .95rem; }
.mega-col a:hover { background: var(--surface-2); color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 10px; }

/* burger */
.burger {
    display: none;
    width: 44px; height: 44px;
    border: 1px solid var(--line-2);
    border-radius: 11px;
    background: var(--surface);
    cursor: pointer;
    position: relative;
}
.burger span, .burger span::before, .burger span::after {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: 18px; height: 2px; background: var(--ink); border-radius: 2px;
    transform: translate(-50%, -50%); transition: all .25s var(--ease);
}
.burger span::before { transform: translate(-50%, -7px); }
.burger span::after  { transform: translate(-50%, 5px); }
body.nav-open .burger span { background: transparent; }
body.nav-open .burger span::before { transform: translate(-50%, -50%) rotate(45deg); }
body.nav-open .burger span::after  { transform: translate(-50%, -50%) rotate(-45deg); }

/* ==========================================================================
   Hero (homepage)
   ========================================================================== */
.hero { padding: clamp(40px, 7vw, 84px) 0 clamp(30px, 5vw, 56px); }
.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
}
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .76rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
    color: var(--accent-d);
    margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--accent); }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent-d); }
.hero .lead { font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--ink-soft); margin-top: 22px; max-width: 38ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-figure {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 4 / 3.4;
    background: var(--surface-2);
}
.hero-figure img { width: 100%; height: 100%; object-fit: cover; }
.hero-badge {
    position: absolute; left: 18px; bottom: 18px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(6px);
    padding: 12px 18px; border-radius: 14px;
    font-size: .85rem; font-weight: 600; color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.hero-badge b { display: block; font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }

/* stats strip */
.stats { display: flex; flex-wrap: wrap; gap: clamp(24px, 5vw, 60px); margin-top: 54px; padding-top: 32px; border-top: 1px solid var(--line); }
.stat b { display: block; font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: .92rem; }

/* ==========================================================================
   Section heading
   ========================================================================== */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-head { max-width: 60ch; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head.center { margin-inline: auto; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; }
.section-head p { color: var(--ink-soft); margin-top: 14px; font-size: 1.08rem; }

/* ==========================================================================
   Category / cards grid
   ========================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: clamp(16px, 2vw, 26px);
}
.card {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--line-2); }
.card-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: scale(1.06); }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-tag { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-d); }
.card h3 { font-size: 1.18rem; font-weight: 700; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card p { color: var(--ink-soft); font-size: .94rem; line-height: 1.55; }
.card-more { margin-top: auto; padding-top: 10px; font-weight: 600; font-size: .9rem; color: var(--accent-d); display: inline-flex; align-items: center; gap: 6px; }

/* feature band */
.band { background: var(--surface); border-block: 1px solid var(--line); }
.band-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: clamp(20px,3vw,40px); }
.feature .ic {
    width: 46px; height: 46px; border-radius: 12px;
    background: var(--surface-2); color: var(--accent-d);
    display: grid; place-items: center; margin-bottom: 16px;
}
.feature h3 { font-size: 1.12rem; margin-bottom: 8px; }
.feature p { color: var(--ink-soft); font-size: .96rem; }

/* ==========================================================================
   Article page
   ========================================================================== */
.page-head { padding: clamp(28px, 4vw, 44px) 0 0; }
.breadcrumb { font-size: .86rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { opacity: .5; }

.article-hero {
    margin: 22px 0 clamp(28px, 4vw, 44px);
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
}
.article-hero .titleblock { max-width: 60ch; }
.article-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); font-weight: 800; }
.article-hero .lead { font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--ink-soft); margin-top: 18px; }
.article-hero-media {
    border-radius: 20px; overflow: hidden; box-shadow: var(--shadow);
    aspect-ratio: 16 / 8; background: var(--surface-2);
}
.article-hero-media img { width: 100%; height: 100%; object-fit: cover; }

.article-layout { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: clamp(32px, 5vw, 64px); align-items: start; padding-bottom: clamp(40px,6vw,80px); }

.prose { max-width: 72ch; font-size: 1.06rem; }
.prose > p { margin: 1.1em 0; color: var(--ink-soft); }
.prose > p:first-child { margin-top: 0; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin: 1.7em 0 .6em; padding-top: .3em; }
.prose h3 { font-size: 1.28rem; font-weight: 700; margin: 1.4em 0 .5em; }
.prose a { color: var(--accent-d); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--ink); }
.prose strong { color: var(--ink); }
.post-list { margin: 1em 0; padding-left: 1.2em; color: var(--ink-soft); }
.post-list li { margin: .35em 0; }

/* inline figure grids inside prose */
.figure-grid { display: grid; gap: 12px; margin: 1.6em 0; }
.figure-grid-1 { grid-template-columns: 1fr; }
.figure-grid-2 { grid-template-columns: repeat(2, 1fr); }
.figure-grid-3 { grid-template-columns: repeat(3, 1fr); }
.figure { margin: 0; }
.figure img {
    width: 100%; border-radius: var(--radius-sm);
    aspect-ratio: 3 / 2; object-fit: cover;
    background: var(--surface-2);
    cursor: zoom-in;
    transition: filter .25s var(--ease);
}
.figure img:hover { filter: brightness(1.04); }
.figure figcaption { font-size: .82rem; color: var(--muted); margin-top: 7px; }

/* sidebar */
.sidebar { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 22px; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.widget h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 14px; }
.widget ul { list-style: none; padding: 0; display: flex; flex-direction: column; }
.widget li + li { border-top: 1px solid var(--line); }
.widget li a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; color: var(--ink-soft); font-weight: 500; font-size: .96rem; }
.widget li a:hover { color: var(--ink); }
.widget li a.is-active { color: var(--ink); font-weight: 700; }
.widget li a svg { opacity: .35; flex: 0 0 auto; }
.widget-cta { background: var(--ink); color: #fff; }
.widget-cta h4 { color: rgba(255,255,255,.6); }
.widget-cta p { color: rgba(255,255,255,.82); font-size: .94rem; margin-bottom: 16px; }
.widget-cta .btn { background: #fff; color: var(--ink); width: 100%; justify-content: center; }
.widget-cta .btn:hover { background: var(--wood); }

/* ==========================================================================
   Gallery + lightbox
   ========================================================================== */
.gallery-section { padding: clamp(36px, 5vw, 64px) 0; border-top: 1px solid var(--line); background: var(--surface); }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 28px;
}
.gallery-grid a {
    display: block; overflow: hidden; border-radius: var(--radius-sm);
    aspect-ratio: 1 / 1; background: var(--surface-2);
    cursor: zoom-in;
}
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gallery-grid a:hover img { transform: scale(1.07); }

/* lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(28, 25, 22, .92);
    display: none; align-items: center; justify-content: center;
    padding: 4vmin;
    opacity: 0; transition: opacity .25s var(--ease);
}
.lightbox.open { display: flex; opacity: 1; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.lightbox-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer;
    font-size: 1.5rem; display: grid; place-items: center;
    transition: background .2s var(--ease);
}
.lightbox-btn:hover { background: rgba(255,255,255,.25); }
.lb-prev { left: 3vmin; } .lb-next { right: 3vmin; }
.lb-close { top: 3vmin; right: 3vmin; transform: none; }
.lb-count { position: absolute; bottom: 3vmin; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.7); font-size: .9rem; }

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta {
    margin: clamp(40px,6vw,80px) auto;
    background: linear-gradient(135deg, var(--ink), #353029);
    color: #fff; border-radius: 24px;
    padding: clamp(36px, 6vw, 72px) clamp(28px, 5vw, 64px);
    text-align: center;
}
.cta h2 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
.cta p { color: rgba(255,255,255,.8); max-width: 52ch; margin: 16px auto 28px; }
.cta .btn-primary { background: #fff; color: var(--ink); }
.cta .btn-primary:hover { background: var(--wood); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: clamp(48px,6vw,72px) 0 28px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: clamp(24px, 4vw, 48px); }
.footer-about .brand { margin-bottom: 16px; }
.footer-about p { color: var(--ink-soft); font-size: .95rem; max-width: 36ch; }
.footer-col h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 16px; }
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { color: var(--ink-soft); font-size: .95rem; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; margin-top: clamp(36px,5vw,56px); padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-figure { order: -1; aspect-ratio: 16/10; }
    .article-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
    .sidebar .widget { flex: 1 1 260px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    body { font-size: 16px; }
    .burger { display: block; }
    .nav {
        position: fixed; inset: 72px 0 auto 0;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
        flex-direction: column; align-items: stretch;
        padding: 12px clamp(20px,5vw,48px) 24px;
        gap: 0;
        transform: translateY(-120%);
        transition: transform .3s var(--ease);
        max-height: calc(100vh - 72px); overflow-y: auto;
    }
    body.nav-open .nav { transform: translateY(0); }
    .nav > ul { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
    .nav a.nav-link, .nav .nav-trigger { width: 100%; padding: 14px 8px; font-size: 1.05rem; }
    .has-mega { position: static; }
    .mega {
        position: static; transform: none; width: 100%;
        opacity: 1; visibility: visible; pointer-events: auto;
        box-shadow: none; border: 0; border-radius: 0;
        grid-template-columns: 1fr 1fr; padding: 4px 0 12px;
        display: none;
    }
    .has-mega.open .mega { display: grid; }
    .header-actions .btn-ghost { display: none; }
    .figure-grid-3, .figure-grid-2 { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
    .figure-grid-3, .figure-grid-2 { grid-template-columns: 1fr; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
