/* =============================================================
   TrimsRaddo Bodenmanufaktur — Scandinavian Clean UI
   Mobile-first, flexbox-only layout. No CSS Grid or Columns.
   ============================================================= */

/* -----------------------------
   CSS RESET & BASELINE NORMALIZE
   ----------------------------- */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: inherit; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif; /* Brand body font */
  color: #1C2B2E; /* primary */
  background: #FAF8F2; /* accent */
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #1C2B2E; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid #B07A3F; outline-offset: 2px; }

/* -----------------------------
   DESIGN TOKENS (with fallbacks)
   ----------------------------- */
:root {
  --color-primary: #1C2B2E;
  --color-secondary: #B07A3F; /* warm wood */
  --color-accent: #FAF8F2; /* soft sand */
  --color-ink: #1C2B2E;
  --color-muted: #6D7B7E;
  --color-border: #E6E2DA;
  --color-surface: #FFFFFF;
  --radius-s: 8px;
  --radius-m: 12px;
  --shadow-s: 0 2px 8px rgba(28,43,46,0.06);
  --shadow-m: 0 6px 18px rgba(28,43,46,0.08);
}

/* -----------------------------
   TYPOGRAPHY
   ----------------------------- */
h1, h2, h3, h4 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; color: var(--color-primary); margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 20px; }
li { margin-bottom: 8px; }

h1 { font-size: 32px; letter-spacing: 0.2px; line-height: 1.25; }
h2 { font-size: 24px; letter-spacing: 0.2px; margin-bottom: 10px; }
h3 { font-size: 18px; letter-spacing: 0.2px; }

@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }
}
@media (min-width: 1024px) {
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
}

em { color: var(--color-muted); }
hr { border: 0; border-top: 1px solid var(--color-border); margin: 20px 0; }

/* -----------------------------
   LAYOUT PRIMITIVES (Flex only)
   ----------------------------- */
.container {
  display: flex;
  width: 100%;
  padding: 0 16px;
  justify-content: center;
}
.content-wrapper {
  display: flex;
  width: 100%;
  max-width: 1120px;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px; /* Ensure min 20px between children */
}

/* Mandatory spacing pattern (also apply to generic section) */
.section { margin-bottom: 60px; padding: 40px 20px; }
section { margin: 0 0 60px 0; padding: 40px 0; }

/* Additional flex utility patterns required */
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-m); padding: 20px; box-shadow: var(--shadow-s); transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; background: #FFFFFF; border: 1px solid var(--color-border); border-radius: var(--radius-m); box-shadow: var(--shadow-s); color: var(--color-ink); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

@media (max-width: 768px) {
  .text-image-section { flex-direction: column; }
}

/* -----------------------------
   HEADER & NAVIGATION
   ----------------------------- */
header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}
header .content-wrapper { padding: 14px 0; }

.logo img { height: 40px; width: auto; }
.tagline { color: var(--color-muted); font-size: 14px; }

.main-nav { display: none; flex-wrap: wrap; gap: 12px; align-items: center; }
.main-nav a { padding: 8px 10px; border-radius: 6px; color: var(--color-primary); }
.main-nav a:hover { background: var(--color-accent); text-decoration: none; }

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--color-primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.mobile-menu-toggle:hover { background: var(--color-accent); transform: translateY(-1px); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #FFFFFF;
  transform: translateX(100%);
  transition: transform .35s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  box-shadow: -6px 0 24px rgba(28,43,46,0.12);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-close {
  align-self: flex-end;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  width: 40px; height: 40px;
  font-size: 18px;
  color: var(--color-primary);
  cursor: pointer;
}
.mobile-nav { display: flex; flex-direction: column; gap: 10px; }
.mobile-nav a { display: flex; padding: 12px 10px; border-radius: 8px; color: var(--color-primary); }
.mobile-nav a:hover { background: var(--color-accent); text-decoration: none; }

/* Desktop breakpoint */
@media (min-width: 992px) {
  header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; }
  .tagline { margin-left: 10px; }
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }
}

/* -----------------------------
   BUTTONS
   ----------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #FFFFFF;
  color: var(--color-primary);
  text-decoration: none;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
  cursor: pointer;
}
.btn:hover { background: var(--color-accent); text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}
.btn-primary:hover { background: #24383C; box-shadow: var(--shadow-m); }

.btn-secondary { /* for cookie banner or alt actions */
  background: #FFFFFF;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-secondary:hover { background: var(--color-accent); }

/* Grouped CTAs */
.cta-group { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 768px) { .cta-group { gap: 16px; } }

/* -----------------------------
   CONTENT ELEMENTS
   ----------------------------- */
.text-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  padding: 16px;
  box-shadow: var(--shadow-s);
}

.map-placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 220px;
  width: 100%;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-m);
  background: #FFFFFF;
  color: var(--color-muted);
}

/* Highlight list blocks inside text-section for clarity */
.text-section ul, .text-section ol { padding-left: 18px; }

/* Headings subtle underline for Scandinavian clarity */
section h2 { padding-bottom: 6px; border-bottom: 2px solid rgba(176,122,63,0.18); }

/* Testimonials: ensure dark text on light cards */
.testimonial-card p { margin: 0; }

/* Footer */
footer { background: #FFFFFF; border-top: 1px solid var(--color-border); }
footer .content-wrapper { padding: 24px 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-nav a { color: var(--color-primary); padding: 6px 8px; border-radius: 6px; }
.footer-nav a:hover { background: var(--color-accent); text-decoration: none; }
.footer-legal { color: var(--color-muted); font-size: 14px; }
.footer-brand, .footer-contact { display: flex; flex-direction: column; gap: 8px; }
.footer-brand img { height: 36px; }

@media (min-width: 992px) {
  footer .content-wrapper { flex-direction: row; justify-content: space-between; align-items: flex-start; }
}

/* -----------------------------
   LIST & MEDIA SPACING
   ----------------------------- */
main .content-wrapper > p, main .content-wrapper > ul, main .content-wrapper > ol { margin-top: 4px; }

/* Ensure no overlapping spacing issues */
section .content-wrapper { padding-top: 0; padding-bottom: 0; }

/* -----------------------------
   TABLES (if any appear later)
   ----------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--color-border); padding: 10px; text-align: left; }

/* -----------------------------
   ACCESSIBILITY & SMALL INTERACTIONS
   ----------------------------- */
[role="button"], button { font: inherit; }
button { cursor: pointer; }

/* -----------------------------
   COOKIE CONSENT BANNER & MODAL
   ----------------------------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex; /* container uses flex */
  justify-content: center;
  padding: 12px;
  z-index: 9998;
  transform: translateY(100%);
  transition: transform .35s ease;
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-banner-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%; max-width: 1120px;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -6px 24px rgba(28,43,46,0.12);
  padding: 16px;
}
.cookie-text { color: var(--color-ink); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Cookie modal (preferences) */
.cookie-modal {
  position: fixed;
  inset: 0;
  background: rgba(28,43,46,0.4);
  display: none; /* hidden by default */
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
}
a.btn.btn-primary{color: white;}
a.btn.btn-primary:hover{color: black; background-color: white;}
.cookie-modal.open { display: flex; }
.cookie-modal-content {
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  width: 100%; max-width: 640px;
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px;
  box-shadow: var(--shadow-m);
}
.cookie-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.cookie-row:last-child { border-bottom: 0; }
.cookie-row small { color: var(--color-muted); }

/* Simple toggle switch */
.toggle { display: flex; align-items: center; gap: 10px; }
.switch { position: relative; width: 44px; height: 24px; border-radius: 24px; background: #D9D9D9; transition: background .2s ease; display: flex; align-items: center; padding: 0 3px; }
.switch::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transform: translateX(0); transition: transform .2s ease; }
input[type="checkbox"].switch-input { position: absolute; opacity: 0; pointer-events: none; }
input[type="checkbox"].switch-input:checked + .switch { background: var(--color-secondary); }
input[type="checkbox"].switch-input:checked + .switch::after { transform: translateX(20px); }

/* -----------------------------
   RESPONSIVE TWEAKS
   ----------------------------- */
@media (min-width: 768px) {
  .cookie-banner-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* -----------------------------
   PAGE-SPECIFIC SMALL ENHANCEMENTS
   ----------------------------- */
/* Phone icon + text row spacing */
.content-wrapper p img[alt="Telefon"] { display: inline-block; vertical-align: middle; margin-right: 6px; }

/* Numbers/facts lists as neat inline blocks at larger screens */
@media (min-width: 768px) {
  .content-wrapper ul { display: flex; flex-wrap: wrap; gap: 10px 20px; }
  .content-wrapper ul li { margin: 0; }
}

/* Ensure adequate spacing between testimonial cards */
.testimonial-card + .testimonial-card { margin-top: 12px; }

/* Thank-you page primary action spacing */
main a.btn-primary + * { margin-top: 10px; }

/* -----------------------------
   PRINT MINIMAL SUPPORT
   ----------------------------- */
@media print {
  .mobile-menu-toggle, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  a { text-decoration: underline; }
}
