/* ===============================
   Famiglia in Equilibrio - style.css
   Vintage Retro theme • Flexbox-only • Mobile-first
   =============================== */

/* -------- CSS Reset & Normalize -------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding-left: 1.2rem; }
img { max-width: 100%; display: block; height: auto; }
a { text-decoration: none; color: inherit; }
button { font: inherit; cursor: pointer; background: transparent; border: 0; padding: 0; }
input, select, textarea { font: inherit; }
:focus { outline: 2px dashed rgba(30,77,122,0.6); outline-offset: 3px; }
::selection { background: #1E4D7A; color: #fff; }

/* -------- Theme Variables (with fallbacks) -------- */
:root {
  --brand-primary: #1E4D7A; /* ink blue */
  --brand-secondary: #2F7D5F; /* pine green */
  --brand-accent: #F5F7FA; /* light accent */

  --retro-cream: #F9F4EC; /* paper */
  --retro-paper: #FAF5E9; /* alt paper */
  --retro-ink: #2B2B2B; /* dark text */
  --retro-brown: #4B3D33; /* warm brown */
  --retro-orange: #C96A2B; /* vintage orange */
  --retro-gold: #C2A36B; /* muted gold */
  --retro-olive: #6C7A49; /* olive accent */

  --text-base: #3A2F2A; /* readable brown */
  --text-muted: #5E514B;
  --bg-base: #F9F4EC;
  --bg-contrast: #ffffff;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-soft: 0 2px 0 rgba(0,0,0,0.1), 0 6px 14px rgba(75,61,51,0.08);
  --shadow-lift: 0 6px 0 rgba(0,0,0,0.08), 0 12px 24px rgba(75,61,51,0.12);

  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
}

/* -------- Base Typography -------- */
html { font-size: 16px; }
body {
  min-height: 100vh;
  background: var(--bg-base, #FAF5E9);
  color: var(--text-base, #3A2F2A);
  font-family: Arial, Helvetica, sans-serif; /* brand body */
  line-height: 1.6;
  display: flex; flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, 'Times New Roman', serif; /* brand display, vintage serif */
  color: var(--retro-ink, #2B2B2B);
}

h1 { font-size: 2rem; line-height: 1.2; margin-bottom: var(--space-16); }
h2 { font-size: 1.75rem; line-height: 1.25; margin-bottom: var(--space-16); }
h3 { font-size: 1.25rem; line-height: 1.3; margin-bottom: var(--space-12); }

p { margin-bottom: var(--space-12); }
small, .meta { color: var(--text-muted); font-size: 0.9375rem; }
.subheadline { color: var(--text-muted); font-size: 1.0625rem; }

/* Vintage accents */
hr { border: 0; height: 1px; background: #D8C9B5; margin: var(--space-24) 0; }

/* -------- Containers & Layout (Flex-only) -------- */
.container {
  width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--space-16);
  display: flex; flex-direction: column; align-items: stretch; gap: var(--space-24);
}
.content-wrapper { display: flex; flex-direction: column; gap: var(--space-24); }

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

/* -------- Header -------- */
.site-header {
  background: var(--retro-paper);
  border-bottom: 3px solid var(--retro-gold);
  position: sticky; top: 0; z-index: 50;
}
.site-header .content-wrapper {
  flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-16);
}
.logo { display: flex; align-items: center; }
.logo img { height: 42px; width: auto; }

.main-nav { display: none; align-items: center; gap: var(--space-16); flex-wrap: wrap; }
.main-nav a {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--retro-ink);
}
.main-nav a[aria-current="page"] { background: #EAE1D3; border: 1.5px solid #D2BE98; }

.header-cta { display: none; align-items: center; gap: var(--space-12); flex-wrap: wrap; }

/* Mobile menu button */
.mobile-menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--brand-primary); color: #fff;
  box-shadow: var(--shadow-soft);
}
.mobile-menu-toggle:hover { filter: brightness(0.95); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed; inset: 0; background: var(--retro-cream);
  display: flex; flex-direction: column; padding: var(--space-24);
  transform: translateX(100%); transition: transform 0.35s ease; z-index: 100;
  border-left: 4px solid var(--retro-gold);
}
.mobile-menu[aria-hidden="false"] { transform: translateX(0); }
.mobile-menu-close {
  align-self: flex-end; width: 40px; height: 40px; border-radius: 8px;
  background: #E1D7C6; color: var(--retro-ink);
}
.mobile-nav { display: flex; flex-direction: column; gap: 14px; margin-top: var(--space-16); }
.mobile-nav a {
  padding: 12px 14px; border: 1.5px solid #D2BE98; border-radius: var(--radius-sm);
  background: #fff; color: var(--retro-brown);
}
.mobile-nav a[aria-current="page"] { background: #F1E7D7; border-color: var(--retro-gold); }

/* -------- Buttons -------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 18px; border-radius: 10px; border: 2px solid transparent;
  font-weight: 700; letter-spacing: 0.2px; transition: transform 0.1s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-soft);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--brand-primary); color: #fff; border-color: #143554;
}
.btn-primary:hover { background: #174063; }

.btn-secondary {
  background: var(--brand-secondary); color: #fff; border-color: #205845;
}
.btn-secondary:hover { background: #296E55; }

.btn-link {
  background: transparent; color: var(--brand-primary); border-color: transparent;
  text-decoration: underline; text-underline-offset: 3px;
}
.btn-link:hover { color: #143554; }

/* CTA rows */
.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-12); align-items: center; }

/* -------- Hero Sections -------- */
.hero {
  background: var(--brand-accent);
  border: 3px solid var(--retro-gold);
  border-radius: var(--radius-lg);
  padding: var(--space-32) var(--space-20);
  box-shadow: var(--shadow-soft);
}
.hero h1 { font-size: 2rem; }
.hero .subheadline { max-width: 70ch; }

/* Brand intro (home) */
.brand-intro { display: flex; align-items: center; gap: var(--space-12); flex-wrap: wrap; }
.tagline { color: var(--text-muted); font-style: italic; }

/* Trust badges */
.trust-badges ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-12); padding-left: 0; }
.trust-badges li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff; border: 1.5px solid #E0D2BD; border-radius: 8px; }
.trust-badges img { width: 18px; height: 18px; }

/* -------- Feature / Card Grids -------- */
.feature-grid, .service-cards, .article-previews, .tool-cards, .package-cards, .cta-cards {
  display: flex; flex-wrap: wrap; gap: var(--space-20);
}

.feature-card, .service-card, .article-card, .tool-card, .package-card, .cta-card {
  flex: 1 1 100%;
  background: #fff; border: 2px solid #E0D2BD; border-radius: var(--radius-md);
  padding: var(--space-20); box-shadow: var(--shadow-soft);
}

/* Subtle vintage top stripe */
.feature-card::before, .service-card::before, .article-card::before, .tool-card::before, .package-card::before, .cta-card::before {
  content: ""; display: block; height: 6px; width: 100%; border-top-left-radius: var(--radius-md); border-top-right-radius: var(--radius-md);
  background: var(--retro-orange);
  margin: -20px -20px 12px -20px;
}

/* Lists */
.icon-list, .benefit-list, .values-list, .best-practices, .impact-metrics ul, .before-after ul, .contact-info, .timeline ul, .team-roles ul, .certifications ul, .faq-list ul, .download-teaser ul, .integration-options ul {
  list-style: none; padding-left: 0; display: flex; flex-direction: column; gap: 10px;
}
.icon-list li, .contact-info li, .before-after li { display: flex; align-items: center; gap: 10px; }
.icon-list img, .contact-info img { width: 18px; height: 18px; }

/* Ordered lists (how it works / steps) */
ol { display: flex; flex-direction: column; gap: 8px; padding-left: 1.2rem; }

/* Stats */
.stat-bars { display: flex; flex-wrap: wrap; gap: var(--space-16); }
.stat { flex: 1 1 100%; background: #fff; border: 2px dashed #D8C9B5; border-radius: var(--radius-md); padding: var(--space-16); }
.stat strong { color: var(--brand-primary); }

/* Case highlights */
.case-highlights ul { display: flex; flex-direction: column; gap: 8px; }

/* Article meta */
.article-card .meta { margin-top: 8px; font-style: italic; }

/* Comparisons / simple tables as lists */
.comparison-table ul, .legal-basis-table ul, .cookie-table ul, .retention-table, .footer-legal, .footer-menu { display: flex; flex-direction: column; gap: 8px; }

/* Reader stars & ratings */
.rating-summary, .reader-stars { display: flex; align-items: center; gap: 8px; }
.rating-summary img, .reader-stars img { width: 18px; height: 18px; }

/* -------- Testimonials (light background for readability) -------- */
.testimonial-slider { display: flex; gap: var(--space-16); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.testimonial-slider .testimonial-card { scroll-snap-align: start; }

.testimonial-card {
  background: var(--bg-contrast, #fff);
  border: 2px solid #E0D2BD;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}
.testimonial-card p { color: var(--retro-ink); }
.testimonial-card .author { color: var(--text-muted); font-weight: 700; }

/* Ensure dark text on light bg in all testimonial sections */
.testimonials, .home-testimonials, .readers, .tools-results, .press, .consulting {
  background: transparent;
}
.testimonials .testimonial-card, .readers .testimonial-card, .tools-results .testimonial-card, .press .testimonial-card, .consulting .testimonial-card {
  background: #ffffff; color: #1F1B16;
}

/* -------- Details / FAQ -------- */
details { border: 2px solid #E0D2BD; border-radius: var(--radius-md); background: #fff; padding: 10px 14px; }
summary { cursor: pointer; font-weight: 700; color: var(--brand-primary); }
details[open] { box-shadow: var(--shadow-soft); }
details .text-section { margin-top: 8px; color: var(--text-base); }

/* -------- Footer -------- */
.site-footer {
  margin-top: auto; background: #EFE6D8; border-top: 3px solid var(--retro-gold);
}
.site-footer .content-wrapper { flex-direction: column; gap: var(--space-24); }
.footer-navigation { display: flex; flex-wrap: wrap; gap: var(--space-24); }
.footer-menu h3, .footer-legal h3, .footer-contact h3, .newsletter h3, .social-links h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--retro-brown); }
.footer-bottom { display: flex; align-items: center; justify-content: center; padding: 10px 0; color: var(--text-muted); }
.footer-navigation a { color: var(--retro-ink); padding: 4px 0; }
.footer-navigation a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Footer brand block (home) */
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-brand img { width: 42px; height: auto; }

/* -------- Page-specific Tweaks -------- */
.search-teaser, .progress-tracker, .video-tutorial-links, .download-list, .versioning-notes, .map-info, .policy-note, .version-history, .request-instructions, .download-pdf, .secondary-note {
  background: #fff; border: 2px solid #E0D2BD; border-radius: var(--radius-md); padding: 12px 14px; box-shadow: var(--shadow-soft);
}

.category-filters ul { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding-left: 0; }
.category-filters li { padding: 8px 12px; border: 1.5px solid #D2BE98; border-radius: 30px; background: #FFFDF8; }

/* Banners */
.cta-banner { display: flex; align-items: center; justify-content: center; padding: 16px; background: #FFF6EA; border: 2px solid #E8D6B8; border-radius: var(--radius-md); }

/* How it works / Process steps */
.how-it-works, .process-steps { display: flex; flex-direction: column; gap: 8px; }
.process-steps { padding-left: 1.2rem; }

/* Principles grid / approach */
.principles-grid { display: flex; flex-wrap: wrap; gap: var(--space-16); }
.principle { flex: 1 1 100%; background: #fff; border: 2px solid #E0D2BD; border-radius: var(--radius-md); padding: var(--space-16); box-shadow: var(--shadow-soft); }
.principle::before { content: ""; display: block; height: 6px; background: var(--brand-secondary); margin: -16px -16px 10px -16px; border-top-left-radius: var(--radius-md); border-top-right-radius: var(--radius-md); }

/* Footer social */
.social-links ul { list-style: none; display: flex; flex-direction: column; gap: 6px; padding-left: 0; }
.social-links li { display: flex; align-items: center; gap: 8px; }
.social-links img { width: 18px; height: 18px; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; color: var(--text-muted); }

/* Rating / stars blocks */
.reader-stars span, .rating-summary span { font-weight: 700; color: var(--retro-brown); }

/* Guarantee block */
.guarantee { display: flex; align-items: center; gap: 10px; background: #FFF6EA; border: 2px solid #E8D6B8; border-radius: var(--radius-md); padding: 10px 12px; }
.guarantee img { width: 20px; height: 20px; }

/* Newsletter blocks */
.newsletter { display: flex; flex-direction: column; gap: 8px; }

/* Hero variants keep consistent look */
.home-hero, .guides-hero, .tools-hero, .consulting-hero, .about-hero, .contact-hero, .privacy-hero, .gdpr-hero, .cookie-hero, .terms-hero, .thankyou-hero {
  background: #FFFDF8; /* warm light */
}

/* Links inside text blocks */
.text-section a { color: var(--brand-primary); text-decoration: underline; text-underline-offset: 3px; }
.text-section a:hover { color: #143554; }

/* -------- Forms / Toggles (for cookie modal) -------- */
.toggle { position: relative; width: 46px; height: 26px; border-radius: 26px; background: #D9D1C6; border: 2px solid #BFAA8D; transition: background 0.2s ease; }
.toggle::after { content: ""; position: absolute; top: 50%; left: 4px; transform: translateY(-50%); width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: left 0.2s ease; }
.toggle.is-on { background: var(--brand-secondary); }
.toggle.is-on::after { left: 22px; }

/* -------- Cookie Consent (banner + modal) -------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
  display: flex; flex-direction: column; gap: var(--space-16);
  background: #fff; color: var(--retro-ink);
  border-top: 3px solid var(--retro-gold);
  padding: var(--space-16);
  box-shadow: 0 -10px 24px rgba(0,0,0,0.08);
}
.cookie-banner .cookie-content { display: flex; flex-direction: column; gap: var(--space-12); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: var(--space-12); }
.cookie-actions .btn { box-shadow: none; }
.cookie-actions .btn-accept { background: var(--brand-secondary); color: #fff; border-color: #205845; }
.cookie-actions .btn-reject { background: #EDE3D4; color: #3B312B; border: 2px solid #D2BE98; }
.cookie-actions .btn-settings { background: var(--brand-primary); color: #fff; border-color: #143554; }

.cookie-modal {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 10000;
  background: rgba(0,0,0,0.45);
}
.cookie-modal.open { display: flex; }
.cookie-modal-content {
  width: 92%; max-width: 680px; background: #FFFDF8; border: 3px solid var(--retro-gold);
  border-radius: var(--radius-lg); padding: var(--space-24); box-shadow: var(--shadow-lift);
  display: flex; flex-direction: column; gap: var(--space-16);
}
.cookie-categories { display: flex; flex-direction: column; gap: var(--space-12); }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); background: #fff; border: 2px solid #E0D2BD; border-radius: var(--radius-md); padding: 10px 12px; }
.cookie-category .label { display: flex; flex-direction: column; }
.cookie-modal-actions { display: flex; flex-wrap: wrap; gap: var(--space-12); justify-content: flex-end; }

/* -------- Utilities -------- */
.text-center { text-align: center; }
.muted { color: var(--text-muted); }
.hidden { display: none !important; }
.maxw-70 { max-width: 70ch; }

/* -------- Accessibility helpers -------- */
a:hover, button:hover { filter: none; }
a:focus, button:focus { outline-style: dashed; }

/* -------- Responsive (Mobile-first) -------- */
@media (min-width: 600px) {
  .feature-card, .service-card, .article-card, .tool-card, .package-card, .cta-card { flex: 1 1 calc(50% - 10px); }
  .principle { flex: 1 1 calc(50% - 10px); }
  .stat { flex: 1 1 calc(50% - 10px); }
}

@media (min-width: 768px) {
  /* Header: show desktop nav */
  .main-nav { display: flex; }
  .header-cta { display: flex; }
  .mobile-menu-toggle { display: none; }

  .content-wrapper { gap: var(--space-32); }
  .hero h1 { font-size: 2.25rem; }

  .feature-card, .service-card, .article-card, .tool-card, .package-card, .cta-card { flex: 1 1 calc(50% - 10px); }
  .stat { flex: 1 1 calc(33.333% - 12px); }
  .principle { flex: 1 1 calc(25% - 12px); }

  .text-image-section { flex-direction: row; }
}

@media (min-width: 992px) {
  .hero h1 { font-size: 2.5rem; }
  .feature-card, .service-card, .article-card, .tool-card, .package-card, .cta-card { flex: 1 1 calc(33.333% - 14px); }
}

/* -------- Interactive micro-interactions -------- */
.feature-card:hover, .service-card:hover, .article-card:hover, .tool-card:hover, .package-card:hover, .cta-card:hover, .principle:hover {
  transform: translateY(-2px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-lift);
}

/* -------- Page element specifics by selector presence -------- */
/* Guides page */
.articles-list .article-previews { align-items: stretch; }

/* Tools page */
.best-practices li::marker { color: var(--brand-secondary); }

/* Consulting page */
.package-cards .package-card strong { color: var(--brand-primary); }

/* About page */
.timeline ul { display: flex; flex-direction: column; gap: 6px; border-left: 3px dashed #D2BE98; padding-left: 10px; }

/* Contact page */
.contact-details .text-section { max-width: 70ch; }

/* Legal pages */
.last-updated { color: var(--text-muted); font-style: italic; }
.user-obligations ul { display: flex; flex-direction: column; gap: 6px; }
.policy-sections { display: flex; flex-direction: column; gap: 10px; }

/* Footer alignment for multi-page consistency */
.footer-navigation { justify-content: space-between; }
.footer-navigation > div { flex: 1 1 220px; }

/* -------- Alignment helpers for given classes in HTML -------- */
.features .content-wrapper,
.services .content-wrapper,
.results .content-wrapper,
.testimonials .content-wrapper,
.about .content-wrapper,
.contact .content-wrapper,
.our-story .content-wrapper,
.approach .content-wrapper,
.team-skills .content-wrapper,
.readers .content-wrapper,
.tools-results .content-wrapper,
.keep-in-touch .content-wrapper,
.support .content-wrapper,
.booking .content-wrapper,
.faq .content-wrapper,
.rights-process .content-wrapper,
.legal-basis .content-wrapper,
.exercise-rights .content-wrapper {
  display: flex; flex-direction: column; gap: var(--space-24);
}

/* -------- Accessibility color contrast for testimonials/reviews -------- */
.home-testimonials, .readers, .tools-results, .press, .consulting { color: #1A1410; }
.home-testimonials .author, .readers .author, .tools-results .author, .press .author, .consulting .author { color: #3F352E; }

/* -------- Mandatory spacing between cards/sections -------- */
section { margin-bottom: var(--space-48); }
section .feature-card, section .service-card, section .article-card, section .tool-card, section .package-card, section .cta-card { margin-bottom: var(--space-20); }

/* -------- Links highlighting current page -------- */
nav a[aria-current="page"] { font-weight: 700; }

/* -------- Header CTA spacing safety -------- */
.header-cta .btn { min-height: 40px; }

/* -------- Return home link style -------- */
.return-home .btn-link { color: var(--retro-orange); }
.return-home .btn-link:hover { color: #A9551F; }

/* -------- Map/info blocks -------- */
.map-info { color: var(--text-muted); }

/* -------- Rating badges safe contrast -------- */
.rating-summary, .reader-stars { color: #221C17; }

/* -------- Prevent overlap & ensure spacing -------- */
section > .container > .content-wrapper > * + * { margin-top: 0; }

/* -------- Mobile menu slide animations (flex-only container) -------- */
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideOutRight { from { transform: translateX(0); } to { transform: translateX(100%); } }

/* -------- End of file -------- */
