/* ============================================================
   Castellanza Affitti — redesign moderno
   Palette: crema / blu / terracotta
   ============================================================ */

:root {
  --cream: #f7f4ee;
  --cream-soft: #eaeff3;
  --ink: #1c2321;
  --ink-soft: #4a5350;
  --sage: #1f5f8b;
  --sage-dark: #163f5c;
  --terracotta: #d9714e;
  --terracotta-dark: #b85535;
  --line: #d8dde2;
  --radius: 18px;
  --shadow: 0 12px 32px rgba(28, 35, 33, 0.08);
  --maxw: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Poppins", "Inter", sans-serif;
  line-height: 1.2;
  margin: 0 0 .5em;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: var(--sage); text-decoration: none; }
a:hover { color: var(--terracotta); }

img { max-width: 100%; display: block; border-radius: var(--radius); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Skip link (accessibility) ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--sage); color: #fff; padding: 10px 16px; z-index: 999;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Header / Nav ---------- */
header.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; max-width: var(--maxw); margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 10px; font-family: "Poppins", sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.brand-mark { display: flex; align-items: center; justify-content: center; }
.brand-mark img { height: 56px; width: auto; display: block; }

nav.main-nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
nav.main-nav a { font-weight: 500; color: var(--ink-soft); font-size: .95rem; }
nav.main-nav a[aria-current="page"] { color: var(--sage); font-weight: 600; }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; }

/* ---------- Language switcher ---------- */
.lang-switch { position: relative; margin-left: 20px; }
.lang-toggle {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: .85rem;
  color: var(--ink); font-family: inherit;
}
.lang-toggle:hover { border-color: var(--sage); color: var(--sage); }
.lang-toggle .flag { font-size: 1.05rem; line-height: 1; }
.lang-toggle .chevron { font-size: .65rem; opacity: .6; }
.lang-menu {
  list-style: none; margin: 0; padding: 6px;
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); min-width: 160px; z-index: 200;
  display: none;
}
.lang-switch.open .lang-menu { display: block; }
.lang-menu li { margin: 0; }
.lang-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-weight: 500; font-size: .9rem; color: var(--ink); }
.lang-menu a:hover { background: var(--cream-soft); color: var(--sage); }
.lang-menu a.lang-current { color: var(--sage); font-weight: 700; }
.lang-menu .flag { font-size: 1.05rem; }

@media (max-width: 860px) {
  nav.main-nav { display: none; }
  nav.main-nav.open { display: block; position: absolute; top: 88px; left: 0; right: 0; background: var(--cream); border-bottom: 1px solid var(--line); padding: 12px 24px; }
  nav.main-nav.open ul { flex-direction: column; gap: 14px; }
  .nav-toggle { display: inline-flex; }
  .lang-switch { margin-left: 10px; }
}

@media (max-width: 420px) {
  .lang-toggle span:not(.flag):not(.chevron) { display: none; }
  .lang-toggle { padding: 7px 9px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 2px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--terracotta); color: #fff; }
.btn-primary:hover { background: var(--terracotta-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { border-color: var(--sage); color: var(--sage); }
.btn-sage { background: var(--sage); color: #fff; }
.btn-sage:hover { background: var(--sage-dark); color: #fff; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem;
  font-weight: 700; color: var(--sage); background: rgba(31,95,139,.09); padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero p.lead { font-size: 1.1rem; max-width: 46ch; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.hero-image img { box-shadow: var(--shadow); width: 100%; max-height: 360px; object-fit: cover; filter: saturate(1.1) contrast(1.04) brightness(1.02); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ---------- Fact strip ---------- */
.fact-strip { background: var(--sage); color: #fff; padding: 22px 0; }
.fact-strip .container { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.fact { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95rem; flex: 1 1 200px; }
.fact-icon { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fact-icon svg { width: 18px; height: 18px; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head .eyebrow { margin-bottom: 12px; }

/* ---------- Feature grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.feature-icon { width: 46px; height: 46px; border-radius: 12px; background: rgba(217,113,78,.12); color: var(--terracotta); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.feature-icon svg { width: 24px; height: 24px; }
@media (max-width: 860px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

/* ---------- Property cards ---------- */
.property-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.property-card { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s ease; }
.property-card:hover { transform: translateY(-4px); }
.property-card img { border-radius: 0; aspect-ratio: 4/3; object-fit: cover; filter: saturate(1.12) contrast(1.04) brightness(1.02); transition: transform .4s ease, filter .4s ease; }
.property-card:hover img { transform: scale(1.06); filter: saturate(1.18) contrast(1.05) brightness(1.03); }
.property-card .pc-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pc-meta { font-size: .85rem; color: var(--ink-soft); }
.pc-tag { align-self: flex-start; background: var(--cream-soft); color: var(--sage); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.pc-link { margin-top: auto; font-weight: 600; }

@media (max-width: 980px) { .property-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .property-grid { grid-template-columns: 1fr; } }

/* ---------- Quote / owners ---------- */
.owner-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; text-align: center; max-width: 720px; margin: 0 auto; }
.owner-block blockquote { font-size: 1.15rem; font-style: italic; margin: 0 0 12px; color: var(--ink); }
.owner-block cite { font-style: normal; font-weight: 600; color: var(--sage); }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: .85rem; color: var(--ink-soft); padding: 18px 0 0; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb span[aria-current] { color: var(--sage); font-weight: 600; }

/* ---------- Property detail page ---------- */
.detail-hero { padding: 20px 0 0; }
.detail-hero img { width: 100%; max-height: 480px; object-fit: cover; box-shadow: var(--shadow); filter: saturate(1.1) contrast(1.04) brightness(1.02); }
.spec-strip { display: flex; flex-wrap: wrap; gap: 16px; margin: 28px 0; }
.detail-content { padding-top: 8px; }
.spec-chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.spec-chip strong { color: var(--sage); }

.two-col { display: grid; grid-template-columns: 1.3fr .9fr; gap: 40px; align-items: start; margin-bottom: 2rem; }
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .side-card { position: static; top: auto; }
}

.amenity-list { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.amenity-list li { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.amenity-list li::before { content: "✓"; color: var(--sage); font-weight: 700; }
@media (max-width: 480px) { .amenity-list { grid-template-columns: 1fr; } }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.gallery-grid figure { margin: 0; border-radius: 12px; overflow: hidden; }
.gallery-grid img { aspect-ratio: 4/3; object-fit: cover; width: 100%; border-radius: 12px; filter: saturate(1.1) contrast(1.04) brightness(1.02); transition: transform .4s ease, filter .4s ease; }
.gallery-grid figure:hover img { transform: scale(1.08); filter: saturate(1.16) contrast(1.05) brightness(1.03); }
.gallery-grid figcaption { font-size: .8rem; color: var(--ink-soft); margin-top: 6px; }
@media (max-width: 700px) { .gallery-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .gallery-grid { grid-template-columns: 1fr; } }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 2rem; border-radius: var(--radius); box-shadow: var(--shadow); }
table.room-table { width: 100%; min-width: 480px; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
table.room-table th, table.room-table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); }
table.room-table th:first-child, table.room-table td:first-child { white-space: nowrap; }
table.room-table th { background: var(--sage); color: #fff; font-weight: 600; }
table.room-table tr:last-child td { border-bottom: none; }
@media (max-width: 560px) {
  table.room-table th, table.room-table td { padding: 10px 12px; font-size: .88rem; }
}

.side-card { background: var(--sage); color: #fff; border-radius: var(--radius); padding: 32px; position: sticky; top: 100px; }
.side-card h3 { color: #fff; }
.side-card p { color: rgba(255,255,255,.85); }
.side-card .btn-primary { width: 100%; justify-content: center; margin-top: 12px; }

.related-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.related-chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 10px 20px; font-weight: 600; }

/* ---------- Contact page ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: stretch; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-info-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.contact-info-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 18px; }
.contact-info-card li { display: flex; gap: 14px; align-items: flex-start; }
.contact-info-card .ci-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--cream-soft); color: var(--sage); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

form.contact-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 16px; }
form.contact-form label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: 6px; }
form.contact-form input, form.contact-form select, form.contact-form textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); font-family: inherit; font-size: .95rem; background: var(--cream);
}
form.contact-form textarea { min-height: 120px; resize: vertical; }
.form-note { font-size: .8rem; color: var(--ink-soft); }

.map-wrap { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.map-wrap iframe { width: 100%; height: 340px; border: 0; display: block; }

/* ---------- Footer ---------- */
footer.site-footer { background: var(--ink); color: rgba(255,255,255,.75); padding: 56px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
footer.site-footer p { color: #fff; }
footer.site-footer h4 { color: #fff; font-size: 1rem; }
footer.site-footer a { color: rgba(255,255,255,.75); }
footer.site-footer a:hover { color: #fff; }
footer.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 40px; padding-top: 20px; font-size: .82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

.section-alt { background: var(--cream-soft); }

/* ---------- Line breaks: desktop only ---------- */
/* Some titles/paragraphs have manual <br> tags meant to control line
   balance on wider screens. On narrow screens the text needs to reflow
   naturally instead, so these breaks are hidden below 701px. */
br.lg-break { display: none; }
@media (min-width: 701px) {
  br.lg-break { display: inline; }
}

/* The opposite: a break meant for narrow screens only, removed on desktop. */
br.sm-break { display: inline; }
@media (min-width: 701px) {
  br.sm-break { display: none; }
}

/* ---------- Mobile refinements ---------- */
@media (max-width: 700px) {
  section { padding: 48px 0; }
  .hero { padding: 40px 0 32px; }
  .hero-image img { max-height: 220px; }
  .detail-hero img { max-height: 240px; }
  .owner-block { padding: 28px 20px; }
  .map-wrap iframe { height: 260px; }
}

@media (max-width: 420px) {
  .nav-wrap { padding: 12px 16px; }
  .brand { font-size: 1rem; gap: 8px; }
  .brand-mark img { height: 42px; }
  .container { padding: 0 16px; }
}
