/*
Theme Name: Zanger News
Theme URI: https://zanger.myrzabek.kz/
Author: Zanger
Description: Responsive Kazakh news theme inspired by a clean mobile editorial interface. Built as a standalone derivative using bundled Twenty Twenty-Four font and image assets.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Text Domain: zanger-news
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

@font-face {
  font-family: "Instrument Sans";
  src: url("assets/fonts/InstrumentSans-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Jost";
  src: url("assets/fonts/Jost-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --zn-bg: #f4f6f8;
  --zn-surface: #ffffff;
  --zn-ink: #16191d;
  --zn-muted: #7d838c;
  --zn-line: #e7eaee;
  --zn-blue: #2f82ef;
  --zn-blue-dark: #1768cf;
  --zn-blue-soft: #eaf3ff;
  --zn-orange: #ff7a45;
  --zn-radius-lg: 30px;
  --zn-radius-md: 22px;
  --zn-radius-sm: 14px;
  --zn-shadow: 0 18px 55px rgba(24, 36, 52, 0.09);
  --zn-wrap: min(1320px, calc(100% - 48px));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--zn-ink);
  background: var(--zn-bg);
  font-family: "Instrument Sans", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.menu-open,
body.search-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--zn-blue); }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
button { color: inherit; }

.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 {
  clip: auto;
  width: auto;
  height: auto;
  margin: 12px;
  padding: 10px 16px;
  z-index: 10000;
  background: #fff;
  border-radius: 10px;
}

.zn-wrap { width: var(--zn-wrap); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 246, 248, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(215, 220, 227, 0.75);
}

.admin-bar .site-header { top: 32px; }

.header-main {
  min-height: 88px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 34px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--zn-blue), #5eabff);
  border-radius: 15px;
  box-shadow: 0 10px 24px rgba(47, 130, 239, 0.28);
  font-family: "Jost", sans-serif;
  font-size: 23px;
  font-weight: 700;
}

.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-family: "Jost", sans-serif; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.brand-tagline { margin-top: 5px; color: var(--zn-muted); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }

.primary-nav ul,
.footer-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0;
  padding: 0;
}

.primary-nav { justify-self: center; }
.primary-nav a { font-size: 15px; font-weight: 600; }
.primary-nav .current-menu-item > a,
.primary-nav a:hover { color: var(--zn-blue); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  background: var(--zn-surface);
  border: 1px solid var(--zn-line);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.icon-button:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(24,36,52,.1); }
.icon-button svg { width: 20px; height: 20px; }
.menu-toggle { display: none; }

.search-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: start center;
  padding-top: 14vh;
  background: rgba(19, 25, 33, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.search-open .search-panel { opacity: 1; visibility: visible; }
.search-panel-inner {
  width: min(760px, calc(100% - 32px));
  padding: 28px;
  background: #fff;
  border-radius: var(--zn-radius-lg);
  box-shadow: var(--zn-shadow);
}
.search-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.search-panel-head strong { font-family: "Jost", sans-serif; font-size: 24px; }
.search-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.search-field {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid var(--zn-line);
  border-radius: 16px;
  outline: none;
}
.search-field:focus { border-color: var(--zn-blue); box-shadow: 0 0 0 4px var(--zn-blue-soft); }
.search-submit,
.button-primary {
  min-height: 52px;
  padding: 0 22px;
  color: #fff;
  background: var(--zn-blue);
  border: 0;
  border-radius: 16px;
  font-weight: 700;
  cursor: pointer;
}
.search-submit:hover,
.button-primary:hover { color: #fff; background: var(--zn-blue-dark); }

.breaking-bar { padding: 16px 0 0; }
.breaking-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 50px;
  padding: 9px 14px 9px 10px;
  background: #fff;
  border: 1px solid var(--zn-line);
  border-radius: 18px;
}
.breaking-label { padding: 7px 12px; color: #fff; background: var(--zn-orange); border-radius: 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.breaking-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.breaking-time { color: var(--zn-muted); font-size: 13px; }

.site-main { min-height: 60vh; }
.section { padding: 62px 0; }
.section + .section { padding-top: 10px; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.section-kicker { display: block; margin-bottom: 6px; color: var(--zn-blue); font-size: 12px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.section-title { margin: 0; font-family: "Jost", sans-serif; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; letter-spacing: -.035em; }
.section-link { color: var(--zn-muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.section-link:hover { color: var(--zn-blue); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(380px, .9fr);
  grid-template-rows: repeat(2, minmax(215px, 1fr));
  gap: 20px;
}
.news-card {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  background: #dce2e8;
  border-radius: var(--zn-radius-lg);
  box-shadow: var(--zn-shadow);
  isolation: isolate;
}
.news-card.is-lead { grid-row: 1 / 3; min-height: 560px; }
.news-card-image,
.news-card-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.news-card::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(8,14,21,.04) 20%, rgba(8,14,21,.86) 100%); }
.news-card-content { position: absolute; inset: auto 0 0; z-index: 1; padding: 24px; color: #fff; }
.news-card.is-lead .news-card-content { padding: 38px; }
.news-card-title { margin: 12px 0 14px; font-family: "Jost", sans-serif; font-size: 25px; line-height: 1.18; letter-spacing: -.025em; }
.news-card.is-lead .news-card-title { max-width: 760px; font-size: clamp(36px, 4vw, 58px); }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 16px; color: rgba(255,255,255,.82); font-size: 13px; }
.card-meta .dot { width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 13px;
  color: #fff;
  background: var(--zn-blue);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.category-pill:hover { color: #fff; background: var(--zn-blue-dark); }
.trending-mark { color: #fff; font-size: 13px; }

.category-scroller { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.category-orb {
  position: relative;
  display: grid;
  overflow: hidden;
  aspect-ratio: 1;
  place-items: end start;
  border-radius: 50%;
  box-shadow: var(--zn-shadow);
  isolation: isolate;
}
.category-orb::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(160deg, rgba(13,20,29,.02), rgba(13,20,29,.7)); }
.category-orb img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.category-orb:hover img { transform: scale(1.06); }
.category-orb span { padding: 18px; color: #fff; font-size: 14px; font-weight: 700; }

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 34px; align-items: start; }
.latest-list { display: grid; gap: 18px; }
.list-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  min-height: 170px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--zn-line);
  border-radius: var(--zn-radius-md);
  transition: transform .2s ease, box-shadow .2s ease;
}
.list-card:hover { transform: translateY(-3px); box-shadow: var(--zn-shadow); }
.list-card-image { overflow: hidden; min-height: 145px; border-radius: 17px; }
.list-card-image img { width: 100%; height: 100%; object-fit: cover; }
.list-card-body { display: flex; flex-direction: column; justify-content: center; }
.list-card .category-pill { align-self: flex-start; color: var(--zn-blue); background: var(--zn-blue-soft); }
.list-card-title { margin: 12px 0 10px; font-family: "Jost", sans-serif; font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
.list-card-excerpt { margin: 0 0 12px; color: var(--zn-muted); font-size: 14px; line-height: 1.55; }
.list-card .card-meta { color: var(--zn-muted); }

.sidebar { display: grid; gap: 22px; position: sticky; top: 116px; }
.panel { padding: 24px; background: #fff; border: 1px solid var(--zn-line); border-radius: var(--zn-radius-md); box-shadow: 0 12px 36px rgba(24,36,52,.05); }
.panel-title { margin: 0 0 18px; font-family: "Jost", sans-serif; font-size: 25px; }
.popular-list { display: grid; gap: 16px; }
.popular-item { display: grid; grid-template-columns: 44px 1fr; gap: 13px; align-items: start; }
.popular-number { display: grid; width: 44px; height: 44px; place-items: center; color: var(--zn-blue); background: var(--zn-blue-soft); border-radius: 14px; font-weight: 700; }
.popular-item h3 { margin: 0 0 5px; font-size: 15px; line-height: 1.35; }
.popular-item time { color: var(--zn-muted); font-size: 12px; }
.info-panel { color: #fff; background: linear-gradient(145deg, #1f74df, #58a6ff); border: 0; }
.info-panel .panel-title { color: #fff; }
.info-panel p { margin: 0 0 18px; color: rgba(255,255,255,.85); font-size: 14px; }
.info-panel .button-primary { display: inline-flex; align-items: center; background: #fff; color: var(--zn-blue-dark); }

.pagination { margin-top: 28px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { display: grid; min-width: 42px; height: 42px; place-items: center; padding: 0 12px; background: #fff; border: 1px solid var(--zn-line); border-radius: 13px; font-size: 14px; }
.page-numbers.current { color: #fff; background: var(--zn-blue); border-color: var(--zn-blue); }

.archive-hero { padding: 54px 0 26px; }
.archive-hero-inner { padding: 42px; background: #fff; border-radius: var(--zn-radius-lg); box-shadow: var(--zn-shadow); }
.archive-title { margin: 0; font-family: "Jost", sans-serif; font-size: clamp(38px, 6vw, 68px); line-height: 1; letter-spacing: -.045em; }
.archive-description { max-width: 720px; margin: 16px 0 0; color: var(--zn-muted); }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; }
.grid-card { overflow: hidden; background: #fff; border: 1px solid var(--zn-line); border-radius: var(--zn-radius-md); transition: transform .2s ease, box-shadow .2s ease; }
.grid-card:hover { transform: translateY(-4px); box-shadow: var(--zn-shadow); }
.grid-card-image { aspect-ratio: 16 / 10; overflow: hidden; }
.grid-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.grid-card:hover img { transform: scale(1.04); }
.grid-card-body { padding: 20px; }
.grid-card-title { margin: 12px 0 10px; font-family: "Jost", sans-serif; font-size: 23px; line-height: 1.22; }
.grid-card .category-pill { color: var(--zn-blue); background: var(--zn-blue-soft); }
.grid-card .card-meta { color: var(--zn-muted); }

.article-wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 56px 0 74px; }
.breadcrumbs { margin-bottom: 22px; color: var(--zn-muted); font-size: 13px; }
.breadcrumbs a:hover { color: var(--zn-blue); }
.article-header { max-width: 980px; margin: 0 auto 32px; text-align: center; }
.article-title { margin: 16px 0 20px; font-family: "Jost", sans-serif; font-size: clamp(42px, 6vw, 76px); line-height: 1.03; letter-spacing: -.05em; }
.article-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; color: var(--zn-muted); font-size: 14px; }
.article-hero { overflow: hidden; aspect-ratio: 16 / 8.5; margin-bottom: 38px; border-radius: var(--zn-radius-lg); box-shadow: var(--zn-shadow); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
.article-layout { display: grid; grid-template-columns: 64px minmax(0, 760px) 280px; justify-content: center; gap: 34px; align-items: start; }
.share-rail { display: grid; gap: 10px; position: sticky; top: 120px; }
.share-link { display: grid; width: 44px; height: 44px; place-items: center; color: var(--zn-muted); background: #fff; border: 1px solid var(--zn-line); border-radius: 50%; font-size: 12px; font-weight: 700; }
.share-link:hover { color: #fff; background: var(--zn-blue); border-color: var(--zn-blue); }
.article-content { min-width: 0; padding: 34px 40px; background: #fff; border-radius: var(--zn-radius-md); }
.article-content > *:first-child { margin-top: 0; }
.article-content p { margin: 0 0 1.45em; color: #353a42; font-size: 18px; }
.article-content h2,
.article-content h3 { margin: 1.7em 0 .65em; font-family: "Jost", sans-serif; line-height: 1.16; }
.article-content h2 { font-size: 36px; }
.article-content h3 { font-size: 28px; }
.article-content blockquote { margin: 2em 0; padding: 22px 28px; border-left: 3px solid var(--zn-blue); background: var(--zn-blue-soft); border-radius: 0 18px 18px 0; font-size: 20px; }
.article-content a { color: var(--zn-blue-dark); text-decoration: underline; text-underline-offset: 3px; }
.article-content ul,
.article-content ol { padding-left: 24px; }
.article-side { display: grid; gap: 18px; position: sticky; top: 120px; }
.article-author { padding: 22px; background: #fff; border-radius: var(--zn-radius-md); }
.article-author strong { display: block; margin-bottom: 6px; font-family: "Jost", sans-serif; font-size: 20px; }
.article-author span { color: var(--zn-muted); font-size: 13px; }
.related-section { margin-top: 44px; }

.empty-state,
.error-404 { padding: 70px 30px; text-align: center; background: #fff; border-radius: var(--zn-radius-lg); }
.error-code { display: block; color: var(--zn-blue); font-family: "Jost", sans-serif; font-size: clamp(82px, 16vw, 180px); font-weight: 700; line-height: .85; }
.empty-state h1,
.error-404 h1 { margin: 20px 0 10px; font-family: "Jost", sans-serif; font-size: 44px; }
.empty-state p,
.error-404 p { color: var(--zn-muted); }

.site-footer { margin-top: 50px; padding: 58px 0 100px; color: #cbd2dc; background: #151a21; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 50px; }
.footer-brand .brand-title { color: #fff; }
.footer-copy { max-width: 460px; margin: 18px 0 0; color: #8f99a7; font-size: 14px; }
.footer-title { margin: 0 0 18px; color: #fff; font-family: "Jost", sans-serif; font-size: 18px; }
.footer-links { list-style: none; display: grid; gap: 9px; margin: 0; padding: 0; font-size: 14px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 44px; padding-top: 22px; border-top: 1px solid #2a3039; color: #7f8997; font-size: 12px; }

.mobile-dock { display: none; }

@media (max-width: 1100px) {
  .primary-nav { display: none; }
  .header-main { grid-template-columns: auto 1fr auto; }
  .menu-toggle { display: inline-grid; }
  .primary-nav.is-open {
    position: fixed;
    inset: 88px 16px auto;
    z-index: 150;
    display: block;
    padding: 22px;
    background: #fff;
    border-radius: 22px;
    box-shadow: var(--zn-shadow);
  }
  .admin-bar .primary-nav.is-open { top: 120px; }
  .primary-nav ul { flex-direction: column; align-items: flex-start; gap: 14px; }
  .content-layout { grid-template-columns: minmax(0,1fr) 320px; }
  .category-scroller { grid-template-columns: repeat(4, 1fr); }
  .category-orb:nth-child(n+5) { display: none; }
  .article-layout { grid-template-columns: 54px minmax(0, 1fr); }
  .article-side { display: none; }
}

@media (max-width: 820px) {
  :root { --zn-wrap: min(100% - 28px, 720px); }
  body { font-size: 16px; padding-bottom: 68px; }
  .admin-bar .site-header { top: 46px; }
  .header-main { min-height: 72px; gap: 12px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 13px; font-size: 20px; }
  .brand-title { font-size: 19px; }
  .brand-tagline { display: none; }
  .icon-button { width: 40px; height: 40px; }
  .primary-nav.is-open { top: 78px; }
  .admin-bar .primary-nav.is-open { top: 124px; }
  .breaking-bar { padding-top: 10px; }
  .breaking-inner { grid-template-columns: auto 1fr; border-radius: 15px; }
  .breaking-time { display: none; }
  .section { padding: 38px 0; }
  .section-head { margin-bottom: 20px; }
  .section-title { font-size: 32px; }
  .hero-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin-right: calc((100vw - var(--zn-wrap)) / -2);
    padding-right: 18px;
    gap: 14px;
  }
  .hero-grid::-webkit-scrollbar,
  .category-scroller::-webkit-scrollbar { display: none; }
  .news-card,
  .news-card.is-lead { flex: 0 0 min(82vw, 420px); min-height: 430px; grid-row: auto; scroll-snap-align: start; border-radius: 24px; }
  .news-card.is-lead .news-card-content,
  .news-card-content { padding: 23px; }
  .news-card.is-lead .news-card-title,
  .news-card-title { font-size: 29px; }
  .category-scroller {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-right: calc((100vw - var(--zn-wrap)) / -2);
    padding-right: 18px;
    gap: 14px;
    scrollbar-width: none;
  }
  .category-orb,
  .category-orb:nth-child(n+5) { display: grid; flex: 0 0 128px; scroll-snap-align: start; }
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .list-card { grid-template-columns: 128px 1fr; gap: 14px; min-height: 130px; padding: 10px; }
  .list-card-image { min-height: 110px; border-radius: 15px; }
  .list-card-title { margin: 8px 0; font-size: 19px; }
  .list-card-excerpt { display: none; }
  .post-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .archive-hero-inner { padding: 28px; }
  .article-wrap { width: min(100% - 28px, 720px); padding-top: 34px; }
  .article-header { text-align: left; }
  .article-title { font-size: 42px; }
  .article-meta { justify-content: flex-start; }
  .article-hero { aspect-ratio: 4 / 3; border-radius: 22px; }
  .article-layout { display: block; }
  .share-rail { display: flex; position: static; margin: 0 0 16px; }
  .article-content { padding: 26px 22px; }
  .article-content p { font-size: 17px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .mobile-dock {
    position: fixed;
    inset: auto 12px 10px;
    z-index: 130;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px;
    background: rgba(255,255,255,.94);
    border: 1px solid var(--zn-line);
    border-radius: 22px;
    box-shadow: 0 14px 42px rgba(19,28,40,.2);
    backdrop-filter: blur(16px);
  }
  .mobile-dock a,
  .mobile-dock button { display: grid; place-items: center; gap: 2px; padding: 5px; color: var(--zn-muted); background: transparent; border: 0; font-size: 10px; cursor: pointer; }
  .mobile-dock svg { width: 21px; height: 21px; }
  .mobile-dock .is-active { color: var(--zn-blue); }
}

@media (max-width: 560px) {
  .header-actions .search-toggle { display: none; }
  .breaking-label { padding-inline: 9px; }
  .breaking-title { font-size: 13px; }
  .section-link { font-size: 12px; }
  .news-card,
  .news-card.is-lead { flex-basis: 86vw; min-height: 420px; }
  .post-grid { grid-template-columns: 1fr; }
  .grid-card { display: grid; grid-template-columns: 132px 1fr; }
  .grid-card-image { height: 100%; aspect-ratio: auto; }
  .grid-card-body { padding: 15px; }
  .grid-card-title { font-size: 19px; }
  .list-card { grid-template-columns: 112px 1fr; }
  .list-card-title { font-size: 17px; }
  .list-card .category-pill { min-height: 26px; padding: 3px 9px; font-size: 10px; }
  .card-meta { font-size: 11px; }
  .article-title { font-size: 36px; }
  .article-content h2 { font-size: 30px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; }
}

