/*
Theme Name: Błonnik.net.pl
Theme URI: https://blonnik.net.pl/
Author: Redakcja Błonnik.net.pl
Description: Lekki, dostępny i mobilny motyw serwisu edukacyjnego o błonniku.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: blonnik
*/

:root {
  --ink: #17312b;
  --ink-soft: #49615a;
  --forest: #14543f;
  --forest-dark: #0a392c;
  --leaf: #2f7b5d;
  --mint: #e6f2eb;
  --oat: #f7f3e9;
  --paper: #fffefa;
  --sun: #e9aa36;
  --line: #d8e1da;
  --danger: #9d342e;
  --danger-bg: #fff1ef;
  --shadow: 0 16px 50px rgb(19 61 46 / 10%);
  --radius: 1.25rem;
  --content: 760px;
  --wide: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--forest);
  text-decoration-thickness: .09em;
  text-underline-offset: .18em;
}

a:hover {
  color: var(--forest-dark);
}

button,
input,
textarea,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: .5rem;
  left: .5rem;
  transform: translateY(-160%);
  padding: .75rem 1rem;
  border-radius: .5rem;
  color: #fff;
  background: var(--forest-dark);
}

.skip-link:focus {
  transform: translateY(0);
}

.wrap {
  width: min(calc(100% - 2rem), var(--wide));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid rgb(216 225 218 / 82%);
  background: rgb(255 254 250 / 94%);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  min-height: 4.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: 50% 50% 48% 52% / 62% 46% 54% 38%;
  color: #fff;
  background: var(--forest);
  transform: rotate(-7deg);
}

.brand-mark svg {
  width: 1.4rem;
  transform: rotate(7deg);
}

.nav-toggle {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: .75rem;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.nav-toggle svg {
  width: 1.35rem;
}

.primary-nav {
  position: absolute;
  top: calc(100% + 1px);
  right: 0;
  left: 0;
  display: none;
  padding: .75rem 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.primary-nav.is-open {
  display: block;
}

.primary-nav ul,
.footer-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-nav a {
  display: block;
  padding: .7rem .65rem;
  border-radius: .55rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a {
  color: var(--forest);
  background: var(--mint);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(4rem, 9vw, 7.5rem);
  background:
    radial-gradient(circle at 86% 17%, rgb(233 170 54 / 23%), transparent 19rem),
    radial-gradient(circle at 12% 92%, rgb(47 123 93 / 18%), transparent 21rem),
    var(--oat);
}

.hero-grid {
  display: grid;
  align-items: center;
  gap: 2.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 1rem;
  color: var(--forest);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .09em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow::before {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--sun);
  content: "";
}

h1,
h2,
h3 {
  max-width: 28ch;
  margin-top: 0;
  color: var(--ink);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.13;
}

h1 {
  margin-bottom: 1.25rem;
  font-size: clamp(2.55rem, 8vw, 5.4rem);
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.8rem, 4.8vw, 3.05rem);
}

h3 {
  margin-bottom: .65rem;
  font-size: clamp(1.25rem, 3.2vw, 1.6rem);
}

.hero-lead {
  max-width: 62ch;
  margin: 0 0 1.75rem;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: .72rem 1.15rem;
  border: 2px solid var(--forest);
  border-radius: .75rem;
  color: #fff;
  background: var(--forest);
  font-weight: 800;
  text-decoration: none;
}

.button:hover {
  color: #fff;
  background: var(--forest-dark);
}

.button-secondary {
  color: var(--forest);
  background: transparent;
}

.button-secondary:hover {
  color: var(--forest-dark);
  background: #fff;
}

.hero-visual {
  position: relative;
  width: min(100%, 34rem);
  min-height: 23rem;
  margin-inline: auto;
}

.fiber-bowl {
  position: absolute;
  right: 2%;
  bottom: 1rem;
  width: 76%;
  aspect-ratio: 1.55;
  border-radius: 9% 9% 48% 48% / 15% 15% 70% 70%;
  background: linear-gradient(145deg, #fff 0 34%, #e4dfd2 35% 100%);
  box-shadow: 0 30px 45px rgb(23 49 43 / 17%);
}

.fiber-bowl::before {
  position: absolute;
  top: -14%;
  right: 3%;
  left: 3%;
  height: 36%;
  border: .9rem solid #f2eee3;
  border-radius: 50%;
  background:
    radial-gradient(circle at 20% 35%, #d49a2f 0 4%, transparent 4.5%),
    radial-gradient(circle at 38% 60%, #7a9d48 0 5%, transparent 5.5%),
    radial-gradient(circle at 58% 35%, #a96934 0 5%, transparent 5.5%),
    radial-gradient(circle at 77% 56%, #d6bd74 0 6%, transparent 6.5%),
    repeating-radial-gradient(ellipse at 50% 50%, #b98a49 0 4%, #dec591 5% 9%);
  box-shadow: inset 0 5px 12px rgb(23 49 43 / 16%);
  content: "";
}

.leaf {
  position: absolute;
  width: 9rem;
  height: 4rem;
  border-radius: 100% 0 100% 0;
  background: var(--leaf);
  box-shadow: inset 0 -1rem 2rem rgb(10 57 44 / 20%);
}

.leaf::after {
  position: absolute;
  top: 50%;
  left: 8%;
  width: 84%;
  height: 2px;
  background: rgb(255 255 255 / 52%);
  content: "";
  transform: rotate(-18deg);
  transform-origin: left;
}

.leaf-one {
  top: 1.6rem;
  right: 8%;
  transform: rotate(26deg);
}

.leaf-two {
  top: 7.8rem;
  left: 3%;
  width: 7rem;
  height: 3rem;
  background: #85a85b;
  transform: rotate(-28deg) scaleX(-1);
}

.stat-badge {
  position: absolute;
  z-index: 2;
  top: 3rem;
  left: 6%;
  width: 8.8rem;
  padding: 1rem;
  border: 1px solid rgb(255 255 255 / 80%);
  border-radius: 1rem;
  background: rgb(255 254 250 / 92%);
  box-shadow: var(--shadow);
}

.stat-badge strong {
  display: block;
  color: var(--forest);
  font-family: ui-serif, Georgia, serif;
  font-size: 2rem;
  line-height: 1;
}

.stat-badge span {
  display: block;
  margin-top: .45rem;
  color: var(--ink-soft);
  font-size: .78rem;
  line-height: 1.35;
}

.section {
  padding: clamp(3.75rem, 8vw, 7rem) 0;
}

.section-tint {
  background: var(--mint);
}

.section-heading {
  max-width: 68rem;
  margin-bottom: 2rem;
}

.section-heading p:not(.eyebrow) {
  max-width: 62ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.card-grid {
  display: grid;
  gap: 1rem;
}

.card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 8px 28px rgb(19 61 46 / 6%);
}

.card-icon {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: .8rem;
  color: var(--forest);
  background: var(--mint);
  font-weight: 900;
}

.card h3 {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 1.2rem;
  letter-spacing: -.02em;
}

.card p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.card-link {
  margin-top: auto;
  font-weight: 800;
}

.fact-strip {
  display: grid;
  overflow: hidden;
  border-radius: var(--radius);
  color: #fff;
  background: var(--forest-dark);
}

.fact {
  padding: 1.5rem;
  border-bottom: 1px solid rgb(255 255 255 / 14%);
}

.fact:last-child {
  border-bottom: 0;
}

.fact strong {
  display: block;
  margin-bottom: .3rem;
  color: #fff;
  font-family: ui-serif, Georgia, serif;
  font-size: 1.6rem;
}

.fact span {
  color: #dcebe3;
  font-size: .92rem;
}

.content-shell {
  display: grid;
  max-width: var(--wide);
  margin-inline: auto;
  gap: 2.5rem;
}

.article-header {
  padding: clamp(3rem, 7vw, 5.5rem) 0 2.5rem;
  background: var(--oat);
}

.article-header h1 {
  max-width: 19ch;
  font-size: clamp(2.25rem, 6vw, 4.25rem);
}

.article-deck {
  max-width: 64ch;
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  font-size: 1.13rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  color: var(--ink-soft);
  font-size: .88rem;
}

.article-meta strong {
  color: var(--ink);
}

.breadcrumbs {
  margin-bottom: 1.5rem;
  color: var(--ink-soft);
  font-size: .82rem;
}

.breadcrumbs a {
  color: inherit;
}

.article-layout {
  display: grid;
  align-items: start;
  gap: 2.5rem;
  padding-top: 2.75rem;
  padding-bottom: 5rem;
}

.article-content {
  min-width: 0;
  max-width: var(--content);
}

.article-content > *:first-child {
  margin-top: 0;
}

.article-content h2,
.article-content h3 {
  scroll-margin-top: 6rem;
}

.article-content h2 {
  max-width: 28ch;
  margin-top: 3.25rem;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.article-content h3 {
  margin-top: 2rem;
  font-size: 1.35rem;
}

.article-content p,
.article-content li {
  max-width: 72ch;
}

.article-content p {
  margin: 0 0 1.25rem;
}

.article-content ul,
.article-content ol {
  padding-left: 1.35rem;
}

.article-content li + li {
  margin-top: .45rem;
}

.article-content blockquote {
  margin: 1.75rem 0;
  padding: 1.1rem 1.25rem;
  border: 0;
  border-left: .35rem solid var(--leaf);
  border-radius: 0 1rem 1rem 0;
  background: var(--mint);
  font-size: 1.04rem;
  font-style: normal;
}

.article-content blockquote > :last-child {
  margin-bottom: 0;
}

.article-content details {
  margin: .75rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: #fff;
}

.article-content summary {
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.article-content details[open] summary {
  margin-bottom: .75rem;
}

.answer,
.note,
.warning,
.sources,
.editorial-note {
  margin: 1.75rem 0;
  padding: 1.25rem;
  border-radius: 1rem;
}

.answer {
  border-left: .35rem solid var(--leaf);
  background: var(--mint);
  font-size: 1.05rem;
}

.answer > :last-child,
.note > :last-child,
.warning > :last-child,
.sources > :last-child,
.editorial-note > :last-child {
  margin-bottom: 0;
}

.note,
.editorial-note {
  border: 1px solid var(--line);
  background: var(--oat);
}

.warning {
  border: 1px solid #f0c3be;
  color: #67231f;
  background: var(--danger-bg);
}

.warning h2,
.warning h3,
.warning strong {
  color: var(--danger);
}

.sources {
  border-top: 3px solid var(--forest);
  background: #f4f7f4;
  font-size: .9rem;
}

.sources ol,
.sources ul {
  margin-bottom: 0;
}

sup a {
  display: inline-block;
  min-width: 1.2rem;
  padding-inline: .1rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.table-scroll {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: .94rem;
}

th,
td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #fff;
  background: var(--forest);
  font-size: .82rem;
  letter-spacing: .02em;
}

tr:last-child td {
  border-bottom: 0;
}

.toc {
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fff;
}

.toc-title {
  margin: 0 0 .65rem;
  font-size: .88rem;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
}

.toc li + li {
  margin-top: .3rem;
}

.toc a {
  font-size: .9rem;
  text-decoration: none;
}

.trust-card {
  margin-top: 1rem;
  padding: 1.1rem;
  border-radius: 1rem;
  color: #eaf5ef;
  background: var(--forest-dark);
  font-size: .86rem;
}

.trust-card strong {
  display: block;
  margin-bottom: .4rem;
  color: #fff;
  font-size: 1rem;
}

.trust-card a {
  color: #fff;
}

.post-nav {
  display: grid;
  margin-top: 3rem;
  gap: .75rem;
}

.post-nav a {
  display: block;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  font-weight: 800;
  text-decoration: none;
}

.archive-header {
  padding: 3.5rem 0 2rem;
}

.archive-header h1 {
  font-size: clamp(2.25rem, 6vw, 4rem);
}

.archive-grid {
  display: grid;
  padding-bottom: 5rem;
  gap: 1rem;
}

.empty-state {
  max-width: 42rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--oat);
}

.search-form {
  display: flex;
  max-width: 36rem;
  gap: .6rem;
}

.search-form label {
  flex: 1;
}

.search-field {
  width: 100%;
  min-height: 3rem;
  padding: .65rem .8rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  color: var(--ink);
  background: #fff;
}

.search-submit {
  min-height: 3rem;
  padding: .65rem 1rem;
  border: 0;
  border-radius: .7rem;
  color: #fff;
  background: var(--forest);
  font-weight: 800;
  cursor: pointer;
}

.site-footer {
  padding: 3.5rem 0 1.5rem;
  color: #dcebe3;
  background: var(--forest-dark);
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

.site-footer .brand,
.site-footer a {
  color: #fff;
}

.site-footer p {
  max-width: 50ch;
  color: #c2d8cd;
  font-size: .9rem;
}

.footer-nav a {
  display: inline-block;
  padding: .25rem 0;
}

.footer-small {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgb(255 255 255 / 14%);
  color: #b8cfc4;
  font-size: .78rem;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 700px) {
  .card-grid,
  .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fact-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .fact {
    border-right: 1px solid rgb(255 255 255 / 14%);
    border-bottom: 0;
  }

  .fact:last-child {
    border-right: 0;
  }

  .footer-grid {
    grid-template-columns: 1.6fr 1fr 1fr;
  }

  .post-nav {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 920px) {
  .nav-toggle {
    display: none;
  }

  .primary-nav {
    position: static;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .primary-nav ul {
    display: flex;
    align-items: center;
    gap: .2rem;
  }

  .primary-nav a {
    padding: .55rem .7rem;
    font-size: .9rem;
  }

  .hero-grid {
    grid-template-columns: 1.08fr .92fr;
  }

  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .article-layout {
    grid-template-columns: minmax(0, var(--content)) minmax(220px, 1fr);
  }

  .article-aside {
    position: sticky;
    top: 6.2rem;
  }

  .archive-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .article-aside,
  .button-row {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
  }

  a {
    color: #000;
  }
}

/* Natywne media artykułów i obrazy wyróżniające. */
.article-featured-wrap {
  padding-top: clamp(1.5rem, 4vw, 3rem);
}

.article-featured-wrap + .article-layout {
  padding-top: 0;
}

.article-featured,
.article-content .wp-block-image.blonnik-media {
  width: 100%;
  margin: 0 auto clamp(1.75rem, 4vw, 3rem);
}

.article-featured img,
.article-content .wp-block-image.blonnik-media img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border-radius: var(--radius);
  background: var(--oat);
  box-shadow: var(--shadow);
}

.article-featured.is-portrait,
.article-content .wp-block-image.blonnik-media.is-portrait {
  max-width: min(100%, 720px);
}

.article-featured figcaption,
.article-content .wp-block-image.blonnik-media figcaption {
  max-width: 72ch;
  margin: .75rem auto 0;
  color: var(--ink-soft);
  font-size: .875rem;
  line-height: 1.55;
  text-align: left;
}

.blonnik-media-caption,
.blonnik-media-credit {
  display: block;
}

.blonnik-media-credit {
  margin-top: .2rem;
  font-size: .8125rem;
}

@media (max-width: 699px) {
  .article-featured img,
  .article-content .wp-block-image.blonnik-media img {
    border-radius: .85rem;
  }
}

@media print {
  .article-featured,
  .article-content .wp-block-image.blonnik-media {
    break-inside: avoid;
  }

  .article-featured img,
  .article-content .wp-block-image.blonnik-media img {
    box-shadow: none;
  }
}
