/*
Theme Name: NEWS24 Kyiv
Theme URI: https://www.news24.kiev.ua/
Author: NEWS24
Description: Lightweight editorial theme for the Kyiv news portal NEWS24.
Version: 1.0.2
Text Domain: news24-kyiv
Requires at least: 6.4
Requires PHP: 8.0
*/

:root {
  --ink: #111927;
  --muted: #687386;
  --paper: #f5f7fa;
  --white: #fff;
  --blue: #0757d8;
  --blue-dark: #063b91;
  --yellow: #ffd43b;
  --red: #d92d20;
  --line: #dfe4ec;
  --radius: 18px;
  --shadow: 0 16px 48px rgba(17, 25, 39, .11);
  --wrap: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 17px; line-height: 1.6; }
body.menu-open { overflow: hidden; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue); }
button, input { font: inherit; }
.wrap { width: min(calc(100% - 40px), var(--wrap)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 9999; top: 10px; left: 10px; width: auto; height: auto; padding: 10px 16px; clip: auto; background: var(--ink); color: white; }

.topline { background: var(--ink); color: white; font-size: 13px; }
.topline__inner { min-height: 36px; display: flex; align-items: center; gap: 22px; }
.topline__city { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.topline__city::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 4px rgba(255,212,59,.15); }
.topline__date { color: #b9c2d0; }
.topline__links { margin-left: auto; display: flex; gap: 18px; }
.topline a:hover { color: var(--yellow); }

.site-header { position: sticky; z-index: 100; top: 0; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.masthead { min-height: 86px; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 13px; flex-shrink: 0; }
.brand__mark { display: grid; grid-template-columns: auto 12px; align-items: stretch; height: 44px; overflow: hidden; border-radius: 8px; background: var(--blue); color: white; box-shadow: 0 7px 20px rgba(7,87,216,.22); }
.brand__name { display: flex; align-items: center; padding: 0 11px 0 14px; font-size: 24px; font-weight: 950; letter-spacing: -.06em; }
.brand__24 { color: var(--yellow); }
.brand__flag { background: linear-gradient(#1477ef 0 50%, #ffd43b 50%); }
.brand__city { font-size: 12px; font-weight: 900; letter-spacing: .16em; }
.main-nav { flex: 1; display: flex; align-items: center; justify-content: center; gap: 24px; }
.main-nav a { position: relative; padding: 30px 0 27px; font-size: 14px; font-weight: 800; }
.main-nav a::after { content: ""; position: absolute; right: 0; bottom: 19px; left: 0; height: 3px; transform: scaleX(0); transform-origin: left; background: var(--blue); transition: .2s; }
.main-nav a:hover::after, .main-nav .current-menu-item a::after { transform: scaleX(1); }
.header-actions { display: flex; gap: 8px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); cursor: pointer; transition: .2s; }
.icon-btn:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }
.menu-toggle, .menu-close { display: none; }

.breaking { background: white; border-bottom: 1px solid var(--line); }
.breaking__inner { min-height: 45px; display: flex; align-items: center; gap: 16px; overflow: hidden; }
.breaking__label { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; color: var(--red); font-size: 12px; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.breaking__label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.5s infinite; }
.breaking__items { display: flex; gap: 30px; min-width: 0; white-space: nowrap; overflow: hidden; font-size: 13px; font-weight: 650; }
.breaking__items a { overflow: hidden; text-overflow: ellipsis; }
.breaking__time { margin-right: 7px; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes pulse { 50% { opacity: .35; } }

.search-panel { display: none; position: fixed; z-index: 200; inset: 0; background: rgba(17,25,39,.82); backdrop-filter: blur(8px); }
.search-panel.is-open, .search-panel:target { display: grid; place-items: start center; padding-top: 18vh; }
.search-panel__box { width: min(calc(100% - 36px), 760px); position: relative; }
.search-panel__box form { display: flex; background: white; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.search-panel input { flex: 1; min-width: 0; padding: 22px 24px; border: 0; outline: 0; font-size: 21px; }
.search-panel button[type=submit] { padding: 0 25px; border: 0; background: var(--blue); color: white; font-weight: 850; cursor: pointer; }
.search-close { position: absolute; top: -55px; right: 0; border: 0; background: transparent; color: white; font-size: 34px; cursor: pointer; }

.hero { padding: 36px 0 42px; }
.hero__intro { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 5px; color: var(--blue); font-size: 12px; font-weight: 950; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; line-height: 1.08; letter-spacing: -.035em; }
.hero h1 { margin-bottom: 0; font-size: clamp(30px, 4vw, 54px); }
.hero__note { max-width: 360px; margin: 0; color: var(--muted); font-size: 14px; text-align: right; }
.hero-grid { display: grid; grid-template-columns: 1.65fr 1fr; grid-template-rows: repeat(2, minmax(220px, 1fr)); gap: 14px; min-height: 610px; }
.lead-card { position: relative; display: flex; align-items: end; min-height: 220px; overflow: hidden; border-radius: var(--radius); color: white; background: var(--blue-dark); isolation: isolate; }
.lead-card:first-child { grid-row: 1 / 3; }
.lead-card:has(.placeholder) { align-items: center; }
.lead-card__media, .card__media { position: absolute; inset: 0; z-index: -2; }
.lead-card__media img, .card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.lead-card:hover img, .card:hover img { transform: scale(1.035); }
.lead-card::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, rgba(9,18,33,.02) 25%, rgba(9,18,33,.9) 100%); }
.lead-card__content { padding: clamp(22px, 4vw, 42px); }
.lead-card:not(:first-child) .lead-card__content { padding: 24px; }
.lead-card h2 { max-width: 850px; margin: 10px 0 14px; font-size: clamp(23px, 3vw, 44px); }
.lead-card:not(:first-child) h2 { font-size: clamp(20px, 2vw, 28px); }
.lead-card h2 a:hover { color: white; text-decoration: underline; text-decoration-color: var(--yellow); text-underline-offset: 5px; }
.category-pill { display: inline-flex; padding: 5px 9px; border-radius: 6px; background: var(--yellow); color: var(--ink); font-size: 11px; font-weight: 950; letter-spacing: .06em; text-transform: uppercase; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: 13px; }
.lead-card .meta { color: #dce2ea; }
.meta time { font-variant-numeric: tabular-nums; }

.section { padding: 40px 0; }
.section--white { background: white; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.section-head h2 { margin: 0; padding-bottom: 14px; font-size: clamp(25px, 3vw, 38px); border-bottom: 4px solid var(--blue); }
.section-head a { margin-bottom: 14px; color: var(--blue); font-size: 13px; font-weight: 850; }
.news-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 44px; }
.news-list { display: grid; gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.list-card { display: grid; grid-template-columns: 230px 1fr; gap: 24px; padding: 18px 0; background: var(--paper); }
.list-card__image { aspect-ratio: 16/10; overflow: hidden; border-radius: 12px; background: linear-gradient(145deg, var(--blue-dark), var(--blue)); }
.list-card__image img { width: 100%; height: 100%; object-fit: cover; }
.list-card h3 { margin: 8px 0 10px; font-size: clamp(20px, 2vw, 27px); }
.list-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(circle at 80% 20%, rgba(255,212,59,.85), transparent 24%), linear-gradient(145deg, var(--blue-dark), var(--blue)); color: white; }
.placeholder svg { width: 44%; max-width: 130px; opacity: .82; }
.sidebar-card { position: sticky; top: 120px; padding: 24px; border-radius: var(--radius); background: var(--ink); color: white; }
.sidebar-card h2 { margin-bottom: 18px; font-size: 22px; }
.popular-list { display: grid; gap: 0; counter-reset: popular; }
.popular-item { counter-increment: popular; display: grid; grid-template-columns: 35px 1fr; gap: 10px; padding: 15px 0; border-top: 1px solid rgba(255,255,255,.13); }
.popular-item::before { content: counter(popular, decimal-leading-zero); color: var(--yellow); font-size: 14px; font-weight: 950; }
.popular-item h3 { margin: 0 0 6px; font-size: 15px; line-height: 1.35; letter-spacing: -.015em; }
.popular-item time { color: #9aa7b8; font-size: 11px; }

.districts { background: var(--blue); color: white; }
.districts .section-head { border-color: rgba(255,255,255,.3); }
.districts .section-head h2 { border-color: var(--yellow); }
.district-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.district-grid a { display: flex; justify-content: space-between; align-items: center; min-height: 58px; padding: 13px 16px; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; font-size: 14px; font-weight: 800; }
.district-grid a:hover { background: white; color: var(--blue); }
.district-grid span { color: var(--yellow); }

.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { position: relative; overflow: hidden; border-radius: var(--radius); background: white; box-shadow: 0 8px 30px rgba(17,25,39,.07); }
.card__image { position: relative; z-index: 0; aspect-ratio: 16/10; overflow: hidden; }
.card__content { padding: 20px; }
.card h3 { margin: 9px 0 12px; font-size: 22px; }

.archive-header { padding: 48px 0 28px; }
.archive-header h1 { margin-bottom: 12px; font-size: clamp(36px, 6vw, 68px); }
.archive-header p { max-width: 720px; margin: 0; color: var(--muted); }
.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-bottom: 60px; }
.pagination { grid-column: 1 / -1; margin-top: 20px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 7px; }
.page-numbers { min-width: 42px; padding: 8px 12px; text-align: center; border-radius: 8px; background: white; }
.page-numbers.current { background: var(--blue); color: white; }

.article-shell { display: grid; grid-template-columns: minmax(0, 820px) 300px; gap: 60px; padding: 48px 0 70px; align-items: start; }
.breadcrumbs { margin-bottom: 25px; color: var(--muted); font-size: 12px; }
.breadcrumbs a { color: var(--blue); }
.article-header h1 { margin: 12px 0 20px; font-size: clamp(36px, 6vw, 68px); }
.article-deck { margin: 0 0 24px; color: #475569; font-size: clamp(18px, 2vw, 23px); line-height: 1.5; }
.article-hero { margin: 30px 0; overflow: hidden; border-radius: var(--radius); }
.article-hero img { width: 100%; display: block; }
.article-body { font-family: Georgia, "Times New Roman", serif; font-size: 19px; line-height: 1.8; }
.article-body > * { max-width: 760px; }
.article-body h2, .article-body h3 { margin-top: 1.8em; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.article-body h2 { font-size: 31px; }
.article-body h3 { font-size: 24px; }
.article-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote { margin: 28px 0; padding: 18px 25px; border-left: 5px solid var(--yellow); background: white; font-size: 21px; }
.article-body table { width: 100%; border-collapse: collapse; font-family: Inter, sans-serif; font-size: 15px; }
.article-body td, .article-body th { padding: 10px; border: 1px solid var(--line); text-align: left; }
.share { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0; padding-top: 25px; border-top: 1px solid var(--line); }
.share a { padding: 8px 12px; border-radius: 8px; background: white; color: var(--ink); font-family: Inter, sans-serif; font-size: 13px; font-weight: 800; text-decoration: none; }
.article-aside { position: sticky; top: 125px; }
.article-aside__box { padding: 22px; border-radius: 16px; background: white; border: 1px solid var(--line); }
.article-aside h2 { font-size: 20px; }

.site-footer { padding: 50px 0 22px; background: var(--ink); color: white; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 60px; }
.footer-about p { max-width: 420px; color: #aab4c2; font-size: 14px; }
.footer-title { margin: 0 0 15px; font-size: 13px; color: var(--yellow); text-transform: uppercase; letter-spacing: .1em; }
.footer-links { display: grid; gap: 8px; color: #c7cfda; font-size: 14px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); color: #8591a2; font-size: 12px; }
.back-top { position: fixed; z-index: 70; right: 22px; bottom: 22px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--blue); color: white; box-shadow: var(--shadow); cursor: pointer; opacity: 0; pointer-events: none; transition: .2s; }
.back-top.is-visible { opacity: 1; pointer-events: auto; }
.empty-state { padding: 70px 0; }
.empty-state h1 { font-size: 50px; }

@media (max-width: 1050px) {
  .main-nav { gap: 14px; }
  .main-nav a { font-size: 12px; }
  .news-layout, .article-shell { grid-template-columns: 1fr; }
  .sidebar-card, .article-aside { position: static; }
  .popular-list { grid-template-columns: repeat(2, 1fr); column-gap: 24px; }
  .district-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .wrap { width: min(calc(100% - 28px), var(--wrap)); }
  .topline__links { display: none; }
  .masthead { min-height: 70px; }
  .brand__city { display: none; }
  .main-nav { display: none; position: fixed; z-index: 120; top: 70px; right: 0; bottom: 0; left: 0; padding: 22px; flex-direction: column; align-items: stretch; justify-content: flex-start; overflow: auto; background: white; }
  .main-nav.is-open, .main-nav:target { display: flex; }
  .main-nav a { display: block; padding: 12px 5px; font-size: 18px; border-bottom: 1px solid var(--line); }
  .menu-toggle { display: grid; }
  .menu-close { display: block; order: -1; color: var(--blue); font-weight: 900; }
  .hero__note { display: none; }
  .hero-grid { min-height: 0; grid-template-columns: 1fr; grid-template-rows: auto; }
  .lead-card:first-child { grid-row: auto; min-height: 500px; }
  .lead-card:not(:first-child) { min-height: 300px; }
  .category-grid, .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .article-header h1 { font-size: clamp(34px, 10vw, 56px); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .brand__mark { height: 40px; }
  .brand__name { font-size: 21px; }
  .header-actions .icon-btn:first-child { display: none; }
  .breaking__items a:not(:first-child) { display: none; }
  .hero { padding-top: 24px; }
  .lead-card:first-child { min-height: 420px; }
  .lead-card__content { padding: 24px; }
  .lead-card h2 { font-size: 30px; }
  .list-card { grid-template-columns: 112px 1fr; gap: 14px; }
  .list-card h3 { font-size: 18px; }
  .list-card p { display: none; }
  .category-grid, .archive-grid { grid-template-columns: 1fr; }
  .popular-list { grid-template-columns: 1fr; }
  .district-grid { grid-template-columns: repeat(2, 1fr); }
  .article-shell { padding-top: 30px; }
  .article-body { font-size: 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-about { grid-column: auto; }
  .footer-bottom { flex-direction: column; }
}

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