/* ================================
   HeimatHappen - Warm Friendly UI
   Mobile-first, flexbox-only layout
   Fonts: Georgia (display), Verdana (body)
   Colors: Primary #7A2E1B, Secondary #2F6B3C, Accent #FFF5E8
   ================================ */

/* 1) Reset & Normalize */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body, h1, h2, h3, h4, p, ul, ol, li, figure, figcaption, blockquote { margin: 0; padding: 0; }
img, picture, video { max-width: 100%; display: block; height: auto; }
ul, ol { padding-left: 1.25rem; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
:focus-visible { outline: 3px solid #2F6B3C; outline-offset: 2px; border-radius: 6px; }

/* 2) Theme Tokens */
:root {
  --color-primary: #7A2E1B;
  --color-secondary: #2F6B3C;
  --color-accent: #FFF5E8;
  --color-bg: #FFFAF5;
  --color-text: #2B1B16;
  --color-muted: #8A6E60;
  --color-border: #E9D9CC;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 18px rgba(122,46,27,0.10);
  --shadow-lg: 0 10px 30px rgba(122,46,27,0.12);
  --container-max: 1120px;
}

/* 3) Base Typography & Body */
body {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}
h1, h2, h3, h4 { font-family: Georgia, "Times New Roman", serif; color: var(--color-primary); line-height: 1.25; }
h1 { font-size: 32px; margin-bottom: 12px; }
h2 { font-size: 24px; margin-bottom: 12px; }
h3 { font-size: 18px; margin-bottom: 8px; }
.small { font-size: 14px; color: var(--color-muted); }
.tagline { color: var(--color-secondary); font-weight: bold; }

/* 4) Containers & Sections (Flex-only) */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
  display: flex; /* flex-only layout */
  flex-direction: column;
  align-items: stretch;
}
.content-wrapper {
  display: flex; /* layout */
  flex-direction: column;
  gap: 20px;
}
section {
  display: flex; /* layout */
  width: 100%;
  margin-bottom: 48px;
}
section > .container { padding-top: 28px; padding-bottom: 28px; }
section:nth-of-type(odd) { background: var(--color-accent); }

/* MANDATORY CSS 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; }

/* 5) Header & Navigation */
header { position: sticky; top: 0; z-index: 100; background: #FFFFFF; box-shadow: var(--shadow-sm); }
header > .container { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; padding-top: 14px; padding-bottom: 14px; }
.logo img { height: 42px; width: auto; }

.main-nav { display: none; align-items: center; gap: 14px; }
.main-nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.main-nav a:hover { background: var(--color-accent); color: var(--color-primary); transform: translateY(-1px); }

.mobile-menu-toggle {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff; font-size: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, background-color .2s ease;
}
.mobile-menu-toggle:hover { transform: translateY(-2px); background: #692816; }
.mobile-menu-toggle:active { transform: translateY(0); }

/* 6) Mobile Menu Overlay */
.mobile-menu {
  position: fixed; inset: 0; z-index: 1000;
  background: #FFFFFF;
  transform: translateX(100%);
  transition: transform .35s ease;
  display: flex; /* layout */
  flex-direction: column;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}
.mobile-menu.open { transform: translateX(0%); }
.mobile-menu-close {
  align-self: flex-end;
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--color-accent); color: var(--color-primary);
  font-size: 18px;
}
.mobile-nav { display: flex; flex-direction: column; gap: 12px; padding-top: 10px; }
.mobile-nav a {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: background-color .2s ease, transform .2s ease;
}
.mobile-nav a:hover { background: #FFEAD3; transform: translateX(3px); }

/* 7) Footer */
footer { background: #FFFFFF; border-top: 1px solid var(--color-border); }
footer .content-wrapper { padding-top: 24px; padding-bottom: 24px; }
footer nav { display: flex; flex-wrap: wrap; gap: 12px; }
footer nav a { color: var(--color-primary); padding: 6px 8px; border-radius: 8px; transition: background-color .2s ease; }
footer nav a:hover { background: var(--color-accent); }

/* 8) Text Blocks, Lists & Helpers */
.text-section { display: flex; flex-direction: column; gap: 12px; }
.text-section p { max-width: 70ch; }
.text-section ul, .text-section ol { display: flex; flex-direction: column; gap: 6px; }
blockquote { font-style: italic; color: var(--color-text); }

/* 9) Cards & Recipe Items */
.card, .recipe-item, .map-placeholder {
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md);
}
.recipe-item { display: flex; flex-direction: column; gap: 8px; transition: transform .2s ease, box-shadow .2s ease; }
.recipe-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.map-placeholder { color: var(--color-muted); display: flex; align-items: center; justify-content: center; min-height: 160px; text-align: center; }

/* 10) Testimonials - readable on light bg */
.testimonial-card {
  background: var(--color-accent);
  border: 1px solid #F0DCC8;
  border-radius: var(--radius-lg);
  color: #231915; /* dark text for contrast */
  box-shadow: var(--shadow-sm);
}
.testimonial-card blockquote { quotes: "\201E" "\201C" "\201A" "\2018"; }
.testimonial-card blockquote:before { content: open-quote; color: var(--color-secondary); font-size: 24px; margin-right: 6px; }
.testimonial-card p { color: #3A2A22; }

/* 11) Buttons */
.cta-primary, .cta-secondary, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 12px 18px; font-weight: bold; transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease; }
.cta-primary { background: var(--color-primary); color: #FFFFFF; box-shadow: var(--shadow-sm); }
.cta-primary:hover { background: #6B2917; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cta-primary:active { transform: translateY(0); }

.cta-secondary { border: 2px solid var(--color-primary); color: var(--color-primary); background: transparent; }
.cta-secondary:hover { background: var(--color-accent); }

/* 12) Forms & Inputs */
label { font-weight: bold; color: var(--color-text); }
input[type="search"], input[type="email"], input[type="text"], textarea {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.03), var(--shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease;
}
input::placeholder, textarea::placeholder { color: #9B8479; }
input:focus, textarea:focus { border-color: var(--color-secondary); box-shadow: 0 0 0 4px rgba(47,107,60,0.15), inset 0 1px 0 rgba(0,0,0,0.03); }

/* 13) Breadcrumbs & Meta Links */
nav[aria-label="Brotkrumen"], nav[aria-label="Seiten"], nav[aria-label="Footer"], nav[aria-label="Kategorien"] {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
nav[aria-label="Brotkrumen"] a { color: var(--color-secondary); }
nav[aria-label="Seiten"] a { padding: 6px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--color-border); }
nav[aria-label="Seiten"] a:hover { background: var(--color-accent); }

/* 14) Utility Flex Patterns (pre-defined for re-use) */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.center { display: flex; align-items: center; justify-content: center; }

/* 15) Alternating section emphasis */
section:nth-of-type(even) .recipe-item { background: #FFFFFF; }

/* 16) Cookie Consent Banner */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
  display: none; /* default hidden; add .show to display */
  padding: 14px;
}
.cookie-banner.show { display: flex; }
.cookie-banner .cookie-inner {
  margin: 0 auto; width: 100%; max-width: var(--container-max);
  display: flex; flex-direction: column; gap: 12px;
  background: #FFFFFF; border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 16px;
}
.cookie-banner .cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-banner .btn-accept { background: var(--color-secondary); color: #fff; border-radius: 999px; padding: 10px 16px; }
.cookie-banner .btn-reject { background: #FFFFFF; color: var(--color-secondary); border: 2px solid var(--color-secondary); border-radius: 999px; padding: 8px 14px; }
.cookie-banner .btn-settings { background: var(--color-accent); color: var(--color-primary); border-radius: 999px; padding: 8px 14px; }
.cookie-banner .btn-accept:hover { background: #255733; }
.cookie-banner .btn-reject:hover { background: #F7FFF8; }
.cookie-banner .btn-settings:hover { background: #FFEAD3; }

/* 17) Cookie Preferences Modal */
.cookie-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1200; display: none; align-items: center; justify-content: center; }
.cookie-modal-overlay.show { display: flex; }
.cookie-modal {
  width: min(94%, 680px);
  background: #FFFFFF;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  transform: translateY(12px);
  transition: transform .25s ease;
}
.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-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* Toggle switches for cookie categories */
.cookie-toggle { display: inline-flex; align-items: center; gap: 10px; }
.cookie-switch {
  width: 46px; height: 26px; background: #E6E6E6; border-radius: 999px; position: relative; transition: background-color .2s ease;
}
.cookie-switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transition: transform .2s ease; }
.cookie-switch.on { background: var(--color-secondary); }
.cookie-switch.on::after { transform: translateX(20px); }

/* 18) Media Queries (mobile-first) */
@media (min-width: 600px) {
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
}

@media (min-width: 768px) {
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }

  /* text-image sections align center (if used) */
  .text-image-section { flex-direction: row; align-items: center; }
}

@media (min-width: 992px) {
  h1 { font-size: 40px; }
  h2 { font-size: 32px; }

  /* Create wider breathing room */
  section > .container { padding-top: 36px; padding-bottom: 36px; }

  /* Optional: arrange footer columns with flex wrap */
  footer .content-wrapper { flex-direction: row; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
  footer .content-wrapper > * { flex: 1 1 240px; }
}

/* 19) Animations & Micro-interactions */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.content-wrapper > * { animation: fadeSlideIn .35s ease both; }

/* 20) Color Utilities & Badges */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--color-accent); color: var(--color-primary); font-size: 14px; }

/* 21) Link Styles */
a { color: var(--color-secondary); }
a:hover { color: #245A31; }

/* 22) Ensure no overlapping and consistent gaps */
.content-wrapper > .text-section, .content-wrapper > .testimonial-card, .content-wrapper > .recipe-item { margin: 0; }
.content-grid > * , .card-container > * { margin: 0; }

/* 23) Accessibility: High contrast in testimonial & review sections */
section:has(.testimonial-card) { background: #FFFFFF; }
/* Note: if :has is unsupported, testimonial cards already ensure contrast on light bg */

/* 24) Specific page tweaks (optional small touches) */
.tagline { background: #FFEFE1; padding: 8px 12px; border-radius: 999px; display: inline-flex; box-shadow: var(--shadow-sm); }

/* 25) Print basic readability */
@media print {
  header, .mobile-menu, .cookie-banner, .cookie-modal-overlay { display: none !important; }
  a { text-decoration: underline; color: #000; }
}
