/*
Theme Name: Meeleolu
Theme URI: https://meeleolu.ee
Author: Taffsellence OÜ
Author URI: https://taffsellence.com
Description: Katrin Roose psühholoogilise nõustamise kodulehe teema. Rahulik, soe ja professionaalne. Sisu muudetakse tavalise plokiredaktoriga.
Version: 1.0.6
Requires at least: 6.4
Requires PHP: 8.0
License: Proprietary
Text Domain: meeleolu
*/

/* Paigutus: rahulik, kergelt asümmeetriline (tekst + päris portree), vahelduvad hele ja salveiroheline taust,
   üks selge tegevus (Broneeri aeg) on alati käeulatuses. Mobiil eelkõige. */

:root {
  --bg: #FBF8F4;
  --bg-green: #E6ECE5;
  --surface: #FFFFFF;
  --ink: #2B2622;
  --muted: #5C554E;
  --line: #E2D8CB;
  --field: #A99C8C;
  --green: #3E5B4B;
  --green-dark: #2C4337;
  --clay: #C7835F;
  --clay-text: #93512F;
  --peach: #EFD8C6;
  --focus: #C7835F;
  --footer-bg: #2C4337;
  --footer-ink: #EEF1EC;
  --footer-muted: #BFCBC2;

  --font-display: "Libre Caslon Display", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;

  --step--1: 0.9375rem;
  --step-0: 1.0625rem;
  --step-1: 1.1875rem;
  --step-2: clamp(1.35rem, 1.2rem + 0.6vw, 1.6rem);
  --step-3: clamp(1.7rem, 1.4rem + 1.2vw, 2.25rem);
  --step-4: clamp(1.85rem, 1.45rem + 1.5vw, 2.55rem);

  --gutter: clamp(20px, 5vw, 48px);
  --shell: 1160px;
  --read: 720px;
  --radius: 8px;
  --radius-small: 6px;
  --header-h: 68px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 76px;
}
@media (min-width: 720px) { body { padding-bottom: 0; } }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
  color: var(--ink);
}
h1 { font-size: var(--step-4); line-height: 1.12; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-family: var(--font-body); font-weight: 700; font-size: var(--step-1); }

p { margin: 0; }
a { color: var(--green); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--green-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
strong { font-weight: 700; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-small); z-index: 100; }
.skip-link:focus { top: 12px; color: #fff; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Nupud (päis, jalus, plokid) ---------- */

.btn,
.wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 22px;
  border-radius: var(--radius-small);
  border: 1.5px solid transparent;
  background: var(--green); color: #fff;
  font: 600 var(--step-0)/1.2 var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover, .wp-block-button__link:hover { background: var(--green-dark); color: #fff; text-decoration: none; }

.btn-quiet,
.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.mk-quiet .wp-block-button__link {
  background: transparent; color: var(--ink); border-color: #8F8378;
}
.btn-quiet:hover,
.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.mk-quiet .wp-block-button__link:hover { background: rgba(43,38,34,.04); border-color: var(--ink); color: var(--ink); }

.wp-block-button.mk-small .wp-block-button__link { min-height: 44px; padding: 0 18px; background: transparent; color: var(--green); border-color: var(--green); }
.wp-block-button.mk-small .wp-block-button__link:hover { background: var(--green); color: #fff; }

.btn-small { min-height: 42px; padding: 0 16px; font-size: var(--step--1); }

.entry-content .wp-block-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.wp-block-button { margin: 0; }

/* tekstilink nupuplokina */
.wp-block-button.mk-link .wp-block-button__link {
  min-height: 44px; padding: 0; background: none; border: 0; color: var(--green);
  font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.wp-block-button.mk-link .wp-block-button__link:hover { background: none; color: var(--green-dark); text-decoration-thickness: 2px; }

/* ---------- Päis ---------- */

.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(251, 248, 244, 0.97);
  border-bottom: 1px solid var(--line);
}
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 0; } }

.header-inner { min-height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.15; }
.brand:hover { color: var(--ink); }
.brand-name { font-family: var(--font-display); font-size: 1.35rem; }
.brand-role { font-size: 0.875rem; color: var(--muted); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions .btn { display: none; }

.menu-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px 0 8px;
  background: none; border: 0; color: var(--ink); font: 600 var(--step--1) var(--font-body); cursor: pointer;
}
.menu-toggle-bars, .menu-toggle-bars::before { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 1px; position: relative; transition: transform .2s ease; }
.menu-toggle-bars { margin-bottom: 6px; }
.menu-toggle-bars::before { content: ""; position: absolute; top: 6px; left: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars { transform: translateY(3px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(-6px) rotate(-90deg); }

.main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px -16px rgba(43,38,34,.25); }
.main-nav.is-open { display: block; }
.main-nav ul { list-style: none; margin: 0; padding: 8px var(--gutter) 20px; display: flex; flex-direction: column; }
.main-nav li { position: relative; }
.main-nav a { display: flex; align-items: center; min-height: 52px; font-size: var(--step-1); font-weight: 500; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_item > a { color: var(--green); }
.main-nav .sub-menu { padding: 0 0 0 16px; }
.main-nav .sub-menu a { font-size: var(--step-0); min-height: 46px; }

@media (min-width: 640px) { .header-actions .btn { display: inline-flex; } }

@media (min-width: 980px) {
  :root { --header-h: 80px; }
  .header-inner { display: grid; grid-template-columns: 1fr auto 1fr; }
  .header-actions { justify-self: end; }
  .menu-toggle { display: none; }
  .main-nav { display: block; position: static; background: none; border: 0; box-shadow: none; }
  .main-nav > ul { flex-direction: row; justify-content: center; gap: 36px; padding: 0; }
  .main-nav a { min-height: 44px; font-size: var(--step-0); border: 0; }
  .main-nav .sub-menu {
    display: none; position: absolute; top: 100%; left: -18px; min-width: 270px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 16px 32px -18px rgba(43,38,34,.3); padding: 8px 0; flex-direction: column;
  }
  .main-nav .sub-menu a { padding: 0 18px; min-height: 42px; font-size: var(--step--1); }
  .main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: flex; }
}

/* ---------- Üldine sisu (plokid) ---------- */

.entry-content > * + * { margin-top: 0; }
.mk-section { padding-block: 56px; }
.mk-section.mk-green { background: var(--bg-green); }
@media (min-width: 900px) { .mk-section { padding-block: 96px; } }
.mk-wrap { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }

.entry-content .wp-block-columns { display: grid; gap: 32px; margin: 0; }
.wp-block-column { min-width: 0; }
@media (min-width: 900px) {
  .entry-content .wp-block-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; }
  .entry-content .wp-block-columns.mk-57 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .entry-content .wp-block-columns.mk-75 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; }
  .entry-content .wp-block-columns.mk-56 { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; }
}

.wp-block-column > * + *,
.mk-stack > * + * { margin-top: 18px; }

.wp-block-image { margin: 0; }
.wp-block-image img { width: 100%; border-radius: var(--radius); background: var(--peach); object-fit: cover; }
.mk-photo-portrait img { aspect-ratio: 4 / 3.4; object-position: 50% 30%; }
.mk-photo-about img { aspect-ratio: 3 / 2; }
@media (min-width: 900px) {
  .mk-photo-portrait img { aspect-ratio: 4 / 5; }
  .mk-photo-about img { aspect-ratio: 4 / 5; }
}

.mk-lead { font-size: var(--step-1); color: var(--muted); max-width: 36em; }
.mk-muted { color: var(--muted); }
.mk-note { color: var(--muted); font-size: var(--step--1); max-width: 34em; }
.mk-kicker { font-size: var(--step-1); color: var(--muted); }

/* teemade loend kahes veerus */
ul.mk-topics { list-style: none; margin: 0; padding: 0; }
ul.mk-topics li { position: relative; padding-left: 22px; line-height: 1.45; margin-bottom: 12px; break-inside: avoid; }
ul.mk-topics li::before { content: "–"; position: absolute; left: 0; color: var(--clay-text); }
@media (min-width: 600px) { ul.mk-topics { column-count: 2; column-gap: 40px; } }

/* ---------- Avaleht ---------- */

.mk-hero { padding-block: 24px 56px; }
@media (min-width: 900px) {
  .mk-hero { padding-block: 64px 96px; }
  .entry-content .mk-hero .wp-block-columns { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: 64px; }
  .mk-hero .wp-block-column:first-child { order: 0; }
}
@media (max-width: 899px) { .mk-hero .mk-hero-photo { order: -1; } }
.mk-hero h1 { letter-spacing: -0.005em; }

.mk-section-head { max-width: 36em; margin-bottom: 32px; }
.mk-section-head > * + * { margin-top: 12px; }
.mk-section-head p { color: var(--muted); }

.mk-services { display: grid; gap: 16px; }
@media (min-width: 640px) { .mk-services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .mk-services { gap: 20px; } }
.mk-service {
  display: flex; flex-direction: column; gap: 14px;
  padding: 26px 24px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); min-width: 0;
}
@media (min-width: 900px) { .mk-service { padding: 32px 32px 28px; } }
.mk-service h3 { font-size: 1.4rem; }
.mk-service h3 a { color: var(--ink); text-decoration: none; }
.mk-service h3 a:hover { color: var(--green); }
.mk-service > p { color: var(--muted); max-width: 36em; }
.mk-service .mk-meta { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink); font-variant-numeric: tabular-nums; }
.mk-service .mk-meta strong { font-size: var(--step-1); }
.mk-service .wp-block-buttons { padding-top: 4px; }

.mk-cv { list-style: none; margin: 0; padding: 0; }
.mk-cv li { padding: 8px 0; font-size: var(--step--1); line-height: 1.45; }
.mk-cv li strong { display: inline-block; min-width: 58px; color: var(--clay-text); font-variant-numeric: tabular-nums; }

/* broneerimise plokk */
.mk-booking .wp-block-columns { align-items: start; }
.mk-contact-lines { font-size: var(--step-1); font-weight: 600; }
.mk-contact-lines a { color: var(--ink); text-decoration: none; }
.mk-contact-lines a:hover { color: var(--green); text-decoration: underline; }

.wp-block-table { margin: 0; overflow-x: auto; }
.wp-block-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.wp-block-table td, .wp-block-table th { padding: 10px 0; border: 0; border-bottom: 1px solid #DDD0C0; text-align: left; vertical-align: baseline; }
.wp-block-table td + td { padding-left: 12px; white-space: nowrap; color: var(--muted); }
.wp-block-table td:last-child { text-align: right; color: var(--ink); font-weight: 700; }

/* ---------- Alamlehed ---------- */

.page-hero { padding-block: 48px 8px; }
@media (min-width: 900px) { .page-hero { padding-block: 72px 16px; } }
.page-hero .shell > * { max-width: var(--read); }
.page-hero .crumbs { font-size: var(--step--1); color: var(--muted); margin-bottom: 14px; }
.page-hero .crumbs a { color: var(--muted); }

.page-body { padding-block: 24px 64px; }
.page-body .entry-content { max-width: var(--read); }
.page-body .entry-content > * + * { margin-top: 20px; }
.page-body .entry-content h2 { margin-top: 44px; }
.page-body .entry-content h3 { margin-top: 32px; }
.page-body .entry-content ul:not(.mk-topics):not(.mk-cv) { padding-left: 1.2em; }
.page-body .entry-content li + li { margin-top: 6px; }
.page-body .entry-content .wp-block-image { margin-block: 28px; }
.page-body .entry-content .mk-wide { max-width: none; }

.mk-price-box {
  display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: baseline;
  padding: 20px 22px; background: var(--bg-green); border-radius: var(--radius);
}
.mk-price-box p { margin: 0 !important; }

/* KKK */
.wp-block-details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.wp-block-details summary { cursor: pointer; padding: 16px 28px 16px 0; font-weight: 600; font-size: var(--step-1); list-style: none; position: relative; }
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.5rem; color: var(--clay-text); font-weight: 400; }
.wp-block-details[open] summary::after { content: "–"; }
.wp-block-details > *:not(summary) { margin: 0 0 18px; color: var(--muted); }

/* lehe lõpu kontaktiriba (mallist) */
.page-cta { background: var(--bg-green); padding-block: 48px; }
.page-cta .shell { display: grid; gap: 20px; }
@media (min-width: 900px) { .page-cta .shell { grid-template-columns: minmax(0,1fr) auto; align-items: center; } .page-cta { padding-block: 64px; } }
.page-cta h2 { font-size: var(--step-3); }
.page-cta p { color: var(--muted); margin-top: 8px; }
.page-cta .cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Vorm (Contact Form 7) ---------- */

.wpcf7 form { display: flex; flex-direction: column; gap: 18px; }
.wpcf7 form > p { margin: 0; }
.wpcf7 label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: var(--step--1); }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 input[type="date"], .wpcf7 select, .wpcf7 textarea {
  width: 100%; min-height: 50px; padding: 10px 14px;
  border: 1px solid var(--field); border-radius: var(--radius-small);
  background: var(--surface); color: var(--ink); font: 400 var(--step-0) var(--font-body);
}
.wpcf7 textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.wpcf7 input:focus-visible, .wpcf7 select:focus-visible, .wpcf7 textarea:focus-visible { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(62,91,75,.25); }
.wpcf7 .wpcf7-list-item { display: flex; margin: 0; }
.wpcf7 .wpcf7-radio { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.wpcf7 .wpcf7-radio label, .wpcf7 .wpcf7-acceptance label { flex-direction: row; align-items: center; gap: 12px; font-weight: 500; font-size: var(--step-0); }
.wpcf7 .wpcf7-radio label { min-height: 50px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); cursor: pointer; width: 100%; }
.wpcf7 .wpcf7-radio label:has(input:checked) { border-color: var(--green); background: var(--bg-green); }
.wpcf7 input[type="radio"], .wpcf7 input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--green); flex-shrink: 0; }
.wpcf7 .wpcf7-acceptance label { font-size: var(--step--1); color: var(--muted); }
.wpcf7 input[type="submit"] {
  min-height: 52px; border: 0; border-radius: var(--radius-small); background: var(--green); color: #fff;
  font: 600 var(--step-0) var(--font-body); cursor: pointer; width: 100%;
}
.wpcf7 input[type="submit"]:hover { background: var(--green-dark); }
.wpcf7 .wpcf7-not-valid-tip { color: #A3402B; font-size: .9rem; font-weight: 600; margin-top: 4px; }
.wpcf7 form .wpcf7-response-output { margin: 0; padding: 14px 16px; border-radius: var(--radius-small); border: 1px solid var(--line); font-size: var(--step--1); }
.wpcf7 form.sent .wpcf7-response-output { border-color: var(--green); background: var(--bg-green); }
.wpcf7-spinner { margin: 8px auto 0; display: block; }
.mk-form-row { display: grid; gap: 18px; }
@media (min-width: 560px) { .mk-form-row { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ---------- Jalus ---------- */

.site-footer { background: var(--footer-bg); color: var(--footer-ink); padding-block: 48px; }
.site-footer a { color: var(--footer-ink); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.site-footer :focus-visible { outline-color: #F0C6A8; }
.footer-inner { display: grid; gap: 28px; }
.footer-brand { display: flex; flex-direction: column; gap: 4px; color: var(--footer-muted); }
.footer-name { font-family: var(--font-display); font-size: 1.5rem; color: var(--footer-ink); }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.footer-links a { display: inline-flex; min-height: 40px; align-items: center; }
.footer-contact { display: flex; flex-direction: column; gap: 6px; }
.footer-contact a { font-weight: 600; }
.footer-copy { color: var(--footer-muted); font-size: 0.9rem; margin-top: 10px; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr); gap: 40px; } .site-footer { padding-block: 64px; } }

/* ---------- Mobiili kontaktiriba ---------- */

.mobile-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(251,248,244,.98); border-top: 1px solid var(--line);
  transition: transform .2s ease;
}
.mobile-cta .btn { min-height: 48px; padding: 0 12px; }
.mobile-cta.is-hidden { transform: translateY(110%); }
@media (min-width: 720px) { .mobile-cta { display: none; } }

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

.page-body .entry-content:has(.mk-wide) { max-width: none; }

.wpcf7 .mk-radio-group { display: flex; flex-direction: column; gap: 6px; }
.wpcf7 .mk-label { font-weight: 600; font-size: var(--step--1); }
.wpcf7 .wpcf7-form-control-wrap { display: block; }
.wpcf7 .mk-note { text-align: center; }

.page-body .mk-photo-about img { aspect-ratio: 3 / 2; object-position: 50% 30%; }
