:root {
  --blue: #1677d2;
  --blue-dark: #075aa8;
  --yellow: #ffd84d;
  --ink: #172033;
  --muted: #667085;
  --line: #e6ebf2;
  --soft: #f6f9fc;
  --radius: 18px;
  --shadow: 0 12px 35px rgba(20, 50, 90, .09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(
    90deg,
    #a9cfe8 0%,
    #c2d7e8 24%,
    #d6dde5 48%,
    #e2d285 72%,
    #cda62b 100%
  );
  background-attachment: fixed;
  line-height: 1.55;
}

.container {
  width: min(1160px, calc(100% - 32px));
  margin: auto;
}

/* ==========================================================
   HEADER
   ========================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
}

.header-inner nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.header-inner nav > a:not(.button) {
  color: var(--muted);
  text-decoration: none;
}

/* ==========================================================
   BUTTONS
   ========================================================== */

.button {
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  padding: 12px 19px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: .2s;
}

.button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.button.small {
  padding: 6px 14px;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

.button.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

/* ==========================================================
   ПІДТРИМКА ВИДАВНИЦТВА «РАНОК»
   ========================================================== */

.ranok-support {
  padding: 16px 0 0;
}

.ranok-support-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
  align-items: stretch;
  overflow: hidden;
  border: 2px solid #dc2626;
  border-radius: 12px;
  background: #fef2f2;
  box-shadow: 0 5px 18px rgba(127, 29, 29, .08);
}

.ranok-support-image {
  display: block;
  min-width: 0;
  overflow: hidden;
}

.ranok-support-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 190px;
  max-height: 230px;
  object-fit: cover;
}

.ranok-support-text {
  display: flex;
  align-items: center;
  padding: 28px 34px;
  color: #b91c1c;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
  letter-spacing: -.025em;
}

.ranok-support-text:hover {
  color: #7f1d1d;
  text-decoration: underline;
  text-underline-offset: 4px;
}


/* ==========================================================
   ПІДТРИМКА УКРАЇНСЬКИХ ВИДАВНИЦТВ
   ========================================================== */

.publishers-support {
  padding: 16px 0 0;
}

.publishers-support-inner {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 26px 30px;
  border: 1px solid rgba(22, 119, 210, .22);
  border-radius: 16px;
  background:
  radial-gradient(circle at 8% 20%, rgba(255, 218, 170, .8), transparent 34%),
  radial-gradient(circle at 92% 30%, rgba(255, 235, 170, .8), transparent 36%),
  rgba(236, 150, 55, .9);
  box-shadow: 0 6px 20px rgba(20, 50, 90, .06);
  backdrop-filter: blur(10px);
}

.publishers-support-copy {
  min-width: 0;
}

.publishers-support-kicker {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.publishers-support h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.publishers-support p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.publishers-support-button {
  flex-shrink: 0;
  white-space: nowrap;
}


/* ==========================================================
   HERO + СТАТИСТИКА
   ========================================================== */

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: stretch;
  padding-top: 42px;
  padding-bottom: 42px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 28px 30px;
  text-align: left;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(45px);
  opacity: .5;
}

.blob.blue {
  width: 320px;
  height: 320px;
  background: #b9ddff;
  left: -100px;
  top: -100px;
}

.blob.yellow {
  width: 340px;
  height: 340px;
  background: #ffe88d;
  right: -120px;
  top: -40px;
}

.eyebrow {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  background: rgba(255, 255, 255, .75);
  font-size: 13px;
  color: var(--muted);
}

.hero h1 {
  max-width: 760px;
  margin: 18px 0 14px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

h1 span {
  color: var(--blue);
}

h1 mark {
  background: none;
  text-decoration: underline;
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 8px;
  text-underline-offset: 5px;
}

.hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.data-status {
  margin-top: 12px !important;
  font-size: 13px !important;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 14px;
  padding: 0;
  min-width: 0;
}

.stats article {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 6px 20px rgba(20, 50, 90, .05);
}

.stats strong {
  display: block;
  font-size: 38px;
  color: var(--blue);
}

.stats span {
  color: var(--muted);
}

/* ==========================================================
   GENERAL HEADINGS
   ========================================================== */

h2 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -.035em;
  margin: 0 0 25px;
}

/* ==========================================================
   CATALOG
   ========================================================== */

.catalog {
  padding-bottom: 80px;
  scroll-margin-top: 85px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(150px, 210px)) auto;
  gap: 10px;
}

.filters input,
.filters select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 13px;
  font: inherit;
  color: var(--ink);
  outline: none;
}

.search-field {
  position: relative;
}

.search-field span {
  position: absolute;
  left: 13px;
  top: 9px;
  color: var(--muted);
  font-size: 22px;
}

.search-field input {
  padding-left: 40px;
}

.result-count {
  color: var(--muted);
  margin: 18px 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 245px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 6px 20px rgba(20, 50, 90, .05);
  transition: .2s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  background: #edf6ff;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.badge.location {
  background: #fff8d7;
  color: #6e5700;
}

.card h3 {
  font-size: 20px;
  margin: 16px 0 8px;
}

.card p {
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.text-link {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.details {
  border: 0;
  background: #eef5fb;
  color: var(--ink);
  border-radius: 11px;
  padding: 9px 13px;
  font-weight: 750;
  cursor: pointer;
}

.empty {
  border: 1px dashed #cdd7e5;
  border-radius: var(--radius);
  padding: 50px;
  text-align: center;
  background: var(--soft);
}

.load-more-wrap {
  text-align: center;
  margin-top: 28px;
}

.catalog-cta {
  margin: 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink);
  font-weight: 700;
  text-align: center;
}

.telegram-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #16a34a;
  color: #fff;
  border: 0;
  padding: 12px 19px;
  font-weight: 750;
  line-height: normal;
  text-decoration: none;
  cursor: pointer;
  transition: .2s;
}

.telegram-button:hover {
  background: #15803d;
  transform: translateY(-1px);
}

/* ==========================================================
   WHY
   ========================================================== */

.why {
  background: rgba(255, 255, 255, .68);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(230, 235, 242, .85);
  padding: 70px 0;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.benefits article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.benefits b {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #eaf5ff;
  color: var(--blue);
  font-size: 22px;
}

.benefits h3 {
  margin: 15px 0 7px;
}

.benefits p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ==========================================================
   FOOTER
   ========================================================== */

footer {
  border-top: 1px solid rgba(230, 235, 242, .9);
  background: rgba(255, 255, 255, .58);
  backdrop-filter: blur(8px);
  padding: 28px 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

/* ==========================================================
   MODAL
   ========================================================== */

dialog {
  width: min(600px, calc(100% - 28px));
  border: 0;
  border-radius: 22px;
  padding: 30px;
  box-shadow: 0 25px 80px rgba(15, 35, 65, .28);
}

dialog::backdrop {
  background: rgba(9, 20, 38, .55);
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 12px;
  border: 0;
  background: transparent;
  font-size: 30px;
  cursor: pointer;
}

.modal-title {
  font-size: 30px;
  margin: 16px 0 10px;
}

.modal-description {
  color: var(--muted);
}

.modal-links {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.modal-links a {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--blue-dark);
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* ==========================================================
   TABLET
   ========================================================== */

@media (max-width: 950px) {

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 32px;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefits {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 640px) {


  .publishers-support {
    padding-top: 10px;
  }

  .publishers-support-inner {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 20px;
  }

  .publishers-support-button {
    width: 100%;
    text-align: center;
  }


  .button.small {
    padding-inline: 11px;
    font-size: 14px;
    white-space: nowrap;
  }

  .header-inner nav > a:not(.button) {
    display: none;
  }

  .ranok-support {
    padding-top: 10px;
  }

  .ranok-support-inner {
    grid-template-columns: 1fr;
  }

  .ranok-support-image img {
    min-height: 0;
    max-height: none;
    aspect-ratio: 1.91 / 1;
    object-fit: cover;
  }

  .ranok-support-text {
    padding: 18px 20px 20px;
    font-size: 21px;
    text-align: center;
    justify-content: center;
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 24px;
    padding-bottom: 28px;
  }

  .hero {
    padding: 22px 18px;
  }

  .hero h1 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .stats {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 8px;
  }

  .stats article {
    padding: 16px 8px;
  }

  .stats strong {
    font-size: 28px;
  }

  .stats span {
    font-size: 12px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: auto;
  }

  .cards,
  .benefits {
    grid-template-columns: 1fr;
  }

  .catalog-cta {
    flex-direction: column;
    gap: 10px;
  }

  .telegram-button {
    width: 100%;
    max-width: 320px;
  }

  .footer-inner {
    flex-direction: column;
  }
}
