/*
Theme Name: Klasa na Gotowo
Theme URI: https://klasanagotowo.pl/
Author: Klasa na Gotowo
Description: Lekki, responsywny motyw sklepu z cyfrowymi materiałami dla nauczycieli.
Version: 1.0.1
Requires at least: 6.8
Tested up to: 7.1
Requires PHP: 8.1
Text Domain: klasa-na-gotowo
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --kng-ink: #24344d;
  --kng-ink-soft: #596579;
  --kng-teal: #247b73;
  --kng-teal-dark: #195d57;
  --kng-mint: #e1f1ee;
  --kng-coral: #c4483d;
  --kng-coral-dark: #a93830;
  --kng-sun: #f2c75c;
  --kng-cream: #fff8ee;
  --kng-paper: #ffffff;
  --kng-line: #dce3ea;
  --kng-muted: #596579;
  --kng-shadow: 0 14px 34px rgba(36, 52, 77, .10);
  --kng-radius: 16px;
  --kng-radius-sm: 10px;
  --kng-content: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--kng-ink);
  background: var(--kng-paper);
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--kng-teal-dark); text-underline-offset: 3px; }
a:hover { color: var(--kng-coral-dark); }

h1, h2, h3, h4 {
  margin: 0 0 .6em;
  color: var(--kng-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  line-height: 1.18;
  letter-spacing: -.025em;
}

h1 { font-size: clamp(2.25rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
p { margin: 0 0 1.15em; }

.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;
}

.screen-reader-text:focus {
  z-index: 100000;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  clip: auto;
  padding: .75rem 1rem;
  color: var(--kng-paper);
  background: var(--kng-ink);
}

.kng-container {
  width: min(calc(100% - 36px), var(--kng-content));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid rgba(220, 231, 231, .88);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
  min-height: 92px;
}

.site-branding,
.site-branding a {
  display: inline-flex;
  gap: .7rem;
  align-items: center;
  color: var(--kng-ink);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
}

.site-branding__mark {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(36, 52, 77, .14));
}
.site-branding__name { white-space: nowrap; }
.custom-logo-link img { width: auto; max-width: 230px; max-height: 66px; object-fit: contain; }

.primary-navigation ul,
.footer-navigation ul {
  display: flex;
  gap: 1.3rem;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-navigation { justify-self: center; }
.primary-navigation a { color: var(--kng-ink); font-size: .95rem; font-weight: 700; text-decoration: none; }
.primary-navigation a:hover { color: var(--kng-teal); }

.header-actions { display: flex; gap: .6rem; align-items: center; }
.header-actions a {
  display: inline-flex;
  min-height: 42px;
  padding: .62rem .9rem;
  align-items: center;
  border: 1px solid var(--kng-line);
  border-radius: 10px;
  color: var(--kng-ink);
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
}
.header-actions a:hover { border-color: var(--kng-teal); background: var(--kng-mint); }

.menu-toggle { display: none; }

.kng-button,
.wp-element-button,
.button,
button,
input[type="submit"] {
  display: inline-flex;
  min-height: 48px;
  padding: .78rem 1.25rem;
  justify-content: center;
  align-items: center;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--kng-coral);
  color: var(--kng-paper) !important;
  font: inherit;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.kng-button:hover,
.wp-element-button:hover,
.button:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--kng-coral-dark);
  box-shadow: 0 9px 20px rgba(196, 72, 61, .2);
  transform: translateY(-1px);
}

.kng-button--secondary { border-color: var(--kng-ink); background: transparent; color: var(--kng-ink) !important; }
.kng-button--secondary:hover { background: var(--kng-ink); color: var(--kng-paper) !important; }
.kng-button--coral { background: var(--kng-coral); }
.kng-button--coral:hover { background: var(--kng-coral-dark); }

.kng-button:focus-visible,
.wp-element-button:focus-visible,
.button:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible {
  outline: 3px solid var(--kng-sun);
  outline-offset: 3px;
}

.kng-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 8vw, 7.6rem) 0;
  background: var(--kng-cream);
}

.kng-hero::before,
.kng-hero::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}

.kng-hero::before { top: -130px; right: -90px; width: 390px; height: 390px; background: var(--kng-mint); }
.kng-hero::after { bottom: -170px; left: -100px; width: 340px; height: 340px; background: rgba(244, 201, 93, .28); }

.kng-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(320px, .78fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}

.kng-eyebrow {
  display: inline-flex;
  gap: .45rem;
  align-items: center;
  margin-bottom: 1.05rem;
  color: var(--kng-teal-dark);
  font-size: .86rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.kng-eyebrow::before { width: 10px; height: 10px; border-radius: 50%; background: var(--kng-coral); content: ""; }
.kng-hero h1 span { color: var(--kng-teal); }
.kng-hero__lead { max-width: 650px; color: var(--kng-ink-soft); font-size: clamp(1.1rem, 2vw, 1.32rem); }
.kng-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

.kng-preview-stack { position: relative; min-height: 430px; }
.kng-preview-sheet {
  position: absolute;
  width: 68%;
  aspect-ratio: 1 / 1.34;
  padding: 2rem 1.65rem;
  border: 1px solid rgba(23, 59, 68, .1);
  border-radius: 14px;
  background: var(--kng-paper);
  box-shadow: var(--kng-shadow);
}
.kng-preview-sheet:nth-child(1) { top: 4%; left: 2%; transform: rotate(-8deg); }
.kng-preview-sheet:nth-child(2) { top: 1%; right: 1%; background: var(--kng-mint); transform: rotate(7deg); }
.kng-preview-sheet:nth-child(3) { z-index: 2; right: 15%; bottom: 0; transform: rotate(-1deg); }
.kng-preview-sheet__dot { display: block; width: 45px; height: 45px; margin-bottom: 1.25rem; border-radius: 14px; background: var(--kng-coral); }
.kng-preview-sheet:nth-child(2) .kng-preview-sheet__dot { background: var(--kng-sun); }
.kng-preview-sheet:nth-child(3) .kng-preview-sheet__dot { background: var(--kng-teal); }
.kng-preview-sheet strong { display: block; margin-bottom: .8rem; font-size: 1.45rem; line-height: 1.15; }
.kng-preview-line { display: block; width: 100%; height: 10px; margin: 12px 0; border-radius: 999px; background: var(--kng-line); }
.kng-preview-line--short { width: 65%; }

.kng-trust { border-block: 1px solid var(--kng-line); background: var(--kng-paper); }
.kng-trust__grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.kng-trust__item { padding: 1.2rem; text-align: center; }
.kng-trust__item + .kng-trust__item { border-left: 1px solid var(--kng-line); }
.kng-trust__item strong { display: block; font-size: 1rem; }
.kng-trust__item span { color: var(--kng-muted); font-size: .88rem; }

.kng-section { padding: clamp(4rem, 7vw, 6.5rem) 0; }
.kng-section--tint { background: #f5faf9; }
.kng-section__head { display: flex; gap: 2rem; justify-content: space-between; align-items: end; margin-bottom: 2.4rem; }
.kng-section__head p { max-width: 580px; margin: 0; color: var(--kng-muted); }

.kng-category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.kng-category-card {
  position: relative;
  min-height: 175px;
  padding: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--kng-line);
  border-radius: var(--kng-radius);
  background: var(--kng-paper);
  box-shadow: 0 8px 24px rgba(23, 59, 68, .05);
  color: var(--kng-ink);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.kng-category-card:hover { border-color: var(--kng-teal); box-shadow: var(--kng-shadow); color: var(--kng-ink); transform: translateY(-3px); }
.kng-category-card__icon { display: grid; width: 50px; height: 50px; place-items: center; margin-bottom: 1.4rem; border-radius: 15px; background: var(--kng-mint); color: var(--kng-teal-dark); font-size: 1.5rem; }
.kng-category-card:nth-child(3n+2) .kng-category-card__icon { background: #fff1e9; color: var(--kng-coral-dark); }
.kng-category-card:nth-child(3n+3) .kng-category-card__icon { background: #fff7d9; color: #8b6810; }
.kng-category-card h3 { margin-bottom: .3rem; font-size: 1.18rem; }
.kng-category-card p { margin: 0; color: var(--kng-muted); font-size: .91rem; }

.kng-freebie {
  display: grid;
  grid-template-columns: .82fr 1.18fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: 28px;
  background: var(--kng-ink);
  color: var(--kng-paper);
  box-shadow: var(--kng-shadow);
}
.kng-freebie h2, .kng-freebie h3 { color: var(--kng-paper); }
.kng-freebie p { color: #dce8e9; }
.kng-freebie__visual { padding: 1.6rem; border-radius: var(--kng-radius); background: var(--kng-mint); color: var(--kng-ink); transform: rotate(-2deg); }
.kng-freebie__visual strong { display: block; margin-bottom: .5rem; font-size: 1.5rem; }

.site-main { min-height: 55vh; }
.entry-shell { width: min(calc(100% - 36px), 900px); margin-inline: auto; padding: clamp(3rem, 7vw, 6rem) 0; }
.entry-header { margin-bottom: 2rem; }
.entry-content > * { max-width: 760px; margin-inline: auto; }
.entry-content > .alignwide { max-width: var(--kng-content); }
.entry-content > .alignfull { max-width: none; }

.site-footer { padding: 4rem 0 1.5rem; background: var(--kng-ink); color: #dce8e9; }
.site-footer a { color: var(--kng-paper); }
.site-footer h2, .site-footer h3 { color: var(--kng-paper); }
.site-footer__grid { display: grid; grid-template-columns: 1.15fr .85fr .85fr; gap: 3rem; }
.site-footer__brand { max-width: 390px; }
.site-footer__brand strong { display: block; margin-bottom: .8rem; color: var(--kng-paper); font-size: 1.35rem; }
.site-footer__brand-lockup { display: flex; gap: 1rem; align-items: flex-start; }
.site-footer__brand-lockup img { width: 82px; height: 82px; flex: 0 0 82px; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .22)); }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: .55rem; }
.site-footer__bottom { display: flex; gap: 1rem; justify-content: space-between; margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid rgba(255, 255, 255, .15); color: #b8cbce; font-size: .85rem; }

/* WooCommerce */
.woocommerce .woocommerce-breadcrumb { margin-bottom: 1.5rem; color: var(--kng-muted); font-size: .86rem; }
.woocommerce ul.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2rem; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product { width: auto !important; margin: 0 !important; padding: 0 0 1.25rem; overflow: hidden; border: 1px solid var(--kng-line); border-radius: var(--kng-radius); background: var(--kng-paper); box-shadow: 0 8px 24px rgba(23, 59, 68, .06); }
.woocommerce ul.products li.product:hover { box-shadow: var(--kng-shadow); transform: translateY(-2px); }
.woocommerce ul.products li.product a img { margin: 0 0 1rem; aspect-ratio: 1 / 1; object-fit: cover; }
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .price,
.woocommerce ul.products li.product .button { margin-inline: 1.1rem; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { min-height: 3em; padding: 0; font-size: 1rem; }
.woocommerce ul.products li.product .price { display: block; color: var(--kng-teal-dark); font-size: 1rem; font-weight: 900; }
.woocommerce ul.products li.product .button { margin-top: .7rem; }
.woocommerce span.onsale { min-width: 0; min-height: 0; padding: .4rem .7rem; border-radius: 999px; background: var(--kng-coral); line-height: 1; }
.woocommerce div.product { padding: clamp(2rem, 5vw, 5rem) 0; }
.woocommerce div.product div.images img { border-radius: var(--kng-radius); }
.woocommerce div.product .product_title { font-size: clamp(2rem, 4vw, 3.4rem); }
.woocommerce div.product p.price { color: var(--kng-teal-dark); font-size: 1.45rem; font-weight: 900; }
.woocommerce-message, .woocommerce-info { border-top-color: var(--kng-teal); background: #f5faf9; }
.woocommerce-message::before, .woocommerce-info::before { color: var(--kng-teal); }
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  min-height: 48px;
  padding: .7rem .8rem;
  border: 1px solid #b9cccc;
  border-radius: 10px;
  background: var(--kng-paper);
  color: var(--kng-ink);
  font: inherit;
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(31, 122, 120, .2); border-color: var(--kng-teal); }
.kng-license-box { margin: 1.2rem 0; padding: 1rem 1.1rem; border-left: 4px solid var(--kng-sun); border-radius: 0 10px 10px 0; background: #fff9df; font-size: .92rem; }
.kng-digital-consent { padding: 1rem; border: 1px solid var(--kng-line); border-radius: 12px; background: #f7fbfa; }

@media (max-width: 980px) {
  .site-header__inner { grid-template-columns: minmax(0, auto) auto; gap: 1rem; justify-content: space-between; min-height: 78px; }
  .site-branding__mark { width: 54px; height: 54px; flex-basis: 54px; }
  .site-branding__name { font-size: 1rem; }
  .custom-logo-link img { max-width: 190px; max-height: 54px; }
  .menu-toggle { display: inline-flex; min-height: 42px; padding: .55rem .85rem; }
  .primary-navigation { display: none; grid-column: 1 / -1; justify-self: stretch; padding-bottom: 1rem; }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul { flex-direction: column; align-items: stretch; gap: .2rem; }
  .primary-navigation a { display: block; padding: .65rem 0; }
  .header-actions { display: none; }
  .kng-hero__grid { grid-template-columns: 1fr .72fr; gap: 2rem; }
  .kng-category-grid { grid-template-columns: repeat(2, 1fr); }
  .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .kng-hero { padding: 3.6rem 0 2.4rem; }
  .kng-hero__grid { grid-template-columns: 1fr; }
  .kng-preview-stack { min-height: 320px; }
  .kng-preview-sheet { width: 57%; padding: 1.35rem; }
  .kng-trust__grid { grid-template-columns: 1fr; }
  .kng-trust__item + .kng-trust__item { border-top: 1px solid var(--kng-line); border-left: 0; }
  .kng-section__head { display: block; }
  .kng-category-grid, .kng-freebie, .site-footer__grid { grid-template-columns: 1fr; }
  .woocommerce ul.products { gap: .75rem; }
  .woocommerce ul.products li.product .button { width: calc(100% - 2.2rem); padding-inline: .65rem; }
  .site-footer__bottom { flex-direction: column; }
  .site-footer__brand-lockup img { width: 74px; height: 74px; flex-basis: 74px; }
}

@media (max-width: 390px) {
  .kng-container { width: min(calc(100% - 24px), var(--kng-content)); }
  .site-branding { gap: .5rem; }
  .site-branding__mark { width: 48px; height: 48px; flex-basis: 48px; }
  .site-branding__name { max-width: 128px; white-space: normal; font-size: .9rem; }
  .menu-toggle { padding-inline: .7rem; }
}

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