/*
Theme Name: Sezione
Description: Журнал об устройстве дома с редакционной главной, рубриками и полной статьёй.
Version: 1.0.6
Requires at least: 7.0.2
Tested up to: 7.0.2
Requires PHP: 8.3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sezione4-pro
Tags: blog, custom-logo, custom-menu, featured-images, translation-ready, accessibility-ready, wide-blocks
*/

:root{--ink:#10231b;--forest:#142e26;--paper:#f6f2ee;--mint:#dae4db;--lavender:#e2d8e3;--plum:#633669;--rail:clamp(210px,17%,326px);--gutter:clamp(16px,2vw,32px);--font:Arial,Helvetica,system-ui,sans-serif}

*{box-sizing:border-box}
html{scroll-padding-top:24px}
body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--font);font-size:18px;line-height:1.6}
body,button,input,textarea{font-family:var(--font)}
a{color:inherit;text-underline-offset:.22em}
a:hover{color:var(--plum)}
a:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid var(--plum);outline-offset:4px}
img{max-width:100%;height:auto;display:block}
figure{margin:0}
h1,h2,h3,p{margin:0 0 .65em}
h1,h2,h3{font-family:var(--font);font-weight:800;line-height:1.05;letter-spacing:-.035em;overflow-wrap:anywhere}
h1{font-size:clamp(36px,4.9vw,72px)}
h2{font-size:clamp(26px,3vw,42px)}
h3{font-size:clamp(24px,2.7vw,38px)}
[hidden]{display:none!important}
.screen-reader-text{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.skip-link:focus{z-index:100;clip:auto;width:auto;height:auto;background:var(--paper);padding:16px}
.journal-shell{position:relative;width:100%;max-width:1920px;margin:auto;min-height:100vh;background:linear-gradient(90deg,var(--forest) 0,var(--forest) var(--rail),var(--paper) var(--rail))}
.site-header{position:absolute;top:0;left:0;width:var(--rail);z-index:2;color:var(--paper);padding:32px 16px}
.site-header a:hover{color:#fff}
.brand{display:flex;flex-direction:column;text-decoration:none;align-items:flex-start;line-height:1.2}
.brand-mark{display:block;width:58px;height:58px;border:2px solid currentColor;position:relative;margin-bottom:12px}
.brand-mark:before,.brand-mark:after{content:"";position:absolute;border:2px solid currentColor;inset:7px}
.brand-mark:after{inset:15px}
.brand-title{font-size:clamp(24px,3vw,38px);font-weight:800;letter-spacing:-.05em;max-width:100%;overflow-wrap:anywhere}
.brand-description{font-size:15px;margin-top:5px}
.custom-logo-link{display:flex;align-items:center;justify-content:center;max-width:100%;padding:14px 10px;background:var(--paper);border:1px solid #dae4db}.custom-logo{object-fit:contain;width:100%;height:auto;max-height:160px}
.site-main{position:relative;padding-left:var(--rail);min-height:90vh}
.content-primary{min-width:0}
.primary-sidebar{position:absolute;left:0;top:0;bottom:0;width:var(--rail);padding:225px 18px 650px;color:var(--paper);background:var(--forest) url('assets/images/sidebar-cutaway.png') right bottom/100% auto no-repeat;z-index:1}
.rail-inner{position:relative}
.rail-heading{font-size:20px;display:none}
.category-navigation ul{list-style:none;padding:0;margin:0}
.category-navigation li{margin-bottom:18px}
.category-navigation a{display:block;text-decoration:none;font-weight:700;line-height:1.4;font-size:18px;overflow-wrap:anywhere;padding:5px 0}
.category-navigation a[aria-current]{text-decoration:underline;text-decoration-thickness:2px}
.primary-sidebar a:hover{color:white}
.primary-sidebar a:focus-visible{outline-color:var(--mint)}
.editorial-grid{display:grid;grid-template-columns:repeat(24,minmax(0,1fr));gap:0}
.journal-intro{grid-column:1/-1;background:var(--mint);text-align:center;padding:18px 0 22px}
.journal-intro h1{font-size:clamp(52px,4.15vw,60px);line-height:1.04;padding:0 24px;margin-bottom:0}
.journal-intro p{font-size:clamp(24px,2.1vw,30px);line-height:1.2;margin:0 18px}
.cutaway-house{width:100%;height:auto;aspect-ratio:3/2;object-fit:contain;margin:-5px auto 0}
.editorial-section{padding:14px 16px 18px;min-width:0;border-bottom:1px solid var(--paper)}
.editorial-section--structure{grid-column:1/9;border-right:1px solid #c9c1c7}
.editorial-section--renovation{grid-column:9/-1}
.editorial-section--surfaces{grid-column:1/-1;background:var(--lavender)}
.editorial-section--rooms{grid-column:1/16;border-right:1px solid #c9c1c7}
.editorial-section--systems{grid-column:16/-1;background:var(--forest);color:var(--paper);margin:0;box-shadow:inset 0 0 0 6px var(--paper)}
.editorial-section--garden{grid-column:1/-1}
.section-label{font-size:22px;text-transform:uppercase;letter-spacing:.04em;color:var(--plum);font-weight:700;border-top:1px solid var(--plum);border-bottom:1px solid var(--plum);padding:10px 0 8px;margin-bottom:10px;line-height:1.3}
.editorial-section--systems .section-label{color:var(--paper);border-color:#ccd6cf}
.post-card{min-width:0;margin-bottom:16px}
.card-category{font-size:16px;font-weight:700;text-decoration:none;color:var(--plum);display:inline-block;margin-bottom:8px}
.card-link{display:block;text-decoration:none}
.card-text{min-width:0}.card-link h2,.card-link h3{margin:0 0 12px}.post-card__title{font-size:clamp(28px,2.4vw,34px);line-height:1.07}.card-text .post-card__excerpt{margin:0 0 14px}
.card-link:hover .post-card__title{text-decoration:underline}
.post-card__image img{width:100%;aspect-ratio:4/3;object-fit:cover}
.post-card__placeholder{background:linear-gradient(135deg,var(--mint),#bccac0);aspect-ratio:4/3;border:1px solid #aabcb0}
.post-card__excerpt{font-size:17px;font-weight:400;letter-spacing:0;line-height:1.4}

.editorial-section--surfaces{display:grid;grid-template-columns:minmax(0,44fr) minmax(0,56fr);column-gap:24px;grid-template-rows:min-content min-content minmax(min-content,1fr);align-content:start}
.editorial-section--surfaces>.section-label{grid-column:1;grid-row:1;align-self:start}
.editorial-section--surfaces>.post-card{grid-column:1/-1}
.editorial-section--surfaces .card-link{display:grid;grid-template-columns:minmax(0,44fr) minmax(0,56fr);gap:24px;align-items:start}
.editorial-section--surfaces>.post-card:first-of-type,.editorial-section--surfaces>.post-card:first-of-type .card-link{display:contents}
.editorial-section--surfaces>.post-card:first-of-type>.card-category{grid-column:1;grid-row:2}

.editorial-section--surfaces .card-text{grid-column:1;grid-row:1;align-self:start}.editorial-section--surfaces .post-card__image,.editorial-section--surfaces .post-card__placeholder{grid-column:2;grid-row:1;aspect-ratio:16/9;position:relative;align-self:start}.editorial-section--surfaces .post-card__image img{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;object-fit:cover}
.editorial-section--surfaces>.post-card:first-of-type .card-text{grid-row:3}
.editorial-section--surfaces>.post-card:first-of-type :is(.post-card__image,.post-card__placeholder){grid-row:1/4}

.editorial-section--systems .card-category{color:var(--paper)}
.editorial-section--systems .card-link:hover{color:white}
.editorial-section--garden .post-card__image img,.editorial-section--garden .post-card__placeholder{aspect-ratio:4/1}
.editorial-section .card-category{margin-bottom:10px}
.empty-state{font-size:16px;padding:24px 0}
.home-ad-slot{grid-column:1/-1}
.home-ad-slot__pair{display:flex;gap:20px}
.site-footer{margin-left:var(--rail);border-top:1px solid var(--plum);padding:20px 24px;display:flex;gap:20px;justify-content:center;align-items:center;flex-wrap:wrap;font-size:20px;line-height:1.5}
.site-footer__section:empty{display:none}
.footer-information,.footer-information ul{display:flex;flex-wrap:wrap;list-style:none;padding:0;margin:0;gap:16px}
.site-footer a{display:inline-flex;align-items:center;min-height:44px;padding:8px 0}.footer-information a{text-decoration:none;font-weight:700}
.footer-information a:hover{text-decoration:underline}
.site-container{max-width:100%}
.archive-content,.utility-content{padding:var(--gutter)}
.breadcrumb{font-size:15px;margin:0 0 22px;display:flex;flex-wrap:wrap;gap:7px}
.archive-header{max-width:800px;margin:24px 0}
.archive-description{max-width:65ch}
.post-grid{display:flex;flex-wrap:wrap;gap:24px}
.post-grid>.post-card{flex:0 0 calc((100% - 48px)/3);order:var(--archive-position-order,0)}
.archive-editorial-grid>.post-card:first-child{flex-basis:100%;background:var(--mint);padding:20px}
.archive-editorial-grid>.post-card:first-child .card-link{display:grid;grid-template-columns:1fr 1.3fr;gap:24px}
.archive-editorial-grid>.post-card:first-child .card-text{grid-column:1;grid-row:1}

.archive-editorial-grid>.post-card:first-child .post-card__image,.archive-editorial-grid>.post-card:first-child .post-card__placeholder{grid-column:2;grid-row:1}
.category-inline-ad{flex-basis:100%}
.category-inline-ad--first { order: 35; }
.category-inline-ad--second{order:65}
.text-pagination{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap;margin:36px 0}
.journal-article{padding:var(--gutter)}
.article-intro{max-width:1000px}
.article-lead{font-size:clamp(18px,2vw,24px);max-width:65ch;margin:24px 0}
.article-cover img{width:100%;aspect-ratio:16/9;object-fit:cover}
.article-cover figcaption{font-size:15px;padding:12px 0}
.article-reading-layout{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:36px;margin-top:32px}
.entry-content{min-width:0;overflow-wrap:anywhere;font-size:18px;line-height:1.65}
.entry-content h2,.entry-content h3{scroll-margin-top:24px}
.entry-content h2{font-size:clamp(26px,2.8vw,38px);margin-top:1.4em}
.entry-content h3{font-size:25px;margin-top:1.2em}
.entry-content p,.entry-content ul,.entry-content ol{margin-bottom:1.2em}
.entry-content a{text-decoration:underline}
.entry-content blockquote,.entry-content .is-style-look-for{margin:28px 0;padding:24px;background:var(--mint);border-left:3px solid var(--plum)}
.entry-content .is-style-before-start{background:var(--lavender)}
.entry-content table{width:100%;border-collapse:collapse}
.entry-content th,.entry-content td{padding:12px;border:1px solid #aaa;vertical-align:top}
.entry-content .wp-block-table{overflow-x:auto}
.entry-content iframe,.entry-content video{max-width:100%}
.article-toc{grid-column:2;grid-row:1;align-self:start;position:sticky;top:24px;padding:20px;background:var(--lavender);font-size:15px}
.article-toc h2{font-size:22px}
.article-toc ul{padding-left:18px}
.article-toc li{margin-bottom:12px}
.article-reading-layout>.entry-content{grid-column:1;grid-row:1}
.article-return{margin-top:32px;display:flex;flex-wrap:wrap;gap:16px}
.utility-content{min-height:90vh}
.utility-content .entry-content{max-width:70ch}
.search-form{display:flex;gap:12px;flex-wrap:wrap;margin:24px 0}
input,textarea,button{max-width:100%;padding:10px;font-size:inherit}
button,input[type=submit]{cursor:pointer;background:var(--forest);color:var(--paper);border:1px solid currentColor}
.comments-area{max-width:70ch;margin:36px var(--gutter)}
.alignwide,.alignfull{max-width:100%;margin-left:0;margin-right:0}

/* Парные редакционные секции: общий нижний край, свободная высота текста. */
.editorial-section:is(.editorial-section--structure,.editorial-section--renovation,.editorial-section--rooms,.editorial-section--systems){display:flex;flex-direction:column}
.editorial-section:is(.editorial-section--structure,.editorial-section--renovation,.editorial-section--rooms,.editorial-section--systems) .post-card{display:flex;flex-direction:column;flex:1;margin-bottom:0}
.editorial-section:is(.editorial-section--structure,.editorial-section--renovation,.editorial-section--rooms,.editorial-section--systems) .card-link{display:flex;flex-direction:column;flex:1}
.editorial-section:is(.editorial-section--structure,.editorial-section--renovation,.editorial-section--rooms,.editorial-section--systems) :is(.post-card__image,.post-card__placeholder){position:relative;flex:1;min-height:clamp(380px,32vw,540px);aspect-ratio:auto}
.editorial-section:is(.editorial-section--structure,.editorial-section--renovation,.editorial-section--rooms,.editorial-section--systems) .post-card__image img{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;object-fit:cover}
.homepage-main .primary-sidebar{background-size:280% auto;background-position:right -36px bottom 100px}
.rail-widgets{border-top:1px solid #748b80;margin-top:28px;padding-top:20px;font-size:16px;line-height:1.5}
.rail-widgets :is(h2,h3,.widget-title,.wp-block-heading){font-size:17px;line-height:1.3;letter-spacing:0;font-weight:700;margin-bottom:14px}
.rail-widgets ul{list-style:none;margin:0;padding:0}.rail-widgets li{margin-bottom:16px}
.rail-widgets a{font-size:16px;line-height:1.5;color:#e7eeea}


/* Первый ряд: узкий портретный кадр и широкий интерьер, общий нижний край. */
.editorial-section.editorial-section--structure :is(.post-card__image,.post-card__placeholder){min-height:clamp(440px,34vw,760px)}
.site-widgets-end{margin-left:var(--rail)}
.site-widgets-end:empty{display:none}
.site-widgets-end .rail-widgets{margin:24px 18px;padding:20px;background:var(--mint);color:var(--ink);border-top:1px solid var(--plum)}
.site-widgets-end .rail-widgets a{color:var(--ink);font-size:17px}
.site-widgets-end .rail-widgets :is(h2,h3,.widget-title,.wp-block-heading){font-size:20px}

@media(max-width:1199px){.post-grid>.post-card{flex-basis:calc((100% - 24px)/2)}
.category-inline-ad--first { order: 45; }
.category-inline-ad--second{order:85}

.site-header{padding:28px 16px}
.primary-sidebar{padding-left:16px;padding-right:16px}
}

@media(max-width:1023px){:root{--rail:0px;--gutter:18px}
.journal-shell{background:var(--paper)}
.site-header{position:static;width:auto;background:var(--forest);padding:18px;color:var(--paper)}
.brand{display:grid;grid-template-columns:36px 1fr;column-gap:12px;align-items:center}
.brand-mark{grid-row:1/3;width:36px;height:36px;margin:0}
.brand-mark:before{inset:5px}
.brand-mark:after{inset:10px}
.brand-title{font-size:28px}
.brand-description{font-size:13px;margin:0}
.custom-logo-link{width:min(100%,240px);padding:10px}.custom-logo{max-height:70px}
.site-main{padding:0}
.primary-sidebar{position:relative;width:auto;inset:auto;padding:22px 18px 100px;margin:0 calc(-1 * var(--gutter));background-size:200px auto;background-position:right bottom}
.homepage-main .primary-sidebar{grid-column:1/-1;margin:0}
.rail-inner{position:static}
.rail-heading{display:block;margin-bottom:16px}
.category-navigation ul{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 16px}
.category-navigation li{margin:0}
.category-navigation a{font-size:17px;min-height:44px;padding:9px 0}
.journal-intro{padding:22px 0}
.journal-intro h1{font-size:clamp(32px,7.8vw,42px);margin-bottom:10px;padding:0 18px}
.journal-intro p{font-size:18px}
.editorial-grid{display:block}
.editorial-section{padding:18px;border-right:0;margin:0}.editorial-section--systems{box-shadow:none}
.editorial-section h3{font-size:30px}
.editorial-section--surfaces{display:block}.editorial-section--surfaces>.post-card,.editorial-section--surfaces>.post-card:first-of-type{display:block}.editorial-section--surfaces .card-link,.editorial-section--surfaces>.post-card:first-of-type .card-link{display:flex;flex-direction:column}
.editorial-section--surfaces .post-card__image,.editorial-section--surfaces .post-card__placeholder{width:100%}
.editorial-section--structure .post-card__image img,.editorial-section--structure .post-card__placeholder{aspect-ratio:4/3}
.editorial-section--renovation .post-card__image img{aspect-ratio:4/3}
.editorial-section--garden .post-card__image img,.editorial-section--garden .post-card__placeholder{aspect-ratio:16/9}
.site-footer{margin:0;padding:20px 18px;gap:12px;font-size:17px}
.footer-information,.footer-information ul{gap:12px}
.post-grid{display:flex}
.post-grid>.post-card{flex-basis:100%}
.archive-editorial-grid>.post-card:first-child .card-link{display:block}
.post-card{margin-bottom:28px}
.archive-editorial-grid>.post-card:first-child{padding:16px}
.category-inline-ad--first { order: 25; }
.category-inline-ad--second{order:65}
.article-intro h1,.archive-header h1{font-size:clamp(32px,7.8vw,42px)}
.journal-article{padding:18px}
.journal-article .primary-sidebar{margin-top:-18px;margin-bottom:22px;padding-top:12px;padding-bottom:12px}.journal-article .rail-heading{display:none}
.article-reading-layout{display:flex;flex-direction:column;gap:24px;margin-top:24px}.article-toc{position:static;max-width:100%;width:100%;margin:24px 0;order:1}.article-reading-layout>.entry-content{order:0}
.article-cover img{aspect-ratio:4/3}
.entry-content{font-size:17px}
.breadcrumb{margin-bottom:18px}
h1{font-size:36px}
.comments-area{margin:24px 18px}
}

@media(max-width:359px){.category-navigation ul{grid-template-columns:1fr}
.category-navigation a{font-size:18px}
.primary-sidebar{padding-bottom:80px}
}

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

.section-label a{text-decoration:none}
.section-label a:hover{text-decoration:underline}
.fallback-title{padding:24px}
.archive-editorial-grid--continuation>.post-card:first-child{flex-basis:calc((100% - 48px)/3);background:transparent;padding:0}
.archive-editorial-grid--continuation>.post-card:first-child .card-link{display:block}
@media(max-width:1199px){.archive-editorial-grid--continuation>.post-card:first-child{flex-basis:calc((100% - 24px)/2)}
}
@media(max-width:1023px){.archive-editorial-grid--continuation>.post-card:first-child{flex-basis:100%}
}

@media(max-width:1023px){
.section-label{font-size:18px}.post-card__title{font-size:28px}.card-category{font-size:15px}
.homepage-main .primary-sidebar{background-size:200px auto;background-position:right bottom}
.editorial-section:is(.editorial-section--structure,.editorial-section--renovation,.editorial-section--rooms,.editorial-section--systems) :is(.post-card__image,.post-card__placeholder){flex:none;min-height:0;aspect-ratio:4/3}
.editorial-section--surfaces .card-link{display:flex;gap:0}.editorial-section--surfaces .post-card__image,.editorial-section--surfaces .post-card__placeholder{aspect-ratio:16/9;flex:none}
.rail-widgets{max-width:65ch}
}

@media(max-width:1023px){
.primary-sidebar,.homepage-main .primary-sidebar{background-image:none;padding-bottom:22px}
.editorial-section.editorial-section--structure :is(.post-card__image,.post-card__placeholder){min-height:0}
}

/* Длинные заголовки сохраняют размер; текст статьи занимает две трети полосы. */
.article-reading-layout>.entry-content{width:100%;max-width:none}
.site-widgets-end .rail-widgets ul{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 24px}
.site-widgets-end .rail-widgets li{margin:0}
@media(max-width:1023px){.site-widgets-end .rail-widgets ul{display:block}.site-widgets-end .rail-widgets li{margin-bottom:16px}}

/* Планшет: меню сверху, рубрика сохраняет две свободные колонки. */
@media(min-width:600px) and (max-width:1023px){
.category-navigation ul{grid-template-columns:repeat(3,minmax(0,1fr))}
.post-grid>.post-card,.archive-editorial-grid--continuation>.post-card:first-child{flex-basis:calc((100% - 24px)/2)}
.archive-editorial-grid:not(.archive-editorial-grid--continuation)>.post-card:first-child{flex-basis:100%}
}
