/*
Theme Name: Blocksy Child
Template: blocksy
Version: 1.0.0
*/

/* ==========================================================================
   Tokenid (CVI v1.0). Color 1–8 = Blocksy palett, ülejäänud lisavärvid.
   ========================================================================== */
:root {
  --th-lilla: var(--theme-palette-color-1, #875f9a);
  --th-tumelilla: var(--theme-palette-color-2, #79508a);
  --th-tekst: var(--theme-palette-color-3, #4a4349);
  --th-tint: var(--theme-palette-color-4, #231e24);
  --th-joon: var(--theme-palette-color-5, #e4ddd8);
  --th-liiv: var(--theme-palette-color-6, #f0eae6);
  --th-paber: var(--theme-palette-color-7, #f7f4ef);
  --th-valge: var(--theme-palette-color-8, #ffffff);
  --th-lavendel: #cfb1dd;
  --th-lillatoon: #f2e6f7;
  --th-hall: #6f666d;
  --th-joon-tume: #d8cfca;
  --th-jalus-tekst: #cdc4cb;

  --th-serif: 'DM Serif Display', Georgia, serif;
  --th-sans: 'Hanken Grotesk', Helvetica, Arial, sans-serif;
  --th-script: 'Mrs Saint Delafield', cursive;
  --th-mono: 'JetBrains Mono', ui-monospace, monospace;

  --th-section-space: clamp(64px, 8vw, 104px);
  --th-gap: 20px;
  --th-radius-card: 18px;
  --th-radius-img: 16px;
}

/* ==========================================================================
   Alus: Blocksy muutujad üle kirjutatud (body > :root, et võita Blocksy oma)
   ========================================================================== */
body {
  --theme-font-family: var(--th-sans);
  --theme-font-size: 17px;
  --theme-line-height: 1.6;
  --theme-text-color: var(--th-tekst);
  --theme-headings-color: var(--th-tint);
  --theme-heading-color: var(--th-tint);
  --theme-link-initial-color: var(--th-lilla);
  --theme-link-hover-color: var(--th-tumelilla);
  --theme-border-color: var(--th-joon);
  --theme-selection-background-color: var(--th-lavendel);
  --theme-selection-text-color: var(--th-tint);

  --theme-button-background-initial-color: var(--th-lilla);
  --theme-button-background-hover-color: var(--th-tint);
  --theme-button-text-initial-color: #fff;
  --theme-button-text-hover-color: #fff;
  --theme-button-border-radius: 999px;
  --theme-button-padding: 15px 26px;
  --theme-button-min-height: 48px;
  --theme-button-font-size: 16px;
  --theme-button-line-height: 1.2;

  --theme-form-field-border-radius: 10px;
  --theme-form-field-border-initial-color: var(--th-joon-tume);
  --theme-form-field-border-focus-color: var(--th-tint);

  background-color: var(--th-paber);
  color: var(--th-tekst);
  -webkit-font-smoothing: antialiased;
}

@media (max-width: 689.98px) {
  body { --theme-font-size: 16px; }
}

/* Pealkirjad: DM Serif Display, H4 Hanken 600 */
body :is(h1, h2, h3) {
  --theme-font-family: var(--th-serif);
  --theme-font-weight: 400;
  --theme-text-transform: none;
  text-wrap: balance;
}
body h1 { --theme-font-size: clamp(44px, 5.3vw, 76px); --theme-line-height: 1.02; --theme-letter-spacing: -0.025em; }
body h2 { --theme-font-size: clamp(34px, 3.5vw, 50px); --theme-line-height: 1.1; --theme-letter-spacing: -0.02em; }
body h3 { --theme-font-size: clamp(24px, 2.1vw, 30px); --theme-line-height: 1.15; --theme-letter-spacing: 0; }
body h4 {
  --theme-font-family: var(--th-sans);
  --theme-font-weight: 600;
  --theme-font-size: clamp(17px, 1.4vw, 19px);
  --theme-line-height: 1.35;
}

/* Kaldkiri pealkirjas = käekirja-aktsent („mis töötavad“). Max 2–4 sõna. */
:is(h1, h2, h3) em {
  font-family: var(--th-script);
  font-style: normal;
  font-weight: 400;
  font-size: 1.45em;
  line-height: 0.8;
  letter-spacing: 0;
  color: var(--th-tumelilla);
}

.th-section--dark :is(h1, h2, h3) em,
.is-style-tume :is(h1, h2, h3) em,
.th-cta :is(h1, h2, h3) em { color: var(--th-lavendel); }

/* Nupud */
.wp-element-button,
.ct-button {
  font-weight: 600;
  white-space: nowrap;
}

/* Teisene: tume ääris, hover täidab tumedaks */
.wp-block-button.is-style-outline {
  --theme-button-background-initial-color: var(--th-tint);
  --theme-button-background-hover-color: var(--th-tint);
  --theme-button-text-initial-color: var(--th-tint);
  --theme-button-text-hover-color: var(--th-paber);
}
.wp-block-button.is-style-outline > .wp-block-button__link {
  color: var(--th-tint);
  border: 1px solid var(--th-tint);
  background: transparent;
  padding: 14px 25px;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
  color: var(--th-paber);
  background: var(--th-tint);
}

.wp-block-button.is-style-tume > .wp-block-button__link {
  --theme-button-background-initial-color: var(--th-tint);
  --theme-button-background-hover-color: var(--th-lilla);
}

.wp-block-button.is-style-lavendel > .wp-block-button__link {
  --theme-button-background-initial-color: var(--th-lavendel);
  --theme-button-background-hover-color: var(--th-paber);
  --theme-button-text-initial-color: var(--th-tint);
  --theme-button-text-hover-color: var(--th-tint);
}

/* K24 olekud: üleminek 200 ms, fookusrõngas klaviatuurile, keelatud = hall */
.wp-element-button,
.ct-button { transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.wp-element-button:focus-visible,
.ct-button:focus-visible,
body .fluentform .ff-btn-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--th-tint);
}
.wp-block-button.is-style-outline > .wp-block-button__link:focus-visible {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--th-lilla);
}
.wp-element-button:disabled,
.wp-element-button[aria-disabled="true"],
body .fluentform .ff-btn-submit:disabled {
  --theme-button-background-initial-color: var(--th-joon);
  --theme-button-background-hover-color: var(--th-joon);
  --theme-button-text-initial-color: #8a8189;
  --theme-button-text-hover-color: #8a8189;
  cursor: not-allowed;
}
a:focus-visible { outline: 2px solid var(--th-tint); outline-offset: 4px; border-radius: 4px; }

/* Tumedal taustal: põhinupp lavendel (hover paber), teisene hele ääris */
:is(.th-cta, .th-section--dark, .is-style-tume) .wp-block-button:not(.is-style-outline) > .wp-block-button__link {
  --theme-button-background-initial-color: var(--th-lavendel);
  --theme-button-background-hover-color: var(--th-paber);
  --theme-button-text-initial-color: var(--th-tint);
  --theme-button-text-hover-color: var(--th-tint);
}
:is(.th-cta, .th-section--dark, .is-style-tume) .wp-block-button.is-style-outline {
  --theme-button-text-initial-color: var(--th-paber);
  --theme-button-background-hover-color: var(--th-paber);
  --theme-button-text-hover-color: var(--th-tint);
}
:is(.th-cta, .th-section--dark, .is-style-tume) .wp-block-button.is-style-outline > .wp-block-button__link {
  color: var(--th-paber);
  border-color: var(--th-jalus-tekst);
}
:is(.th-cta, .th-section--dark, .is-style-tume) .wp-block-button.is-style-outline > .wp-block-button__link:hover { color: var(--th-tint); }

/* K26 sildid (blogi kategooriad jm). Lõigul: Stiil → Silt. */
.th-badge,
p.is-style-silt {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--th-lillatoon);
  color: var(--th-tumelilla);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}
.th-badge--liiv { background: var(--th-liiv); color: var(--th-tekst); }
.th-badge--lilla { background: var(--th-lilla); color: #fff; }
.th-badge--tume { background: var(--th-tint); color: var(--th-paber); }
.th-badge--outline { background: transparent; border: 1px solid var(--th-tint); color: var(--th-tint); padding: 5px 11px; }
a.th-badge:hover { background: var(--th-lilla); color: #fff; }

/* K27 teated. Lõigul: Stiil → Teade (info / õnnestus / viga). */
p:is(.is-style-teade-info, .is-style-teade-edu, .is-style-teade-viga) {
  position: relative;
  padding: 16px 18px 16px 44px;
  border: 1px solid;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.5;
}
p:is(.is-style-teade-info, .is-style-teade-edu, .is-style-teade-viga)::before { position: absolute; left: 18px; top: 16px; font-weight: 700; }
p.is-style-teade-info { background: var(--th-lillatoon); border-color: #e2cfeb; color: #4b2f58; }
p.is-style-teade-info::before { content: "i"; }
p.is-style-teade-edu { background: #eef5f0; border-color: #cfe2d6; color: #1f4a33; }
p.is-style-teade-edu::before { content: "\2713"; }
p.is-style-teade-viga { background: #fbeef0; border-color: #efcdd3; color: #7a2333; }
p.is-style-teade-viga::before { content: "!"; }

/* Tekstilink nooleks: „Kõik teenused →“ */
.th-arrow-link a,
a.th-arrow-link {
  color: var(--th-tint);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: nowrap;
}
.th-arrow-link a:hover,
a.th-arrow-link:hover { color: var(--th-lilla); }

/* Väikesed tekstistiilid */
.th-eyebrow,
.th-num,
.th-breadcrumb {
  font-family: var(--th-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--th-tumelilla);
}
.th-eyebrow { letter-spacing: 0.1em; text-transform: uppercase; }
.th-breadcrumb { color: var(--th-hall); }

.th-lead {
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.6;
  max-width: 520px;
  text-wrap: pretty;
}

.th-muted { color: var(--th-hall); }

/* ==========================================================================
   Päis (Blocksy header builder)
   ========================================================================== */
#header {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px);
  z-index: 50;
}

#header [data-row*="middle"] {
  background-color: color-mix(in srgb, var(--th-paber) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--th-joon);
  --height: 90px;
  transition: box-shadow 0.2s ease;
}

/* K12 menüü: hover = liivane pill, aktiivne leht = lilla + joon */
#header [data-id="menu"] {
  --menu-items-spacing: 0px;
  --menu-item-height: auto;
}
#header [data-id="menu"] > ul { gap: 6px; }
#header [data-id="menu"] > ul > li > a {
  --theme-font-family: var(--th-sans);
  --theme-font-weight: 500;
  --theme-font-size: 15px;
  --theme-text-transform: none;
  --theme-letter-spacing: 0;
  --theme-link-initial-color: var(--th-tint);
  --theme-link-hover-color: var(--th-tint);
  --theme-link-active-color: var(--th-tumelilla);
  padding: 8px 14px;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
#header [data-id="menu"] > ul > li:hover > a { background-color: var(--th-liiv); }
#header [data-id="menu"] > ul > li[class*="current-menu-"] > a {
  --theme-font-weight: 600;
  background-color: transparent;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 8px;
}

#header [data-id="button"] .ct-button {
  --theme-button-background-initial-color: var(--th-tint);
  --theme-button-background-hover-color: var(--th-lilla);
  --theme-button-text-initial-color: var(--th-paber);
  --theme-button-text-hover-color: #fff;
  --theme-button-min-height: 44px;
  --theme-button-padding: 11px 20px;
  --theme-button-font-size: 14px;
  border-radius: 999px;
}

/* K12 sticky olek pärast kerimist (klass tuleb assets/site.js-st):
   madalam rida, logo 44 px, nupp lilla, õrn vari */
body.th-scrolled #header [data-row*="middle"] {
  --height: 68px;
  box-shadow: 0 8px 24px -12px rgba(35, 30, 36, 0.18);
}
body.th-scrolled #header [data-id="logo"] .site-logo-container { --logo-max-height: 44px; }
body.th-scrolled #header [data-id="button"] .ct-button {
  --theme-button-background-initial-color: var(--th-lilla);
  --theme-button-background-hover-color: var(--th-tint);
  --theme-button-text-initial-color: #fff;
}

/* Mobiil: ümmargune tume menüünupp */
/* Blocksy määrab toggle'i tausta/raadiuse !important'iga, aga loeb neid muutujatest */
#header [data-id="trigger"] {
  --theme-icon-color: #fff;
  --theme-icon-hover-color: #fff;
  --toggle-button-size: 44px;
  --toggle-button-radius: 50%;
  --toggle-button-background: var(--th-tint);
}

@media (max-width: 999.98px) {
  #header [data-row*="middle"] { --height: 72px; }
}

/* Off-canvas menüü: liivataust, suured serif-lingid.
   body[data-header] ees, et võita Blocksy oma `[data-header*="type-1"] #offcanvas` reegleid (need laevad pärast meie faili). */
body[data-header] #offcanvas .ct-panel-inner { background-color: var(--th-liiv); }

body[data-header] #offcanvas .ct-toggle-close {
  --theme-icon-color: var(--th-tint);
  --theme-icon-hover-color: var(--th-lilla);
}

body[data-header] #offcanvas [data-id="mobile-menu"] {
  --theme-font-family: var(--th-serif);
  --theme-font-weight: 400;
  --theme-font-size: 32px;
  --theme-line-height: 1.3;
  --theme-text-transform: none;
  --theme-link-initial-color: var(--th-tint);
  --theme-link-hover-color: var(--th-lilla);
  --theme-link-active-color: var(--th-lilla);
}

body[data-header] #offcanvas [data-id="button"] { width: 100%; }
body[data-header] #offcanvas [data-id="button"] .ct-button {
  width: 100%;
  border-radius: 999px;
  --theme-button-background-initial-color: var(--th-lilla);
  --theme-button-background-hover-color: var(--th-tint);
  --theme-button-text-initial-color: #fff;
  --theme-button-text-hover-color: #fff;
}

/* ==========================================================================
   Jalus (inc/footer.php)
   ========================================================================== */
#footer { background: var(--th-tint); color: var(--th-jalus-tekst); }

.th-footer {
  width: var(--theme-container-width, 90vw);
  max-width: 1200px;
  margin: 0 auto;
  font-size: 14px;
  line-height: 1.6;
}
.th-footer a { color: var(--th-jalus-tekst); text-decoration: none; }
.th-footer a:hover { color: var(--th-lavendel); }

.th-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding: 64px 0 40px;
}
.th-footer__brand { display: flex; flex-direction: column; gap: 18px; }
.th-footer__brand img { height: 72px; width: auto; align-self: flex-start; }
.th-footer__brand p { margin: 0; max-width: 300px; }
.th-footer__col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.th-footer__heading { color: var(--th-paber); font-weight: 600; }

.th-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 0 32px;
  border-top: 1px solid #3a3239;
  font-size: 13px;
  color: #8a8189;
}
.th-footer__bottom a { color: #8a8189; }
.th-footer__legal { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* Sotsiaalikoonid: ring 44 px, hover lilla */
.th-socials { display: flex; gap: 10px; }
.th-footer .th-socials a {
  width: 44px;
  height: 44px;
  border: 1px solid var(--th-tekst);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--th-paber);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.th-footer .th-socials a:hover { background: var(--th-lilla); border-color: var(--th-lilla); color: #fff; }

.th-footer__grid--3 { grid-template-columns: 1.4fr 1fr 1.2fr; }
@media (max-width: 999.98px) {
  .th-footer__grid { grid-template-columns: 1fr 1fr; }
  .th-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 499.98px) {
  .th-footer__grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Sektsioonid (mustrid): täislaiuses taust, sisu 1200 px
   ========================================================================== */
.entry-content > .th-section,
.th-section {
  margin-block: 0;
  padding-block: var(--th-section-space);
}

.th-section--sand {
  background: var(--th-liiv);
  border-block: 1px solid var(--th-joon);
}
.th-section--lilac { background: var(--th-lillatoon); }
/* .th-section.th-… : sama tugev kui .entry-content > .th-section, muidu jääb live lehel peale tavaline vahe */
.th-section.th-section--no-top { padding-top: 0; }
.th-section.th-section--header { padding-top: clamp(20px, 3vw, 40px); padding-bottom: 0; }
.th-section--header + .th-section { padding-top: clamp(48px, 6vw, 72px); }

/* Sektsiooni sees plokkide vahe */
.th-section > * + * { margin-top: 48px; }
.th-section > :is(h1, h2, h3, p) { margin-bottom: 0; }

/* Pealkiri vasakul, link paremal */
.th-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px 40px;
  flex-wrap: wrap;
}
.th-section-head > * { margin: 0 !important; }
.th-section-head h2 { max-width: 640px; }

/* ==========================================================================
   Avaleht: hero
   ========================================================================== */
.th-hero {
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
.th-hero .wp-block-column:first-child > * { margin: 0; }
.th-hero .wp-block-column:first-child > * + * { margin-top: 28px; }
.th-hero h1 { max-width: 640px; }

.th-portrait {
  position: relative;
  padding-bottom: 28px;
  max-width: 520px;
  margin-inline: auto;
}
.th-portrait .wp-block-image { margin: 0; }
.th-portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 15%;
  border-radius: 220px 220px 16px 16px;
  background: #ebe3e3;
}

/* „Teele“ allkiri pildi all paremal */
.th-signature {
  font-family: var(--th-script);
  font-size: clamp(64px, 7vw, 96px);
  line-height: 1;
  color: var(--th-tumelilla);
  margin: 0;
}
.th-portrait .th-signature {
  position: absolute;
  right: -8px;
  bottom: 0;
}

/* ==========================================================================
   K01 Alamlehe päis
   ========================================================================== */
.th-page-header {
  background: var(--th-liiv);
  border: 1px solid var(--th-joon);
  border-radius: var(--th-radius-card);
  padding: clamp(40px, 5vw, 72px) clamp(24px, 4.5vw, 64px);
  gap: 40px;
  align-items: flex-end;
}
.th-page-header .wp-block-column > * { margin: 0; }
.th-page-header .wp-block-column > * + * { margin-top: 18px; }
.th-page-header h1 { --theme-font-size: clamp(42px, 4.5vw, 64px); }
.th-page-header p:not(.th-breadcrumb) { font-size: clamp(17px, 1.3vw, 18px); }

/* ==========================================================================
   K02 Teenusekaart (plokk teele/teenuste-kaardid)
   ========================================================================== */
.th-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--th-gap);
}

.th-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px;
  background: var(--th-valge);
  border: 1px solid var(--th-joon);
  border-radius: var(--th-radius-card);
  color: var(--th-tekst);
  text-decoration: none;
  transition: border-color 0.2s ease;
}
.th-card:hover { border-color: var(--th-tint); color: var(--th-tekst); }
.th-card__title { margin: 0; }
.th-card__text { margin: 0; font-size: 16px; }
.th-card__price {
  margin-top: auto;
  padding-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--th-tint);
}

@media (max-width: 899.98px) {
  .th-cards { grid-template-columns: 1fr; }
}

/* ==========================================================================
   K03 Portfoolio kaart (plokk teele/tood)
   ========================================================================== */
.th-works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--th-gap);
}

.th-work {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--th-tint);
  text-decoration: none;
}
.th-work:hover { color: var(--th-lilla); }

.th-work__img {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--th-joon);
  border-radius: var(--th-radius-img);
  overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--th-liiv) 0 10px, var(--th-paber) 10px 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--th-mono);
  font-size: 12px;
  color: #8a8189;
}
.th-work__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.th-work:hover .th-work__img img { transform: scale(1.03); }

.th-work__meta { display: flex; justify-content: space-between; gap: 12px; }
.th-work__title { font-weight: 600; }
.th-work__type { font-size: 14px; color: var(--th-hall); }

@media (max-width: 899.98px) {
  .th-works { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Koostöö sammud (nummerdatud list)
   ========================================================================== */
.th-split { gap: clamp(40px, 6vw, 80px); align-items: flex-start; }
.th-split .wp-block-column > * { margin: 0; }
.th-split .wp-block-column > * + * { margin-top: 20px; }

@media (min-width: 782px) {
  .th-split .th-sticky { position: sticky; top: 120px; }
}

ol.th-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: th-step;
  border-bottom: 1px solid var(--th-joon-tume);
}
ol.th-steps > li {
  counter-increment: th-step;
  display: grid;
  grid-template-columns: 72px 1fr;
  column-gap: 20px;
  padding: 28px 0;
  margin: 0;
  border-top: 1px solid var(--th-joon-tume);
  font-size: 16px;
}
ol.th-steps > li::before {
  content: counter(th-step);
  grid-row: span 2;
  font-family: var(--th-serif);
  font-size: 40px;
  line-height: 1;
  color: var(--th-tumelilla);
}
@media (max-width: 689.98px) {
  ol.th-steps > li { grid-template-columns: 44px 1fr; column-gap: 12px; }
}
ol.th-steps > li strong {
  display: block;
  font-size: 19px;
  font-weight: 600;
  color: var(--th-tint);
  margin-bottom: 6px;
}

/* ==========================================================================
   K04 Teenuse detailplokk (plokk teele/teenuste-detailid)
   ========================================================================== */
.th-service {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px clamp(40px, 5vw, 64px);
  padding-top: 40px;
  border-top: 1px solid var(--th-joon-tume);
  scroll-margin-top: 120px;
}
.th-service + .th-service { margin-top: 72px; }
.th-service__intro { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.th-service__title { margin: 0; --theme-font-size: clamp(30px, 2.7vw, 38px); }
.th-service__text { margin: 0; }
.th-service__price { font-weight: 600; color: var(--th-tint); }

.th-dotlist { list-style: none; padding: 0; margin: 0; }
.th-dotlist li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0 16px 32px;
  margin: 0;
  border-bottom: 1px solid var(--th-joon);
}
.th-dotlist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 25px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--th-lilla);
}
.th-dotlist__title { font-weight: 600; font-size: 17px; color: var(--th-tint); }
.th-dotlist__text { font-size: 15px; color: var(--th-hall); }

@media (max-width: 781.98px) {
  .th-service { grid-template-columns: 1fr; }
}

/* ==========================================================================
   K05 Kliendilugu enne / pärast
   ========================================================================== */
.th-case {
  background: var(--th-valge);
  border: 1px solid var(--th-joon);
  border-radius: 20px;
  padding: clamp(20px, 2.5vw, 36px);
  gap: 40px;
  align-items: center;
}
.th-case .wp-block-column > * { margin: 0; }
.th-case .wp-block-column > * + * { margin-top: 14px; }

.th-case__images { gap: 12px; }
.th-case__images .wp-block-image { margin: 0; }
.th-case__images img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
}
.th-case__images figcaption {
  font-family: var(--th-mono);
  font-size: 11px;
  color: #8a8189;
  text-transform: uppercase;
}
.th-case h2 { --theme-font-size: clamp(28px, 2.4vw, 34px); }
.th-case p strong { color: var(--th-tint); }

/* ==========================================================================
   K06 Hinnarida (plokk teele/hinnakiri)
   ========================================================================== */
.th-pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 56px clamp(40px, 5vw, 72px);
}
.th-pricing__title { margin: 0 0 8px; --theme-font-size: 28px; }

.th-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--th-joon-tume);
}
.th-price-row:last-child { border-bottom: 1px solid var(--th-joon-tume); }
.th-price-row__info { display: flex; flex-direction: column; gap: 4px; }
.th-price-row__name { font-weight: 600; font-size: 17px; color: var(--th-tint); }
.th-price-row__text { font-size: 14.5px; color: var(--th-hall); }
.th-price-row__price {
  font-family: var(--th-serif);
  font-size: 26px;
  color: var(--th-tint);
  white-space: nowrap;
}
.th-price-row__price small {
  font-family: var(--th-sans);
  font-size: 13px;
  color: var(--th-hall);
}

/* ==========================================================================
   K07 Tagasiside
   ========================================================================== */
.th-quote {
  max-width: 1000px;
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.th-quote::before {
  content: "\201C";
  font-family: var(--th-serif);
  font-size: 96px;
  line-height: 0.5;
  height: 40px;
  color: var(--th-lilla);
}
.th-quote > * { margin: 0 !important; }
.th-quote__text {
  font-family: var(--th-serif);
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--th-tint);
  text-wrap: balance;
}
.th-quote__author {
  display: grid;
  grid-template-columns: 52px auto;
  column-gap: 14px;
  align-items: center;
  text-align: left;
  font-size: 14px;
  color: var(--th-hall);
}
.th-quote__author::before {
  content: "";
  grid-row: span 2;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--th-lavendel);
}
.th-quote__author strong { display: block; font-size: 16px; color: var(--th-tint); }

/* Kaardina (K07 väike variant) */
.th-quote--card {
  background: var(--th-lillatoon);
  border-radius: var(--th-radius-card);
  padding: 36px;
  text-align: left;
  align-items: flex-start;
  gap: 20px;
}
.th-quote--card::before { font-size: 72px; height: 28px; }
.th-quote--card .th-quote__text { font-size: 24px; line-height: 1.35; }

/* ==========================================================================
   K08 KKK (Details plokk)
   ========================================================================== */
.th-faq { border-top: 1px solid var(--th-joon-tume); }
.th-faq > .wp-block-details { margin: 0; border-bottom: 1px solid var(--th-joon-tume); }
.th-faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  font-weight: 600;
  font-size: 17px;
  color: var(--th-tint);
  margin: 0;
  cursor: pointer;
  list-style: none;
}
.th-faq summary::-webkit-details-marker { display: none; }
.th-faq summary::after {
  content: "+";
  font-family: var(--th-serif);
  font-size: 28px;
  line-height: 1;
  color: var(--th-tumelilla);
}
.th-faq details[open] summary::after { content: "\2212"; }
.th-faq details > :not(summary) { margin: 0 0 20px; max-width: 560px; }

/* ==========================================================================
   K09 Kontakt: kontaktandmed + Fluent Formsi vorm
   ========================================================================== */
.th-contact-list { list-style: none; padding: 0; margin: 0; }
.th-contact-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 0;
  margin: 0;
  border-bottom: 1px solid var(--th-joon);
  font-size: 17px;
  color: var(--th-tint);
}
.th-contact-list li:first-child { border-top: 1px solid var(--th-joon); }
.th-contact-list strong {
  font-family: var(--th-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--th-tumelilla);
}
.th-contact-list a { color: var(--th-tint); text-decoration: none; }
.th-contact-list a:hover { color: var(--th-lilla); }

.th-form-card {
  background: var(--th-valge);
  border: 1px solid var(--th-joon);
  border-radius: 20px;
  padding: clamp(24px, 3vw, 32px);
}

/* K25 vormiväljad (kõik Fluent Formsi vormid). body ees, et võita Fluenti oma stiile. */
body .fluentform .ff-el-group { margin-bottom: 16px; }
body .fluentform .ff-el-input--label label {
  font-size: 14px;
  font-weight: 600;
  color: var(--th-tint);
}
body .fluentform .ff-el-form-control {
  padding: 14px 16px;
  border: 1px solid var(--th-joon-tume);
  border-radius: 10px;
  background: #faf8f5;
  font-family: var(--th-sans);
  font-size: 16px;
  color: var(--th-tint);
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
body .fluentform .ff-el-form-control::placeholder { color: #8a8189; }
body .fluentform .ff-el-form-control:focus {
  border-color: var(--th-tint);
  background: #fff;
  box-shadow: 0 0 0 1px var(--th-tint), 0 0 0 5px var(--th-lillatoon);
  outline: none;
}
body .fluentform .ff-el-is-error .ff-el-form-control {
  border-color: #a3364a;
  background: #fdf6f7;
  box-shadow: 0 0 0 1px #a3364a;
}
body .fluentform .error.text-danger { margin-top: 6px; font-size: 13px; font-weight: 500; color: #a3364a; }
body .fluentform .ff-el-form-control:disabled {
  border-color: var(--th-joon);
  background: var(--th-liiv);
  color: #8a8189;
}

/* Tavalised valikud (nõusolek, raadionupp): lilla linnuke */
body .fluentform .ff-el-form-check-input { accent-color: var(--th-lilla); width: 18px; height: 18px; }
body .fluentform .ff-el-form-check-label { font-weight: 500; color: var(--th-tint); }

/* Teemad: checkbox'id nuppudena, valitud = tume */
body .fluentform .th-chips .ff-el-input--content {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
body .fluentform .th-chips .ff-el-form-check { margin: 0; }
body .fluentform .th-chips .ff-el-form-check-label {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border: 1px solid var(--th-joon-tume);
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
body .fluentform .th-chips .ff-el-form-check-label:hover { border-color: var(--th-tint); }
body .fluentform .th-chips .ff-el-form-check-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
body .fluentform .th-chips .ff-el-form-check-label:has(input:checked) {
  background: var(--th-tint);
  border-color: var(--th-tint);
  color: #fff;
}
body .fluentform .th-chips .ff-el-form-check-label:has(input:focus-visible) {
  outline: 2px solid var(--th-lilla);
  outline-offset: 2px;
}

/* Saatmisnupp. Blocksy joonistab nupu tausta ::before kihiga, seega muutujatega. */
body .fluentform .ff-btn-submit {
  --theme-button-background-initial-color: var(--th-tint);
  --theme-button-background-hover-color: var(--th-lilla);
  --theme-button-text-initial-color: #fff;
  --theme-button-text-hover-color: #fff;
  min-height: 48px;
  padding: 15px 26px;
  border: 0;
  border-radius: 999px;
  font-family: var(--th-sans);
  font-size: 16px;
  font-weight: 600;
  opacity: 1;
}
.th-form-card .fluentform .ff_submit_btn_wrapper { margin-top: 8px; }
.th-form-card .fluentform .ff-btn-submit { width: 100%; min-height: 52px; }

/* Vormi vastused = K27 teated */
body .ff-message-success,
body .fluentform .ff-errors-in-stack {
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: none;
}
body .ff-message-success { border: 1px solid #cfe2d6; background: #eef5f0; color: #1f4a33; }
body .fluentform .ff-errors-in-stack { border: 1px solid #efcdd3; background: #fbeef0; color: #7a2333; }

/* ==========================================================================
   K10 Üleskutse (CTA)
   ========================================================================== */
.th-cta {
  background: var(--th-tint);
  color: var(--th-paber);
  border-radius: 24px;
  padding: clamp(40px, 5vw, 72px) clamp(28px, 4.5vw, 64px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px 40px;
  flex-wrap: wrap;
}
.th-cta > * { margin: 0 !important; }
.th-cta h2 { --theme-heading-color: var(--th-paber); color: var(--th-paber); max-width: 640px; }

.th-cta-small {
  background: var(--th-lillatoon);
  border-radius: 24px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}
.th-cta-small > * { margin: 0 !important; }
.th-cta-small .th-signature { font-size: 64px; line-height: 0.9; }

/* Võrgustike sees ei kehti Blocksy plokkide alumine vahe (muidu read ebaühtlased) */
:is(.th-step-cards, .th-stats, .th-case-steps, .th-logos) > * { margin: 0 !important; }

/* ==========================================================================
   K14 Protsessi sammud kaartidena
   ========================================================================== */
.th-step-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--th-gap);
}
.th-step-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  background: var(--th-valge);
  border: 1px solid var(--th-joon);
  border-radius: var(--th-radius-card);
}
.th-step-card > * { margin: 0 !important; }
.th-step-card p { font-size: 15px; }
.th-step-card__num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--th-lillatoon);
  color: var(--th-tumelilla);
  font-family: var(--th-serif);
  font-size: 24px !important;
  line-height: 1;
}
.th-step-card__title {
  --theme-font-family: var(--th-sans);
  --theme-font-weight: 600;
  --theme-font-size: 18px;
  --theme-line-height: 1.3;
}
.th-step-card--dark { background: var(--th-tint); border-color: var(--th-tint); color: var(--th-jalus-tekst); }
.th-step-card--dark .th-step-card__title { --theme-heading-color: var(--th-paber); color: var(--th-paber); }
.th-step-card--dark .th-step-card__num { background: var(--th-lilla); color: #fff; }

@media (max-width: 999.98px) { .th-step-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 599.98px) { .th-step-cards { grid-template-columns: 1fr; } }

/* ==========================================================================
   K15 Minust plokk
   ========================================================================== */
.th-about {
  background: var(--th-liiv);
  border: 1px solid var(--th-joon);
  border-radius: 24px;
  padding: clamp(28px, 4vw, 56px);
  gap: clamp(32px, 4.5vw, 64px);
}
.th-about .wp-block-column > * { margin: 0; }
.th-about .wp-block-column > * + * { margin-top: 22px; }
.th-about h2 { --theme-font-size: clamp(32px, 3vw, 44px); }
.th-portrait--small { max-width: 340px; padding-bottom: 24px; }
.th-portrait--small img { border-radius: 170px 170px 14px 14px; }
.th-portrait--small .th-signature { font-size: 72px; right: -6px; }

.th-facts {
  list-style: none;
  padding: 22px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  border-top: 1px solid var(--th-joon-tume);
}
.th-facts li { margin: 0; font-size: 13px; line-height: 1.5; color: var(--th-hall); }
/* Väärtus algab uuelt realt, aga jääb ühele reale ka siis, kui redaktor salvestas selle
   mitme paksu tükina (<strong>Veebidisain,</strong> <strong>e-pood</strong>) */
.th-facts strong { font-size: 16px; font-weight: 600; color: var(--th-tint); }
.th-facts strong:first-of-type::before { content: ""; display: block; height: 4px; }

@media (max-width: 599.98px) { .th-facts { grid-template-columns: 1fr 1fr; } }

/* ==========================================================================
   K16 Logoriba
   ========================================================================== */
.th-section.th-section--tight { padding-block: clamp(32px, 4vw, 48px); }
.th-logos {
  display: grid;
  grid-template-columns: 200px repeat(5, 1fr);
  gap: 24px;
  align-items: center;
  padding: 32px 0;
  border-block: 1px solid var(--th-joon-tume);
}
.th-logos__label { font-size: 15px; line-height: 1.4; }
.th-logos .wp-block-image { display: flex; justify-content: center; }
.th-logos img {
  max-height: 40px;
  width: auto;
  filter: grayscale(1);
  opacity: 0.6;
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.th-logos img:hover { filter: none; opacity: 1; }
.th-logos img:not([src]) { display: none; }

@media (max-width: 899.98px) {
  .th-logos { grid-template-columns: repeat(3, 1fr); }
  .th-logos__label { grid-column: 1 / -1; }
}

/* ==========================================================================
   K18 Uudiskiri
   ========================================================================== */
.th-newsletter {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(28px, 3vw, 40px);
  background: var(--th-lillatoon);
  border-radius: 24px;
}
.th-newsletter > * { margin: 0 !important; }
.th-newsletter h2 { --theme-font-size: clamp(28px, 2.5vw, 34px); --theme-line-height: 1.15; }
.th-newsletter > p { font-size: 15.5px; }
.th-newsletter .th-newsletter__note { font-size: 12.5px; color: var(--th-hall); }

/* E-post ja nupp ühes valges „pillis“ */
.th-newsletter .fluentform form {
  padding: 6px;
  background: #fff;
  border: 1px solid var(--th-joon-tume);
  border-radius: 999px;
}
.th-newsletter .fluentform fieldset {
  display: flex;
  align-items: center;
  gap: 8px;
}
.th-newsletter .fluentform form:focus-within { border-color: var(--th-tint); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.7); }
body .th-newsletter .fluentform .ff-el-group { flex: 1; margin: 0; position: relative; }
body .th-newsletter .fluentform .ff-el-form-control,
body .th-newsletter .fluentform .ff-el-form-control:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px 16px;
}
body .th-newsletter .fluentform .error.text-danger { position: absolute; left: 16px; top: calc(100% + 14px); }
body .th-newsletter .fluentform .ff_submit_btn_wrapper { flex: 0 0 auto; width: auto; margin: 0; }
body .th-newsletter .fluentform .ff-btn-submit {
  --theme-button-background-initial-color: var(--th-lilla);
  --theme-button-background-hover-color: var(--th-tint);
  min-height: 44px;
  padding: 12px 22px;
  font-size: 15px;
}

/* ==========================================================================
   K20 Tulemused numbrites
   ========================================================================== */
/* Numbreid võib olla ükskõik mitu (grupp → Tee koopia / Eemalda): kõik ühes reas,
   4+ numbri puhul on number väiksem (kuni ~5 tk mahub hästi). */
.th-stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  border-block: 1px solid var(--th-joon-tume);
}
.th-stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 36px clamp(16px, 2.5vw, 32px);
}
/* Ununenud tühi lõik rea sees ei tee lehel tühja veergu (redaktoris jääb näha) */
.th-stats > p:empty:not([contenteditable]) { display: none; }
/* Pealkiri numbritele („Kolme kuu statistika“): tavaline lõik vahetult numbrite ploki ette */
.th-section > p:has(+ .th-stats) {
  font-family: var(--th-mono);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--th-tumelilla);
}
.th-section > p:has(+ .th-stats) + .th-stats { margin-top: 12px; }
.th-stat:first-child { padding-left: 0; }
.th-stat:last-child { padding-right: 0; }
.th-stat + .th-stat { border-left: 1px solid var(--th-joon-tume); }
.th-stat > * { margin: 0 !important; }
.th-stat p { font-size: 15px; }
.th-stat .th-stat__num {
  font-family: var(--th-serif);
  font-size: clamp(52px, 5vw, 72px);
  line-height: 1;
  white-space: nowrap;
  color: var(--th-tumelilla);
}
.th-stats:has(> :nth-child(4)) .th-stat__num { font-size: clamp(40px, 4vw, 60px); }
.th-stats:has(> :nth-child(5)) .th-stat__num { font-size: clamp(36px, 3.4vw, 50px); }

@media (max-width: 781.98px) {
  .th-stats { grid-auto-flow: row; grid-template-columns: 1fr; }
  .th-stat { padding: 28px 0; }
  .th-stats .th-stat .th-stat__num { font-size: 52px; }
  .th-stat + .th-stat { border-left: 0; border-top: 1px solid var(--th-joon-tume); }
}

/* ==========================================================================
   K21 Blogi postituse kaart (plokk teele/postitused)
   ========================================================================== */
.th-post-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px var(--th-gap);
}
.th-post-card { display: flex; flex-direction: column; gap: 14px; }
.th-post-card > * { margin: 0; }
.th-post-card__img {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid var(--th-joon);
  border-radius: var(--th-radius-img);
  background: var(--th-liiv);
}
.th-post-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.th-post-card:hover .th-post-card__img img { transform: scale(1.03); }
.th-post-card__meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; color: var(--th-hall); }
.th-post-card__title {
  --theme-font-size: clamp(22px, 1.9vw, 26px);
  --theme-line-height: 1.2;
}
.th-post-card__title a { color: var(--th-tint); text-decoration: none; }
.th-post-card__title a:hover { color: var(--th-tumelilla); }
.th-post-card__excerpt { font-size: 15px; }
.th-post-card--text {
  padding: 28px;
  background: var(--th-valge);
  border: 1px solid var(--th-joon);
  border-radius: var(--th-radius-card);
}
.th-post-card--text .th-arrow-link { margin-top: auto; }

@media (max-width: 899.98px) { .th-post-cards { grid-template-columns: 1fr; } }

/* ==========================================================================
   K22 Blogi postituse leht (Blocksy single, kitsas 720 px)
   ========================================================================== */
.single-post .th-post-header {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: clamp(16px, 3vw, 40px);
  margin-bottom: 40px;
}
.single-post .th-post-header > * { margin: 0; }
.th-post-header .th-breadcrumb a { color: var(--th-hall); text-decoration: none; }
.th-post-header .th-breadcrumb a:hover { color: var(--th-tumelilla); }
.th-post-header h1 { --theme-font-size: clamp(38px, 4.2vw, 56px); --theme-line-height: 1.05; }
.th-post-author { display: flex; align-items: center; gap: 12px; }
.th-post-author__img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.th-post-author div { display: flex; flex-direction: column; }
.th-post-author strong { font-size: 15px; color: var(--th-tint); }
.th-post-author span { font-size: 13px; color: var(--th-hall); }

/* Esiletõstetud pilt laiem kui tekst (960 px) */
.th-post-image {
  width: min(960px, var(--theme-container-width, 90vw));
  margin: 0 0 40px 50%;
  transform: translateX(-50%);
}
.th-post-image img { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border-radius: var(--th-radius-card); }

.single-post .entry-content { font-size: 18px; line-height: 1.75; }
.single-post .entry-content > p:first-child { font-size: 21px; line-height: 1.6; color: var(--th-tint); }
.single-post .entry-content h2 { --theme-font-size: clamp(28px, 2.6vw, 34px); --theme-line-height: 1.15; margin-top: 1.4em; }
.single-post .entry-content h3 { --theme-font-size: clamp(22px, 2vw, 26px); margin-top: 1.2em; }
.single-post .entry-content a { color: var(--th-tumelilla); text-decoration: underline; text-underline-offset: 3px; }
.single-post .entry-content ul li::marker { color: var(--th-lilla); }
.single-post .entry-content blockquote,
.single-post .entry-content .wp-block-quote {
  margin: 1.2em 0;
  padding: 8px 0 8px 28px;
  border-left: 2px solid var(--th-lilla);
  font-family: var(--th-serif);
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.35;
  color: var(--th-tint);
}
.single-post .entry-content .wp-block-quote cite { font-family: var(--th-sans); font-size: 14px; color: var(--th-hall); }

.th-post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--th-joon);
}
.th-post-footer__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.th-share { font-size: 14px; font-weight: 600; color: var(--th-tint); }
.th-share a { color: var(--th-tint); }
.th-share a:hover { color: var(--th-tumelilla); }
.th-share__copy {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--th-tint);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Postituse lõpp: uudiskiri (kitsas) + seotud postitused (lai) */
.th-post-after { margin-top: 72px; }
.th-post-after__newsletter { max-width: 720px; margin-inline: auto; }
.th-post-related {
  width: min(1200px, var(--theme-container-width, 90vw));
  margin: 96px 0 0 50%;
  transform: translateX(-50%);
}
.th-post-related h2 { margin: 0 0 32px; }

/* ==========================================================================
   K23 Juhtumiuuringu leht (CPT „Tööd“)
   ========================================================================== */
.th-case-head { gap: 48px; align-items: flex-end; }
.th-case-head .wp-block-column > * { margin: 0; }
.th-case-head .wp-block-column > * + * { margin-top: 16px; }
.th-case-head .th-breadcrumb a { color: var(--th-hall); text-decoration: none; }
.th-case-head h1 { --theme-font-size: clamp(40px, 4.3vw, 60px); }
.th-facts--2 { grid-template-columns: 1fr 1fr; padding-top: 20px; border-color: var(--th-joon); }
.th-facts--2 a { color: var(--th-tumelilla); text-decoration: underline; text-underline-offset: 3px; }

.th-section > .th-case-hero { margin-top: 40px; }
.th-case-hero img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  object-position: top;
  border-radius: var(--th-radius-card);
}

.th-case-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding-block: 16px;
}
.th-case-steps > * > * { margin: 0 !important; }
.th-case-steps .th-eyebrow + p { margin-top: 10px !important; font-size: 16px; }

.th-case-gallery { gap: var(--th-gap); }
.th-case-gallery .wp-block-image { margin: 0; }
/* Vana variant (veerud): iga pilt kolmandik reast nagu galeriis, mitte venitatud */
.wp-block-columns.th-case-gallery { flex-wrap: wrap !important; }
@media (min-width: 782px) {
  .wp-block-columns.th-case-gallery > .wp-block-column { flex: 0 0 calc((100% - 2 * var(--th-gap)) / 3) !important; }
}
.wp-block-columns.th-case-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--th-radius-img); }
.th-case-gallery figcaption { font-family: var(--th-mono); font-size: 12px; color: var(--th-hall); }

@media (max-width: 781.98px) { .th-case-steps { grid-template-columns: 1fr; gap: 24px; } }

/* Eelmine / järgmine töö: liivane riba üle kogu laiuse */
.th-work-nav {
  margin-top: var(--th-section-space);
  background: var(--th-liiv);
  border-top: 1px solid var(--th-joon);
}
.th-work-nav__inner {
  width: var(--theme-container-width, 90vw);
  max-width: 1200px;
  margin-inline: auto;
  padding: 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.th-work-nav a { color: var(--th-tint); font-weight: 600; text-decoration: none; }
.th-work-nav a:hover { color: var(--th-tumelilla); }
.th-work-nav__next { font-family: var(--th-serif); font-weight: 400 !important; font-size: clamp(20px, 2vw, 24px); }

/* ==========================================================================
   K28 404 · K29 tänuleht
   ========================================================================== */
.th-404-wrap {
  width: var(--theme-container-width, 90vw);
  max-width: 1200px;
  margin: clamp(24px, 4vw, 56px) auto var(--th-section-space);
}
.th-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: clamp(48px, 7vw, 96px) 24px;
  text-align: center;
  background: var(--th-liiv);
  border: 1px solid var(--th-joon);
  border-radius: 24px;
}
.th-404 > p { margin: 0; max-width: 380px; font-size: 17px; }
.th-404 .th-404__code {
  max-width: none;
  font-family: var(--th-serif);
  font-size: clamp(100px, 12vw, 140px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--th-tint);
}
.th-404 .th-404__oops {
  margin-top: -28px;
  font-family: var(--th-script);
  font-size: 60px;
  line-height: 0.8;
  color: var(--th-tumelilla);
}
.th-404 .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.th-section > .th-thanks {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(36px, 5vw, 56px) clamp(24px, 4vw, 48px);
  background: var(--th-lillatoon);
  border-radius: 24px;
}
.th-thanks > * { margin: 0 !important; }
.th-thanks h1 { --theme-font-size: clamp(38px, 4vw, 48px); --theme-line-height: 1.05; }
ol.th-steps--small { border-color: #dcc8e6; }
ol.th-steps--small > li {
  grid-template-columns: 40px 1fr;
  padding: 16px 0;
  border-color: #dcc8e6;
  color: var(--th-tint);
}
ol.th-steps--small > li::before { grid-row: auto; font-size: 26px; }

/* ==========================================================================
   Plokkide seaded: kaartide veerud (Tööd, Postitused, Teenuste kaardid)
   ========================================================================== */
:is(.th-cards, .th-works, .th-post-cards).th-cols-1 { grid-template-columns: minmax(0, 1fr); }
:is(.th-cards, .th-works, .th-post-cards).th-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:is(.th-cards, .th-works, .th-post-cards).th-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1099.98px) {
  :is(.th-cards, .th-works, .th-post-cards).th-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899.98px) {
  :is(.th-cards, .th-works, .th-post-cards)[class*="th-cols-"] { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   Grupi stiilid: sektsiooni / kasti taust (grupp → Stiilid)
   ========================================================================== */
.wp-block-group.is-style-liiv { background: var(--th-liiv); }
.wp-block-group.is-style-lilla { background: var(--th-lillatoon); }
.wp-block-group.is-style-kaart { background: var(--th-valge); border: 1px solid var(--th-joon); }
.wp-block-group.is-style-tume {
  --theme-heading-color: var(--th-paber);
  --theme-text-color: var(--th-jalus-tekst);
  --theme-link-initial-color: var(--th-lavendel);
  --theme-link-hover-color: var(--th-paber);
  background: var(--th-tint);
  color: var(--th-jalus-tekst);
}
.wp-block-group.is-style-tume :is(h1, h2, h3, h4, strong) { color: var(--th-paber); }
/* Heledad kaardid tumeda sektsiooni sees jäävad tumeda tekstiga */
.wp-block-group.is-style-tume :is(.th-card, .th-post-card--text, .th-cta-small, .wp-block-group:is(.is-style-kaart, .is-style-liiv, .is-style-lilla)) {
  --theme-heading-color: var(--th-tint);
  --theme-text-color: var(--th-tekst);
  --theme-link-initial-color: var(--th-tint);
  --theme-link-hover-color: var(--th-tumelilla);
  color: var(--th-tekst);
}
.wp-block-group.is-style-tume :is(.th-card, .th-post-card--text, .th-cta-small, .wp-block-group:is(.is-style-kaart, .is-style-liiv, .is-style-lilla)) :is(h1, h2, h3, h4, strong) { color: var(--th-tint); }
.wp-block-group.is-style-liiv.alignfull { border-block: 1px solid var(--th-joon); }
.wp-block-group:is(.is-style-liiv, .is-style-lilla, .is-style-tume).alignfull:not(.th-section) { padding-block: var(--th-section-space); }
.wp-block-group:is(.is-style-liiv, .is-style-lilla, .is-style-tume, .is-style-kaart):not(.alignfull) {
  padding: clamp(28px, 4vw, 48px);
  border-radius: 24px;
}
.wp-block-group:is(.is-style-liiv, .is-style-lilla, .is-style-tume, .is-style-kaart):not(.alignfull) > :first-child { margin-top: 0; }
.wp-block-group:is(.is-style-liiv, .is-style-lilla, .is-style-tume, .is-style-kaart):not(.alignfull) > :last-child { margin-bottom: 0; }

/* Pilt → Stiilid → Raamiga */
.wp-block-image.is-style-raam img { border: 1px solid var(--th-joon); border-radius: var(--th-radius-img); }

/* ==========================================================================
   Pilt täissuuruses (inc/media.php + assets/site.js)
   ========================================================================== */
img[data-th-zoom] { cursor: zoom-in; }
img[data-th-zoom]:focus-visible { outline: 2px solid var(--th-tint); outline-offset: 3px; }
figure.th-zoomable { position: relative; }
figure.th-zoomable::after {
  content: "⤢";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(247, 244, 239, 0.92);
  color: var(--th-tint);
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
figure.th-zoomable:hover::after { opacity: 1; }
.th-logos figure.th-zoomable::after { display: none; }

html.th-lb-open { overflow: hidden; }
.th-lb {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  flex-direction: column;
  background: var(--th-paber);
  color: var(--th-tint);
}
.th-lb.is-open { display: flex; }
.th-lb__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--th-joon);
  font-size: 14px;
}
.th-lb__count { margin-right: auto; font-family: var(--th-mono); font-size: 12px; color: var(--th-hall); }
.th-lb__bar :is(button, a) {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--th-joon);
  border-radius: 999px;
  background: var(--th-valge);
  color: var(--th-tint);
  font: 600 13px/1 var(--th-sans);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
}
.th-lb__bar :is(button, a):hover { border-color: var(--th-tint); }
.th-lb__close { width: 38px; justify-content: center; padding: 0 !important; font-size: 15px !important; }
.th-lb__view {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px clamp(16px, 5vw, 72px);
}
.th-lb__figure { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.th-lb .th-lb__img { display: block; max-width: none; height: auto; border-radius: 8px; box-shadow: 0 8px 40px rgba(35, 30, 36, 0.12); }
.th-lb[data-mode="loading"] .th-lb__img { opacity: 0; }
/* Mahuta ekraanile */
.th-lb[data-mode="fit"] .th-lb__img {
  max-width: calc(100vw - 2 * clamp(16px, 5vw, 72px));
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  width: auto;
}
/* Kõrge ekraanitõmmis: ekraani laiuselt, kerib alla */
.th-lb[data-mode="width"] .th-lb__img { max-width: min(100%, 1400px); }
.th-lb[data-mode="width"] .th-lb__figure { width: 100%; }
/* 100% = päris pikslisuurus */
.th-lb[data-mode="full"] .th-lb__view { padding: 0; }
.th-lb[data-mode="full"] .th-lb__img { border-radius: 0; box-shadow: none; }
.th-lb[data-mode="full"] .th-lb__figure { align-items: flex-start; }
.th-lb__caption { font-family: var(--th-mono); font-size: 12px; color: var(--th-hall); text-align: center; }
.th-lb[data-mode="full"] .th-lb__caption { display: none; }
.th-lb__nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  margin-top: 8px;
  border: 1px solid var(--th-joon);
  border-radius: 999px;
  background: var(--th-valge);
  color: var(--th-tint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(35, 30, 36, 0.08);
}
.th-lb__nav:hover { border-color: var(--th-tint); }
.th-lb__nav--prev { left: 16px; }
.th-lb__nav--next { right: 16px; }
.th-lb--single .th-lb__nav,
.th-lb[data-mode="full"] .th-lb__nav { display: none; }
.th-lb :is(button, a):focus-visible { outline: 2px solid var(--th-tint); outline-offset: 2px; }
.th-zoom-nofile .th-lb__orig { display: none !important; }
@media (max-width: 689.98px) {
  .th-lb__nav { top: auto; bottom: 16px; margin: 0; }
  .th-lb[data-mode="fit"] .th-lb__img { max-height: calc(100dvh - 200px); }
  .th-lb__orig { display: none !important; }
}

/* Töö lehe galerii (core/gallery): allkiri pildi all, mitte peal. Kehtib igale galeriile
   töö lehel (ka redaktoris + → Galerii lisatud), mujal klassiga th-case-gallery.
   Veerud: galerii → Veerud. „Kärbi pildid“ sees = kõik 4:3, väljas = pilt tervikuna. */
.wp-block-gallery.th-case-gallery { gap: var(--th-gap); margin: 0; }
.wp-block-gallery.has-nested-images:is(.th-case-gallery, .single-too *) figure.wp-block-image { flex-direction: column; flex-grow: 0; }
/* Kõige rohkem 4 pilti reas (ka siis, kui galerii seadetes on rohkem veerge) */
@media (min-width: 600px) {
  .wp-block-gallery.has-nested-images:is(.columns-5, .columns-6, .columns-7, .columns-8) figure.wp-block-image:not(#individual-image) {
    width: calc(25% - var(--wp--style--unstable-gallery-gap, 16px) * 0.75);
  }
}
.wp-block-gallery.has-nested-images:is(.th-case-gallery, .single-too *) figure.wp-block-image::before { display: none; }
.wp-block-gallery.has-nested-images:is(.th-case-gallery, .single-too *) figure.wp-block-image img {
  flex: none !important;
  width: 100% !important;
  height: auto !important;
  border-radius: var(--th-radius-img);
}
.wp-block-gallery.has-nested-images.is-cropped:is(.th-case-gallery, .single-too *) figure.wp-block-image img { aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.wp-block-gallery.has-nested-images:is(.th-case-gallery, .single-too *):not(.is-cropped) { align-items: flex-start; }
.wp-block-gallery.has-nested-images:is(.th-case-gallery, .single-too *):not(.is-cropped) figure.wp-block-image { align-self: flex-start; }
.wp-block-gallery.has-nested-images:is(.th-case-gallery, .single-too *) figure.wp-block-image figcaption {
  position: static;
  padding: 10px 0 0;
  background: none;
  font-family: var(--th-mono);
  font-size: 12px;
  color: var(--th-hall);
  text-align: left;
  text-shadow: none;
  overflow: visible;
  max-height: none;
}

/* Postituse esiletõstetud pilt (pildiplokk, avaneb täissuuruses) */
.th-post-image .wp-block-image { margin: 0; }

/* ==========================================================================
   Redaktor: vihje, kui dünaamilisel plokil pole sisu
   ========================================================================== */
.th-empty {
  padding: 24px;
  border: 1px dashed var(--th-joon-tume);
  border-radius: 12px;
  font-family: var(--th-mono);
  font-size: 13px;
  color: var(--th-hall);
  text-align: center;
}
