/* takochfasadmalmo.se — Scandi-clean, trade-credible
 * Mobile-first. Design probe for the Rent and Rank portfolio template.
 * Tokens here are what the SSG will eventually pull from per-site JSON.
 */

/* Color-palette variables are injected per-page from site palette + category default_theme.
 * Structural variables (font, radius) are defined here as defaults so every site shares them. */
:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 4px;
  --radius-lg: 10px;
}

* { box-sizing: border-box; }
* + * { margin-top: 0; }
html, body, h1, h2, h3, h4, p, ul, ol, figure, table, form { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: 72px; /* clearance for sticky mobile CTA */
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); }
h2 { font-size: clamp(1.35rem, 4vw, 1.625rem); margin-top: 2.5rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; }
p  { margin-top: 1rem; }
ul, ol { margin-top: 1rem; padding-left: 1.25rem; }
li + li { margin-top: 0.35rem; }

/* Single source of truth for horizontal page rail.
 * Mobile: 1.5rem (24px). Desktop: 2rem. Used by every section (header,
 * hero, main, footer) so everything aligns to the same left/right edge. */
.container { max-width: 720px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Header ---------- */
header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
header.site .row {
  display: flex; align-items: center; justify-content: space-between;
  /* Vertical only — horizontal padding inherited from .container so the
     header brand aligns to the same left rail as the page body. */
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  gap: 0.75rem;
  min-width: 0; /* allow children to shrink instead of overflowing */
}
.brand {
  font-weight: 700; font-size: 1rem; color: var(--ink);
  text-decoration: none; line-height: 1.15;
  min-width: 0; /* permits truncation of small label if needed */
}
.brand small { display: block; font-size: 0.7rem; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }
.phone-header {
  font-weight: 700; font-size: 0.95rem; color: var(--ink);
  text-decoration: none; white-space: nowrap;
  min-height: 48px; display: inline-flex; align-items: center; gap: 0.4rem;
  flex-shrink: 0;
}
.phone-header svg { width: 18px; height: 18px; fill: var(--primary); flex-shrink: 0; }
nav.primary { display: none; }

/* ---------- Mobile menu (hamburger via <details>) ---------- */
.mobile-menu { position: relative; flex-shrink: 0; }
.mobile-menu > summary {
  list-style: none;
  min-height: 48px; min-width: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink);
  border-radius: var(--radius);
  margin-right: -0.5rem; /* visually align hamburger to the container rail */
}
.mobile-menu > summary::-webkit-details-marker { display: none; }
.mobile-menu > summary::marker { content: ""; }
.mobile-menu > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.mobile-menu > summary svg { width: 26px; height: 26px; fill: currentColor; }
.mobile-menu[open] > summary { background: var(--bg); }

.mobile-menu-panel {
  position: absolute; right: 0; top: calc(100% + 0.5rem);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  min-width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  display: flex; flex-direction: column; gap: 0.15rem;
  z-index: 30;
}
.mobile-menu-panel a {
  padding: 0.85rem 1rem; text-decoration: none; color: var(--ink);
  border-radius: var(--radius); min-height: 48px;
  display: flex; align-items: center;
  font-weight: 500;
}
.mobile-menu-panel a:hover { background: var(--bg); }
.mobile-menu-panel a[aria-current="page"] { color: var(--primary); font-weight: 700; }
.mobile-menu-panel .menu-cta {
  background: var(--primary); color: var(--primary-ink); font-weight: 700; margin-top: 0.35rem; justify-content: center;
}
.mobile-menu-panel .menu-cta:hover { background: var(--primary-hover); color: var(--primary-ink); }

/* Very narrow phones: drop the brand sublabel so the phone number gets room */
@media (max-width: 380px) {
  .brand small { display: none; }
  .phone-header { font-size: 0.9rem; }
}

/* ---------- Hero ---------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--border); }
/* Vertical only — horizontal padding inherited from .container. */
.hero-inner { padding-top: 2rem; padding-bottom: 2.25rem; }
.hero .eyebrow { color: var(--accent); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; }
.hero h1 { margin-top: 0.5rem; }
.hero .lede { color: var(--muted); font-size: 1.05rem; margin-top: 0.85rem; }
.hero .cta-row { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Hero image — stacks above copy on mobile, sits beside copy on desktop. */
.hero.has-image .hero-inner { display: grid; gap: 1.5rem; }
.hero-image {
  width: 100%; height: auto; display: block;
  aspect-ratio: 16/9; object-fit: cover;
  border-radius: var(--radius-lg);
}

/* Service / B2B page hero — sits at the top of <main>, full width of the content column. */
.service-hero-image {
  width: 100%; height: auto; display: block;
  aspect-ratio: 16/9; object-fit: cover;
  border-radius: var(--radius-lg);
  margin-top: 1.25rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--primary); color: var(--primary-ink);
  padding: 12px 20px; border-radius: var(--radius);
  text-decoration: none; font-weight: 700; font-size: 1rem;
  border: 0; cursor: pointer;
  /* Research doc rule: min 48×48 px tap target */
  min-height: 48px; min-width: 48px;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--primary-hover); color: var(--primary-ink); }
.btn.secondary { background: var(--surface); color: var(--primary); border: 1px solid var(--primary); }
.btn.secondary:hover { background: var(--bg); }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: #9D4D2E; }
.btn.full { width: 100%; }

/* ---------- Cards / generic blocks ---------- */
main { padding: 2rem 0 3rem; }
section { margin-top: 2.5rem; }
section:first-of-type { margin-top: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
}

.services-grid { display: grid; gap: 1rem; margin-top: 1.25rem; }
.service-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0;
  text-decoration: none; color: var(--ink); display: block;
  transition: border-color 0.15s ease, transform 0.15s ease;
  overflow: hidden;
}
.service-card:hover { border-color: var(--primary); color: var(--ink); }
.service-card-body { padding: 1.25rem; }
.service-card h3 { margin-top: 0; color: var(--primary); }
.service-card p { color: var(--muted); margin-top: 0.5rem; font-size: 0.95rem; }
.service-card .arrow { margin-top: 0.85rem; font-weight: 700; color: var(--primary); font-size: 0.9rem; }
.service-card-thumb {
  width: 100%; height: auto; display: block;
  aspect-ratio: 1/1; object-fit: cover;
}

/* ---------- ROT highlights ---------- */
.rot-badge {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  padding: 0.3rem 0.7rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase;
}
.callout {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem; border-radius: var(--radius);
  margin-top: 1.5rem;
}
.callout strong { color: var(--accent); }
.callout p:first-child { margin-top: 0; }

/* ---------- Tables (priser) ---------- */
.price-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.95rem; }
.price-table caption { text-align: left; padding-bottom: 0.5rem; font-weight: 700; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.price-table th, .price-table td { padding: 0.7rem 0.5rem; text-align: left; border-bottom: 1px solid var(--border); }
.price-table th { font-weight: 700; background: var(--bg); }
.price-table td:last-child, .price-table th:last-child { text-align: right; white-space: nowrap; }

/* ---------- Q&A (visible, no accordion — research §J for AI-Overview citation) ---------- */
.qa { margin-top: 1rem; }
.qa h3 {
  margin-top: 1.5rem; font-size: 1.05rem; font-weight: 700; color: var(--ink);
  padding-left: 1.25rem; position: relative;
}
.qa h3::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.qa h3:first-child { margin-top: 0; }
.qa p { margin-top: 0.5rem; color: var(--ink); }

/* Legacy: keep .faq details styling for any remaining accordions (e.g. future use) */
.faq { margin-top: 1rem; }
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-top: 0.5rem; padding: 0 1rem;
}
.faq summary {
  padding: 0.95rem 0; cursor: pointer; font-weight: 600; list-style: none;
  min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 1.4rem; line-height: 1; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details > p, .faq details > ul { padding-bottom: 1rem; color: var(--ink); margin-top: 0; }

/* ---------- Trust row ---------- */
.trust-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.trust-pill {
  background: var(--surface); border: 1px solid var(--border);
  padding: 0.5rem 0.85rem; border-radius: 999px; font-size: 0.85rem;
  font-weight: 600; color: var(--ink);
}

/* ---------- Form ---------- */
.form-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-top: 1.25rem; }
.form-wrap h2 { margin-top: 0; }
label { display: block; font-weight: 600; margin-top: 1rem; font-size: 0.95rem; }
label .req { color: var(--accent); }
input[type=text], input[type=tel], input[type=email], select, textarea {
  width: 100%; margin-top: 0.35rem;
  padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg); min-height: 48px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.checkbox-row {
  display: flex; gap: 0.65rem; align-items: flex-start;
  font-size: 0.9rem; color: var(--muted); margin-top: 1rem;
  line-height: 1.5;
}
.checkbox-row input {
  width: 18px; height: 18px; flex-shrink: 0;
  min-height: auto; margin: 0;
  /* Align checkbox vertical center with first line of label text:
     line-height 1.5 × 0.9rem ≈ 1.35rem, half = 0.675rem; checkbox half = 9px (~0.56rem);
     so a small top offset puts the box center on the text baseline. */
  margin-top: 0.18rem;
  accent-color: var(--primary);
}
.checkbox-row label { margin: 0; font-weight: 400; }
.checkbox-row a { color: var(--primary); }
.form-wrap .submit-row { margin-top: 1.25rem; }
.honeypot { position: absolute !important; left: -9999px !important; top: -9999px !important; height: 0; width: 0; overflow: hidden; }
.form-note { margin-top: 0.85rem; font-size: 0.85rem; color: var(--muted); }

/* Form validation states (set by the inline validator script per form). */
input.invalid, select.invalid, textarea.invalid {
  border-color: var(--accent);
  background: var(--accent-soft);
}
input.invalid:focus, select.invalid:focus, textarea.invalid:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.checkbox-row input.invalid + label { color: var(--accent); }
.field-error {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.35rem;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

/* ---------- Sticky bottom CTA (mobile only) ---------- */
.sticky-cta {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--primary); color: var(--primary-ink);
  display: flex; justify-content: center; align-items: center; gap: 0.5rem;
  padding: 0.95rem 1rem; text-decoration: none; font-weight: 700;
  z-index: 20; min-height: 56px;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.08);
  font-size: 1rem;
}
.sticky-cta svg { width: 18px; height: 18px; fill: currentColor; }
.sticky-cta:hover { color: var(--primary-ink); }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-top: 0.75rem; }
.breadcrumb a { color: var(--muted); text-decoration: underline; }
.breadcrumb span[aria-current] { color: var(--ink); }
.breadcrumb .sep { margin: 0 0.4rem; color: var(--border); }

/* ---------- Image placeholders (until real photos in production) ---------- */
.img-ph {
  background: linear-gradient(135deg, #ECE7DD, #DDD5C5);
  aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center;
  color: var(--muted); border-radius: var(--radius-lg); font-size: 0.85rem;
  margin-top: 1.25rem; padding: 1rem; text-align: center;
}
.img-ph.tall { aspect-ratio: 4/5; }

/* ---------- Map embed (contact page only, lazy-loaded) ---------- */
.map-embed {
  position: relative; width: 100%; aspect-ratio: 16/10;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); margin-top: 1.25rem;
  background: var(--bg);
}
.map-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* ---------- Footer ---------- */
footer.site {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 2.5rem 0 2rem; margin-top: 3rem;
  font-size: 0.9rem; color: var(--muted);
}
footer.site h4 { color: var(--ink); font-size: 0.95rem; margin-bottom: 0.75rem; }
footer.site address { font-style: normal; color: inherit; line-height: 1.6; }
footer.site a { color: var(--muted); text-decoration: none;
                /* tap target: min 44px height when used as nav link */ }
footer.site a:hover { color: var(--ink); text-decoration: underline; }
footer.site .grid { display: grid; gap: 1.75rem; }
footer.site ul { list-style: none; padding-left: 0; margin-top: 0.5rem; }
footer.site li { display: block; }
footer.site li a { display: inline-flex; align-items: center; min-height: 40px; padding: 0.25rem 0; }
footer.site li + li { margin-top: 0; }
footer.site .legal { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border); font-size: 0.8rem; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--primary-ink); padding: 0.75rem 1rem;
  text-decoration: none; font-weight: 700; z-index: 100;
}
.skip-link:focus { left: 0; color: var(--primary-ink); }

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  body { padding-bottom: 0; font-size: 18px; }
  .container { max-width: 960px; padding: 0 2rem; }
  nav.primary { display: flex; gap: 1.5rem; align-items: center; }
  nav.primary a { text-decoration: none; color: var(--ink); font-weight: 500; font-size: 0.95rem;
                  min-height: 44px; display: inline-flex; align-items: center; }
  nav.primary a:hover { color: var(--primary); }
  nav.primary a[aria-current="page"] { color: var(--primary); font-weight: 700; }
  .mobile-menu { display: none; }
  .sticky-cta { display: none; }
  .hero-inner { padding-top: 4rem; padding-bottom: 4.5rem; }
  .hero.has-image .hero-inner {
    grid-template-columns: 1.1fr 1fr;
    gap: 3rem;
    align-items: center;
  }
  .hero.has-image .hero-image { order: 2; aspect-ratio: 4/5; object-fit: cover; }
  .services-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  footer.site .grid { grid-template-columns: 2fr 1fr 1fr; }
  main { padding: 3rem 0 5rem; }
  h1 { font-size: 2.75rem; }
  h2 { font-size: 1.875rem; }
  .form-wrap { padding: 2rem; }
}

@media (min-width: 1024px) {
  .container { max-width: 1100px; }
  .hero .container { max-width: 900px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
