/* DomusRa Rosa — design system */
:root {
  --rose: #ea899a;
  --rose-deep: #B83D55;
  --rose-deeper: #8E2F42;
  --rose-soft: #F6C9D2;
  --cream: #FFF8F5;
  --ivory: #FFF1EC;
  --card: #FFFFFF;
  --ink: #2A1F22;
  --ink-soft: #5A4549;
  --ink-muted: #6E565B;
  --footer: #4A232C;
  --line: rgba(42, 31, 34, 0.10);
  --shadow: 0 10px 30px rgba(74, 35, 44, 0.08);
  --shadow-hover: 0 16px 40px rgba(74, 35, 44, 0.12);
  --radius: 1rem;
  --radius-sm: 0.75rem;
  --font-sans: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.font-serif {
  font-family: var(--font-serif);
  letter-spacing: -0.02em;
  font-weight: 550;
}

/* Sticky header */
#header {
  background: rgba(255, 248, 245, 0.88) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line) !important;
  transition: box-shadow .25s ease, background .25s ease;
}
#header.header-scrolled {
  box-shadow: 0 8px 24px rgba(74, 35, 44, 0.08);
  background: rgba(255, 248, 245, 0.96) !important;
}
#mobile-menu {
  background: var(--cream) !important;
  border-top: 1px solid var(--line) !important;
}
nav a {
  color: var(--ink-soft);
  transition: color .15s ease, opacity .15s ease;
}
nav a:hover { color: var(--rose-deep); opacity: 1; }
nav a.nav-active,
nav a.text-gold-600 {
  color: var(--rose-deep) !important;
  border-bottom-color: var(--rose-deep) !important;
}

/* Buttons */
.btn-gold,
.btn-primary {
  background: var(--rose-deep) !important;
  color: #fff !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 20px rgba(184, 61, 85, 0.25) !important;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}
.btn-gold:hover,
.btn-primary:hover {
  background: var(--rose-deeper) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 12px 26px rgba(142, 47, 66, 0.28) !important;
  opacity: 1 !important;
}
.btn-secondary {
  background: transparent !important;
  color: var(--ink) !important;
  border: 1.5px solid rgba(42, 31, 34, 0.22) !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  transition: background .15s ease, border-color .15s ease, transform .15s ease !important;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.45) !important;
  border-color: var(--rose-deep) !important;
  color: var(--rose-deep) !important;
  transform: translateY(-1px);
}

/* Cards */
.card-elegant,
.service-card,
.surface-card {
  background: var(--card) !important;
  border: 1px solid rgba(42, 31, 34, 0.06) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  transition: transform .2s ease, box-shadow .2s ease !important;
}
.card-elegant:hover,
.service-card:hover,
.surface-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: var(--shadow-hover) !important;
  opacity: 1 !important;
}
.card-icon {
  background: var(--ivory) !important;
  border: 1px solid rgba(184, 61, 85, 0.15) !important;
  color: var(--rose-deep) !important;
}

/* Surfaces */
.band-rose { background: var(--rose) !important; color: var(--ink) !important; }
.band-cream { background: var(--cream) !important; color: var(--ink) !important; }
.band-ivory { background: var(--ivory) !important; color: var(--ink) !important; }
.band-soft { background: var(--rose-soft) !important; color: var(--ink) !important; }
.band-deep { background: var(--footer) !important; color: #FFF8F5 !important; }

.eyebrow {
  color: var(--rose-deep) !important;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

/* Forms */
.form-input, select, textarea, input[type="text"], input[type="email"], input[type="tel"] {
  border-radius: 0.75rem !important;
  border-color: rgba(42,31,34,0.14) !important;
  background: #fff !important;
  color: var(--ink) !important;
}
.form-input:focus, select:focus, textarea:focus, input:focus {
  outline: none !important;
  border-color: var(--rose-deep) !important;
  box-shadow: 0 0 0 3px rgba(184, 61, 85, 0.18) !important;
}

/* Footer */
footer {
  background: var(--footer) !important;
  color: rgba(255, 248, 245, 0.78) !important;
}
footer h4 { color: #fff !important; }
footer a { color: rgba(255, 248, 245, 0.78); }
footer a:hover { color: var(--rose-soft) !important; }
footer .text-gold-400 { color: var(--rose-soft) !important; }
footer .border-charcoal-800 { border-color: rgba(255,248,245,0.12) !important; }
footer .text-charcoal-400,
footer .text-charcoal-500 { color: rgba(255,248,245,0.55) !important; }

.fade-in { animation: fadeUp .7s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

[dir="rtl"] body { font-family: "Noto Sans Arabic", var(--font-sans); }
[dir="rtl"] .font-serif { font-family: "Noto Sans Arabic", var(--font-serif); }
[dir="rtl"] .space-x-10 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 1; }
[dir="rtl"] .space-x-6 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 1; }
[dir="rtl"] .space-x-3 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 1; }

@media (max-width: 640px) {
  .font-serif { letter-spacing: -0.015em; }
}

/* Hero on rose: stronger hierarchy */
.band-rose h1,
.band-rose h2,
.band-rose h3 { color: var(--ink); }
.band-rose p { color: var(--ink); }
.band-rose .eyebrow { color: var(--rose-deeper) !important; }

.band-deep p { color: rgba(255,248,245,0.82) !important; }
.band-deep h2, .band-deep h3 { color: #fff !important; }

.band-soft h2 { color: var(--ink); }

/* Service cards on cream/ivory */
.service-card h3 { color: var(--ink); }
.service-card p { color: var(--ink-soft); }
.service-card .card-icon svg { color: var(--rose-deep); }

/* Header logo breathing room */
#header img { border-radius: 0.5rem; }

/* Better vertical rhythm on mobile */
@media (max-width: 640px) {
  .band-rose, .band-cream, .band-ivory, .band-soft, .band-deep {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Contact office badges */
.bg-rose-soft { background: var(--rose-soft) !important; }
.bg-cream-ivory { background: var(--ivory) !important; }
.text-rose-deep { color: var(--rose-deep) !important; }
.text-rose-deeper { color: var(--rose-deeper) !important; }


}

/* Sedi dark map (Leaflet + CartoDB Dark Matter) */
.sedi-map-shell {
  overflow: hidden;
  background: #0b0b0b;
  background: #141414;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.06);
}
#sedi-map {
  width: 100%;
  height: 420px;
  background: #0b0b0b;
}
@media (min-width: 1024px) {
  #sedi-map { height: 520px; }
}
.sedi-map-shell .leaflet-container {
  background: #0b0b0b;
  font-family: var(--font-sans);
}
.sedi-map-shell .leaflet-control-attribution {
  background: rgba(0,0,0,0.55) !important;
  color: #9a9a9a;
  font-size: 10px;
}
.sedi-map-shell .leaflet-control-attribution a { color: #c9c9c9; }
.sedi-map-shell .leaflet-bar a {
  background: #1c1c1c;
  color: #f5f5f5;
  border-bottom-color: #333;
}
.sedi-map-shell .leaflet-bar a:hover { background: #2a2a2a; }
.sedi-marker { background: transparent; border: 0; }
.sedi-marker-dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #B83D55;
  border: 2px solid #FFF8F5;
  box-shadow: 0 0 0 3px rgba(184,61,85,0.35), 0 4px 12px rgba(0,0,0,0.45);
}
.sedi-marker.is-upcoming .sedi-marker-dot {
  background: #F6C9D2;
  border-color: #B83D55;
  box-shadow: 0 0 0 3px rgba(246,201,210,0.25), 0 4px 12px rgba(0,0,0,0.45);
}
.sedi-map-shell .leaflet-popup-content-wrapper {
  background: #1a1416;
  color: #FFF8F5;
  border-radius: 0.75rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}
.sedi-map-shell .leaflet-popup-tip { background: #1a1416; }
.sedi-map-shell .leaflet-popup-content { margin: 10px 12px; font-size: 13px; line-height: 1.4; }
.sedi-map-shell .leaflet-popup-content strong { color: #F6C9D2; font-family: var(--font-serif); }
.sedi-map-shell .leaflet-popup-content em { color: #ea899a; font-style: normal; font-size: 12px; }

/* Dark OSM fallback (invert tiles) */
#sedi-map.is-inverted-tiles .leaflet-tile-pane,
#sedi-map .sedi-tiles-invert {
  filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.95) saturate(0.35);
}
#sedi-map.is-inverted-tiles .sedi-marker-dot {
  filter: invert(1) hue-rotate(180deg); /* keep marker colors readable after parent invert? markers are outside tile pane */
}




/* Brand wordmark — single clean string, no wrap/ligatures (avoid misread spacing/ligatures) */
.brand-lockup { text-decoration: none; align-items: center; gap: 0.65rem; }
.brand-wordmark {
  font-family: var(--font-serif);
  color: var(--ink);
  font-weight: 600;
  font-size: clamp(0.78rem, 0.7rem + 0.35vw, 1.05rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  white-space: nowrap !important;
  max-width: none !important;
  overflow: visible;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "dlig" 0, "calt" 0;
  -webkit-font-smoothing: antialiased;
}
footer .brand-wordmark { color: #fff !important; }
.brand-mark { background: var(--cream); flex-shrink: 0; }

/* World map shell */
#sedi-map { height: min(62vh, 560px); min-height: 360px; }
@media (min-width: 1024px) {
  #sedi-map { height: min(68vh, 620px); min-height: 480px; }
}
.italy-highlight-label {
  background: transparent;
  border: 0;
  color: #FFF8F5;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.65);
  letter-spacing: 0.04em;
}


/* Header: keep wordmark clear of nav */
#header .brand-lockup { position: relative; z-index: 20; flex-shrink: 0; }
#header .brand-wordmark {
  font-size: clamp(0.72rem, 0.62rem + 0.45vw, 0.98rem);
  white-space: nowrap !important;
}
#header nav a { white-space: nowrap; }
@media (max-width: 1279px) {
  /* wordmark gets full room; menu via hamburger until xl */
  #header .brand-wordmark { font-size: clamp(0.8rem, 0.7rem + 0.5vw, 1.05rem); }
}

#sedi-map, #sedi-map .leaflet-container { background: #0b0b0b !important; }


/* —— Map v5: full-bleed dark world, Italy callout, cluster —— */
#sedi-map,
#sedi-map .leaflet-container {
  background: #0b0b0b !important;
}
/* Do not paint .leaflet-pane / .leaflet-tile-pane — their world-sized box shows as a faint rectangle */
#sedi-map .leaflet-pane,
#sedi-map .leaflet-tile-pane,
#sedi-map .leaflet-overlay-pane,
#sedi-map .leaflet-shadow-pane {
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
}
#sedi-map .leaflet-tile-container {
  outline: none !important;
  box-shadow: none !important;
}
#sedi-map {
  width: 100%;
  height: min(64vh, 580px);
  min-height: 380px;
}
@media (min-width: 1024px) {
  #sedi-map { height: min(70vh, 640px); min-height: 480px; }
}
.italy-highlight-label { background: transparent !important; border: 0 !important; }
.italy-callout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #4A232C;
  color: #FFF8F5;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(234,137,154,0.55);
  box-shadow: 0 4px 16px rgba(0,0,0,0.45), 0 0 0 3px rgba(234,137,154,0.22);
  white-space: nowrap;
}
.italy-callout-arrow {
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #ea899a;
}
.sedi-cluster { background: transparent; border: 0; }
.sedi-cluster-dot {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px;
  background: #B83D55;
  border: 3px solid #FFF8F5;
  box-shadow: 0 0 0 4px rgba(234,137,154,0.35), 0 6px 18px rgba(0,0,0,0.45);
  color: #fff; font-family: var(--font-sans); font-weight: 700; font-size: 13px;
}
.sedi-cluster-dot em { font-style: normal; }
.sedi-marker.is-small .sedi-marker-dot {
  width: 10px; height: 10px;
  box-shadow: 0 0 0 2px rgba(184,61,85,0.35), 0 2px 8px rgba(0,0,0,0.4);
}
@keyframes italyPulse {
  0% { stroke-opacity: 0.9; fill-opacity: 0.2; }
  50% { stroke-opacity: 0.35; fill-opacity: 0.05; }
  100% { stroke-opacity: 0.9; fill-opacity: 0.2; }
}
#sedi-map path.italy-pulse-ring,
#sedi-map .italy-pulse-ring {
  animation: italyPulse 2.2s ease-in-out infinite;
}

.italy-leaflet-tooltip {
  background: #4A232C !important;
  color: #FFF8F5 !important;
  border: 1px solid rgba(234,137,154,0.65) !important;
  border-radius: 999px !important;
  padding: 6px 14px !important;
  font-family: var(--font-serif) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  letter-spacing: 0.06em !important;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5), 0 0 0 3px rgba(234,137,154,0.25) !important;
}
.italy-leaflet-tooltip::before {
  border-left-color: #4A232C !important;
}
.leaflet-tooltip-left.italy-leaflet-tooltip::before {
  border-left-color: #4A232C !important;
}

/* Brand: original DomusRa logo + text wordmark only */
#header .brand-logo { display: block; max-height: 2.5rem; width: auto; }
footer .brand-logo { max-height: 2.25rem; }
#header .brand-wordmark {
  font-size: clamp(0.95rem, 0.85rem + 0.35vw, 1.15rem) !important;
  white-space: nowrap !important;
  max-width: none !important;
}
#header .max-w-7xl { padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 1280px) {
  #header .max-w-7xl { padding-left: 1.25rem; padding-right: 1.25rem; }
  #header .brand-lockup { gap: 0.5rem; }
}
#header .btn-gold { white-space: nowrap !important; }

#sedi-map, #formazione-map { overflow: hidden !important; }
#sedi-map .leaflet-map-pane,
#formazione-map .leaflet-map-pane {
  /* clip world-tile edge aliasing so no faint rectangle shows */
}
#sedi-map .leaflet-tile,
#formazione-map .leaflet-tile {
  outline: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

#formazione-map {
  width: 100%;
  height: min(64vh, 580px);
  min-height: 380px;
  background: #0b0b0b !important;
}
@media (min-width: 1024px) {
  #formazione-map { height: min(70vh, 640px); min-height: 480px; }
}
