/* Casa Crisalide — stylesheet */

:root {
  --color-bg: #eaf6f4;
  --color-bg-alt: #ddf0ec;
  --color-bg-sky: #eaf6f4;
  --color-text: #244752;
  --color-text-soft: #5f7d85;
  --color-primary: #14b8d4;
  --color-primary-dark: #0f96ae;
  --color-secondary: #3ecfa8;
  --color-secondary-dark: #2caf8c;
  --color-whatsapp: #2fb96f;
  --color-whatsapp-dark: #259a5a;
  --color-border: #dbf1f4;
  --color-white: #ffffff;
  --color-footer: #123b47;
  --radius: 18px;
  --max-width: 1120px;
  --shadow: 0 6px 22px rgba(20, 90, 105, 0.08);
  --font-base: "Nunito", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  font-size: 17px;
  padding-bottom: 68px; /* space for sticky mobile call bar */
}

img { max-width: 100%; display: block; }

a { color: var(--color-primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-base);
  font-weight: 800;
  line-height: 1.28;
  color: var(--color-text);
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.85rem, 5vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 3.5vw, 1.9rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 52px 0;
}

.section-alt {
  background: transparent;
}

.section-header {
  max-width: 720px;
  margin: 0 auto 2rem;
  text-align: center;
}

.section-header p { color: var(--color-text-soft); }

/* Header / Nav — always visible, no dropdown */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo-img {
  height: 38px;
  width: auto;
  display: block;
}
@media (min-width: 900px) {
  .logo-img { height: 48px; }
}

.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}
.header-phone:hover { background: var(--color-primary-dark); color: var(--color-white); text-decoration: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-actions .social-icon {
  width: 36px;
  height: 36px;
  background: var(--color-bg-alt);
  color: var(--color-primary-dark);
}
.header-actions .social-icon:hover { background: var(--color-border); }

.main-nav {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
}

.main-nav ul {
  max-width: var(--max-width);
  margin: 0 auto;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 4px;
  padding: 8px 10px;
}

.main-nav a {
  display: inline-block;
  color: var(--color-text);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 7px 11px;
  border-radius: 999px;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
}

@media (min-width: 560px) {
  .main-nav a { font-size: 0.9rem; padding: 8px 14px; }
}

@media (min-width: 900px) {
  .header-top { padding: 18px 20px; }
  .logo { font-size: 1.5rem; }
  .header-phone { font-size: 1rem; padding: 11px 20px; }
  body { padding-bottom: 0; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.02rem;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
}
.btn:hover { text-decoration: none; }

.btn-call {
  background: var(--color-primary);
  color: var(--color-white);
}
.btn-call:hover { background: var(--color-primary-dark); color: var(--color-white); }

.btn-whatsapp {
  background: var(--color-whatsapp);
  color: var(--color-white);
}
.btn-whatsapp:hover { background: var(--color-whatsapp-dark); color: var(--color-white); }

.btn-outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}
.btn-outline:hover { background: var(--color-primary); color: var(--color-white); }

.btn-secondary {
  background: var(--color-secondary);
  color: var(--color-white);
}
.btn-secondary:hover { background: var(--color-secondary-dark); color: var(--color-white); }

.btn-block { width: 100%; }

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 1.6rem;
}
.hero .cta-group { justify-content: flex-start; }

/* Hero — spacing kept tight so title/subtitle/CTA stay as close to the fold
   as possible; the Home hero in particular has more content (longer copy +
   two stacked CTA buttons on narrow screens) than Servizi/Struttura, so every
   bit of reclaimed vertical space here matters. */
.hero {
  padding: 22px 0 16px;
}

.hero h1 {
  margin-bottom: 0.35em;
}

.hero-inner {
  max-width: 780px;
}

.hero .subtitle {
  font-size: 1.12rem;
  color: var(--color-text-soft);
  max-width: 640px;
  margin-bottom: 0.7em;
}

.hero .cta-group {
  margin-top: 0.9rem;
  gap: 10px;
}

/* Full-width hero photo, image on top, text flows right below — no card, no split columns.
   Kept short on purpose so title/subtitle/CTA stay visible without scrolling.
   Three height tiers (mobile/tablet/desktop); object-position is tuned per
   image inline on the <img> itself, wherever the default center crop would
   cut a face — see index.html / servizi/index.html / la-struttura/index.html. */
.hero-photo {
  width: 100%;
  height: auto;
  max-height: 215px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: block;
  margin-bottom: 0.8rem;
}
@media (min-width: 700px) {
  .hero-photo { max-height: 260px; }
}
@media (min-width: 900px) {
  .hero-photo { max-height: 320px; }
}

/* Trust bar */
.trust-bar {
  margin: 8px 0 4px;
}
.trust-bar ul {
  list-style: none;
  margin: 0;
  padding: 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--color-primary-dark);
}

/* Cards / grids */
.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.service-list li {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-weight: 700;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.service-list li::before {
  content: "✓";
  color: var(--color-secondary-dark);
  font-weight: 900;
}
.service-list.detailed li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  font-weight: 800;
}
.service-list.detailed li::before {
  content: none;
}
.service-icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-dark);
}
.service-icon svg {
  width: 26px;
  height: 26px;
}
.service-text { flex: 1 1 auto; }
.service-list.detailed li span {
  display: block;
  font-weight: 400;
  color: var(--color-text-soft);
  margin-top: 6px;
}

.photo-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
  margin-top: 1.4rem;
}
.photo-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@media (min-width: 700px) {
  .photo-grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Zone servita tags */
.zone-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1.2rem;
}
.zone-tags span {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

/* Map */
.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  margin-top: 1.2rem;
}
.map-wrap iframe { width: 100%; height: 340px; border: 0; display: block; }

/* Emphasized inline note (e.g. "ogni situazione è diversa") */
.lead-note {
  font-style: italic;
  font-weight: 600;
  color: var(--color-primary-dark);
  font-size: 1.08rem;
}

/* Family names section */
.family-block {
  text-align: center;
}
.family-block p {
  font-size: 1.15rem;
  font-weight: 700;
}

/* Final band — flows on the same page background, no card, no color block */
.final-band {
  padding: 8px 0 64px;
}
.final-band .container {
  max-width: 720px;
  text-align: center;
}
.final-band .cta-group { justify-content: center; }
.final-band .lead {
  max-width: 560px;
  margin: 0 auto 1.8rem;
  font-size: 1.05rem;
  color: var(--color-text-soft);
}
.final-band .meta {
  margin-top: 18px;
  font-size: 0.95rem;
  color: var(--color-text-soft);
}

/* Forms */
.form-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.form-field {
  margin-bottom: 18px;
}
.form-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--color-bg-alt);
}
.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}
.form-field textarea { min-height: 110px; resize: vertical; }

.form-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 20px;
  font-size: 0.95rem;
  color: var(--color-text-soft);
}
.form-check input { margin-top: 4px; }

.form-note {
  font-size: 0.85rem;
  color: var(--color-text-soft);
  margin-top: 10px;
}

/* Contact blocks */
.contact-block {
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-white);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.contact-block h2 { margin-bottom: 0.5em; }

/* Blog */
.post-list {
  display: grid;
  gap: 20px;
}
.post-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.post-card .category {
  display: inline-block;
  background: var(--color-bg-alt);
  color: var(--color-secondary-dark);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.post-card h2 { font-size: 1.3rem; margin-bottom: 0.4em; }
.post-card a.title-link { color: var(--color-text); }
.post-card a.title-link:hover { color: var(--color-primary-dark); }

article.post-body h2 { margin-top: 1.6em; }
article.post-body p { color: var(--color-text); }
.post-meta {
  color: var(--color-text-soft);
  font-size: 0.9rem;
  margin-bottom: 1.6rem;
}
.post-cta {
  margin-top: 2.8rem;
  padding-top: 8px;
  text-align: center;
}

/* Footer */
.site-footer {
  background: var(--color-footer);
  color: #d9f2ee;
  padding: 44px 0 24px;
  margin-top: 40px;
}
.site-footer a { color: #d9f2ee; text-decoration: underline; }
.footer-inner {
  display: grid;
  gap: 24px;
}
@media (min-width: 700px) {
  .footer-inner { grid-template-columns: 2fr 1fr; }
}
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  text-decoration: none !important;
}
.social-icon svg { width: 19px; height: 19px; }
.social-icon:hover { background: rgba(255,255,255,0.24); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  margin-top: 28px;
  padding-top: 18px;
  font-size: 0.85rem;
  color: #8fbdb6;
}

/* Sticky mobile call bar */
.sticky-call {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--color-primary);
  display: flex;
  box-shadow: 0 -4px 14px rgba(0,0,0,0.12);
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
/* Hidden whenever a page CTA (or the footer) is already visible in the viewport —
   toggled by IntersectionObserver in main.js, not by scroll position. */
.sticky-call.is-hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}
.sticky-call a {
  flex: 1;
  color: var(--color-white);
  text-align: center;
  padding: 14px 10px;
  font-weight: 700;
  font-size: 1rem;
}
.sticky-call a:hover { text-decoration: none; }
.sticky-call .sticky-whatsapp { background: var(--color-whatsapp); }

@media (min-width: 900px) {
  .sticky-call { display: none; }
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: var(--color-footer);
  color: var(--color-white);
  padding: 18px 20px;
  display: none;
}
.cookie-banner.visible { display: block; }
.cookie-banner .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; flex: 1 1 320px; }
.cookie-banner p a { color: #a6ecdf; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-actions button {
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  border: 2px solid var(--color-white);
  cursor: pointer;
  font-size: 0.9rem;
}
.cookie-accept { background: var(--color-white); color: var(--color-footer); }
.cookie-decline { background: transparent; color: var(--color-white); }

/* Legal pages */
.legal-content h2 { margin-top: 1.8em; }
.legal-content ul { padding-left: 1.2em; }

/* Utility */
.text-center { text-align: center; }
.mt-lg { margin-top: 2.5rem; }
