/*
Theme Name: Maardu Lilled
Theme URI: https://maardulilled.ee/
Author: Maardu Lilled
Description: Kerge, mobiilikeskne ja ligipääsetav WordPressi teema Maardu Lilledele.
Version: 1.1.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: maardu-lilled
*/

:root {
  --ml-cream: #f7f2e9;
  --ml-cream-strong: #efe5d8;
  --ml-paper: #fffdf8;
  --ml-green: #173f32;
  --ml-green-2: #285c49;
  --ml-rose: #c9867a;
  --ml-terracotta: #a95f4a;
  --ml-ink: #1d2a25;
  --ml-muted: #66726c;
  --ml-line: rgba(23, 63, 50, 0.16);
  --ml-shadow: 0 18px 50px rgba(23, 63, 50, 0.09);
  --ml-radius: 1.25rem;
  --ml-radius-sm: 0.75rem;
  --ml-max: 1180px;
  --ml-serif: Georgia, "Times New Roman", serif;
  --ml-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ml-cream);
  color: var(--ml-ink);
  font-family: var(--ml-sans);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

body.admin-bar .ml-site-header { top: 32px; }

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

a { color: var(--ml-green); text-underline-offset: 0.18em; }
a:hover { color: var(--ml-terracotta); }

h1, h2, h3, h4 {
  margin: 0 0 0.55em;
  color: var(--ml-green);
  font-family: var(--ml-serif);
  font-weight: 500;
  line-height: 1.12;
  text-wrap: balance;
}

h1 { font-size: clamp(2.65rem, 7vw, 5.8rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(2rem, 4vw, 3.55rem); letter-spacing: -0.025em; }
h3 { font-size: clamp(1.35rem, 2vw, 1.75rem); }
p { margin: 0 0 1.25rem; }

:focus-visible {
  outline: 3px solid #dd8f7f;
  outline-offset: 4px;
}

.screen-reader-text,
.ml-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ml-skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 99999;
  padding: 0.8rem 1rem;
  background: var(--ml-green);
  color: #fff;
  border-radius: 0.5rem;
  transform: translateY(-180%);
}

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

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

.ml-eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--ml-terracotta);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.ml-button,
.wp-block-button__link,
button[type="submit"] {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.82rem 1.25rem;
  border: 2px solid var(--ml-green);
  border-radius: 999px;
  background: var(--ml-green);
  color: #fff;
  font: 750 0.96rem/1 var(--ml-sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.ml-button:hover,
.wp-block-button__link:hover,
button[type="submit"]:hover {
  background: var(--ml-green-2);
  color: #fff;
  transform: translateY(-2px);
}

.ml-button--light {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ml-green);
}

.ml-button--light:hover { background: #fff; color: var(--ml-green); }

.ml-button--outline,
.is-style-outline > .wp-block-button__link {
  background: transparent;
  color: var(--ml-green);
}

.ml-button--outline:hover,
.is-style-outline > .wp-block-button__link:hover { background: var(--ml-green); color: #fff; }

/* Header */
.ml-site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  border-bottom: 1px solid var(--ml-line);
  background: rgba(247, 242, 233, 0.96);
  backdrop-filter: blur(12px);
}

.ml-header-inner {
  display: grid;
  min-height: 82px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.3rem;
}

.ml-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  color: var(--ml-green);
  font-family: var(--ml-serif);
  font-size: 1.42rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.ml-brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: var(--ml-rose);
  color: #fff;
  font-family: var(--ml-sans);
  font-size: 1.05rem;
}

.ml-primary-nav { justify-self: center; }
.ml-primary-nav ul { display: flex; align-items: center; gap: clamp(0.8rem, 2vw, 1.45rem); margin: 0; padding: 0; list-style: none; }
.ml-primary-nav a { color: var(--ml-ink); font-size: 0.92rem; font-weight: 680; text-decoration: none; }
.ml-primary-nav a:hover,
.ml-primary-nav .current-menu-item > a { color: var(--ml-terracotta); }

.ml-header-actions { display: flex; align-items: center; gap: 0.65rem; }
.ml-phone { color: var(--ml-green); font-size: 0.9rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.ml-menu-toggle { display: none; }

/* Hero */
.ml-hero {
  position: relative;
  min-height: clamp(600px, 78vh, 840px);
  overflow: hidden;
  background: var(--ml-green);
}

.ml-hero-media,
.ml-hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ml-hero-media img { object-fit: cover; object-position: center; }
.ml-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18, 48, 38, 0.9) 0%, rgba(18, 48, 38, 0.68) 40%, rgba(18, 48, 38, 0.05) 76%); }

.ml-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: inherit;
  align-items: center;
  padding-block: 5.5rem;
}

.ml-hero-copy { width: min(660px, 100%); color: #fff; }
.ml-hero-copy h1 { color: #fff; }
.ml-hero-copy p { max-width: 590px; font-size: clamp(1.05rem, 2vw, 1.3rem); }
.ml-hero .ml-eyebrow { color: #f1b6a9; }
.ml-hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }
.ml-hero-note { margin-top: 1.35rem; font-size: 0.86rem !important; opacity: 0.82; }

/* Sections and blocks */
.ml-main { overflow: clip; }
.ml-page-content > * { max-width: var(--ml-max); margin-inline: auto; }
.ml-page-content > .alignwide { width: min(calc(100% - 2rem), var(--ml-max)); max-width: none; }
.ml-section { padding-block: clamp(4.6rem, 9vw, 8rem); }
.ml-section--paper { background: var(--ml-paper); }
.ml-section--green { background: var(--ml-green); color: #f9f3e8; }
.ml-section--green h2,
.ml-section--green h3 { color: #fff; }
.ml-section-header { max-width: 720px; margin: 0 auto 2.5rem; text-align: center; }
.ml-section-header p { color: var(--ml-muted); }
.ml-section--green .ml-section-header p { color: rgba(255,255,255,0.75); }

.ml-grid { display: grid; gap: 1.2rem; }
.ml-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ml-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.ml-category-card,
.ml-product-card,
.ml-reason-card,
.ml-step-card,
.ml-info-card {
  border: 1px solid var(--ml-line);
  border-radius: var(--ml-radius);
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 10px 35px rgba(23, 63, 50, 0.04);
}

.ml-category-card {
  position: relative;
  min-height: 235px;
  overflow: hidden;
  padding: 1.55rem;
  color: #fff;
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.ml-category-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(23,63,50,.92), rgba(40,92,73,.58)); }
.ml-category-card:nth-child(2n)::before { background: linear-gradient(145deg, rgba(105,53,49,.9), rgba(180,116,98,.6)); }
.ml-category-card:nth-child(3n)::before { background: linear-gradient(145deg, rgba(23,63,50,.82), rgba(201,134,122,.64)); }
.ml-category-card > * { position: relative; z-index: 1; }
.ml-category-card h3 { margin-top: 5.8rem; color: #fff; }
.ml-category-card p { margin: 0; color: rgba(255,255,255,.82); font-size: .94rem; }
.ml-category-card:hover { color: #fff; transform: translateY(-5px); box-shadow: var(--ml-shadow); }
.ml-category-icon { font-size: 1.7rem; }

.ml-product-media { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: var(--ml-radius) var(--ml-radius) 0 0; background: var(--ml-cream-strong); }
.ml-product-media img { width: 100%; height: 100%; object-fit: cover; }
.ml-product-media img.ml-product-fallback { width: 300%; max-width: none; }
.ml-product-card:nth-child(1) .ml-product-media img.ml-product-fallback { transform: translateX(0); }
.ml-product-card:nth-child(2) .ml-product-media img.ml-product-fallback { transform: translateX(-33.333%); }
.ml-product-card:nth-child(3) .ml-product-media img.ml-product-fallback { transform: translateX(-66.666%); }
.ml-product-copy { padding: 1.35rem; }
.ml-sample-label { display: inline-block; margin-bottom: .7rem; padding: .28rem .55rem; border-radius: 999px; background: #f1dfd9; color: #7e4638; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

.ml-reason-card,
.ml-step-card,
.ml-info-card { padding: 1.45rem; }
.ml-number { display: grid; width: 2.65rem; height: 2.65rem; margin-bottom: 1rem; place-items: center; border-radius: 50%; background: var(--ml-rose); color: #fff; font-family: var(--ml-serif); font-size: 1.25rem; }

.ml-split { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(2rem, 6vw, 5rem); }
.ml-split-media { position: relative; }
.ml-split-media img { width: 100%; min-height: 430px; object-fit: cover; border-radius: var(--ml-radius); box-shadow: var(--ml-shadow); }
.ml-image-note { margin-top: .7rem; color: var(--ml-muted); font-size: .76rem; font-style: italic; }

.ml-quote {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 3rem);
  border-left: 5px solid var(--ml-rose);
  border-radius: 0 var(--ml-radius) var(--ml-radius) 0;
  background: var(--ml-paper);
  color: var(--ml-green);
  font-family: var(--ml-serif);
  font-size: clamp(1.35rem, 3vw, 2.15rem);
}
.ml-quote small { display: block; margin-top: 1rem; color: var(--ml-muted); font: 700 .78rem/1.4 var(--ml-sans); letter-spacing: .08em; text-transform: uppercase; }

.ml-contact-band { padding-block: clamp(3.5rem, 8vw, 6rem); background: #e8d8cc; }
.ml-contact-band .ml-grid { align-items: stretch; }
.ml-map-card { display: flex; min-height: 100%; flex-direction: column; justify-content: center; padding: clamp(1.6rem, 4vw, 2.8rem); border-radius: var(--ml-radius); background: var(--ml-green); color: #fff; }
.ml-map-card h2, .ml-map-card h3 { color: #fff; }
.ml-map-card a { color: #fff; }

/* Inner pages */
.ml-page-hero { padding-block: clamp(5rem, 10vw, 8rem); background: var(--ml-green); color: #fff; text-align: center; }
.ml-page-hero h1 { color: #fff; font-size: clamp(2.8rem, 6vw, 5rem); }
.ml-page-hero p { max-width: 700px; margin-inline: auto; color: rgba(255,255,255,.78); }
.ml-page-body { width: min(calc(100% - 2rem), 900px); margin-inline: auto; padding-block: clamp(3.8rem, 8vw, 7rem); }
.ml-page-body > :first-child { margin-top: 0; }
.ml-page-body h2 {
  margin-top: 1.7em;
  font-size: clamp(1.65rem, 2.3vw, 2.2rem);
}
.ml-step-card h2,
.ml-step-card h3 {
  font-size: clamp(1.45rem, 1.8vw, 1.9rem);
  line-height: 1.14;
}
.ml-page-body h3 { margin-top: 1.45em; }
.ml-page-body ul { padding-left: 1.2rem; }
.ml-page-body li { margin-bottom: .5rem; }
.ml-callout { margin-block: 2rem; padding: 1.5rem; border-left: 5px solid var(--ml-rose); border-radius: 0 var(--ml-radius-sm) var(--ml-radius-sm) 0; background: var(--ml-paper); }
.ml-service-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; margin-block: 2rem; }

/* Forms */
.ml-form-wrap { margin-block: 2rem; padding: clamp(1.35rem, 4vw, 2.4rem); border: 1px solid var(--ml-line); border-radius: var(--ml-radius); background: var(--ml-paper); box-shadow: var(--ml-shadow); }
.ml-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ml-field { display: flex; flex-direction: column; gap: .42rem; }
.ml-field--full { grid-column: 1 / -1; }
.ml-field label { color: var(--ml-green); font-size: .9rem; font-weight: 750; }
.ml-field input,
.ml-field select,
.ml-field textarea {
  width: 100%;
  min-height: 50px;
  padding: .78rem .9rem;
  border: 1.5px solid #a6b1ab;
  border-radius: .65rem;
  background: #fff;
  color: var(--ml-ink);
  font: inherit;
}
.ml-field textarea { min-height: 140px; resize: vertical; }
.ml-field input:focus,
.ml-field select:focus,
.ml-field textarea:focus { border-color: var(--ml-green); box-shadow: 0 0 0 3px rgba(201,134,122,.28); outline: none; }
.ml-form-note { margin-top: 1rem; color: var(--ml-muted); font-size: .82rem; }
.ml-alert { margin-bottom: 1.3rem; padding: 1rem 1.1rem; border-radius: .65rem; background: #e4f0e9; color: #144631; font-weight: 700; }
.ml-alert--error { background: #f5dfdb; color: #7a2f27; }

/* Footer */
.ml-site-footer { padding: 4.3rem 0 2rem; background: #102f26; color: rgba(255,255,255,.78); }
.ml-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.ml-site-footer h2, .ml-site-footer h3 { color: #fff; }
.ml-site-footer a { color: #fff; }
.ml-site-footer ul { margin: 0; padding: 0; list-style: none; }
.ml-site-footer li { margin-bottom: .5rem; }
.ml-footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.15); font-size: .78rem; }
.ml-preview-note { margin-top: 1rem; padding: .75rem 1rem; border: 1px solid rgba(255,255,255,.2); border-radius: .6rem; font-size: .8rem; }
.ml-mobile-bar { display: none; }

@media (max-width: 1050px) {
  .ml-header-inner { grid-template-columns: auto 1fr auto; }
  .ml-phone { display: none; }
  .ml-primary-nav { position: fixed; inset: 82px 1rem auto; display: none; padding: 1rem; border: 1px solid var(--ml-line); border-radius: 1rem; background: var(--ml-paper); box-shadow: var(--ml-shadow); }
  .ml-primary-nav.is-open { display: block; }
  .ml-primary-nav ul { align-items: stretch; flex-direction: column; gap: 0; }
  .ml-primary-nav a { display: block; padding: .8rem .4rem; }
  .ml-menu-toggle { display: inline-grid; width: 48px; height: 48px; place-items: center; border: 1.5px solid var(--ml-green); border-radius: 50%; background: transparent; color: var(--ml-green); font-size: 1.2rem; cursor: pointer; }
  .ml-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 782px) {
  body.admin-bar .ml-site-header { top: 46px; }
  .ml-header-inner { min-height: 72px; }
  .ml-primary-nav { inset-block-start: 72px; }
  .ml-header-actions .ml-button { display: none; }
  .ml-hero { min-height: 680px; }
  .ml-hero::after { background: linear-gradient(180deg, rgba(18,48,38,.56) 0%, rgba(18,48,38,.84) 62%, rgba(18,48,38,.94) 100%); }
  .ml-hero-media img { object-position: 64% center; }
  .ml-hero-content { align-items: flex-end; padding-block: 4.2rem; }
  .ml-grid--3,
  .ml-grid--4,
  .ml-split,
  .ml-footer-grid { grid-template-columns: 1fr; }
  .ml-split-media { order: -1; }
  .ml-service-list { grid-template-columns: 1fr; }
  .ml-footer-bottom { flex-direction: column; }
  .ml-mobile-bar { position: fixed; z-index: 1200; right: .7rem; bottom: .7rem; left: .7rem; display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; padding: .55rem; border: 1px solid var(--ml-line); border-radius: 999px; background: rgba(255,253,248,.96); box-shadow: 0 12px 35px rgba(17,47,38,.25); backdrop-filter: blur(12px); }
  .ml-mobile-bar a { min-height: 46px; }
  .ml-site-footer { padding-bottom: 6.2rem; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .ml-container { width: min(calc(100% - 1.25rem), var(--ml-max)); }
  .ml-brand { font-size: 1.22rem; }
  .ml-brand-mark { width: 1.8rem; height: 1.8rem; }
  .ml-hero { min-height: 650px; }
  .ml-hero-actions { display: grid; }
  .ml-hero-actions a { width: 100%; }
  .ml-category-card { min-height: 205px; }
  .ml-form-grid { grid-template-columns: 1fr; }
  .ml-field--full { grid-column: auto; }
}

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