/* ==========================================================================
   Gaarne — base
   Reset, typografie, container, knoppen, formulieren, hulpklassen.
   Mobile first. Geen framework, geen !important tenzij onvermijdelijk.
   ========================================================================== */

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

body.gaarne {
  margin: 0;
  background: var(--g-surface-page);
  color: var(--g-text-body);
  font-family: var(--g-font-body);
  font-size: var(--g-text-base);
  line-height: var(--g-leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Blocksy zet zelf een containerbreedte; wij nemen die over voor Gaarne-schermen. */
body.gaarne .site-main > .ct-container,
body.gaarne .ct-container { max-width: none; padding: 0; }

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

a { color: inherit; text-decoration: none; transition: color var(--g-transition); }
a:hover { color: var(--g-coral-dark); }
a:hover:active { color: var(--g-coral-darker); }

h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--g-text-heading); font-weight: var(--g-weight-semibold); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

del { color: var(--g-text-quiet); text-decoration: line-through; }

/* --------------------------------------------------------------------------
   Container — 1280px met 48px gutter, 28px onder 780px
   -------------------------------------------------------------------------- */
.g-container {
  width: 100%;
  max-width: calc(var(--g-container) + var(--g-container-gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--g-container-gutter);
}

@media (max-width: 780px) {
  .g-container { padding-inline: var(--g-container-gutter-sm); }
}

.g-section { padding-block: var(--g-section-y); }
.g-section--sm { padding-block: var(--g-section-y-sm); }
.g-section--muted { background: var(--g-surface-muted); }
.g-section--cream { background: var(--g-surface-cream-soft); }

@media (max-width: 780px) {
  .g-section, .g-section--sm { padding-block: var(--g-section-y-xs); }
}

/* --------------------------------------------------------------------------
   Typografische rollen
   -------------------------------------------------------------------------- */
.g-hero-title {
  font-family: var(--g-font-heading);
  font-weight: var(--g-weight-semibold);
  font-size: var(--g-text-hero);
  line-height: var(--g-leading-hero);
  letter-spacing: var(--g-tracking-hero);
}

.g-page-title {
  font-family: var(--g-font-heading);
  font-weight: var(--g-weight-semibold);
  font-size: var(--g-text-h1);
  line-height: 1.08;
  letter-spacing: var(--g-tracking-h1);
}

.g-section-title {
  font-family: var(--g-font-heading);
  font-weight: var(--g-weight-semibold);
  font-size: var(--g-text-h2);
  line-height: var(--g-leading-heading);
}

@media (max-width: 780px) {
  .g-page-title { font-size: 31px; }
  .g-section-title { font-size: var(--g-text-h2-sm); }
}

/*
 * Lucht onder een sectiekop.
 *
 * Hierboven gaan alle kopmarges op nul, omdat de winkelschermen hun eigen
 * ritme opbouwen. Voor de sectiekop klopte dat niet: die stond overal strak
 * tegen zijn inhoud aan — kaartenraster, projecttegels, merkenrij.
 *
 * 30px sluit aan bij wat het ontwerp elders al doet: 34px onder de
 * categoriekop, 28px onder de keuzehulpkop. Een lead hoort dichter tegen zijn
 * kop te staan, net als daar (14px).
 */
.g-section-title + * { margin-block-start: var(--g-space-13); }

.g-section-title + p,
.g-section-title + .g-lead { margin-block-start: var(--g-space-6); }

.g-eyebrow {
  font-size: var(--g-text-11);
  font-weight: var(--g-weight-bold);
  letter-spacing: var(--g-tracking-eyebrow);
  text-transform: uppercase;
  color: var(--g-coral);
}
.g-eyebrow--quiet { color: var(--g-text-quiet); }

.g-kicker {
  font-size: var(--g-text-10);
  font-weight: var(--g-weight-bold);
  letter-spacing: var(--g-tracking-promo);
  text-transform: uppercase;
  color: var(--g-text-quiet);
}

.g-lead {
  font-size: var(--g-text-lead);
  line-height: var(--g-leading-lead);
  color: var(--g-text-body);
  max-width: 34em;
}

.g-meta { font-size: var(--g-text-13); color: var(--g-text-quiet); }
.g-soft { color: var(--g-text-soft); }

/* --------------------------------------------------------------------------
   Knoppen — koraal is nooit een knopvulling
   -------------------------------------------------------------------------- */
.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: var(--g-button-height);
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--g-radius-pill);
  font-family: var(--g-font-body);
  font-size: var(--g-text-sm);
  font-weight: var(--g-weight-semibold);
  line-height: 1;
  cursor: pointer;
  transition: background var(--g-transition), color var(--g-transition), border-color var(--g-transition);
}

.g-btn--primary {
  background: var(--g-action-solid);
  color: var(--g-white);
}
.g-btn--primary:hover { background: var(--g-action-solid-hover); color: var(--g-white); }

.g-btn--ghost {
  background: transparent;
  color: var(--g-text-heading);
  border-color: var(--g-border-control);
}
.g-btn--ghost:hover { background: var(--g-cream); color: var(--g-text-heading); }

.g-btn--quiet {
  background: transparent;
  color: var(--g-coral-dark);
  padding-inline: 0;
  min-height: 0;
}
.g-btn--quiet:hover { color: var(--g-coral-darker); }

.g-btn--lg { min-height: 52px; font-size: 15px; }
.g-btn--block { width: 100%; }

/* Ronde toevoegknop op kaarten */
.g-btn-add {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--g-radius-circle);
  background: var(--g-action-solid); color: var(--g-white);
  font-size: 19px; line-height: 1; cursor: pointer;
  transition: background var(--g-transition);
}
.g-btn-add:hover { background: var(--g-action-solid-hover); }

/* --------------------------------------------------------------------------
   Formulieren
   -------------------------------------------------------------------------- */
.g-input,
.g-select,
input[type="text"].g-input,
input[type="email"].g-input,
input[type="tel"].g-input {
  width: 100%;
  min-height: var(--g-control-height);
  padding: 0 20px;
  border: 1px solid var(--g-border-control);
  border-radius: var(--g-radius-pill);
  background: var(--g-white);
  font-family: var(--g-font-body);
  font-size: 14.5px;
  color: var(--g-text-heading);
  transition: border-color var(--g-transition), box-shadow var(--g-transition);
}
.g-input::placeholder,
.g-textarea::placeholder { color: var(--g-text-placeholder); }
.g-input:focus,
.g-textarea:focus,
.g-select:focus {
  outline: none;
  border-color: var(--g-border-focus);
  box-shadow: var(--g-focus-ring);
}

.g-textarea {
  width: 100%;
  min-height: 110px;
  padding: 14px 18px;
  border: 1px solid var(--g-border-control);
  border-radius: var(--g-radius-16);
  background: var(--g-white);
  font-family: var(--g-font-body);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--g-text-heading);
  resize: vertical;
}

.g-select {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%238d8880' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 11px 7px;
  cursor: pointer;
}

.g-label {
  display: block;
  margin-bottom: 7px;
  font-size: var(--g-text-13);
  font-weight: var(--g-weight-medium);
  color: var(--g-text-soft);
}

/* Checkbox — 17px, radius 5px, 1px #d4d4d4 */
.g-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: var(--g-text-sm);
  color: var(--g-text-body);
}
.g-check input[type="checkbox"] {
  appearance: none;
  flex: 0 0 auto;
  width: 17px; height: 17px;
  margin: 0;
  border: 1px solid var(--g-border-checkbox);
  border-radius: var(--g-radius-5);
  background: var(--g-white);
  cursor: pointer;
  transition: background var(--g-transition), border-color var(--g-transition);
}
.g-check input[type="checkbox"]:checked {
  background: var(--g-action-solid);
  border-color: var(--g-action-solid);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.3 4.8 8.6 9.5 3.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px;
}
.g-check--lg input[type="checkbox"] { width: 20px; height: 20px; border-radius: var(--g-radius-6); }

/* Radio */
.g-radio input[type="radio"] {
  appearance: none;
  width: 19px; height: 19px;
  margin: 0;
  border: 1px solid var(--g-border-checkbox);
  border-radius: var(--g-radius-circle);
  background: var(--g-white);
  cursor: pointer;
  transition: border-color var(--g-transition), box-shadow var(--g-transition);
}
.g-radio input[type="radio"]:checked {
  border-color: var(--g-coral);
  border-width: 5px;
}

/* --------------------------------------------------------------------------
   Chips en pills
   -------------------------------------------------------------------------- */
.g-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius-pill);
  background: var(--g-cream);
  font-size: var(--g-text-12);
  color: var(--g-text-heading);
  transition: background var(--g-transition), border-color var(--g-transition);
}
.g-chip__remove {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: #969696; font-size: 13px; line-height: 1;
}
.g-chip__remove:hover { color: var(--g-text-heading); }

.g-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius-pill);
  background: var(--g-white);
  font-size: var(--g-text-sm);
  color: var(--g-text-body);
  cursor: pointer;
  transition: background var(--g-transition), border-color var(--g-transition), color var(--g-transition);
}
.g-pill:hover { background: var(--g-cream); }
.g-pill[aria-pressed="true"],
.g-pill.is-active {
  background: var(--g-cream);
  border-color: var(--g-coral);
  color: var(--g-text-heading);
  font-weight: var(--g-weight-semibold);
}

/* Badge — 9-10px, 700, uppercase, pill */
.g-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--g-radius-pill);
  background: var(--g-white);
  font-size: var(--g-text-9);
  font-weight: var(--g-weight-bold);
  letter-spacing: var(--g-tracking-promo);
  text-transform: uppercase;
  color: var(--g-text-heading);
}
.g-badge--new { background: var(--g-badge-new-bg); }
.g-badge--sale { background: var(--g-badge-sale-bg); color: var(--g-badge-sale-text); }

/* --------------------------------------------------------------------------
   Sterren — glyphs verborgen voor screenreaders, aria-label op de wrapper
   -------------------------------------------------------------------------- */
.g-stars {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--g-text-13);
  color: var(--g-text-quiet);
}
.g-stars__glyphs {
  color: var(--g-star);
  font-size: var(--g-text-10);
  letter-spacing: 1px;
}
.g-stars__glyphs .is-empty { color: var(--g-star-empty); }

/* --------------------------------------------------------------------------
   Favorietenhart
   -------------------------------------------------------------------------- */
.g-heart {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--g-radius-circle);
  background: var(--g-white);
  color: var(--g-text-soft);
  font-size: 22px; line-height: 1; cursor: pointer;
  transition: color var(--g-transition), transform var(--g-transition);
}
.g-heart:hover { color: var(--g-coral-dark); }
.g-heart[aria-pressed="true"] { color: var(--g-coral-dark); }
.g-heart--lg { width: 50px; height: 50px; border: 1px solid var(--g-border-control); }

/* --------------------------------------------------------------------------
   Hoeveelheidkiezer
   -------------------------------------------------------------------------- */
.g-qty {
  display: inline-flex;
  align-items: center;
  height: var(--g-control-height);
  border: 1px solid var(--g-border-control);
  border-radius: var(--g-radius-pill);
  background: var(--g-white);
  overflow: hidden;
}
.g-qty--sm { height: 42px; }
.g-qty button {
  width: 42px; height: 100%;
  border: 0; background: none;
  font-size: 16px; color: var(--g-text-soft);
  cursor: pointer;
  transition: color var(--g-transition), background var(--g-transition);
}
.g-qty button:hover { background: var(--g-cream); color: var(--g-text-heading); }
.g-qty input {
  width: 34px; height: 100%;
  border: 0; background: none; text-align: center;
  font-family: var(--g-font-body); font-size: var(--g-text-sm);
  font-weight: var(--g-weight-semibold); color: var(--g-text-heading);
  appearance: textfield;
}
.g-qty input::-webkit-outer-spin-button,
.g-qty input::-webkit-inner-spin-button { appearance: none; margin: 0; }

/* --------------------------------------------------------------------------
   Kaartlift
   -------------------------------------------------------------------------- */
.g-liftable { transition: transform var(--g-transition-card), box-shadow var(--g-transition-card); }
.g-liftable:hover { transform: var(--g-lift-card); box-shadow: var(--g-shadow); }

/* --------------------------------------------------------------------------
   Toegankelijkheid
   -------------------------------------------------------------------------- */
.g-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.g-skip-link {
  position: absolute;
  left: 50%; top: 8px;
  transform: translate(-50%, -200%);
  z-index: 10000;
  padding: 12px 22px;
  border-radius: var(--g-radius-pill);
  background: var(--g-action-solid);
  color: var(--g-white);
  font-size: var(--g-text-sm);
  font-weight: var(--g-weight-semibold);
  transition: transform var(--g-transition);
}
.g-skip-link:focus { transform: translate(-50%, 0); color: var(--g-white); }

/* Eén zichtbare focusbehandeling voor toetsenbordgebruikers */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--g-focus-ring-keyboard);
  border-radius: var(--g-radius-6);
}

/* --------------------------------------------------------------------------
   Beeldvlakken met CSS-fallback
   -------------------------------------------------------------------------- */
/*
 * display:block is hier geen opsmuk maar noodzaak.
 *
 * Een deel van deze beeldvlakken staat als <span> in de opmaak, en op een
 * inline element doet aspect-ratio niets. Het vlak van de inspiratiekaart op
 * de homepage nam daardoor de vorm van de foto aan in plaats van 3:2 — bij
 * één artikel valt dat niet op, bij drie artikelen naast elkaar met foto's in
 * verschillende verhoudingen wordt het een rafelige rij.
 */
.g-media {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--g-gradient-product);
  border-radius: inherit;
}
.g-media--product { aspect-ratio: var(--g-ratio-product); }
.g-media--kit { aspect-ratio: var(--g-ratio-kit); background: var(--g-gradient-kit); }
.g-media--project { aspect-ratio: var(--g-ratio-project); }
.g-media--thumb { aspect-ratio: var(--g-ratio-thumb); background: var(--g-card-soft); }
.g-media img { width: 100%; height: 100%; object-fit: cover; }

/* Het beeld bij een inspiratieartikel past in zijn vlak in plaats van dat het
   wordt bijgesneden — zie de toelichting bij .g-entry-card__media in
   content.css. Productfoto's blijven wél bijsnijden: die komen in één
   verhouding binnen en horen in een strak raster. */
.g-media--project img {
  object-fit: contain;
  background: var(--g-surface-muted);
}

/* CSS-getekende garenbol — fallback zolang er geen foto is */
.g-skein {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 55%;
  aspect-ratio: 1 / 1.18;
  border-radius: var(--g-radius-yarn-blob);
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.30), transparent 58%), var(--g-skein-color, var(--g-yarn-3));
  box-shadow: var(--g-shadow-yarn-inset), var(--g-shadow-yarn-drop);
}
.g-skein--sm { width: 46px; height: 46px; aspect-ratio: 1; position: static; margin: auto; box-shadow: var(--g-shadow-yarn-inset); }

/* Overlaypositie op beeldvlakken */
.g-media__badge { position: absolute; top: 14px; left: 14px; z-index: 2; }
.g-media__heart { position: absolute; top: 12px; right: 12px; z-index: 2; }
.g-media__type {
  position: absolute; left: 16px; bottom: 14px; z-index: 2;
  font-size: var(--g-text-10); font-weight: var(--g-weight-bold);
  letter-spacing: var(--g-tracking-eyebrow); text-transform: uppercase;
  color: var(--g-white);
}

/* --------------------------------------------------------------------------
   Grids
   -------------------------------------------------------------------------- */
.g-grid { display: grid; gap: var(--g-gap-grid); }
.g-grid--3 { grid-template-columns: repeat(3, 1fr); }
.g-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1100px) {
  .g-grid--4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .g-grid--3, .g-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .g-grid--3, .g-grid--4 { grid-template-columns: 1fr; }
}

/* Horizontale scrollers onder 780px */
@media (max-width: 780px) {
  .g-scroller-sm {
    display: flex;
    gap: var(--g-gap-grid);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-inline: calc(var(--g-container-gutter-sm) * -1);
    padding-inline: var(--g-container-gutter-sm);
    scrollbar-width: none;
  }
  .g-scroller-sm::-webkit-scrollbar { display: none; }
  .g-scroller-sm > * { flex: 0 0 250px; scroll-snap-align: start; }
}

/* Nooit horizontale overflow, op geen enkele breedte */
html, body { overflow-x: clip; }

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */
.g-breadcrumb {
  padding-top: var(--g-space-8);
  font-size: var(--g-text-13);
  color: var(--g-text-quiet);
}
.g-breadcrumb a { color: var(--g-text-soft); }
.g-breadcrumb a:hover { color: var(--g-coral-dark); }
.g-breadcrumb .sep { margin-inline: 8px; color: var(--g-line-strong); }

/* --------------------------------------------------------------------------
   Prijs
   -------------------------------------------------------------------------- */
.g-price {
  font-family: var(--g-font-body);
  font-weight: var(--g-weight-bold);
  color: var(--g-text-heading);
}
.g-price--display {
  font-family: var(--g-font-heading);
  font-weight: var(--g-weight-semibold);
}

/* --------------------------------------------------------------------------
   [hidden] wint altijd
   Een eigen display-regel verslaat de useragentregel [hidden]{display:none}.
   Deze regel zet dat recht voor alle Gaarne-componenten in één keer.
   -------------------------------------------------------------------------- */
[class^="g-"][hidden],
[class*=" g-"][hidden] { display: none !important; }
