/*
Theme Name: 500Case Real Estate
Theme URI: https://www.500case.it
Author: 500Case
Description: Tema WordPress su misura per il circuito immobiliare 500Case — listino immobili filtrabile, richieste di valutazione e di informazioni via email, gestione immobili con foto multiple da pannello di amministrazione.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: 500case
*/

:root {
  --bg: #FFFFFF;
  --bg-soft: #F7F4EC;
  --ink: #16150F;
  --ink-soft: #5A5748;
  --gold: #A9834B;
  --gold-deep: #8B6A38;
  --line: #E4E0D2;
  --white-on-gold: #FFFDF8;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 20px; } }

.serif { font-family: 'Fraunces', Georgia, serif; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 20px 0; }
.logo { font-family: 'Fraunces', serif; font-size: 1.35rem; font-weight: 400; letter-spacing: 0.01em; justify-self: center; }
.logo img {
  height: 64px; width: auto; display: block;
  background: #FFFFFF; padding: 4px 8px; border-radius: 2px;
}
footer .logo img, .site-footer .logo img { height: 40px; }
.nav-wrap { position: relative; justify-self: start; }
.nav-toggle {
  font-family: inherit; background: none; border: none; cursor: pointer;
  color: var(--ink); font-size: 0.95rem; display: flex; align-items: center; gap: 8px; padding: 6px 0;
}
.nav-toggle .bars { display: flex; flex-direction: column; gap: 3px; }
.nav-toggle .bars span { width: 18px; height: 2px; background: var(--ink); display: block; }
.nav-dropdown {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 190px;
  background: var(--bg); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  display: none; flex-direction: column; z-index: 50;
}
.nav-dropdown.open { display: flex; }
.nav-dropdown a {
  font: inherit; text-decoration: none; text-align: left; cursor: pointer;
  padding: 12px 16px; font-size: 0.92rem; color: var(--ink-soft); border-bottom: 1px solid var(--line);
  display: block;
}
.nav-dropdown a:last-child { border-bottom: none; }
.nav-dropdown a:hover { color: var(--ink); background: var(--bg-soft); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px;
  align-items: end; padding: 76px 0 64px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding: 48px 0 40px; gap: 32px; } }
.hero h1 {
  font-size: clamp(2.4rem, 4.6vw, 4rem);
  line-height: 1.1; font-weight: 340; font-style: italic; margin: 0 0 22px;
  letter-spacing: -0.005em; text-align: center;
}
.hero p { font-size: 1.08rem; color: var(--ink-soft); max-width: 46ch; line-height: 1.6; margin: 0 auto 14px; text-align: center; }
.hero p:last-of-type { margin-bottom: 0; }
.hero-figure {
  aspect-ratio: 4/5; border-radius: 2px; overflow: hidden;
  background: var(--bg-soft);
  position: relative;
}
.hero-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-stats { display: flex; gap: 32px; margin-top: 34px; margin-bottom: 40px; flex-wrap: nowrap; justify-content: center; }
.hero-stats div { border-left: 1px solid var(--line); padding-left: 18px; white-space: nowrap; }
.hero-stats strong { display: block; font-family: 'Fraunces', serif; font-size: 2.3rem; font-weight: 500; color: var(--gold-deep); }
.hero-stats span { font-size: 0.98rem; color: var(--ink-soft); }
@media (max-width: 640px) {
  .hero-stats { gap: 14px; }
  .hero-stats div { padding-left: 10px; }
  .hero-stats strong { font-size: 1.3rem; }
  .hero-stats span { font-size: 0.7rem; }
}

/* ---------- filtri e listino ---------- */
.catalog { padding: 72px 0 20px; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 34px; flex-wrap: wrap; gap: 10px;
}
.section-head h1, .section-head h2 { font-size: 1.9rem; font-weight: 380; margin: 0; }
.home-listings-title { font-size: 1.3rem; font-weight: 380; text-align: center; margin: 0 0 18px; }
.section-head .count { color: var(--ink-soft); font-size: 0.95rem; }

.filters {
  display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 14px;
  padding: 20px; background: var(--bg-soft); border: 1px solid var(--line);
  margin-bottom: 40px; align-items: end;
}
@media (max-width: 900px) { .filters { grid-template-columns: repeat(2, 1fr); } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.78rem; color: var(--ink-soft); }
.field select, .field input {
  font-family: inherit; font-size: 0.92rem; padding: 9px 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 1px;
}
.field select:focus, .field input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.filters button, .filters .btn-reset {
  font-family: inherit; font-size: 0.9rem; padding: 10px 18px;
  background: var(--ink); color: var(--bg); border: none; cursor: pointer;
  white-space: nowrap; transition: opacity .2s; text-decoration: none; text-align: center;
}
.filters button:hover, .filters .btn-reset:hover { opacity: 0.85; }

.listings { display: flex; flex-direction: column; }
.listing {
  display: grid; grid-template-columns: 300px 1fr; gap: 32px;
  padding: 30px 0; border-top: 1px solid var(--line);
}
.listings .listing:last-child { border-bottom: 1px solid var(--line); }
@media (max-width: 720px) { .listing { grid-template-columns: 1fr; gap: 16px; } }
.listing-media { aspect-ratio: 4/3; overflow: hidden; background: var(--bg-soft); }
.listing-media img { width: 100%; height: 100%; object-fit: cover; }
.listing-body { display: flex; flex-direction: column; }
.listing-top { display: flex; justify-content: space-between; gap: 16px; }
.listing-title { font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 500; margin: 0 0 4px; }
.listing-title a { text-decoration: none; color: inherit; }
.listing-loc { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }
.listing-price { font-family: 'Fraunces', serif; font-size: 1.3rem; color: var(--gold-deep); white-space: nowrap; }
.listing-tag {
  display: inline-block; font-size: 0.75rem; padding: 3px 9px;
  border: 1px solid var(--gold); color: var(--gold-deep); margin-top: 8px; width: fit-content;
}
.listing-desc { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.55; margin: 14px 0; max-width: 62ch; }
.listing-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: auto; font-size: 0.82rem; color: var(--ink-soft); }
.listing-meta span { display: flex; align-items: center; gap: 6px; }
.listing-meta svg { flex-shrink: 0; color: var(--gold-deep); }
.listing-meta b { color: var(--ink); font-weight: 600; }
.listing-cta { margin-top: 16px; }
.listing-cta a { font-size: 0.9rem; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.listing-cta a:hover { text-decoration-color: var(--gold); }

.empty-state { padding: 60px 0; text-align: center; color: var(--ink-soft); border-top: 1px solid var(--line); }
.empty-state strong { display: block; color: var(--ink); font-family: 'Fraunces', serif; font-size: 1.3rem; margin-bottom: 6px; }

.pagination { display: flex; gap: 10px; justify-content: center; margin: 50px 0 10px; }
.pagination a, .pagination span {
  padding: 8px 14px; border: 1px solid var(--line); font-size: 0.9rem; text-decoration: none; color: var(--ink);
}
.pagination .current { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- singolo immobile ---------- */
.property-hero { padding: 56px 0 40px; }
.property-gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-bottom: 40px; }
.property-gallery .main-photo { aspect-ratio: 4/3; overflow: hidden; background: var(--bg-soft); }
.property-gallery .main-photo img { width: 100%; height: 100%; object-fit: cover; }
.property-gallery .thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.property-gallery .thumbs a { aspect-ratio: 4/3; overflow: hidden; display: block; background: var(--bg-soft); }
.property-gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 720px) { .property-gallery { grid-template-columns: 1fr; } .property-gallery .thumbs { grid-template-columns: repeat(3,1fr); } }

.property-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 60px; padding-bottom: 80px; }
@media (max-width: 900px) { .property-layout { grid-template-columns: 1fr; } }
.property-title { font-size: 2.1rem; font-weight: 400; margin: 0 0 6px; }
.property-loc { color: var(--ink-soft); margin: 0 0 20px; }
.property-facts {
  display: flex; flex-wrap: wrap; gap: 18px 40px;
  padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 26px;
}
.fact-item { display: flex; align-items: center; gap: 12px; font-size: 1.02rem; color: var(--ink); }
.fact-item svg { flex-shrink: 0; color: var(--gold-deep); }
.fact-item b { font-weight: 600; }
.property-price { font-family: 'Fraunces', serif; font-size: 1.8rem; color: var(--gold-deep); margin-bottom: 20px; }
.property-desc { line-height: 1.75; color: var(--ink-soft); }
.property-sidebar { background: var(--bg-soft); border: 1px solid var(--line); padding: 28px; align-self: start; }
.property-sidebar h3 { font-family: 'Fraunces', serif; font-weight: 500; margin: 0 0 6px; font-size: 1.25rem; }
.property-sidebar p.hint { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 18px; }

/* ---------- chi siamo ---------- */
.about {
  padding: 96px 0; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 60px; align-items: center;
}
@media (max-width: 900px) { .about { grid-template-columns: 1fr; gap: 30px; padding: 60px 0; } }
.about-photo {
  display: flex; flex-direction: column; align-items: center; justify-self: center;
}
.about-photo > img {
  width: 260px; height: 260px; border-radius: 50%; overflow: hidden;
  object-fit: cover; object-position: left center; border: 1px solid var(--line);
}
.about-name { margin-top: 14px; font-size: 1rem; color: var(--ink-soft); text-align: center; }
@media (max-width: 900px) { .about-photo > img { width: 200px; height: 200px; } }
.about-body p { color: var(--ink-soft); line-height: 1.7; font-size: 1.02rem; text-align: center; }

/* ---------- contatti ---------- */
.contact { padding: 90px 0 100px; border-top: 1px solid var(--line); }
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
@media (max-width: 900px) { .contact-inner { grid-template-columns: 1fr; gap: 40px; } }
.contact h2 { font-size: 2rem; font-weight: 380; margin: 0 0 14px; text-align: center; }
.contact-info p { color: var(--ink-soft); line-height: 1.7; text-align: center; }
.contact-info p strong { color: var(--gold-deep); font-weight: 600; }
.hidden { display: none !important; }
.form-trigger {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  margin: 26px auto 0; font-family: inherit; font-size: 0.95rem; padding: 12px 26px;
  background: var(--gold-deep); color: var(--white-on-gold); border: none; cursor: pointer;
  transition: background .2s;
}
.form-trigger:hover { background: var(--gold); }
.reveal-form { margin-top: 30px; }

.contact-list {
  list-style: none; padding: 30px 0 0; margin: 46px 0 0;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.contact-list li { display: flex; gap: 8px; font-size: 0.95rem; }
.contact-list b { color: var(--ink-soft); font-weight: 500; }

form.site-form { display: flex; flex-direction: column; gap: 16px; }
form.site-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { form.site-form .row { grid-template-columns: 1fr; } }
form.site-form label { font-size: 0.82rem; color: var(--ink-soft); display: block; margin-bottom: 6px; }
form.site-form input, form.site-form textarea {
  width: 100%; font-family: inherit; font-size: 0.95rem; padding: 11px 12px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink); border-radius: 1px;
}
form.site-form input:focus, form.site-form textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; background: var(--bg); }
form.site-form textarea { resize: vertical; min-height: 100px; }
form.site-form button {
  align-self: flex-start; margin-top: 4px;
  font-family: inherit; font-size: 0.95rem; padding: 12px 26px;
  background: var(--gold-deep); color: var(--white-on-gold); border: none; cursor: pointer;
  transition: background .2s;
}
form.site-form button:hover { background: var(--gold); }
.form-note { font-size: 0.9rem; padding: 12px 16px; margin-top: 6px; border: 1px solid var(--gold); color: var(--gold-deep); }
.form-note.error { border-color: #b23b3b; color: #b23b3b; }
.honeypot { position: absolute; left: -9999px; }

.social-row {
  display: flex; justify-content: center; gap: 14px;
  padding: 34px 0; border-top: 1px solid var(--line);
}
.social-row a {
  width: 32px; height: 32px; border-radius: 8px; background: rgba(60, 60, 60, 0.55);
  display: flex; align-items: center; justify-content: center;
  color: var(--bg); transition: background .2s;
}
.social-row a:hover { background: var(--gold-deep); }
.social-row svg { width: 15px; height: 15px; }

.site-footer {
  border-top: 1px solid var(--line); padding: 30px 0;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 0.85rem; color: var(--ink-soft);
}
.site-footer .logo { font-size: 1.05rem; }

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