/*
Theme Name: Leu+Kälin Malergeschäft
Theme URI: https://example.com/leu-kaelin
Author: OpenAI für Leu+Kälin Malergeschäft
Description: Massgeschneidertes WordPress-Theme für Leu+Kälin Malergeschäft in Luzern. Modern, responsiv und auf dem Markengrün aufgebaut.
Version: 1.2.0
Requires at least: 6.2
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: leukaelin
*/

:root {
  --lk-green: #1e9c8d;
  --lk-green-dark: #11766c;
  --lk-green-deep: #0c625a;
  --lk-green-soft: #e9f7f5;
  --lk-green-pale: #f3fbf9;
  --lk-ink: #221f20;
  --lk-text: #474244;
  --lk-muted: #777173;
  --lk-bg: #f8f7f5;
  --lk-white: #fff;
  --lk-line: #e6e1dd;
  --lk-shadow-sm: 0 10px 30px rgba(36,31,33,.07);
  --lk-shadow: 0 24px 65px rgba(36,31,33,.12);
  --lk-radius: clamp(18px, 2.2vw, 28px);
  --lk-max: 1200px;
  --lk-reading: 820px;
  --lk-pad-x: clamp(18px, 4vw, 44px);
  --lk-section: clamp(64px, 8vw, 110px);
  --lk-body-size: clamp(1rem, .92rem + .25vw, 1.12rem);
  --lk-small-size: clamp(.84rem, .81rem + .12vw, .92rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--lk-text);
  background: var(--lk-bg);
  font-family: Inter, Aptos, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--lk-body-size);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--lk-green-dark); text-decoration-thickness: .08em; text-underline-offset: .14em; }
a:hover { color: var(--lk-green); }
button, input, select, textarea { font: inherit; }

.container { width: min(calc(100% - (2 * var(--lk-pad-x))), var(--lk-max)); margin-inline: auto; }
.narrow { width: min(calc(100% - (2 * var(--lk-pad-x))), var(--lk-reading)); margin-inline: auto; }
.section { padding: var(--lk-section) 0; }
.section--white { background: var(--lk-white); }

h1, h2, h3, h4 {
  margin: 0 0 .65em;
  color: var(--lk-ink);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -.035em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.55rem, 5.5vw, 5.45rem); }
h2 { font-size: clamp(1.85rem, 3.5vw, 3.2rem); }
h3 { font-size: clamp(1.28rem, 2vw, 1.7rem); }
h4 { font-size: clamp(1.08rem, 1.4vw, 1.3rem); }
p { margin: 0 0 1.15em; }
.lead, .has-large-font-size { font-size: clamp(1.12rem, 1rem + .45vw, 1.38rem) !important; line-height: 1.58; color: #514b4d; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin: 0 0 1.1rem !important;
  color: var(--lk-green-dark);
  font-size: clamp(.75rem, .72rem + .13vw, .86rem);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 34px; height: 4px; background: var(--lk-green); border-radius: 100% 20% 80% 30%; transform: rotate(-2deg); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid rgba(230,225,221,.9);
  backdrop-filter: blur(16px);
}
.header-inner { min-height: clamp(76px, 8vw, 94px); display: flex; align-items: center; justify-content: space-between; gap: clamp(20px, 3vw, 38px); }
.site-brand { flex: 0 1 auto; }
.site-brand img { width: clamp(190px, 22vw, 278px); max-width: 58vw; }
.main-nav { display: flex; align-items: center; gap: clamp(15px, 2vw, 25px); }
.main-nav ul { display: flex; align-items: center; gap: clamp(14px, 1.7vw, 25px); margin: 0; padding: 0; list-style: none; }
.main-nav a { color: var(--lk-ink); font-size: clamp(.9rem, .86rem + .12vw, .98rem); font-weight: 690; text-decoration: none; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_item > a { color: var(--lk-green-dark); }
.menu-toggle { display: none; min-width: 48px; min-height: 44px; border: 1px solid var(--lk-line); border-radius: 999px; background: #fff; color: var(--lk-ink); font-weight: 760; cursor: pointer; }

/* Buttons */
.btn, .entry-content .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: .76rem 1.3rem;
  border: 2px solid var(--lk-green);
  border-radius: 999px;
  background: var(--lk-green);
  color: #fff !important;
  font-weight: 760;
  line-height: 1.1;
  text-decoration: none;
  box-shadow: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover, .entry-content .wp-block-button__link:hover { transform: translateY(-2px); background: var(--lk-green-dark); border-color: var(--lk-green-dark); box-shadow: 0 11px 25px rgba(30,156,141,.18); }
.btn--light { background: #fff; color: var(--lk-ink) !important; border-color: #fff; }
.btn--light:hover { background: var(--lk-ink); border-color: var(--lk-ink); color: #fff !important; }
.entry-content .is-style-outline .wp-block-button__link { background: transparent; color: var(--lk-ink) !important; border-color: rgba(34,31,32,.32); }
.entry-content .is-style-outline .wp-block-button__link:hover { background: var(--lk-ink); border-color: var(--lk-ink); color: #fff !important; }
.header-cta { white-space: nowrap; }

/* Page hero with restrained painter detail */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(56px, 7vw, 90px) 0 clamp(48px, 6vw, 72px);
  background: linear-gradient(135deg, var(--lk-green-pale), #fff 72%);
  border-bottom: 1px solid #d9eeea;
}
.page-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(42vw, 520px);
  height: clamp(28px, 5vw, 58px);
  right: -5%;
  bottom: 16%;
  background:
    linear-gradient(92deg, transparent 0 3%, rgba(30,156,141,.17) 4% 88%, transparent 93%),
    repeating-linear-gradient(176deg, rgba(30,156,141,.14) 0 5px, transparent 5px 10px);
  border-radius: 45% 12% 40% 20%;
  transform: rotate(-4deg);
  filter: blur(.1px);
}
.page-hero h1 { max-width: 900px; margin: 0; }

/* Gutenberg / editable content */
.front-editor-content { padding: clamp(36px, 5vw, 70px) 0 var(--lk-section); }
.front-editor-content .entry-content { max-width: var(--lk-max); }
.entry-content { font-size: inherit; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content > * + * { margin-top: clamp(1rem, 1.4vw, 1.35rem); }
.entry-content h2 { margin-top: clamp(2.6rem, 5vw, 4.6rem); }
.entry-content h3 { margin-top: clamp(2rem, 3vw, 3rem); }
.entry-content p, .entry-content li { max-width: 78ch; }
.entry-content ul, .entry-content ol { padding-left: 1.35em; }
.entry-content li + li { margin-top: .45rem; }
.entry-content strong { color: var(--lk-ink); }
.entry-content hr { margin: clamp(3rem, 6vw, 5.5rem) 0; border: 0; height: 1px; background: var(--lk-line); }
.entry-content .wp-block-columns { gap: clamp(2rem, 5vw, 5.5rem); margin-bottom: clamp(2.2rem, 5vw, 4.6rem); }
.entry-content .wp-block-buttons { gap: .8rem; margin-top: 1.7rem; }

.hero-editor { position: relative; align-items: center !important; margin: 0; }
.hero-editor::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: clamp(95px, 11vw, 155px);
  height: clamp(18px, 2.6vw, 33px);
  left: 1.5%;
  top: 10%;
  background: var(--lk-green);
  opacity: .12;
  border-radius: 60% 10% 55% 16%;
  transform: rotate(-5deg);
  pointer-events: none;
}
.hero-editor > * { position: relative; z-index: 1; }
.hero-editor h1 { font-size: clamp(2.65rem, 5.2vw, 5.35rem); line-height: .98; margin-bottom: clamp(1.1rem, 2vw, 1.5rem); }
.hero-editor p { max-width: 630px; }
.hero-editor-image { position: relative; margin: 0; }
.hero-editor-image::after {
  content: "";
  position: absolute;
  width: 34%;
  height: 14px;
  right: 5%;
  bottom: -8px;
  background: var(--lk-green);
  border-radius: 50% 10% 55% 20%;
  transform: rotate(-2deg);
  opacity: .9;
}
.hero-editor-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--lk-radius); box-shadow: var(--lk-shadow); }

.notice-box { position: relative; padding: 1.25rem 1.45rem; border-left: 4px solid var(--lk-green); background: var(--lk-green-pale); border-radius: 10px; }

/* Forms */
.quote-form { margin-top: 2rem; }
.quote-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.quote-form p { margin: 0 0 1rem; }
.quote-form label { display: block; color: var(--lk-ink); font-size: .93rem; font-weight: 760; margin-bottom: .45rem; }
.quote-form input, .quote-form select, .quote-form textarea {
  width: 100%;
  border: 1px solid #d5cfcb;
  border-radius: 12px;
  background: #fff;
  padding: .85rem .95rem;
  color: var(--lk-ink);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.quote-form input:focus, .quote-form select:focus, .quote-form textarea:focus { border-color: var(--lk-green); box-shadow: 0 0 0 4px rgba(30,156,141,.10); }
.quote-form textarea { min-height: 170px; resize: vertical; }
.form-message { padding: 1rem 1.15rem; border-radius: 10px; margin: 0 0 1.25rem; }
.form-message--success { background: #eaf7f3; color: var(--lk-green-dark); }
.form-message--error { background: #fff0f0; color: #9d2929; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

/* CTA band */
.cta-band { margin: 0; padding: 0 0 clamp(64px, 8vw, 100px); background: var(--lk-white); }
.cta-inner { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: clamp(25px, 4vw, 60px); padding: clamp(30px, 4vw, 50px); border-radius: var(--lk-radius); background: var(--lk-green); color: #fff; box-shadow: var(--lk-shadow-sm); }
.cta-inner::before, .cta-inner::after { content: ""; position: absolute; z-index: -1; background: rgba(255,255,255,.13); }
.cta-inner::before { width: 230px; height: 33px; right: 9%; top: 15%; border-radius: 70% 12% 60% 20%; transform: rotate(-8deg); }
.cta-inner::after { width: 145px; height: 19px; right: 3%; bottom: 15%; border-radius: 20% 80% 24% 65%; transform: rotate(8deg); }
.cta-kicker { display: block; margin-bottom: .55rem; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .82; }
.cta-inner h2 { color: #fff; margin: 0; font-size: clamp(1.8rem, 3vw, 2.85rem); }
.cta-inner p { margin: .65rem 0 0; color: rgba(255,255,255,.9); max-width: 680px; }

/* Footer */
.site-footer { position: relative; overflow: hidden; padding: clamp(54px, 7vw, 82px) 0 28px; background: #211e1f; color: #c9c4c5; }
.site-footer::before { content: ""; position: absolute; width: 480px; height: 48px; left: -120px; top: 42px; background: rgba(30,156,141,.14); border-radius: 60% 10% 70% 15%; transform: rotate(-7deg); }
.footer-grid { position: relative; display: grid; grid-template-columns: minmax(240px, 1.2fr) minmax(210px, .9fr) minmax(180px, .75fr) minmax(150px, .6fr); gap: clamp(28px, 4vw, 55px); align-items: start; }
.footer-brand p { max-width: 330px; margin-top: 1rem; }
.footer-logo-link { display: inline-block; background: #fff; padding: 10px 12px; border-radius: 12px; }
.footer-logo { width: clamp(190px, 19vw, 245px); filter: none; opacity: 1; }
.footer-photo-wrap { position: relative; max-width: 300px; }
.footer-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 18px 40px rgba(0,0,0,.22); }
.footer-brush { position: absolute; width: 56%; height: 12px; right: -5%; bottom: -6px; background: var(--lk-green); border-radius: 60% 5% 60% 20%; transform: rotate(-3deg); }
.footer-title { margin: 0 0 14px; color: #fff; font-size: .79rem; font-weight: 850; text-transform: uppercase; letter-spacing: .13em; }
.site-footer p { margin: 0 0 .9rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: #85d9cf; }
.footer-links nav { display: grid; gap: .45rem; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: clamp(38px, 5vw, 58px); padding-top: 22px; border-top: 1px solid #3b3738; font-size: var(--lk-small-size); color: #969092; }
.footer-handmade { color: #b8b1b3; }

/* Generic legacy components retained for optional editor use */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; }
.card { padding: clamp(24px, 3vw, 32px); border: 1px solid var(--lk-line); border-radius: var(--lk-radius); background: #fff; box-shadow: var(--lk-shadow-sm); }
.service-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; }
.service-list li { position: relative; padding: 15px 18px 15px 44px; border-radius: 13px; background: #fff; border: 1px solid var(--lk-line); }
.service-list li::before { content: "+"; position: absolute; left: 16px; top: 10px; color: var(--lk-green); font-size: 1.35rem; font-weight: 900; }

/* Laptop / small desktop */
@media (max-width: 1100px) {
  .header-cta { display: none; }
  .footer-grid { grid-template-columns: 1.15fr .9fr .8fr; }
  .footer-links { grid-column: 3; }
  .footer-photo-wrap { max-width: 260px; }
}

/* Tablet + mobile nav */
@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .main-nav { position: absolute; left: 0; right: 0; top: 100%; display: none; max-height: calc(100vh - 76px); overflow-y: auto; padding: 22px var(--lk-pad-x) 28px; background: rgba(255,255,255,.99); border-bottom: 1px solid var(--lk-line); box-shadow: var(--lk-shadow-sm); }
  .main-nav.is-open { display: block; }
  .main-nav ul { display: grid; gap: 0; }
  .main-nav li { border-bottom: 1px solid var(--lk-line); }
  .main-nav li:last-child { border-bottom: 0; }
  .main-nav a { display: block; padding: 13px 0; font-size: 1.04rem; }
  .main-nav .header-cta { display: inline-flex; margin-top: 18px; }
  .hero-editor { flex-direction: column; }
  .hero-editor > .wp-block-column { flex-basis: 100% !important; width: 100%; }
  .hero-editor-image { max-width: 760px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-links { grid-column: auto; }
  .footer-photo-wrap { max-width: 100%; }
}

/* Phone */
@media (max-width: 640px) {
  :root { --lk-pad-x: 16px; --lk-section: 62px; }
  .header-inner { min-height: 74px; }
  .site-brand img { width: min(215px, 62vw); }
  .menu-toggle { min-width: 64px; padding-inline: 14px; font-size: .9rem; }
  .front-editor-content { padding-top: 30px; }
  .hero-editor h1 { font-size: clamp(2.45rem, 12vw, 3.75rem); }
  .hero-editor-image img { border-radius: 18px; }
  .entry-content .wp-block-buttons { flex-direction: column; align-items: stretch; }
  .entry-content .wp-block-button { width: 100%; }
  .entry-content .wp-block-button__link { width: 100%; }
  .quote-grid { grid-template-columns: 1fr; }
  .cta-inner { align-items: flex-start; flex-direction: column; padding: 28px 24px; }
  .cta-inner .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-photo-wrap { max-width: none; }
  .footer-photo { aspect-ratio: 16 / 9; }
  .footer-bottom { flex-direction: column; gap: 6px; }
  .cards, .service-list { grid-template-columns: 1fr; }
}

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