/* ============================================================
   Fuoribinario B&B — fuoribinariobeb.it
   Palette dal logo: navy #1C3A5E · oro #B98F3E · crema #FAF6EE
   ============================================================ */

/* ---------- Font self-hosted (GDPR friendly) ---------- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
  --navy: #1c3a5e;
  --navy-dark: #142c49;
  --navy-ink: #24344a;
  --gold: #b98f3e;
  --gold-soft: #d8b76a;
  --gold-bg: #f4e9d2;
  --cream: #faf6ee;
  --paper: #ffffff;
  --ink: #33404f;
  --muted: #64707f;
  --line: #e8e0d0;
  --ok: #2e7d4f;
  --err: #b3423a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(28, 58, 94, 0.10);
  --shadow-soft: 0 4px 14px rgba(28, 58, 94, 0.08);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); }
h1, h2, h3 { font-family: var(--font-display); color: var(--navy); line-height: 1.15; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }

:target { scroll-margin-top: 90px; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 22px; }

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

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 246, 238, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 22px; max-width: 1220px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { width: 46px; height: 46px; flex: none; }
.brand img { height: 52px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 1.22rem;
  color: var(--navy); letter-spacing: 0.02em;
}
.brand-sub {
  font-size: 0.62rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-top: 3px;
}
.main-nav { display: flex; align-items: center; gap: 26px; }
.main-nav a {
  text-decoration: none; color: var(--navy-ink); font-weight: 500; font-size: 0.95rem;
  padding: 6px 2px; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.main-nav a:hover { color: var(--gold); border-bottom-color: var(--gold-soft); }
.nav-cta {
  background: var(--navy); color: #fff !important; padding: 10px 18px !important;
  border-radius: 999px; border-bottom: none !important; font-weight: 600;
  transition: background .15s;
}
.nav-cta:hover { background: var(--navy-dark); color: #fff !important; }
.lang-switch {
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em;
  color: var(--muted) !important; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px !important; border-bottom-width: 1px !important;
}
.lang-switch:hover { color: var(--navy) !important; border-color: var(--gold-soft); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 20px; height: 2px; background: var(--navy); margin: 4px 0;
  transition: transform .2s, opacity .2s;
}

/* ---------- Hero ---------- */
.hero { padding: 64px 0 84px; overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center;
}
.kicker {
  display: inline-block; color: var(--gold); font-weight: 600; font-size: 0.8rem;
  letter-spacing: 0.24em; text-transform: uppercase; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); font-weight: 700; margin-bottom: 18px; }
.hero .lead { font-size: 1.13rem; color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 30px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  padding: 14px 26px; border-radius: 999px; text-decoration: none;
  border: none; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--navy-dark); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.86rem; font-weight: 500; color: var(--navy-ink); padding: 7px 14px;
}
.chip svg { width: 15px; height: 15px; color: var(--gold); flex: none; }

.hero-media { position: relative; }
.hero-media::before {
  content: ""; position: absolute; inset: 18px -18px -18px 18px;
  border: 2px solid var(--gold-soft); border-radius: var(--radius); z-index: 0;
}
.hero-media img {
  position: relative; z-index: 1; border-radius: var(--radius);
  box-shadow: var(--shadow); aspect-ratio: 4 / 3; object-fit: cover;
  object-position: center 72%; width: 100%;
}
.hero-badge {
  position: absolute; z-index: 2; left: -14px; bottom: 26px;
  background: var(--paper); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 12px 18px; display: flex; flex-direction: column; line-height: 1.3;
}
.hero-badge strong { font-family: var(--font-display); color: var(--navy); font-size: 1.25rem; }
.hero-badge span { font-size: 0.8rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-alt { background: var(--paper); }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.about-media { position: relative; }
.about-media img {
  border-radius: var(--radius); box-shadow: var(--shadow);
  aspect-ratio: 3 / 4; object-fit: cover; width: 100%;
}
.about-media::after {
  content: ""; position: absolute; inset: -16px 18px 18px -16px;
  border: 2px solid var(--gold-soft); border-radius: var(--radius); z-index: -1;
}
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 26px; margin-top: 30px; padding: 0; list-style: none; }
.features li { display: flex; gap: 12px; align-items: flex-start; }
.features svg { width: 22px; height: 22px; color: var(--gold); flex: none; margin-top: 2px; }
.features strong { display: block; color: var(--navy); font-size: 0.98rem; }
.features span { font-size: 0.88rem; color: var(--muted); }

/* ---------- Rooms ---------- */
.room-card {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-soft); margin-bottom: 44px;
}
.section-alt .room-card { background: var(--cream); }
.room-card:last-child { margin-bottom: 0; }
.room-card.reverse .room-gallery { order: 2; }
.room-gallery { position: relative; display: grid; grid-template-rows: 1fr; min-height: 100%; }
.room-gallery-main {
  width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; cursor: zoom-in;
}
.room-thumbs {
  position: absolute; left: 14px; bottom: 14px; display: flex; gap: 8px;
}
.room-thumbs button {
  padding: 0; border: 2px solid rgba(255,255,255,0.9); border-radius: 10px;
  overflow: hidden; cursor: pointer; background: none; width: 62px; height: 62px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}
.room-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.room-thumbs .more {
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 44, 73, 0.82); color: #fff; font-size: 0.78rem; font-weight: 600;
}
.room-body { padding: 38px 40px; display: flex; flex-direction: column; }
.room-body h3 { font-size: 1.65rem; margin-bottom: 4px; }
.room-price { color: var(--gold); font-weight: 600; font-size: 1.02rem; margin-bottom: 16px; }
.room-price small { color: var(--muted); font-weight: 400; }
.room-body p { color: var(--ink); font-size: 0.98rem; }
.amenities { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 26px; padding: 0; list-style: none; }
.amenities li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.83rem; color: var(--navy-ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}
.amenities svg { width: 14px; height: 14px; color: var(--gold); }
.room-body .btn { align-self: flex-start; margin-top: auto; }

/* ---------- Availability / booking ---------- */
.steps { display: flex; flex-wrap: wrap; gap: 22px; margin: 0 0 36px; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; color: var(--navy-ink); }
.steps li::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold-bg); color: var(--gold); font-weight: 700; font-size: 0.9rem;
}
.booking-card {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 46px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 40px;
}
.room-toggle { display: flex; gap: 8px; margin-bottom: 20px; }
.room-toggle label {
  flex: 1; text-align: center; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 8px;
  font-weight: 600; font-size: 0.93rem; color: var(--muted);
  transition: border-color .15s, color .15s, background .15s;
}
.room-toggle input { position: absolute; opacity: 0; }
.room-toggle input:checked + span { color: inherit; }
.room-toggle label:has(input:checked) {
  border-color: var(--navy); color: var(--navy); background: var(--cream);
}
.room-toggle label:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }

.calendar-wrap { min-height: 340px; }
.calendar-status { font-size: 0.85rem; color: var(--muted); margin-top: 10px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.legend .free { background: var(--paper); border: 1px solid var(--line); }
.legend .busy { background: #e9e2d5; position: relative; }

.stay-summary {
  margin-top: 16px; background: var(--cream); border: 1px dashed var(--gold-soft);
  border-radius: var(--radius-sm); padding: 13px 16px; font-size: 0.94rem; color: var(--navy-ink);
}
.stay-summary strong { color: var(--navy); }

/* Form */
.request-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 0.86rem; font-weight: 600; color: var(--navy-ink); }
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: 0.97rem; color: var(--ink);
  background: var(--cream); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 11px 13px; transition: border-color .15s; width: 100%;
}
.field textarea { resize: vertical; min-height: 88px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
}
.consent { display: flex; gap: 10px; font-size: 0.83rem; color: var(--muted); align-items: flex-start; }
.consent input { margin-top: 3px; accent-color: var(--navy); }
.consent a { color: var(--navy); }
.crib-option {
  background: var(--gold-bg); border: 1px solid var(--gold-soft);
  border-radius: var(--radius-sm); padding: 11px 14px;
  font-size: 0.88rem; color: var(--navy-ink); cursor: pointer;
}
.crib-option[hidden] { display: none; }
.form-note { font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.form-note svg { width: 15px; height: 15px; color: var(--gold); flex: none; }
.hp-field { position: absolute; left: -5000px; top: -5000px; opacity: 0; pointer-events: none; }

.form-feedback { display: none; border-radius: var(--radius-sm); padding: 13px 16px; font-size: 0.93rem; }
.form-feedback.ok { display: block; background: #e8f3ec; color: var(--ok); border: 1px solid #bfdccb; }
.form-feedback.err { display: block; background: #f9e9e7; color: var(--err); border: 1px solid #e7c4c0; }

.success-panel { text-align: center; padding: 30px 10px; display: none; }
.success-panel.show { display: block; }
.success-panel svg { width: 54px; height: 54px; color: var(--ok); margin: 0 auto 14px; display: block; }
.success-panel h3 { margin-bottom: 8px; }
.success-panel p { color: var(--muted); }

/* ---------- flatpickr theme overrides ---------- */
.flatpickr-calendar.inline {
  box-shadow: none; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-body); width: 100%; max-width: 100%;
}
.flatpickr-calendar.inline .flatpickr-months { padding-top: 6px; }
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
span.flatpickr-weekday { color: var(--navy); fill: var(--navy); }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
  background: var(--navy); border-color: var(--navy);
}
.flatpickr-day.inRange {
  background: var(--gold-bg); border-color: var(--gold-bg); box-shadow: -5px 0 0 var(--gold-bg), 5px 0 0 var(--gold-bg);
}
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover {
  background: #efe9dc; color: #b9b0a0; text-decoration: line-through; border-color: transparent;
}
.flatpickr-day.today { border-color: var(--gold); }
.flatpickr-day:hover { background: var(--cream); }

/* ---------- Location ---------- */
.location-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 46px; align-items: start; }
.address-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 32px; box-shadow: var(--shadow-soft);
}
.address-card address { font-style: normal; font-size: 1.02rem; color: var(--navy-ink); line-height: 1.7; }
.address-card .btn { margin-top: 18px; }
.distances { list-style: none; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.distances li { display: flex; justify-content: space-between; gap: 14px; font-size: 0.93rem; }
.distances span:first-child { color: var(--ink); }
.distances span:last-child { color: var(--gold); font-weight: 600; white-space: nowrap; }

.map-embed {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-soft);
  aspect-ratio: 16 / 11; background: var(--gold-bg);
}
.map-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px;
  background:
    radial-gradient(circle at 30% 30%, rgba(216,183,106,0.35), transparent 55%),
    radial-gradient(circle at 75% 70%, rgba(28,58,94,0.12), transparent 50%),
    var(--cream);
}
.map-placeholder svg { width: 42px; height: 42px; color: var(--navy); }
.map-placeholder p { font-size: 0.88rem; color: var(--muted); max-width: 34em; margin: 0; }
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Contact strip ---------- */
.contact-strip { background: var(--navy); color: #fff; }
.contact-strip .container {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 24px; padding-top: 52px; padding-bottom: 52px;
}
.contact-strip h2 { color: #fff; font-size: 1.6rem; margin: 0 0 6px; }
.contact-strip p { color: rgba(255,255,255,0.75); margin: 0; }
.contact-links { display: flex; flex-wrap: wrap; gap: 14px; }
.contact-links a {
  display: inline-flex; align-items: center; gap: 9px;
  color: #fff; text-decoration: none; font-weight: 600;
  border: 1.5px solid rgba(255,255,255,0.35); border-radius: 999px; padding: 12px 20px;
  transition: border-color .15s, background .15s;
}
.contact-links a:hover { border-color: var(--gold-soft); background: rgba(255,255,255,0.06); }
.contact-links svg { width: 17px; height: 17px; color: var(--gold-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,0.78); font-size: 0.88rem; }
.footer-grid {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 36px;
  padding: 54px 0 40px;
}
.site-footer h4 {
  color: #fff; font-family: var(--font-body); font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.16em; margin: 0 0 14px;
}
.site-footer a { color: rgba(255,255,255,0.85); text-decoration: none; }
.site-footer a:hover { color: var(--gold-soft); }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-brand svg { width: 42px; height: 42px; }
.footer-brand img { height: 58px; width: auto; display: block; }
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand-sub { color: var(--gold-soft); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-ids { font-size: 0.8rem; color: rgba(255,255,255,0.55); line-height: 1.7; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 18px 0 22px; display: flex; flex-wrap: wrap; gap: 10px 24px;
  justify-content: space-between; font-size: 0.8rem; color: rgba(255,255,255,0.5);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300; display: none;
  background: rgba(16, 26, 40, 0.93);
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(92vw, 1100px); max-height: 84vh; object-fit: contain;
  border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox button {
  position: absolute; background: rgba(255,255,255,0.1); color: #fff;
  border: 1px solid rgba(255,255,255,0.25); border-radius: 50%;
  width: 46px; height: 46px; font-size: 1.25rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lightbox button:hover { background: rgba(255,255,255,0.22); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-caption {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.85); font-size: 0.9rem; background: rgba(0,0,0,0.35);
  padding: 6px 14px; border-radius: 999px;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .about-grid, .location-grid { grid-template-columns: 1fr; gap: 40px; }
  .booking-card { grid-template-columns: 1fr; padding: 28px 22px; gap: 34px; }
  .room-card, .room-card.reverse { grid-template-columns: 1fr; }
  .room-card.reverse .room-gallery { order: 0; }
  .room-body { padding: 28px 24px; }
  .hero { padding: 40px 0 64px; }
  .hero-media::before { display: none; }
  .hero-badge { left: 12px; }
  .about-media::after { display: none; }
  .about-media img { aspect-ratio: 4 / 3; }
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; inset: 63px 0 auto 0; z-index: 99;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); display: none; padding: 10px 22px 20px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 13px 4px; border-bottom: 1px solid var(--line); }
  .main-nav a:last-child { border-bottom: none; }
  .nav-cta { margin-top: 12px; text-align: center; border-radius: 12px; }
  .lang-switch { margin-top: 10px; text-align: center; }
  .section { padding: 60px 0; }
  .form-row { grid-template-columns: 1fr; }
  .contact-strip .container { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .brand img { height: 42px; }
  .room-thumbs button { width: 52px; height: 52px; }
  .steps { flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
