/* =========================================================
   Studio Notarile Andrea Bramante — Porto Recanati
   Palette: deep ink navy · warm ivory · antique gold
   Font: Libre Baskerville (titoli) · Roboto (testo)
   ========================================================= */

:root {
  --ivory:            #faf8f3;
  --ivory-card:       #fdfcf9;
  --ink:             #1d2029;
  --primary:         #23283a;   /* midnight navy */
  --primary-foreground: #faf8f3;
  --secondary:       #ece9e2;
  --secondary-soft:  #f2efe9;
  --muted-foreground:#5b6072;
  --gold:            #b8924e;   /* antique gold */
  --gold-soft:       #cbab74;
  --border:          #ddd9d0;
  --border-dark:     rgba(250, 248, 243, 0.12);

  --font-serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-sans:  "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--ivory);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--primary);
  line-height: 1.15;
}

a { color: inherit; text-decoration: none; transition: color .25s ease; }
img { max-width: 100%; display: block; }

.section { padding: 6rem 0; }
@media (min-width: 992px) { .section { padding: 8rem 0; } }

.bg-secondary-soft { background-color: var(--secondary-soft); }
.bg-ink { background-color: var(--primary); color: var(--primary-foreground); }
.bg-ink h1, .bg-ink h2, .bg-ink h3 { color: var(--primary-foreground); }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}
.font-serif { font-family: var(--font-serif); }
.text-muted-ink { color: var(--muted-foreground); }
.lead-ink { color: rgba(29, 32, 41, 0.78); }
.lead-ivory { color: rgba(250, 248, 243, 0.72); }

.display-title {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.05;
}
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
}

.rule-gold {
  display: inline-block;
  width: 3rem;
  height: 1px;
  background: var(--gold);
  vertical-align: middle;
}

/* ---------- Navbar ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1030;
  background: rgba(250, 248, 243, 0.82);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid rgba(221, 217, 208, 0.7);
}
.site-header .navbar-brand {
  font-family: var(--font-serif);
  color: var(--primary);
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.site-header .navbar-brand .brand-pre {
  font-style: italic;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  margin-right: 0.45rem;
}
.nav-link-serif {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 400;
  color: rgba(35, 40, 58, 0.82) !important;
  padding: 0.4rem 0 !important;
}
.nav-link-serif:hover,
.nav-link-serif:focus { color: var(--gold) !important; }

.lang-switch { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.18em; }
.lang-switch a { color: var(--muted-foreground); padding: 0.25rem 0.5rem; }
.lang-switch a:hover { color: var(--primary); }
.lang-switch a.active { color: var(--gold); }
.lang-switch .sep { color: var(--border); }

.navbar-toggler { border: none; padding: 0.25rem 0.4rem; }
.navbar-toggler:focus { box-shadow: none; }

/* ---------- Buttons ---------- */
.btn-notary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.btn-notary-solid {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn-notary-solid:hover {
  background: var(--gold);
  color: var(--ink);
}
.btn-notary-outline {
  border-color: rgba(35, 40, 58, 0.3);
  color: var(--primary);
}
.btn-notary-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- Hero ---------- */
.hero { padding-top: 9rem; padding-bottom: 6rem; overflow: hidden; }
@media (min-width: 992px) { .hero { padding-top: 11rem; padding-bottom: 8rem; } }

.hero-figure { position: relative; }
.hero-figure .frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 2px;
}
.hero-figure .frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-figure .frame::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(35, 40, 58, 0.1);
}
.hero-figure .gold-square {
  position: absolute; bottom: -1.4rem; left: -1.4rem;
  width: 6rem; height: 6rem; border: 1px solid var(--gold);
}
@media (max-width: 991.98px) { .hero-figure .gold-square { display: none; } }

.hero-place {
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* ---------- Generic figures ---------- */
.figure-cover { position: relative; overflow: hidden; border-radius: 2px; }
.figure-cover img { width: 100%; height: 100%; object-fit: cover; }
.ratio-3-4 { aspect-ratio: 3 / 4; }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border-dark);
  margin-top: 3.5rem;
}
@media (min-width: 768px) { .services-grid { grid-template-columns: repeat(3, 1fr); } }

.service-card {
  background: var(--primary);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  transition: background-color .3s ease;
}
.service-card:hover { background: #2a3047; }
.service-card .service-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 2rem;
}
.service-card .service-num { font-family: var(--font-serif); font-style: italic; color: var(--gold); font-size: 1.1rem; }
.service-card .service-line { height: 1px; width: 2.5rem; background: rgba(184, 146, 78, 0.45); transition: width .3s ease; }
.service-card:hover .service-line { width: 4rem; }
.service-card h3 { color: var(--primary-foreground); font-size: 1.5rem; margin: 0 0 0.9rem; line-height: 1.25; }
.service-card p { color: rgba(250, 248, 243, 0.72); font-size: 0.92rem; margin: 0; }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.gallery-grid > * { display: block; }
.gallery-grid picture { display: block; }
.gallery-grid img {
  width: 100%; object-fit: cover; aspect-ratio: 1 / 1; border-radius: 2px; display: block;
}
@media (min-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
  .gallery-grid .g-feature { grid-column: span 2; grid-row: span 2; height: 100%; }
  .gallery-grid .g-feature picture { height: 100%; }
  .gallery-grid .g-feature img { aspect-ratio: auto; height: 100%; }
}

/* ---------- Contact ---------- */
.contact-block .eyebrow { margin-bottom: 0.4rem; }
.contact-block a:hover { color: var(--gold); }
.contact-value { color: var(--primary); white-space: pre-line; }

.map-frame {
  aspect-ratio: 16 / 6;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 2px;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; filter: grayscale(0.4); }

/* ---------- FAQ ---------- */
.faq .accordion-item { background: transparent; border: none; border-bottom: 1px solid var(--border); }
.faq .accordion-button {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  color: var(--primary);
  background: transparent;
  box-shadow: none;
  padding: 1.3rem 0;
}
.faq .accordion-button:not(.collapsed) { color: var(--gold); background: transparent; }
.faq .accordion-button:focus { box-shadow: none; }
.faq .accordion-button::after {
  width: 1rem; height: 1rem; background-size: 1rem;
}
.faq .accordion-body { padding: 0 0 1.4rem; color: rgba(29, 32, 41, 0.78); font-size: 0.98rem; }

/* ---------- Legal / policy page ---------- */
.legal-page { padding-top: 8rem; padding-bottom: 5rem; }
.legal { max-width: 780px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: .5rem; }
.legal .updated { font-size: 0.8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 2.5rem; }
.legal h2 { font-size: 1.4rem; margin: 2.5rem 0 .9rem; }
.legal h3 { font-size: 1.08rem; margin: 1.6rem 0 .5rem; }
.legal p, .legal li { color: rgba(29, 32, 41, 0.82); font-size: 0.96rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: .4rem; }
.legal a { color: var(--gold); text-decoration: underline; }
.legal a:hover { color: var(--ink); }
.legal .lead { font-size: 1.05rem; }
.legal table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.88rem; }
.legal table th, .legal table td { border: 1px solid var(--border); padding: .6rem .7rem; text-align: left; vertical-align: top; }
.legal table th { background: var(--secondary); font-family: var(--font-sans); font-weight: 500; }
.legal .table-wrap { overflow-x: auto; }
.legal .contact-box { background: var(--secondary-soft); border-left: 3px solid var(--gold); padding: 1rem 1.25rem; margin: 1rem 0; }

/* ---------- Cookie banner (Consent Mode v2) ---------- */
.cc-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000;
  transform: translateY(120%); transition: transform .4s ease;
  background: var(--primary); color: rgba(250, 248, 243, 0.9);
  border-top: 1px solid var(--gold);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
}
.cc-banner.cc-show { transform: translateY(0); }
.cc-banner-inner {
  max-width: 1200px; margin: 0 auto; padding: 1.3rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem;
}
.cc-text { flex: 1 1 340px; }
.cc-title { font-family: var(--font-serif); font-size: 1.05rem; color: var(--primary-foreground); margin: 0 0 .35rem; }
.cc-body { font-size: 0.85rem; line-height: 1.55; margin: 0; color: rgba(250, 248, 243, 0.7); }
.cc-body a { color: var(--gold-soft); text-decoration: underline; }
.cc-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

.cc-btn {
  font-family: var(--font-sans); font-size: 0.75rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  padding: .7rem 1.15rem; border-radius: 2px; border: 1px solid transparent;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.cc-btn-solid { background: var(--gold); color: var(--ink); }
.cc-btn-solid:hover { background: var(--gold-soft); }
.cc-btn-ghost { background: transparent; color: var(--primary-foreground); border-color: rgba(250, 248, 243, 0.4); }
.cc-btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }
.cc-btn-link { background: transparent; color: rgba(250, 248, 243, 0.75); border: none; text-transform: none; letter-spacing: 0; text-decoration: underline; padding: .7rem .4rem; }
.cc-btn-link:hover { color: var(--gold-soft); }

/* Modal preferenze */
.cc-modal { position: fixed; inset: 0; z-index: 2100; display: none; }
.cc-modal.cc-show { display: block; }
.cc-modal-overlay { position: absolute; inset: 0; background: rgba(20, 22, 30, 0.55); backdrop-filter: blur(2px); }
.cc-modal-panel {
  position: relative; z-index: 1; background: var(--ivory-card); color: var(--ink);
  max-width: 560px; width: calc(100% - 2rem); margin: 6vh auto 0;
  max-height: 88vh; overflow-y: auto; border-radius: 3px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); padding: 1.75rem;
}
.cc-modal-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1.25rem; }
.cc-modal-head h2 { font-size: 1.4rem; margin: 0; }
.cc-modal-x { background: none; border: none; font-size: 1.8rem; line-height: 1; color: var(--muted-foreground); cursor: pointer; }
.cc-modal-x:hover { color: var(--gold); }
.cc-cat { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.cc-cat:last-of-type { border-bottom: none; }
.cc-cat-row { display: flex; align-items: center; justify-content: space-between; }
.cc-cat-row strong { font-family: var(--font-serif); font-weight: 400; font-size: 1.05rem; color: var(--primary); }
.cc-cat p { margin: .4rem 0 0; font-size: 0.85rem; color: rgba(29, 32, 41, 0.72); }
.cc-always { font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.cc-modal-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; margin-top: 1.5rem; }
.cc-modal-actions .cc-btn-ghost { color: var(--primary); border-color: rgba(35, 40, 58, 0.35); }
.cc-modal-actions .cc-btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* Switch */
.cc-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.cc-switch input { opacity: 0; width: 0; height: 0; }
.cc-slider { position: absolute; inset: 0; background: #c9c4b8; border-radius: 24px; transition: background-color .2s ease; cursor: pointer; }
.cc-slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s ease; }
.cc-switch input:checked + .cc-slider { background: var(--gold); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(20px); }
.cc-switch input:focus-visible + .cc-slider { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (max-width: 575.98px) {
  .cc-actions { width: 100%; }
  .cc-actions .cc-btn-solid, .cc-actions .cc-btn-ghost { flex: 1; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--primary); color: rgba(250, 248, 243, 0.6); padding: 3rem 0; font-size: 0.8rem; }
.site-footer .brand { font-family: var(--font-serif); font-style: italic; color: rgba(250, 248, 243, 0.85); font-size: 0.95rem; }
.site-footer a { color: rgba(250, 248, 243, 0.75); }
.site-footer a:hover { color: var(--gold); }
.site-footer .tracking { letter-spacing: 0.18em; text-transform: uppercase; }
