/* ============================================================
   Sant'Andrea Immobiliare — Custom CSS
   Override Bootstrap 5 + stile luxury
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --sa-green:        #1a3a2a;
  --sa-green-light:  #2d5a3d;
  --sa-green-pale:   #e8f0eb;
  --sa-cream:        #f8f4ef;
  --sa-gold:         #c9a96e;
  --sa-gold-light:   #e8d5b0;
  --sa-dark:         #1a1a1a;
  --sa-text:         #3a3a3a;
  --sa-muted:        #7a7a7a;
  --sa-border:       #e2ddd8;
  --bs-body-font-family: 'Inter', sans-serif;
  --bs-body-color:   var(--sa-text);
  --bs-primary:      var(--sa-green);
  --bs-primary-rgb:  26, 58, 42;
}

/* ---- Base ---- */
body { background-color: #fff; color: var(--sa-text); }
h1, h2, h3, h4, .font-serif { font-family: 'Playfair Display', serif; }
a { color: var(--sa-green); }
a:hover { color: var(--sa-green-light); }

/* ---- Admin bar (sito pubblico, solo loggati) ---- */
.admin-bar {
  background: #1a1a1a;
  color: rgba(255,255,255,.75);
  font-size: .72rem;
  letter-spacing: .04em;
  padding: 0 1rem;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 2000;
}
.admin-bar a,
.admin-bar button {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font-size: .72rem;
  cursor: pointer;
  letter-spacing: .04em;
}
.admin-bar a:hover,
.admin-bar button:hover { color: #fff; }
.admin-bar-left { display: flex; align-items: center; gap: .5rem; }
.admin-bar-right { display: flex; align-items: center; gap: .5rem; }
.admin-bar-sep { color: rgba(255,255,255,.25); }
.admin-bar-status { font-size: .65rem; padding: .1rem .4rem; border-radius: 20px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.admin-bar-status--published { background: #1a4731; color: #6fcf97; }
.admin-bar-status--draft     { background: #4a3800; color: #f2c94c; }

/* ---- Navbar ---- */
.navbar-sa {
  background-color: #fff;
  border-bottom: 1px solid var(--sa-border);
  padding: .9rem 0;
}
.navbar-sa .navbar-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sa-green);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.navbar-sa .nav-link {
  color: var(--sa-text);
  font-size: .85rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 500;
}
.navbar-sa .nav-link:hover { color: var(--sa-green); }
.btn-brochure {
  background-color: var(--sa-green);
  color: #fff !important;
  font-size: .8rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  border-radius: 0;
  padding: .5rem 1.2rem;
}
.btn-brochure:hover { background-color: var(--sa-green-light); }

/* ---- Hero ---- */
.hero-section {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: flex-end;
  background-color: var(--sa-dark);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .7;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,25,18,.85) 0%, rgba(10,25,18,.3) 60%, transparent 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem 0 4rem;
}
.hero-location {
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--sa-gold-light);
  font-weight: 500;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  color: #fff;
  line-height: 1.1;
}
.hero-tagline {
  color: rgba(255,255,255,.8);
  font-size: 1rem;
  font-weight: 300;
  max-width: 520px;
}
.btn-sa-outline-white {
  border: 1px solid rgba(255,255,255,.6);
  color: #fff;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 0;
  padding: .6rem 1.6rem;
  background: transparent;
}
.btn-sa-outline-white:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}

/* ---- Highlights strip ---- */
.highlights-strip {
  background-color: var(--sa-cream);
  border-top: 3px solid var(--sa-gold);
}
.highlight-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--sa-border);
}
.highlight-item:last-child { border-right: none; }
.highlight-icon {
  width: 36px;
  height: 36px;
  color: var(--sa-green);
  margin-bottom: .6rem;
}
.highlight-icon svg { width: 100%; height: 100%; fill: currentColor; }
.highlight-value {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--sa-dark);
  line-height: 1.2;
}
.highlight-label {
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--sa-muted);
  margin-top: .2rem;
}

/* ---- Sezione generica ---- */
.section-label {
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--sa-gold);
  font-weight: 600;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--sa-dark);
}
.section-bg-cream { background-color: var(--sa-cream); }
.section-bg-green { background-color: var(--sa-green); }
.divider-gold {
  width: 48px;
  height: 2px;
  background: var(--sa-gold);
  margin: 1rem 0 1.5rem;
}

/* ---- Gallery grid ---- */
.gallery-grid img {
  object-fit: cover;
  width: 100%;
  cursor: pointer;
  transition: transform .3s ease;
}
.gallery-grid img:hover { transform: scale(1.03); }

/* ---- Checklist ---- */
.sa-checklist { list-style: none; padding: 0; }
.sa-checklist li {
  padding: .35rem 0;
  padding-left: 1.6rem;
  position: relative;
  font-size: .9rem;
  border-bottom: 1px solid var(--sa-border);
}
.sa-checklist li:last-child { border-bottom: none; }
.sa-checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .55rem;
  width: 10px;
  height: 10px;
  border: 2px solid var(--sa-gold);
  border-radius: 50%;
}

/* ---- Card planimetria ---- */
.floor-plan-card img {
  object-fit: contain;
  background: var(--sa-cream);
  border: 1px solid var(--sa-border);
}

/* ---- Brochure card ---- */
.brochure-card {
  border: 1px solid var(--sa-border);
  background: #fff;
  padding: 1.5rem;
  text-align: center;
}
.brochure-thumb {
  width: 80px;
  opacity: .5;
  margin-bottom: 1rem;
}

/* ---- Form contatto ---- */
.contact-section {
  background-color: var(--sa-green);
  color: #fff;
}
.contact-section .form-control,
.contact-section .form-control:focus {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.2);
  color: #fff;
  border-radius: 0;
}
.contact-section .form-control::placeholder { color: rgba(255,255,255,.5); }
.contact-section .form-control:focus {
  box-shadow: none;
  border-color: var(--sa-gold);
}
.contact-section label { color: rgba(255,255,255,.75); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.btn-contact-submit {
  background-color: var(--sa-gold);
  color: var(--sa-dark);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 0;
  border: none;
  padding: .75rem 2.5rem;
}
.btn-contact-submit:hover { background-color: var(--sa-gold-light); }

/* ---- Footer ---- */
.site-footer {
  background-color: var(--sa-dark);
  color: rgba(255,255,255,.6);
  font-size: .8rem;
}
.site-footer .brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.site-footer a { color: rgba(255,255,255,.6); }
.site-footer a:hover { color: var(--sa-gold); }

/* ---- Homepage card immobile ---- */
.property-card {
  border: none;
  border-radius: 0;
  overflow: hidden;
  transition: box-shadow .3s;
}
.property-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.12); }
.property-card .card-img-top {
  height: 240px;
  object-fit: cover;
}
.property-card .card-body { background: #fff; padding: 1.4rem; }
.property-card .prop-location {
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--sa-gold);
  font-weight: 600;
}
.property-card .prop-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--sa-dark);
}
.btn-sa-primary {
  background-color: var(--sa-green);
  color: #fff;
  border-radius: 0;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .55rem 1.4rem;
  border: none;
}
.btn-sa-primary:hover { background-color: var(--sa-green-light); color: #fff; }

/* ---- Admin ---- */
.admin-sidebar {
  background-color: var(--sa-green);
  min-height: 100vh;
  width: 240px;
  transition: transform .25s ease;
}
.admin-sidebar .nav-link {
  color: rgba(255,255,255,.75);
  font-size: .85rem;
  padding: .6rem 1.2rem;
  border-radius: 4px;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active { color: #fff; background: rgba(255,255,255,.12); }
.admin-sidebar .brand {
  font-family: 'Playfair Display', serif;
  color: #fff;
  font-size: .9rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.btn-close-sidebar {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 .2rem;
}
.btn-close-sidebar:hover { color: #fff; }

/* Mobile: sidebar off-canvas */
@media (max-width: 991.98px) {
  .admin-sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    z-index: 1050;
    transform: translateX(-100%);
    width: 260px;
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-main { width: 100%; min-width: 0; }
}

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1040;
}
.sidebar-overlay.is-visible { display: block; }

/* Hamburger */
.admin-hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.admin-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--sa-green);
  border-radius: 2px;
}

.admin-main { flex: 1; background: #f4f4f4; min-height: 100vh; }
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: .75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.icon-picker-grid .icon-item {
  cursor: pointer;
  padding: .6rem;
  border: 2px solid transparent;
  border-radius: 4px;
  text-align: center;
  transition: border-color .2s;
}
.icon-picker-grid .icon-item:hover { border-color: var(--sa-green-pale); }
.icon-picker-grid .icon-item.selected { border-color: var(--sa-green); background: var(--sa-green-pale); }
.icon-picker-grid .icon-item svg { width: 32px; height: 32px; fill: var(--sa-green); display: block; margin: 0 auto .3rem; }
.icon-picker-grid .icon-item small { font-size: .65rem; color: var(--sa-muted); }

/* ---- Admin bottoni azioni tabella ---- */
.admin-btn {
  border-radius: 0 !important;
  font-size: .75rem !important;
  padding: .3rem .75rem !important;
  line-height: 1.4 !important;
  white-space: nowrap;
}

/* ---- Descrizione immobile (CKEditor output) ---- */
.prop-description p  { margin-bottom: .9rem; }
.prop-description ul { padding-left: 1.4rem; margin-bottom: .9rem; }
.prop-description h3 { font-family: 'Playfair Display', serif; font-size: 1.1rem; margin: 1.2rem 0 .4rem; color: var(--sa-dark); }
.prop-description a  { color: var(--sa-green); text-decoration: underline; }
.desc-collapsed { max-height: 140px; overflow: hidden; position: relative; }
.desc-collapsed::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, #fff);
}

/* ---- Admin bottoni azioni tabella ---- */
.admin-btn {
  border-radius: 0 !important;
  font-size: .75rem !important;
  padding: .3rem .75rem !important;
  line-height: 1.4 !important;
  white-space: nowrap;
}

/* ---- Utile ---- */
.ratio-16x9 { aspect-ratio: 16/9; }
