/* ==========================================================================
   CASALE ISIDORO - Main Stylesheet
   Rural Luxury Villa, Umbria, Italy
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. CUSTOM FONTS
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Amsterdam One';
  src: url('/font/AmsterdamOne-eZ12l.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   1. CSS RESET (Modern Minimal)
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

a {
  text-decoration: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

fieldset {
  border: none;
  padding: 0;
}

table {
  border-collapse: collapse;
}

/* --------------------------------------------------------------------------
   2. CSS CUSTOM PROPERTIES
   -------------------------------------------------------------------------- */

:root {
  /* --- Typography --- */
  --font-heading: 'Marcellus', 'Georgia', serif;
  --font-body: 'Source Sans 3', 'Helvetica Neue', sans-serif;

  /* --- Font Sizes (Fluid) --- */
  --fs-h1: clamp(2.5rem, 5vw, 4.5rem);
  --fs-h2: clamp(1.8rem, 3.5vw, 3rem);
  --fs-h3: clamp(1.3rem, 2vw, 1.8rem);
  --fs-h4: clamp(1.1rem, 1.5vw, 1.4rem);
  --fs-h5: clamp(1rem, 1.2vw, 1.2rem);
  --fs-h6: clamp(0.9rem, 1vw, 1rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-cta: 0.9rem;

  /* --- Font Weights --- */
  --fw-light: 400;
  --fw-regular: 500;
  --fw-medium: 600;
  --fw-bold: 700;

  /* --- Spacing Scale --- */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 8rem;
  --space-section: clamp(4rem, 8vw, 8rem);

  /* --- Layout --- */
  --container-max: 1280px;
  --container-narrow: 900px;
  --container-wide: 1440px;
  --container-padding: clamp(1.25rem, 4vw, 2.5rem);

  /* --- Border Radius --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);

  /* --- Transitions --- */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.4s ease;
  --transition-slower: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* --- Z-Index Scale --- */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* --- Semantic State Colors --- */
  --color-error: #C0392B;
  --color-error-bg: rgba(192, 57, 43, 0.06);
  --color-success: #27AE60;
  --color-success-bg: rgba(39, 174, 96, 0.06);
  --color-warning: #E67E22;
  --color-warning-bg: rgba(230, 126, 34, 0.06);

  /* --- Focus Ring --- */
  --focus-ring: 0 0 0 3px rgba(139, 94, 60, 0.15);

  /* --- Header --- */
  --header-height: 80px;

  /* --- Hover Lift --- */
  --lift-sm: -2px;
  --lift-md: -4px;
}

/* --- WARM THEME (Default) --- */
[data-theme="warm"],
:root {
  --bg-primary: #F5F0EB;
  --bg-secondary: #EDE5DA;
  --bg-card: #FFFFFF;

  --text-primary: #2C1810;
  --text-secondary: #4A3328;
  --text-muted: #5E4D3F;

  --accent: #8B5E3C;
  --accent-dark: #6B4226;
  --accent-light: #B8866A; /* decorative only — fails AA for text use */

  --border: #D4C4B0;
  --border-light: #E8DDD0;

  --nav-bg: rgba(245, 240, 235, 0.98);
  --footer-bg: #2C1810;
  --footer-text: #EDE5DA;

  --btn-primary-bg: #8B5E3C;
  --btn-primary-text: #FFFFFF;
  --btn-primary-hover: #6B4226;

  --overlay-gradient: linear-gradient(
    180deg,
    rgba(44, 24, 16, 0.25) 0%,
    rgba(44, 24, 16, 0.55) 100%
  );

  --selection-bg: #8B5E3C;
  --selection-text: #FFFFFF;
}

/* --- DARK THEME --- */
[data-theme="dark"] {
  --bg-primary: #0D0D0D;
  --bg-secondary: #1C1917;
  --bg-card: #1F1B18;

  --text-primary: #F2E8D9;
  --text-secondary: #BFB0A0;
  --text-muted: #918579;

  --accent: #C9A96E;
  --accent-dark: #8B6914;
  --accent-light: #DFC48E;

  --border: #3A3430;
  --border-light: #4A4540;

  --nav-bg: rgba(13, 13, 13, 0.97);
  --footer-bg: #000000;
  --footer-text: #BFB0A0;

  --btn-primary-bg: #C9A96E;
  --btn-primary-text: #0D0D0D;
  --btn-primary-hover: #DFC48E;

  --overlay-gradient: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.65) 100%
  );

  --selection-bg: #C9A96E;
  --selection-text: #0D0D0D;

  --color-error: #E74C3C;
  --color-error-bg: rgba(231, 76, 60, 0.1);
  --color-success: #2ECC71;
  --color-success-bg: rgba(46, 204, 113, 0.1);
  --color-warning: #F39C12;
  --color-warning-bg: rgba(243, 156, 18, 0.1);

  --focus-ring: 0 0 0 3px rgba(201, 169, 110, 0.2);

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   3. BASE STYLES
   -------------------------------------------------------------------------- */

body {
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  font-size: var(--fs-body);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* --- Selection --- */
::selection {
  background-color: var(--selection-bg);
  color: var(--selection-text);
}

::-moz-selection {
  background-color: var(--selection-bg);
  color: var(--selection-text);
}

/* --- Scrollbar (Webkit) --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Focus Visible --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   4. TYPOGRAPHY
   -------------------------------------------------------------------------- */

h1,
.h1 {
  font-family: var(--font-heading);
  font-weight: var(--fw-regular);
  font-size: var(--fs-h1);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h2,
.h2 {
  font-family: var(--font-heading);
  font-weight: var(--fw-medium);
  font-size: var(--fs-h2);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h3,
.h3 {
  font-family: var(--font-heading);
  font-weight: var(--fw-medium);
  font-size: var(--fs-h3);
  line-height: 1.3;
  color: var(--text-primary);
}

h4,
.h4 {
  font-family: var(--font-heading);
  font-weight: var(--fw-medium);
  font-size: var(--fs-h4);
  line-height: 1.35;
  color: var(--text-primary);
}

h5,
.h5 {
  font-family: var(--font-heading);
  font-weight: var(--fw-medium);
  font-size: var(--fs-h5);
  line-height: 1.4;
  color: var(--text-secondary);
}

h6,
.h6 {
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--fs-h6);
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

p {
  margin-bottom: 1em;
  color: var(--text-secondary);
  line-height: 1.8;
}

p:last-child {
  margin-bottom: 0;
}

.text-lead {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  font-weight: var(--fw-regular);
  line-height: 1.8;
  color: var(--text-secondary);
}

.text-small {
  font-size: var(--fs-small);
  font-weight: var(--fw-regular);
  color: var(--text-muted);
}

.text-accent {
  color: var(--accent);
}

.text-center {
  text-align: center;
}

.text-narrow {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* --- Links --- */
a {
  color: var(--accent);
  transition: color var(--transition-base);
}

a:hover {
  color: var(--accent-dark);
}

.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--accent);
  transition: width var(--transition-base);
}

.link-underline:hover::after {
  width: 100%;
}

/* --- Lists --- */
.list-styled {
  padding-left: 1.5em;
}

.list-styled li {
  position: relative;
  padding-left: 0.5em;
  margin-bottom: 0.5em;
  color: var(--text-secondary);
}

.list-styled li::before {
  content: '';
  position: absolute;
  left: -1em;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
}

/* --- Section Label / Eyebrow --- */
.section__label {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: var(--space-sm);
  display: block;
}

/* --- Decorative Divider --- */
.divider {
  width: 60px;
  height: 1px;
  background-color: var(--accent);
  border: none;
  margin: var(--space-md) 0;
}

.divider--center {
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
   5. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

.section {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}

.section--no-top {
  padding-top: 0;
}

.section--no-bottom {
  padding-bottom: 0;
}

.section--bg-secondary {
  background-color: var(--bg-secondary);
}

.section--bg-accent {
  background-color: var(--accent);
  color: #FFFFFF;
}

[data-theme="dark"] .section--bg-accent {
  background-color: var(--accent-dark);
}

.section--bg-accent .section__label {
  color: rgba(255, 255, 255, 0.8);
}

.section--bg-accent h2,
.section--bg-accent h3 {
  color: #FFFFFF;
}

.section--bg-accent p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.9;
}

.section--bg-accent .divider {
  background-color: rgba(255, 255, 255, 0.4);
}

.section--bg-accent .text-small {
  color: rgba(255, 255, 255, 0.75);
}

/* --- Grid System --- */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 {
  grid-template-columns: 1fr;
}

.grid--3 {
  grid-template-columns: 1fr;
}

.grid--4 {
  grid-template-columns: 1fr;
}

.grid--center {
  align-items: center;
}

.grid--gap-sm {
  gap: var(--space-sm);
}

.grid--gap-2xl {
  gap: var(--space-2xl);
}

/* Reverse column order (e.g., image-right / text-left alternating layouts) */
.grid--reverse > *:first-child {
  order: 2;
}

.grid--reverse > *:last-child {
  order: 1;
}

@media (min-width: 768px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- Flex Utilities --- */
.flex {
  display: flex;
}

.flex--wrap {
  flex-wrap: wrap;
}

.flex--center {
  align-items: center;
  justify-content: center;
}

.flex--between {
  align-items: center;
  justify-content: space-between;
}

.flex--column {
  flex-direction: column;
}

.flex--gap-sm {
  gap: var(--space-sm);
}

.flex--gap-md {
  gap: var(--space-md);
}

.flex--gap-lg {
  gap: var(--space-lg);
}

.flex--align-center {
  align-items: center;
}

.flex--align-start {
  align-items: flex-start;
}

/* --- Spacing Helpers --- */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* --- Aspect Ratio --- */
.aspect-ratio {
  position: relative;
  overflow: hidden;
}

.aspect-ratio--3-2 {
  aspect-ratio: 3 / 2;
}

.aspect-ratio--16-9 {
  aspect-ratio: 16 / 9;
}

.aspect-ratio--4-3 {
  aspect-ratio: 4 / 3;
}

.aspect-ratio--1-1 {
  aspect-ratio: 1 / 1;
}

.aspect-ratio img,
.aspect-ratio video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   5b. DATA TABLES
   -------------------------------------------------------------------------- */

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.data-table thead tr {
  background-color: var(--accent);
}

.data-table th,
.data-table td {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  font-weight: var(--fw-bold);
  color: #FFFFFF;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table th[data-align="center"],
.data-table td[data-align="center"] {
  text-align: center;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:nth-child(even) {
  background-color: var(--bg-secondary);
}

.data-table tbody tr:hover {
  background-color: var(--bg-card);
}

.data-table td {
  font-weight: var(--fw-regular);
  color: var(--text-secondary);
}

.data-table td:first-child {
  font-weight: var(--fw-medium);
  color: var(--text-primary);
}

.data-table .data-table__accent {
  color: var(--accent);
  font-weight: var(--fw-bold);
}

.data-table .data-table__muted {
  color: var(--text-muted);
}

.data-table .data-table__secondary {
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   6. BUTTONS
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.9em 2.2em;
  font-family: var(--font-body);
  font-size: var(--fs-cta);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

/* Primary Button */
.btn--primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
}

.btn--primary:hover {
  background-color: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  color: var(--btn-primary-text);
  box-shadow: var(--shadow-md);
}

/* Outline Button */
.btn--outline {
  background-color: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn--outline:hover {
  background-color: var(--accent);
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .btn--outline:hover {
  color: var(--btn-primary-text);
}

/* Ghost Button */
.btn--ghost {
  background-color: transparent;
  color: var(--text-primary);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
  letter-spacing: 1.5px;
}

.btn--ghost::after {
  content: '';
  position: absolute;
  bottom: 0.6em;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-base);
}

.btn--ghost:hover {
  color: var(--accent);
}

.btn--ghost:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Outline White Button (for dark/image backgrounds) */
.btn--outline-white,
.btn--outline.btn--outline-white {
  background-color: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.6);
  border-width: 2px;
}

.btn--outline-white:hover,
.btn--outline.btn--outline-white:hover {
  background-color: #FFFFFF;
  color: var(--accent-dark);
  border-color: #FFFFFF;
}

/* White Button (for dark backgrounds) */
.btn--white {
  background-color: #FFFFFF;
  color: var(--accent-dark);
  border-color: #FFFFFF;
}

.btn--white:hover {
  background-color: transparent;
  color: #FFFFFF;
  border-color: #FFFFFF;
}

/* Button Sizes */
.btn--sm {
  padding: 0.6em 1.5em;
  font-size: 0.8rem;
  letter-spacing: 1.5px;
}

.btn--lg {
  padding: 1.1em 3em;
  font-size: 1rem;
  letter-spacing: 2.5px;
}

/* Button with Arrow */
.btn__arrow {
  display: inline-block;
  transition: transform var(--transition-base);
}

.btn:hover .btn__arrow {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   6b. FILTER PILLS (Shared pattern for tab/filter buttons)
   -------------------------------------------------------------------------- */

.filter-pill {
  padding: 0.5em 1.3em;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: var(--fw-regular);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition:
    color var(--transition-base),
    background-color var(--transition-base),
    border-color var(--transition-base);
}

.filter-pill:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.filter-pill--active {
  background-color: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

[data-theme="dark"] .filter-pill--active {
  color: var(--bg-primary);
}

/* --------------------------------------------------------------------------
   6c. CTA BANNER (Global — used on all pages before footer)
   -------------------------------------------------------------------------- */

.home-cta {
  position: relative;
  padding: var(--space-2xl) 0;
  background-color: var(--accent);
  overflow: hidden;
}

.home-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

[data-theme="dark"] .home-cta {
  background-color: var(--accent-dark);
}

.home-cta__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.home-cta__title {
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  font-weight: var(--fw-light);
  color: #FFFFFF;
  margin-bottom: var(--space-sm);
}

.home-cta__text {
  font-size: 1.05rem;
  font-weight: var(--fw-light);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.home-cta__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.home-cta__actions .btn--outline-white {
  border-width: 2px;
  background-color: rgba(255, 255, 255, 0.1);
}

.home-cta__actions .btn--outline-white:hover {
  background-color: #FFFFFF;
}

@media (min-width: 768px) {
  .home-cta__actions {
    flex-direction: row;
    justify-content: center;
  }

  .home-cta {
    padding: var(--space-3xl) 0;
  }
}

/* --------------------------------------------------------------------------
   7. ANIMATION UTILITIES
   -------------------------------------------------------------------------- */

/* Fade In */
.fade-in {
  opacity: 0;
  transition: opacity var(--transition-slower);
}

.fade-in.is-visible {
  opacity: 1;
}

/* Slide Up */
.slide-up {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity var(--transition-slower),
    transform var(--transition-slower);
}

.slide-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Slide In Left */
.slide-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition:
    opacity var(--transition-slower),
    transform var(--transition-slower);
}

.slide-in-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide In Right */
.slide-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition:
    opacity var(--transition-slower),
    transform var(--transition-slower);
}

.slide-in-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale In */
.scale-in {
  opacity: 0;
  transform: scale(0.95);
  transition:
    opacity var(--transition-slower),
    transform var(--transition-slower);
}

.scale-in.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger Children (use with JS to add delay) */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.stagger-children.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.is-visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.is-visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.is-visible > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children.is-visible > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children.is-visible > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-children.is-visible > *:nth-child(6) { transition-delay: 0.5s; }

/* --------------------------------------------------------------------------
   8. UTILITY CLASSES
   -------------------------------------------------------------------------- */

.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;
}

.overflow-hidden {
  overflow: hidden;
}

.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fw-bold {
  font-weight: var(--fw-bold);
}

.text-italic {
  font-style: italic;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* --- Body lock for modals --- */
body.is-locked {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* --------------------------------------------------------------------------
   9. RESPONSIVE BREAKPOINTS (Mobile-First)
   -------------------------------------------------------------------------- */

/* Tablet: 768px */
@media (min-width: 768px) {
  :root {
    --header-height: 90px;
  }
}

/* Desktop: 1024px */
@media (min-width: 1024px) {
  :root {
    --header-height: 100px;
  }
}

/* Large Desktop: 1200px */
@media (min-width: 1200px) {
  /* fine-tuning at wider breakpoints if needed */
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in,
  .slide-up,
  .slide-in-left,
  .slide-in-right,
  .scale-in {
    opacity: 1;
    transform: none;
  }
}

/* --- Print Styles --- */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  .header,
  .footer,
  .nav,
  .btn,
  .popup {
    display: none !important;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }
}

/* --------------------------------------------------------------------------
   WhatsApp Floating Action Button
   -------------------------------------------------------------------------- */

.whatsapp-fab {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
  text-decoration: none;
}

.whatsapp-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.whatsapp-fab svg {
  width: 28px;
  height: 28px;
}

/* --------------------------------------------------------------------------
   Breadcrumb (bottom of page)
   -------------------------------------------------------------------------- */

.breadcrumb {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--border-light);
}

.breadcrumb__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.breadcrumb__item {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb__item:not(:last-child)::after {
  content: '/';
  margin-left: 0.4rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.breadcrumb__link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-base);
}

.breadcrumb__link:hover {
  color: var(--accent);
}

.breadcrumb__current {
  color: var(--text-secondary);
  font-weight: var(--fw-regular);
}

/* --------------------------------------------------------------------------
   Chi Siamo — Family Photo
   -------------------------------------------------------------------------- */

.chi-siamo__family-photo {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.chi-siamo__family-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   Leaflet Map — dove-siamo
   -------------------------------------------------------------------------- */

/* Mappa full-bleed, full viewport-height.
   Isolation crea un nuovo stacking context: tutti gli z-index interni di
   Leaflet (controls 1000, pane 400, popup 700) restano confinati dentro #map
   e non scavalcano l'header sticky (z-index 200). */
#map {
  position: relative;
  isolation: isolate;
  z-index: 1;
  width: 100%;
  height: 50vh;
  min-height: 360px;
  overflow: hidden;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

@media (max-width: 767px) {
  #map {
    min-height: 320px;
  }
}

/* Tile rendering più morbido sui retina */
.leaflet-container { background: var(--bg-secondary); }

/* Marker brandizzato (sostituisce il pin blu default di Leaflet) */
.casale-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}

.casale-marker::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-right: 3px solid #FFFFFF;
  border-bottom: 3px solid #FFFFFF;
}

/* Pulse animation per attirare l'attenzione */
.casale-marker::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: casaleMarkerPulse 2.4s ease-out infinite;
  z-index: -1;
}

@keyframes casaleMarkerPulse {
  0%   { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(1.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .casale-marker::before { animation: none; opacity: 0; }
}

/* Popup styling allineato al brand */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 0;
}

.leaflet-popup-content {
  margin: var(--space-md);
  font-family: var(--font-body, sans-serif);
  color: var(--text-primary);
  line-height: 1.5;
}

.leaflet-popup-tip {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Attribution più discreta */
.leaflet-control-attribution {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.85) !important;
  padding: 2px 6px;
}
