/* Politerno — WordPress-specific additions on top of design.css (the mockup styles). */

/* accessibility */
.screen-reader-text{border:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute!important;width:1px;word-wrap:normal!important}
.skip-link:focus{clip:auto;clip-path:none;height:auto;width:auto;left:12px;top:12px;z-index:100;background:#fff;padding:10px 16px;border:2px solid var(--blue);font-weight:600}
:focus-visible{outline:2px solid var(--blue);outline-offset:2px}

/* masthead: the logo may be wrapped in <h1> on the homepage */
.brand-wrap{margin:0;display:inline-block;font:inherit;line-height:0}
@media (max-width:600px){.mast .brand-wrap{justify-self:center}}

/* headings that became links */
.sec-head h2 a,.rail-head h3 a,.papers-head h2 a{color:inherit}
.sec-head h2 a:hover,.rail-head h3 a:hover{color:var(--blue)}
a.arrow:hover{background:var(--blue);color:#fff}
.menu a.is-active{color:var(--blue);box-shadow:inset 0 -2px 0 var(--blue)}

/* image placeholder for posts without a featured image */
img.ph{object-fit:cover;background:var(--tint)}

/* WP admin bar */
body.admin-bar .sticky{top:32px}
@media (max-width:782px){body.admin-bar .sticky{top:46px}}

/* pager gap + empty / search states */
.pager .gap{min-width:20px;color:var(--muted)}
.empty-state{max-width:660px;margin:34px auto 0;text-align:center;color:var(--muted)}
.search-inline{display:flex;gap:10px;justify-content:center;margin-top:16px}
.search-inline input{flex:1;max-width:420px;border:1.5px solid var(--line);border-radius:999px;padding:10px 18px;font:15px var(--sans)}
.search-inline input:focus{border-color:var(--blue);outline:none}
.search .icon-btn[type=submit]{position:static}

/* ===== article body: real content from the editor ===== */
.a-body a{color:var(--blue-dk);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
.a-body a:hover{color:var(--blue)}
.a-body a.also{text-decoration:none;color:inherit}
.a-body h2,.a-body h3,.a-body h4{font-family:var(--serif);font-weight:600;line-height:1.25;margin:36px 0 14px;color:var(--ink)}
.a-body h2{font-size:28px}.a-body h3{font-size:24px}.a-body h4{font-size:21px}
.a-body ul,.a-body ol{margin:0 0 22px;padding-left:1.3em}
.a-body li{margin:0 0 8px}
.a-body li p{margin:0}
.a-body img{width:auto;max-width:100%;height:auto;object-fit:initial;background:none;margin:0 auto}
.a-body figure,.a-body .wp-caption{margin:30px 0;max-width:100%!important;width:auto!important}
.a-body figure img,.a-body .wp-caption img{width:100%}
.a-body figcaption,.a-body .wp-caption-text,.a-body .wp-element-caption{font:12.5px/1.45 var(--sans);color:var(--muted);text-align:center;padding-top:8px}
.a-body .alignleft{float:left;margin:6px 24px 14px 0;max-width:50%}
.a-body .alignright{float:right;margin:6px 0 14px 24px;max-width:50%}
.a-body .aligncenter{margin-left:auto;margin-right:auto}
.a-body iframe{max-width:100%}
.a-body iframe[src*="youtube"],.a-body iframe[src*="youtu.be"],.a-body iframe[src*="facebook.com/plugins/video"],.a-body iframe[src*="vimeo"]{width:100%;height:auto;aspect-ratio:16/9;display:block;margin:30px 0}
.a-body .wp-block-embed{margin:30px 0}
.a-body .wp-block-embed__wrapper{position:relative}
.a-body blockquote.twitter-tweet,.a-body blockquote.instagram-media,.a-body blockquote.telegram-post{font:400 16px/1.5 var(--sans);border-left:3px solid var(--line);color:var(--graphite)}
.a-body blockquote p{margin:0 0 10px}
.a-body blockquote p:last-child{margin:0}
.a-body table{width:100%;border-collapse:collapse;font:15px/1.45 var(--sans);margin:0 0 24px;display:block;overflow-x:auto}
.a-body td,.a-body th{border:1px solid var(--line);padding:8px 10px;vertical-align:top}
.a-body hr,.a-body .wp-block-separator{border:0;border-top:1px solid var(--line);margin:34px auto;width:120px}
.a-body pre{white-space:pre-wrap;font-size:15px}
.a-body video,.a-body audio{width:100%;display:block;margin:24px 0}
.a-body .wp-block-media-text{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:center;margin:30px 0}
.a-body .wp-block-media-text__media img{width:100%}
/* Galleries. Classic [gallery]: columns and image size come from its classes (gallery-columns-N,
   gallery-size-*) — images keep their own proportions, never cropped. Block galleries (.wp-block-gallery)
   are laid out by WordPress's own block styles (columns-N, is-cropped); only spacing is set here. */
.a-body .gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:30px 0;align-items:start}
.a-body .gallery-columns-1{grid-template-columns:minmax(0,1fr)}
.a-body .gallery-columns-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.a-body .gallery-columns-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.a-body .gallery-columns-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.a-body .gallery-columns-5{grid-template-columns:repeat(5,minmax(0,1fr))}
.a-body .gallery-columns-6{grid-template-columns:repeat(6,minmax(0,1fr))}
.a-body .gallery-columns-7{grid-template-columns:repeat(7,minmax(0,1fr))}
.a-body .gallery-columns-8{grid-template-columns:repeat(8,minmax(0,1fr))}
.a-body .gallery-columns-9{grid-template-columns:repeat(9,minmax(0,1fr))}
.a-body .gallery-item{margin:0;min-width:0}
.a-body .gallery-icon{margin:0}
.a-body .gallery-icon a{display:block}
.a-body .gallery br{display:none}
.a-body .gallery img{display:block;width:100%;height:auto;margin:0}
.a-body .gallery-size-thumbnail img{width:auto;max-width:100%;margin:0 auto}
.a-body .gallery-caption{margin:6px 0 0;font:13px/1.4 var(--sans);color:var(--muted);text-align:center}
.a-body .wp-block-gallery{margin:30px 0}
.a-body .blocks-gallery-grid{padding:0;margin:0;list-style:none}
.a-body .blocks-gallery-item{margin-bottom:1em}
.a-body .wp-block-pullquote{border:0;padding:0;margin:34px 0;text-align:left}
.a-body::after{content:"";display:table;clear:both}
.a-body.is-big{font-size:23px}
.a-body.is-big p.lead-p{font-size:26px}
.a-after{max-width:660px;margin:30px auto 0}
.page-body{margin-top:10px}
@media (max-width:600px){
  .a-body h2{font-size:24px}.a-body h3{font-size:21px}
  .a-body .alignleft,.a-body .alignright{float:none;margin:20px auto;max-width:100%}
  .a-body .wp-block-media-text{grid-template-columns:1fr}
  .a-body.is-big{font-size:21px}
}

/* copy-link feedback */
.share .js-copy.is-copied{background:var(--blue);color:#fff}
.toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:10px 18px;border-radius:999px;font:500 13px var(--sans);z-index:70;opacity:0;transition:opacity .2s}
.toast.on{opacity:1}

/* homepage: blocks fed by live data can be shorter than in the mockup */
.hhd-r2l .art--sup figure img{aspect-ratio:4/3;height:auto}
.vcard img{width:100%;height:100%;object-fit:cover}
.yt .poster .thumb{background:#0e1215}

/* rail «Україна і світ»: the generic `.rail a` card rule must not apply to the heading links */
.rail .rail-head a{display:inline;padding:0;border:0;grid-template-columns:none;gap:0}
.rail .rail-head a.arrow{display:grid;border:1.5px solid var(--blue);padding:0}

/* ===== static pages: «Про нас», «Контакти» (block classes pol-*) ===== */
.page-body>p:first-child,.page-body .pol-intro{font-size:22px;line-height:1.5;color:var(--ink)}
.page-body h2{font:500 28px/1.2 var(--serif);margin:44px 0 18px;padding-top:18px;border-top:2px solid var(--blue)}
.pol-cards{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:0 0 10px}
.pol-card{border-top:3px solid var(--blue);background:var(--tint);padding:16px 18px 6px}
.pol-card.is-red{border-top-color:var(--red)}
.pol-card h3{font:500 21px/1.2 var(--serif)!important;margin:0 0 8px!important}
.pol-card h3 a{color:var(--ink)!important;text-decoration:none!important}
.pol-card.is-red h3 a{color:var(--red)!important}
.pol-card.is-live h3 a{color:var(--blue)!important}
.pol-card p{font:15px/1.5 var(--sans);color:#4a5358;margin:0 0 12px}
.pol-facts p,.pol-contact p{font:16px/1.55 var(--sans);margin:0;padding:14px 0;border-bottom:1px solid var(--line)}
.pol-facts p:first-child{padding-top:0}
.pol-facts .lbl,.pol-contact .lbl{display:block;font:600 11px var(--sans);letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin-bottom:4px}
.pol-facts a,.pol-contact a{font:italic 500 20px var(--serif);color:var(--blue)!important;text-decoration:none!important}
.pol-contact a[href^="tel:"]{font:500 17px var(--sans)}
.page-body .pol-doc{max-width:340px;margin:26px 0;border:1px solid var(--line);padding:8px;background:#fff}
.page-body .pol-doc figcaption{text-align:left}
.pol-cta{background:var(--tint);border-left:3px solid var(--blue);padding:18px 22px;margin:34px 0 0}
.pol-cta p{font:16px/1.55 var(--sans);margin:0}
.pol-contacts{display:grid;grid-template-columns:1fr 1fr;gap:0 32px;margin-top:10px}
.pol-contact p{border-bottom:1px solid var(--line);height:100%}
.pol-social-list{list-style:none;padding:0!important;display:flex;flex-wrap:wrap;gap:8px}
.pol-social-list li{margin:0}
.pol-social-list a{display:inline-block;border:1px solid #cfdbe3;padding:7px 16px;border-radius:999px;font:500 14px var(--sans);color:var(--blue)!important;text-decoration:none!important}
.pol-social-list a:hover{background:var(--blue);color:#fff!important;border-color:var(--blue)}
.page-body h2[id]{scroll-margin-top:80px}
@media (max-width:600px){
  .pol-cards,.pol-contacts{grid-template-columns:1fr}
  .page-body>p:first-child,.page-body .pol-intro{font-size:19px}
  .page-body h2{font-size:24px}
}
/* group blocks may wrap children in .wp-block-group__inner-container (classic themes) */
.pol-cards>.wp-block-group__inner-container,.pol-contacts>.wp-block-group__inner-container{display:contents}
.page-body figure.pol-doc{max-width:340px!important;width:340px!important}
@media (max-width:600px){.page-body figure.pol-doc{width:100%!important}}

/* ===== Politerno.LIVE cards: robust layout =====
   The mockup sized cards with aspect-ratio on grid items + an absolutely positioned <img>.
   Some engines (Safari) resolve that grid to zero height, leaving only a tiny image.
   Here the image itself (in normal flow, with fixed proportions) gives the card its height. */
.live-grid{align-items:start}
.vcard,.vcard.big,.live-side .vcard{aspect-ratio:auto;min-height:0;height:auto}
.vcard img{position:static;display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:cover}
/* side cards are a bit wider than 16:9 so the two of them + gap match the big card's height */
.live-side{grid-template-rows:none;align-content:start}
.live-side .vcard img{aspect-ratio:37/20}
@media (max-width:860px){.live-side .vcard img{aspect-ratio:16/10}}
@media (max-width:600px){.live-side .vcard img,.vcard.big img{aspect-ratio:16/9}}

/* «Завантажити ще»: items appended to the month group already on the page */
.mg-cont{border-top:1px solid var(--line)}
.mg-cont.is-new,.mgroup.is-new{animation:fadein .4s ease}
.mg-cont>.mg-row:first-child{padding-top:24px}
/* reserve image space before images load so appended content never shifts the page */
.mg-row figure img,.mg-feat figure img,.mg-list figure img,.mg-lead figure img{background:var(--tint)}

/* ===== Robust grids: browser extensions may inject icons next to links (e.g. after YouTube links).
   Each such element would become an extra grid cell and push the layout around, so cards get explicit
   positions and anything that is not ours is taken out of the grid flow. ===== */
.live-grid>.vcard.big{grid-column:1;grid-row:1}
.live-grid>.live-side{grid-column:2;grid-row:1}
.live-grid>:not(.vcard):not(.live-side),.live-side>:not(.vcard),.press-grid>:not(.press-card),
.tv-strip>:not(.th):not(.btn-yt):not(div),.yt>:not(.frame):not(div){position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important}
.tv-strip>.th{grid-column:1;grid-row:1}.tv-strip>div{grid-column:2;grid-row:1}.tv-strip>.btn-yt{grid-column:3;grid-row:1}
@media (max-width:860px){.live-grid>.vcard.big,.live-grid>.live-side{grid-column:1}.live-grid>.live-side{grid-row:2}}
@media (max-width:600px){.tv-strip>.btn-yt{grid-column:1/-1;grid-row:2}}

/* drop cap also when the first text block is a sub-heading lead (h2/h3/h4) */
.a-body :is(h2,h3,h4).lead-p{margin-top:0}
.a-body :is(h2,h3,h4).lead-p::first-letter{float:left;font:500 88px/.8 var(--serif);color:var(--blue);margin:8px 12px 0 0;text-transform:uppercase}
@media (max-width:600px){.a-body :is(h2,h3,h4).lead-p::first-letter{font-size:70px;margin:6px 10px 0 0}}

@media (max-width:600px){
  .a-body .gallery:not(.gallery-columns-1):not(.gallery-columns-2){grid-template-columns:repeat(2,minmax(0,1fr))}
  .a-body .gallery{gap:8px}
}

/* ---- lightbox (main.js) ---- */
.a-body .lb-zoom{cursor:zoom-in}
.lb-lock,.lb-lock body{overflow:hidden}
.lb{position:fixed;inset:0;z-index:1000;display:none;align-items:center;justify-content:center;background:rgba(14,18,20,.94);padding:56px 72px;touch-action:pan-y}
.lb.on{display:flex}
.lb-fig{margin:0;max-width:100%;max-height:100%;display:flex;flex-direction:column;align-items:center}
.lb-fig img{max-width:100%;max-height:calc(100vh - 140px);max-height:calc(100dvh - 140px);width:auto;height:auto;object-fit:contain;box-shadow:0 10px 40px rgba(0,0,0,.4);transition:opacity .2s;background:#222}
.lb-fig img.is-loading{opacity:.35}
.lb-fig figcaption{color:#d7dde0;font:14px/1.45 var(--sans);text-align:center;margin-top:12px;max-width:760px}
.lb button{position:absolute;border:0;background:rgba(255,255,255,.08);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background .15s}
.lb button:hover,.lb button:focus-visible{background:var(--blue);outline:0}
.lb-x{top:14px;right:14px;width:44px;height:44px;font:300 30px/1 var(--sans)}
.lb-nav{top:50%;width:52px;height:52px;margin-top:-26px;font:300 40px/1 var(--serif);padding-bottom:6px}
.lb-prev{left:14px}.lb-next{right:14px}
.lb-nav[hidden]{display:none}
.lb-count{position:absolute;top:24px;left:0;right:0;text-align:center;color:#aeb7bc;font:600 13px var(--sans);letter-spacing:.06em;pointer-events:none}
@media (max-width:600px){
  .lb{padding:56px 0 48px}
  .lb-fig img{max-height:calc(100dvh - 130px);box-shadow:none}
  .lb-fig figcaption{padding:0 16px}
  .lb-nav{top:auto;bottom:10px;margin:0;width:46px;height:46px;background:rgba(255,255,255,.12)}
  .lb-prev{left:calc(50% - 64px)}.lb-next{right:calc(50% - 64px)}
}

.a-body .also.no-img{grid-template-columns:1fr}
