/* =============================
   HeimatHerd – Minimalist Flex CSS
   Mobile-first, flex-only layouts, brand-driven
   ============================= */

/* 1) RESET + NORMALIZE (safe, lightweight) */
* { box-sizing: border-box; }
html, body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0 0 0 20px; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
html { -webkit-text-size-adjust: 100%; }

/* 2) DESIGN TOKENS (with fallbacks) */
:root {
  --color-primary: #2E5339; /* forest green */
  --color-secondary: #8C3A2E; /* warm brick */
  --color-accent: #FAF3E7; /* warm paper */
  --color-bg: #FFFFFF;
  --color-muted: #F6F6F6;
  --color-border: #E6E6E6;
  --color-text: #111111;
  --color-text-subtle: #555555;
  --shadow-soft: 0 1px 3px rgba(0,0,0,0.06), 0 6px 24px rgba(0,0,0,0.04);
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --trans-fast: 180ms ease;
  --trans-medium: 280ms ease;
}

/* 3) BASE TYPOGRAPHY */
body {
  font-family: Verdana, Geneva, sans-serif; /* Brand body */
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif; /* Brand display */
  color: var(--color-primary);
}

h1 { font-size: 34px; line-height: 1.2; letter-spacing: 0.2px; }
h2 { font-size: 24px; line-height: 1.3; margin-top: 8px; }
h3 { font-size: 18px; line-height: 1.35; color: #2A2A2A; }
h4 { font-size: 16px; line-height: 1.4; }

p { color: var(--color-text); }
.subheadline { color: #2A2A2A; margin-top: 6px; }

/***** TYPOGRAPHY at larger screens *****/
@media (min-width: 768px) {
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  h3 { font-size: 24px; }
  h4 { font-size: 18px; }
  .subheadline { font-size: 18px; }
}

/* 4) GLOBAL LAYOUT HELPERS (flex-only) */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cta-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .cta-row { flex-direction: row; align-items: center; gap: 16px; }
}

/* Mandatory spacing and alignment patterns */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; }
.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; }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Ensure column on mobile and row on desktop for text-image sections */
.text-image-section { flex-direction: column; }
@media (min-width: 768px) {
  .text-image-section { flex-direction: row; }
}

/* Generic section rhythm to emphasize minimalist whitespace */
main > section { padding: 28px 0; margin-bottom: 60px; }

/* 5) LINKS + BUTTONS */
a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-color: rgba(46,83,57,0.35); }

.link {
  color: var(--color-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link:hover { opacity: 0.8; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #FFFFFF;
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
  transition: transform var(--trans-fast), box-shadow var(--trans-fast), background var(--trans-fast), color var(--trans-fast), border-color var(--trans-fast);
}
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.button:active { transform: translateY(0); }
.button:focus-visible { outline: 2px solid #A4C3B2; outline-offset: 2px; }

.button.primary {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}
.button.primary:hover { background: #264732; }
.button.primary:active { background: #1F3A29; }

/* 6) HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: #FFFFFF;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 14px rgba(0,0,0,0.03);
}
.site-header .container {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.logo { display: flex; align-items: center; }
.logo img { height: 36px; width: auto; }

.tagline {
  font-size: 12px;
  color: var(--color-text-subtle);
  flex: 1 1 100%;
}

.main-nav {
  display: none; /* hidden on mobile */
  align-items: center;
  gap: 16px;
}
.main-nav a {
  color: #2A2A2A;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background var(--trans-fast), color var(--trans-fast);
}
.main-nav a:hover { background: var(--color-muted); }

.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}
.mobile-menu-toggle:hover { background: var(--color-muted); }

/* Show main nav on wider screens, hide burger */
@media (min-width: 992px) {
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }
  .tagline { flex: 0 0 auto; order: 3; margin-left: auto; }
}

/* 7) HERO */
.hero {
  background: var(--color-accent);
  border-top: 1px solid #F0E8DA;
  border-bottom: 1px solid #F0E8DA;
}
.hero .container { padding-top: 32px; padding-bottom: 32px; }
.hero .content-wrapper { gap: 12px; }

/* 8) TEXT BLOCKS */
.text-section { display: flex; flex-direction: column; gap: 10px; }
.text-section p + ul, .text-section p + ol { margin-top: -4px; }
.text-section ul li, .text-section ol li { margin: 6px 0; }
.text-section a { color: var(--color-secondary); }

/* 9) TESTIMONIALS (readable on light bg) */
.testimonial-card {
  background: #FFFFFF; /* ensure dark text on light bg */
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.testimonial-card p { color: #222; }
.testimonial-card p strong { color: #1a1a1a; }

/* 10) FOOTER */
.site-footer {
  background: #FBFBFB;
  border-top: 1px solid var(--color-border);
}
.site-footer .container { padding-top: 28px; padding-bottom: 28px; }
.site-footer .content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-badge { display: flex; align-items: center; gap: 12px; }
.brand-badge img { width: 32px; height: 32px; }
.brand-badge p { color: var(--color-text-subtle); font-size: 14px; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.footer-nav a { color: #2A2A2A; text-decoration: underline; text-underline-offset: 2px; }
.footer-nav a:hover { opacity: 0.8; }

.social-links { display: flex; align-items: center; gap: 12px; }
.social-links a { display: inline-flex; padding: 6px; border-radius: 8px; border: 1px solid var(--color-border); background: #fff; transition: background var(--trans-fast); }
.social-links a:hover { background: var(--color-muted); }
.social-links img { width: 18px; height: 18px; }

.newsletter-miniform { display: flex; flex-direction: column; gap: 10px; }
.newsletter-miniform p { color: var(--color-text-subtle); font-size: 14px; }

.copyright { color: #777; font-size: 12px; margin-top: 8px; }

@media (min-width: 768px) {
  .site-footer .content-wrapper { flex-direction: row; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; }
  .brand-badge { flex: 1 1 280px; }
  .footer-nav { flex: 1 1 280px; }
  .social-links { flex: 0 0 auto; }
  .newsletter-miniform { flex: 1 1 280px; align-items: flex-start; }
}

/* 11) CARDS (generic) */
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.card h3 { margin-bottom: 4px; }

/* 12) IMAGES WITH TEXT (utility) */
.text-image-section img { border-radius: var(--radius); box-shadow: var(--shadow-soft); }

/* 13) ACCESSIBILITY FOCUS */
:focus-visible { outline: 2px solid #A4C3B2; outline-offset: 2px; }

/* 14) MOBILE MENU (full-screen overlay, slide-in) */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform var(--trans-medium), box-shadow var(--trans-medium);
  display: flex;
  flex-direction: column;
  padding: 18px;
  box-shadow: -8px 0 24px rgba(0,0,0,0.12);
  pointer-events: none;
}
/* open states supported: element has .open OR body has .menu-open */
.mobile-menu.open,
body.menu-open .mobile-menu { transform: translateX(0); pointer-events: auto; }

.mobile-menu-close {
  align-self: flex-end;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 8px; background: #fff; box-shadow: var(--shadow-soft);
}
.mobile-menu-close:hover { background: var(--color-muted); }

.mobile-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mobile-nav a {
  display: flex; align-items: center; height: 44px;
  padding: 0 10px; border-radius: 8px;
  color: #1E1E1E;
  border: 1px solid transparent;
}
.mobile-nav a:hover { background: var(--color-accent); border-color: #F0E8DA; }

/* 15) LISTS inside content */
.content-wrapper > p, .content-wrapper > .text-section { max-width: 70ch; }

/* 16) UTILITIES */
.muted { color: var(--color-text-subtle); }
.hidden { display: none !important; }

/* 17) RESPONSIVE TWEAKS */
@media (min-width: 600px) {
  .logo img { height: 40px; }
}

@media (min-width: 768px) {
  .hero .container { padding-top: 48px; padding-bottom: 48px; }
  .content-wrapper { gap: 20px; }
}

/* 18) COOKIE CONSENT BANNER + MODAL (flex-only, animated) */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1100;
  background: #FFFFFF;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.08);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
  transform: translateY(100%);
  transition: transform var(--trans-medium);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cookie-text { color: #222; font-size: 14px; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-actions .button { padding: 10px 14px; }
.cookie-actions .button.accept { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.cookie-actions .button.reject { background: #fff; color: #333; }
.cookie-actions .button.settings { background: var(--color-accent); border-color: #F0E8DA; }

/* Modal overlay */
.cookie-modal-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none;
  transition: opacity var(--trans-medium);
  display: flex; align-items: center; justify-content: center;
}
.cookie-modal-overlay.show { opacity: 1; pointer-events: auto; }

.cookie-modal {
  width: min(680px, 92vw);
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
  transform: translateY(20px);
  transition: transform var(--trans-medium);
  display: flex; flex-direction: column; gap: 16px;
  padding: 18px;
}
.cookie-modal-overlay.show .cookie-modal { transform: translateY(0); }

.cookie-modal .modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal .modal-body { display: flex; flex-direction: column; gap: 12px; }
.cookie-modal .modal-footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.cookie-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.cookie-option:last-child { border-bottom: none; }

/* Simple toggle switch (works with a checkbox + label.layout) */
.toggle { display: inline-flex; align-items: center; gap: 8px; }
.toggle input[type="checkbox"] { appearance: none; width: 40px; height: 22px; background: #DDD; border-radius: 999px; position: relative; outline: none; transition: background var(--trans-fast); }
.toggle input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: transform var(--trans-fast); }
.toggle input[type="checkbox"]:checked { background: var(--color-primary); }
.toggle input[type="checkbox"]:checked::after { transform: translateX(18px); }

/* 19) PRINT BASICS */
@media print {
  .site-header, .site-footer, .mobile-menu, .cookie-banner, .cookie-modal-overlay { display: none !important; }
  a { text-decoration: underline; }
}

/* 20) EXTRA SPACING + PREVENT OVERLAP */
main > section .testimonial-card, main > section .card, main > section .text-section { margin-top: 8px; }

/* 21) SMALL MICRO-ANIMATIONS */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.hero .content-wrapper > * { animation: fadeInUp 420ms ease both; }
.hero .content-wrapper > *:nth-child(2) { animation-delay: 60ms; }
.hero .content-wrapper > *:nth-child(3) { animation-delay: 120ms; }

/* 22) FORMS (newsletter mini) */
.newsletter-miniform input[type="email"] { min-height: 40px; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 8px; }

/* 23) Ensure adequate gaps across lists and navs */
nav a + a { margin-left: 0; }

/* 24) Ensure no overlapping by guarding min-heights */
.button, .mobile-menu-toggle, .mobile-menu-close { min-height: 40px; }

/* 25) Dark mode consideration (optional, non-invasive) */
@media (prefers-color-scheme: dark) {
  /* Keep minimalist high-contrast while staying brand-aligned */
  body { background: #111; color: #EEE; }
  .site-header, .site-footer, .card, .testimonial-card, .cookie-modal, .mobile-menu { background: #161616; border-color: #2A2A2A; }
  .footer-nav a, .main-nav a { color: #EAEAEA; }
  .hero { background: #1B1B1B; border-color: #2A2A2A; }
  .button { background: #1E1E1E; color: #EAEAEA; border-color: #2A2A2A; }
  .button.primary { background: var(--color-primary); }
  .cookie-banner { background: #161616; border-top-color: #2A2A2A; }
}
