/* Costantino Immobiliare – sito pubblico
   Colori ripresi dal logo: nero inchiostro e oro dell'arco. Nessun font esterno. */

:root {
  --ink: #1c1b19;
  --ink-soft: #4a4740;
  --muted: #6d695f;
  --paper: #fbfaf7;
  --card: #ffffff;
  --line: #e6e1d6;
  --gold: #9c7b33;
  --gold-dark: #7a5f22;
  --gold-light: #d8bd7a;
  --gold-wash: #f4eedf;
  --ok: #2f6b3a;
  --err: #a23a2a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 27, 25, .06), 0 6px 20px rgba(28, 27, 25, .06);
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.6 var(--sans);
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-dark); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.7rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
.muted { color: var(--muted); }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { margin-bottom: .35rem; }

/* --- Barra superiore e intestazione --------------------------------- */
.topbar { background: var(--ink); color: #d9d4c7; font-size: .85rem; }
.topbar-in { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; flex-wrap: wrap; }
.topbar a { color: var(--gold-light); text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar-contacts { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.topbar-contacts a { margin-left: 0; }

/* --- Icone social ------------------------------------------------ */
.social { list-style: none; margin: 0; padding: 0; display: flex; gap: .5rem; align-items: center; }
.social-footer { margin-top: 1rem; }
.social .social-link {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: var(--ink); text-decoration: none; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.social-top .social-link { width: 26px; height: 26px; }
.social .social-link:hover { transform: scale(1.08); box-shadow: 0 0 0 2px var(--gold-light); color: var(--ink); }
.social .social-link img { width: 100%; height: 100%; object-fit: contain; }
.social .social-text { width: auto; border-radius: 999px; padding: 0 .7rem; font-size: .78rem; font-weight: 700; }
.social-top .social-text { font-size: .72rem; padding: 0 .55rem; }
.social-generic { display: grid; place-items: center; }

.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 84px; }
.brand img { width: auto; height: 58px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.site-nav a {
  display: block; padding: .55rem .8rem; border-radius: 6px;
  color: var(--ink); text-decoration: none; font-weight: 500; letter-spacing: .01em;
}
.site-nav a:hover { background: var(--gold-wash); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--gold-dark); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .topbar-in > span:first-child { display: none; }
  .topbar-contacts { gap: .9rem; }
  .header-in { min-height: 68px; }
  .brand img { height: 42px; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer;
  }
  .nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    display: block; width: 20px; height: 2px; background: var(--ink); position: relative; content: "";
  }
  .nav-toggle-bar::before { position: absolute; top: -6px; }
  .nav-toggle-bar::after { position: absolute; top: 6px; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); display: none; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding: .5rem 16px 1rem; }
  .site-nav a { padding: .8rem .5rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav a[aria-current="page"] { box-shadow: none; }
}

/* --- Pulsanti ----------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .6rem 1.2rem; border-radius: 8px; border: 1px solid transparent;
  font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--gold-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-small { min-height: 34px; padding: .3rem .8rem; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-whatsapp { background: #1f7a45; color: #fff; }
.btn-whatsapp:hover { background: #18613a; color: #fff; }
.btn-whatsapp img { width: 22px; height: 22px; }
.or { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .85rem; margin: 1rem 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* --- Hero e ricerca ----------------------------------------------- */
.hero {
  background:
    linear-gradient(180deg, rgba(28,27,25,.0) 0%, rgba(28,27,25,.0) 100%),
    radial-gradient(ellipse at 85% 0%, var(--gold-wash) 0%, transparent 55%),
    #fff;
  border-bottom: 1px solid var(--line);
}
.hero-in { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero h1 { text-wrap: balance; }
.hero-lead { font-size: 1.12rem; color: var(--ink-soft); margin-bottom: 1.75rem; text-wrap: pretty; }

.search {
  display: grid; gap: .75rem; align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.search .btn { width: 100%; }

/* --- Campi -------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; min-width: 0; }
.search .field { margin-bottom: 0; }
.field > span { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: .55rem .7rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #cfc8b8; border-radius: 8px;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); outline: 2px solid var(--gold-wash); }
[aria-invalid="true"] { border-color: var(--err) !important; }
.field-error { color: var(--err); font-size: .85rem; display: block; margin: -.2rem 0 .6rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; margin: .3rem 0 1rem; }
.check input { width: 20px; height: 20px; margin-top: .15rem; flex: none; accent-color: var(--gold-dark); }
.fieldset { border: 0; padding: 0; margin: 0 0 .5rem; }
.fieldset legend { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin-bottom: .6rem; padding: 0; }

.notice { padding: .8rem 1rem; border-radius: 8px; border: 1px solid; }
.notice.ok { background: #eef6ef; border-color: #b9d8be; color: var(--ok); }
.notice.err { background: #fbeeec; border-color: #eac2bb; color: var(--err); }

/* --- Sezioni ------------------------------------------------------ */
.section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section-tight { padding-top: 1.75rem; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-head .links a { margin-left: 1rem; font-weight: 600; }
.page-head { background: #fff; border-bottom: 1px solid var(--line); padding: clamp(1.8rem, 4vw, 2.8rem) 0 1.4rem; }
.page-head p { color: var(--ink-soft); }
.empty { background: #fff; border: 1px dashed #cfc8b8; border-radius: var(--radius); padding: 2rem; text-align: center; color: var(--ink-soft); }
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.prose { max-width: 68ch; }
.prose-wide { max-width: none; }
.prose h2 { margin-top: 1.6rem; }
.about-mark img { width: 240px; margin-inline: auto; }

.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.service { padding: 1.4rem; border-left: 3px solid var(--gold); background: var(--paper); border-radius: 0 var(--radius) var(--radius) 0; }
.service p { color: var(--ink-soft); }
@media (max-width: 860px) { .services { grid-template-columns: 1fr; } }

/* --- Schede annuncio --------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.5rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(28,27,25,.08), 0 12px 28px rgba(28,27,25,.1); }
.card-link { color: inherit; text-decoration: none; display: block; height: 100%; }
.card-link:hover { color: inherit; }
.card-media { position: relative; aspect-ratio: 3 / 2; background: var(--gold-wash); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-nophoto { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .9rem; }
.card.is-closed .card-media img { filter: grayscale(.6); opacity: .85; }
.tag { position: absolute; top: .7rem; left: .7rem; padding: .25rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.tag-vendita { background: var(--ink); color: #fff; }
.tag-affitto { background: var(--gold); color: #fff; }
.tag-status { left: auto; right: .7rem; background: #fff; color: var(--ink); border: 1px solid var(--line); }
.listing-price .tag-status { position: static; display: inline-block; margin-bottom: .3rem; }
.card-body { padding: 1rem 1.1rem 1.2rem; }
.card-place { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-dark); font-weight: 600; margin-bottom: .3rem; }
.card-title { font-size: 1.12rem; margin-bottom: .6rem; }
.card-facts { list-style: none; padding: 0; margin: 0 0 .8rem; display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .88rem; color: var(--ink-soft); }
.card-price { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin: 0; }
.card-price small, .listing-price small { font-family: var(--sans); font-size: .85rem; color: var(--muted); font-weight: 400; margin-left: .15rem; }

.toolbar { display: flex; justify-content: flex-end; margin: 1.25rem 0 1rem; }
.sort label { font-size: .9rem; color: var(--ink-soft); display: flex; align-items: center; gap: .5rem; }
.sort select { min-height: 38px; padding: .3rem .5rem; border: 1px solid #cfc8b8; border-radius: 8px; font: inherit; background: #fff; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin-top: 2rem; }
.pager a { font-weight: 600; }

/* --- Dettaglio annuncio ------------------------------------------ */
.listing { padding: 1.25rem 0 3.5rem; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); }
.listing-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.listing-head h1 { margin: 0; max-width: 28ch; }
.listing-price { text-align: right; }
.listing-price strong { font-family: var(--serif); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); display: block; }

.gallery { margin-bottom: 2rem; }
.gallery-main { position: relative; margin: 0; background: #111; border-radius: var(--radius); overflow: hidden; width: 100%; height: clamp(240px, 58vw, 640px); }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.9); color: var(--ink); font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.gallery-nav.prev { left: .8rem; } .gallery-nav.next { right: .8rem; }
.gallery-main figcaption { position: absolute; bottom: .7rem; right: .8rem; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; padding: .2rem .55rem; border-radius: 999px; }
.thumbs { display: flex; gap: .5rem; overflow-x: auto; padding: .6rem 0 .2rem; scrollbar-width: thin; }
.thumbs a { flex: none; width: 110px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; opacity: .75; }
.thumbs a[aria-current="true"] { border-color: var(--gold); opacity: 1; }
.thumbs img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }

.listing-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 2.5rem; align-items: start; }
.listing-main section { margin-bottom: 2.2rem; }
.listing-side { position: sticky; top: 100px; }
.call { text-align: center; margin: 1rem 0 0; font-weight: 600; }
@media (max-width: 960px) {
  .listing-grid { grid-template-columns: 1fr; }
  .listing-side { position: static; }
  .listing-price { text-align: left; }
}

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 2rem; margin: 0 0 1rem; border-top: 1px solid var(--line); }
.facts > div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .2rem; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.facts-single { grid-template-columns: 1fr; }
.facts-single > div { flex-direction: column; gap: .15rem; }
.facts-single dd { text-align: left; font-weight: 400; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li { background: var(--gold-wash); border: 1px solid #e7dcc0; padding: .3rem .75rem; border-radius: 999px; font-size: .9rem; }

.energy { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; max-width: 520px; }
.energy li { text-align: center; font-size: .78rem; font-weight: 700; color: #fff; padding: .35rem 0; border-radius: 3px; opacity: .45; }
.energy li.is-current { opacity: 1; transform: scaleY(1.25); box-shadow: 0 0 0 2px var(--ink); }
.energy .e0 { background: #0b7a3b; } .energy .e1 { background: #1f8f3a; } .energy .e2 { background: #3fa535; } .energy .e3 { background: #6cb52d; }
.energy .e4 { background: #a6c21c; color: #1c1b19; } .energy .e5 { background: #e0c60f; color: #1c1b19; } .energy .e6 { background: #f0a30a; color: #1c1b19; }
.energy .e7 { background: #e8710f; } .energy .e8 { background: #d9471b; } .energy .e9 { background: #c01d1d; }

/* --- Piè di pagina ------------------------------------------------ */
.site-footer { background: var(--ink); color: #cfc9bb; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; padding: 2.8rem 0 2rem; }
.footer-logo { width: 220px; height: auto; background: #fff; padding: .6rem .8rem; border-radius: 6px; margin-bottom: .8rem; }
.site-footer h2 { font-size: 1.05rem; color: #fff; }
.site-footer a { color: var(--gold-light); }
.site-footer a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem 2rem; flex-wrap: wrap; border-top: 1px solid #3a3833; padding: 1rem 0 1.5rem; font-size: .85rem; }
.footer-bottom p { margin: 0; }
.footer-bottom .legal span { white-space: nowrap; }
.footer-bottom .legal span + span::before { content: "·"; color: #7d786c; margin: 0 .45rem; }
@media (max-width: 560px) { .footer-bottom .legal span { display: block; white-space: normal; } .footer-bottom .legal span + span::before { content: none; } }
.footer-bottom .credit { color: #a39d8f; }
.footer-bottom .credit a { color: var(--gold-light); font-weight: 600; letter-spacing: .03em; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .topbar, .site-header, .site-footer, .listing-side, .gallery-nav, .thumbs { display: none !important; } }
@media (max-width: 560px) { .topbar-contacts a[href^="mailto"] { display: none; } }

/* --- Servizi ------------------------------------------------------ */
.lead { color: var(--ink-soft); font-size: 1.08rem; text-wrap: pretty; }
.lead p:last-child { margin-bottom: 0; }
.lead p { margin: 0 0 .5rem; }
.actions-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.prose ul, .svc-text ul { padding-left: 1.2rem; }
.prose li, .svc-text li { margin-bottom: .3rem; }
.prose li::marker, .svc-text li::marker { color: var(--gold); }

.svc-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.svc-card { display: block; height: 100%; padding: 1.2rem 1.25rem; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); color: inherit; text-decoration: none; transition: box-shadow .15s ease, transform .15s ease; }
.svc-card:hover { color: inherit; transform: translateY(-2px); box-shadow: var(--shadow); }
.svc-card h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.svc-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.svc-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.svc { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem 1.2rem 4.4rem; scroll-margin-top: 90px; }
.svc:target { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
.svc-num { position: absolute; left: 1.4rem; top: 1.35rem; font: 600 1.5rem/1 var(--serif); color: var(--gold); }
.svc h2 { font-size: 1.25rem; margin-bottom: .4rem; }
.svc-text { color: var(--ink-soft); }
.svc-text p:last-child { margin-bottom: 0; }
@media (max-width: 760px) { .svc-list { grid-template-columns: 1fr; } .svc { padding-left: 3.6rem; } .svc-num { left: 1.1rem; } }

.svc-cta { margin-top: 2rem; display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.svc-cta h2 { margin-bottom: .3rem; font-size: 1.35rem; }
.svc-cta p { margin: 0; color: var(--ink-soft); max-width: 58ch; }
.svc-cta-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.svc-cta-actions img { width: 22px; height: 22px; }

/* --- Foto delle pagine: con foto testo a sinistra, senza foto testo a tutta larghezza --- */
.hero.has-photo .hero-top, .page-head.has-photo .page-head-in { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.hero-photo img, .page-head-photo img, .about-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-photo { aspect-ratio: 4 / 3; max-height: 380px; margin-bottom: 1.75rem; }
.page-head-photo { aspect-ratio: 16 / 10; max-height: 260px; }
.about-photo { aspect-ratio: 4 / 3; }
@media (max-width: 860px) {
  .hero.has-photo .hero-top, .page-head.has-photo .page-head-in { grid-template-columns: 1fr; }
  .hero-photo { order: -1; aspect-ratio: auto; height: 220px; max-height: none; margin-bottom: 1.25rem; }
  .page-head-photo { aspect-ratio: auto; height: 180px; max-height: none; }
}
/* Immagini trasparenti (marchio, logo): intere, senza riquadro né ombra */
.is-transparent img { object-fit: contain; box-shadow: none; border-radius: 0; }
.about-photo.is-transparent { aspect-ratio: auto; max-width: 340px; margin-inline: auto; }
.about-photo.is-transparent img { height: auto; }
