/* =========================================
   Casa Baldoni Website Stylesheet (updated)
   - Keeps original design and layout
   - Fixes mobile language toggle positioning
   - Adds SVG flag styling
   ========================================= */

/* Fonts & Color Palette (unchanged) */
:root {
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Lato', sans-serif;
  --color-bg: #FAFAF7;
  --color-text: #2C2C2C;
  --color-accent: #9C8E64;
  --color-link: #335C67;

  /* Header height is global so elements outside .navbar (like .lang-toggle) can read it */
  --header-height: 64px; /* desktop/tablet default */
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
}

/* ======================
   Navigation / Header
   ====================== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.navbar .logo {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--color-link);
  font-weight: 700;
}

.navbar nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 400;
}

.navbar nav a:hover {
  color: var(--color-accent);
}

/* ================
   Hero Section
   ================ */
.hero {
  height: 100vh;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.hero-overlay {
  background-color: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 2rem;
  border-radius: 6px;
  animation: fadeIn 2s ease-in-out;
}

.hero-overlay h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero-overlay p {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.btn {
  background-color: var(--color-link);
  color: white;
  text-decoration: none;
  padding: 0.6rem 1.4rem;
  border-radius: 4px;
  font-weight: 400;
  transition: background-color 0.3s ease;
}

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

/* ======================
   Sections / Content
   ====================== */
section {
  padding: 5rem 1rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s ease forwards;
}

section:nth-of-type(1) { animation-delay: 0.5s; }
section:nth-of-type(2) { animation-delay: 0.8s; }
section:nth-of-type(3) { animation-delay: 1.1s; }
section:nth-of-type(4) { animation-delay: 1.4s; }

.container {
  max-width: 1100px;
  margin: 0 auto;
}

h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-link);
  margin-bottom: 1.2rem;
  text-align: center;
}

p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
  font-size: 1.2rem;
  margin: 2rem 0;
}

.about-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.about-images img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.gallery-grid img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.contact a {
  color: var(--color-link);
  text-decoration: none;
}

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

footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  background-color: rgba(0, 0, 0, 0.03);
}

/* ================
   Animations
   ================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* =====================================
   Language Toggle (desktop / tablet)
   - Centered, same visual style as before
   - Sits above the header (z-index > navbar)
   ===================================== */
.lang-toggle {
  position: fixed;
  top: 12px; /* fallback for early paint */
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(255,255,255,.9), rgba(255,255,255,.85));
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  z-index: 2000; /* above navbar */
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  transition: all .4s ease;
  user-select: none;
}

.lang-toggle:hover {
  background: linear-gradient(90deg, rgba(255,255,255,.95), rgba(255,255,255,.9));
  transform: translateX(-50%) scale(1.05);
}

/* Inline links keep original look */
.lang-toggle .lang-link {
  text-decoration: none;
  color: inherit;
}

/* SVG flag icon: small, subtle, consistent with Casa Baldoni look */
.lang-toggle .flag {
  width: 20px;      /* balanced height for the capsule */
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  border-radius: 2px;
  box-shadow: 0 0 1px rgba(0,0,0,0.25); /* subtle edge like your images */
  display: inline-block;
}

/* =========================
   Mobile adjustments
   ========================= */
@media (max-width: 768px) {
  /* Compact header paddings; keep original visual rhythm */
  .navbar {
    flex-direction: row;
    align-items: center;
    padding: .6rem .9rem;
  }

  /* Mobile header height so the toggle can sit just beneath it */
  :root {
    --header-height: 60px;
  }

  section {
    padding: 3rem 1rem;
  }

  .hero-overlay h1 {
    font-size: 1.8rem;
  }

  /* Toggle: precisely below the header, always clickable */
  .lang-toggle {
    top: 6px;
    font-size: .9rem;
    padding: 4px 10px;
    z-index: 2001;          /* keep it above header/menu on mobile */
    pointer-events: auto;   /* ensure taps always register */
  }

  /* (Optional) If you previously relied on disabling container clicks:
     Uncomment below to mimic that behavior while links remain tappable.

  .lang-toggle { pointer-events: none; }
  .lang-toggle a { pointer-events: auto; }
  */
}

/* ==============================
   Hero alignment per your layout
   ============================== */
.hero-overlay {
  position: relative;
  top: -80px;
  text-align: center;
}
