/* =====================================
   HanseQuartier Immobilien - style.css
   Design: gradient_modern (flex-only)
   ===================================== */

/* -----------------------------
   CSS RESET / NORMALIZE
------------------------------ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul, ol { margin: 0; padding-left: 20px; }
button { border: 0; background: none; font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid #2F8C82; outline-offset: 2px; }

/* -----------------------------
   THEME VARIABLES + FALLBACKS
------------------------------ */
:root {
  --hq-primary: #0D2E3F; /* deep blue */
  --hq-secondary: #2F8C82; /* teal */
  --hq-accent: #F4F7FA; /* light gray-blue */
  --hq-text: #0D2E3F;
  --hq-muted: #5E7A88;
  --hq-white: #ffffff;
  --hq-dark: #0B2330;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(13,46,63,0.08);
  --shadow-md: 0 8px 24px rgba(13,46,63,0.12);
  --shadow-lg: 0 16px 40px rgba(13,46,63,0.16);
  --transition: 220ms ease;
}

/* -----------------------------
   TYPOGRAPHY
------------------------------ */
body {
  font-family: Arial, Helvetica, sans-serif; /* brand body */
  color: var(--hq-text);
  background-color: var(--hq-white);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6 { font-family: Georgia, 'Times New Roman', serif; /* brand display */ margin: 0 0 12px 0; line-height: 1.25; color: var(--hq-dark); }
h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
p { margin: 0 0 14px 0; color: #8bb4c9; }
.subheadline { font-size: 18px; color: var(--hq-muted); margin-bottom: 18px; }
.note { font-size: 14px; color: var(--hq-muted); }

/* Desktop type scaling */
@media (min-width: 992px) {
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  .subheadline { font-size: 20px; }
}

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

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

section { padding: 40px 0; }

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

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

/* -----------------------------
   HEADER & NAVIGATION
------------------------------ */
header {
  position: sticky; top: 0; z-index: 1000;
  background-color: rgba(255,255,255,0.96);
  backdrop-filter: saturate(120%) blur(6px);
  box-shadow: 0 1px 0 rgba(13,46,63,0.08);
}
header .container {
  flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px;
}
.logo img { height: 42px; width: auto; }

.main-nav { display: none; align-items: center; gap: 18px; }
.main-nav a {
  color: var(--hq-text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background-color var(--transition);
}
.main-nav a:hover { background-color: var(--hq-accent); color: var(--hq-dark); }

.header-cta { display: none; align-items: center; gap: 10px; }

/* Hamburger */
.mobile-menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background-color: var(--hq-primary);
  color: var(--hq-white);
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition), transform var(--transition);
}
.mobile-menu-toggle:hover { background-color: #114055; transform: translateY(-1px); }

/* Desktop nav visibility */
@media (min-width: 992px) {
  .main-nav { display: flex; }
  .header-cta { display: flex; }
  .mobile-menu-toggle { display: none; }
}

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed; inset: 0; z-index: 2000;
  background-color: var(--hq-primary);
  color: var(--hq-white);
  display: flex; /* flex-only */
  flex-direction: column; justify-content: flex-start; align-items: stretch;
  padding: 20px; gap: 20px;
  transform: translateX(100%);
  transition: transform 320ms ease;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-close {
  align-self: flex-end; width: 40px; height: 40px; border-radius: 10px;
  color: var(--hq-primary); background-color: var(--hq-white);
}
.mobile-nav { display: flex; flex-direction: column; gap: 14px; }
.mobile-nav a {
  color: var(--hq-white);
  font-size: 18px; padding: 12px 10px; border-radius: 8px;
  transition: background-color var(--transition), transform var(--transition);
}
.mobile-nav a:hover { background-color: rgba(255,255,255,0.12); transform: translateX(4px); }

/* -----------------------------
   BUTTONS
------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 18px; border-radius: 12px; font-weight: bold;
  transition: background-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
  box-shadow: var(--shadow-sm);
}
.btn.primary {
  color: var(--hq-white);
  background-color: var(--hq-secondary); /* fallback */
  background-image: linear-gradient(135deg, #2F8C82 0%, #0D2E3F 100%);
}
.btn.primary:hover { filter: brightness(1.05); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn.secondary {
  color: var(--hq-secondary);
  background-color: var(--hq-accent);
  border: 2px solid rgba(47,140,130,0.25);
}
.btn.secondary:hover { background-color: #E9F1F6; border-color: rgba(47,140,130,0.45); transform: translateY(-2px); }

.cta-group { display: flex; flex-wrap: wrap; gap: 12px; }

/* -----------------------------
   HERO (gradient_modern)
------------------------------ */
.hero {
  color: var(--hq-white);
  background-color: var(--hq-primary); /* fallback */
  background-image: linear-gradient(160deg, #0D2E3F 0%, #2F8C82 100%);
}
.hero .container { gap: 10px; }
.hero .content-wrapper { padding: 20px 0; gap: 16px; }
.hero h1, .hero .subheadline, .hero p, .hero a { color: var(--hq-white); }
.hero .subheadline { opacity: 0.95; }
.trust-badges, .contact-snippet, .contact-short {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; opacity: 0.95;
}
.trust-badges img, .contact-snippet img, .contact-short img { width: 18px; height: 18px; }

/* -----------------------------
   GENERIC SECTIONS & CONTENT
------------------------------ */
/* Alternating subtle backgrounds for rhythm */
main section:nth-of-type(even) { background-color: var(--hq-accent); }

.text-section { display: flex; flex-direction: column; gap: 12px; }

ul li, ol li { margin-bottom: 8px; }
ul li { list-style: disc; }
ol { padding-left: 20px; }

.value-points { display: flex; flex-direction: column; gap: 8px; padding-left: 20px; }

/* Cards (generic) */
.card {
  background-color: var(--hq-white);
  border: 1px solid rgba(13,46,63,0.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.card:hover { box-shadow: var(--shadow-md); }

/* Testimonials - light background with dark text for contrast */
.testimonial-card {
  background-color: var(--hq-white);
  color: var(--hq-text);
  border: 1px solid rgba(13,46,63,0.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.testimonial-card p { margin: 0; }

/* Content wrappers inside sections should not overlap; spacing */
.content-grid { justify-content: space-between; }

/* -----------------------------
   FOOTER
------------------------------ */
footer {
  background-color: var(--hq-dark);
  color: var(--hq-white);
}
footer .container { padding: 32px 20px; }
footer .content-wrapper {
  display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start;
}
.footer-brand, .footer-contact, .footer-links, .footer-cta {
  display: flex; flex-direction: column; gap: 12px; flex: 1 1 240px;
}
.footer-links nav { display: flex; flex-direction: column; gap: 8px; }
footer a { color: #D9E7EE; }
footer a:hover { color: var(--hq-white); }
.footer-cta .btn.secondary { background-color: rgba(255,255,255,0.08); color: var(--hq-white); border-color: rgba(255,255,255,0.24); }
.footer-cta .btn.secondary:hover { background-color: rgba(255,255,255,0.16); }

/* -----------------------------
   FORMS / INPUTS (generic)
------------------------------ */
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(13,46,63,0.22); background-color: #fff; color: var(--hq-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus { border-color: var(--hq-secondary); box-shadow: 0 0 0 3px rgba(47,140,130,0.18); }
label { display: inline-flex; margin-bottom: 6px; color: var(--hq-dark); font-weight: bold; }

/* -----------------------------
   UTILITIES & MICRO-INTERACTIONS
------------------------------ */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.rounded { border-radius: var(--radius-md); }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-row { display: flex; flex-direction: row; }
.gap-20 { gap: 20px; }

/* Links underline animation */
a { position: relative; }
a:not(.btn):after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px;
  background-color: currentColor; transition: width var(--transition);
}
a:not(.btn):hover:after { width: 100%; }

/* -----------------------------
   RESPONSIVE
------------------------------ */
@media (min-width: 768px) {
  .container { gap: 24px; }
}

@media (min-width: 992px) {
  .content-wrapper { gap: 20px; }
}

/* -----------------------------
   COOKIE CONSENT BANNER & MODAL
------------------------------ */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3000;
  background-color: var(--hq-white);
  border-top: 1px solid rgba(13,46,63,0.12);
  box-shadow: 0 -6px 24px rgba(13,46,63,0.08);
  padding: 16px 20px;
  display: flex; /* flex-only */
  flex-direction: column; gap: 12px;
  transform: translateY(100%);
  transition: transform 320ms ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cookie-content { display: flex; flex-direction: column; gap: 10px; }
.cookie-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-buttons .btn { padding: 10px 14px; }
.cookie-buttons .btn.accept { background-color: var(--hq-secondary); color: var(--hq-white); background-image: linear-gradient(135deg, #2F8C82, #0D2E3F); }
.cookie-buttons .btn.reject { background-color: var(--hq-accent); color: var(--hq-secondary); border: 2px solid rgba(47,140,130,0.25); }
.cookie-buttons .btn.settings { background-color: #E9F1F6; color: var(--hq-text); }

/* Cookie Modal */
.cookie-modal {
  position: fixed; inset: 0; z-index: 4000;
  background-color: rgba(13,46,63,0.55);
  display: none; /* toggled with .open */
  align-items: center; justify-content: center; /* flex-only */
  padding: 20px;
}
.cookie-modal.open { display: flex; }
.cookie-modal-content {
  background-color: var(--hq-white);
  width: 100%; max-width: 720px; border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 16px; padding: 20px;
}
.cookie-modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid rgba(13,46,63,0.08); border-radius: 10px; }

/* Simple toggle (pure CSS look) */
.toggle {
  width: 46px; height: 26px; border-radius: 26px; background-color: #DDE7ED;
  position: relative; display: inline-flex; align-items: center; padding: 3px; transition: background-color var(--transition);
}
.toggle::after { content: ""; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transform: translateX(0); transition: transform var(--transition); }
.toggle.on { background-color: #2F8C82; }
.toggle.on::after { transform: translateX(20px); }

/* -----------------------------
   ACCESSIBILITY & PRINT
------------------------------ */
::selection { background: rgba(47,140,130,0.25); }
@media print {
  header, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  a:after { content: " (" attr(href) ")"; font-size: 12px; }
}

/* -----------------------------
   PAGE-SPECIFIC TWEAKS
------------------------------ */
/* Index: balance spacing in testimonial sections */
main .testimonial-card + .testimonial-card { margin-top: 12px; }

/* Kontakt: compact contact rows */
.contact-short, .contact-snippet { font-weight: 600; }

/* Footer spacing when cookie banner shown (optional utility) */
body.has-cookie-banner { padding-bottom: 90px; }

/* -----------------------------
   FLEX SAFEGUARDS & SPACING
------------------------------ */
/* Ensure no overlap and consistent gaps */
main .container { gap: 20px; }
main .content-wrapper > * { margin: 0; }
section .container .content-wrapper { padding: 0; }

/* Ensure adequate spacing between all content blocks */
section .content-wrapper > * + * { margin-top: 8px; }

/* -----------------------------
   HOVER/FOCUS STATES CONSISTENCY
------------------------------ */
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(47,140,130,0.25), var(--shadow-sm); }
.main-nav a:focus-visible { background-color: var(--hq-accent); }
.mobile-nav a:focus-visible { background-color: rgba(255,255,255,0.18); }

/* -----------------------------
   MODERN GRADIENT HEADERS INSIDE LIGHT SECTIONS
------------------------------ */
/* Subtle gradient underline for h2 */
h2 { position: relative; padding-bottom: 6px; }
h2:after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 56px; border-radius: 2px;
  background-color: var(--hq-secondary); /* fallback */
  background-image: linear-gradient(90deg, #2F8C82 0%, #0D2E3F 100%);
}

/* -----------------------------
   NAV WRAPPING ON TABLET
------------------------------ */
@media (min-width: 992px) and (max-width: 1180px) {
  .main-nav { flex-wrap: wrap; row-gap: 8px; }
}

/* -----------------------------
   ENSURE FLEX USAGE IN FOOTER NAVS
------------------------------ */
footer nav[aria-label] { display: flex; flex-direction: column; gap: 8px; }

/* -----------------------------
   PREVENT OVERLAPS AROUND HEADER
------------------------------ */
main { display: flex; flex-direction: column; gap: 0; }

/* -----------------------------
   VISUAL EMPHASIS BLOCKS
------------------------------ */
.emphasis {
  display: flex; flex-direction: column; gap: 10px; padding: 16px;
  border-radius: 12px; background-color: var(--hq-accent);
  border: 1px solid rgba(13,46,63,0.08);
}

/* -----------------------------
   ACCESSIBLE TESTIMONIAL CONTRAST
------------------------------ */
/* Dark text on light background enforced */
section .testimonial-card, .testimonial-card * { color: var(--hq-text); }

/* -----------------------------
   TRANSITIONS FOR SECTION APPEARANCE (subtle)
------------------------------ */
section { will-change: opacity, transform; }
section .content-wrapper { transition: transform 360ms ease, opacity 360ms ease; }

/* -----------------------------
   MISC SMALL ELEMENTS
------------------------------ */
.footer-contact img, .footer-links img, .footer-brand img,
.content-wrapper img[alt^="Telefon"], .content-wrapper img[alt^="Adresse"], .content-wrapper img[alt^="E-Mail"] {
  width: 18px; height: 18px; margin-right: 6px;
}

/* End of stylesheet */
