@import url("/assets/index-original.css");

@font-face {
  font-family: "Casa Galdi Hand";
  src: url("/fonts/caveat-500.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

/* Una scrittura manuale fresca e leggibile, identica in tutte le lingue. */
.personal-note,
.marco-signature {
  font-family: "Casa Galdi Hand", "Segoe Print", cursive !important;
  font-style: normal !important;
  font-weight: 500 !important;
  letter-spacing: 0;
}
.personal-note {
  line-height: 1.02;
}

/* Il disegno è già siglato: nessun secondo monogramma nella hero. */
.mg-mark {
  display: none !important;
}

/* La fotografia resta riconoscibile anche sotto il collage di benvenuto. */
.hero-main::after {
  background: linear-gradient(
    90deg,
    rgba(247, 239, 226, 0.52) 0%,
    rgba(240, 225, 201, 0.34) 40%,
    rgba(240, 225, 201, 0.1) 57%,
    rgba(31, 21, 13, 0.02) 100%
  );
}

.hero-background {
  filter: saturate(0.94) contrast(1) brightness(1.01);
}

.hero-paper {
  background: rgba(240, 225, 201, 0.06);
  overflow: visible;
  z-index: 3;
}

.paper-grain {
  opacity: 0.38;
}

/* La facciata diventa un foglio appoggiato sulla fotografia. */
.house-sketch {
  width: 58%;
  height: auto;
  top: 25%;
  right: -20%;
  bottom: auto;
  z-index: 1;
  outline: 1px solid rgba(89, 60, 32, 0.12);
  box-shadow:
    0 24px 34px rgba(39, 24, 12, 0.2),
    -8px 10px 18px rgba(39, 24, 12, 0.1);
  transform: perspective(1200px) rotateY(-2.2deg) rotateX(0.8deg) rotateZ(-0.55deg);
  transform-origin: 50% 55%;
}

/* Il monogramma resta raccolto nell'angolo inferiore del foglio. */
.mg-mark {
  width: 5.5%;
  height: 10%;
  right: -7%;
  bottom: 18%;
  z-index: 2;
  opacity: 0.68;
}

/* Il menu esteso appare solo quando nav e lingue hanno spazio reale. */
@media (min-width: 1401px) and (max-width: 1760px) {
  .site-header {
    grid-template-columns: minmax(300px, 0.95fr) auto;
  }

  .main-nav {
    z-index: 60;
    background: var(--paper-light);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 18px 34px 30px;
    display: none;
    position: fixed;
    top: 112px;
    left: 0;
    right: 0;
    box-shadow: 0 18px 30px rgba(42, 27, 14, 0.15);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav button {
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 15px 0;
  }

  .main-nav button:first-child::after {
    display: none;
  }

  .header-actions {
    justify-content: flex-end;
  }

  .menu-button {
    display: block;
  }
}

@media (max-width: 840px) {
  .hero-main::after {
    background: linear-gradient(
      180deg,
      rgba(247, 239, 226, 0.58) 0%,
      rgba(240, 225, 201, 0.38) 50%,
      rgba(240, 225, 201, 0.1) 66%,
      rgba(31, 21, 13, 0.03) 100%
    );
  }

  .house-sketch {
    width: 40%;
    top: 32%;
    right: -4%;
  }

  .mg-mark {
    width: 6%;
    height: 9%;
    right: 2%;
    bottom: 17%;
  }
}

@media (max-width: 520px) {
  .house-sketch {
    width: 44%;
    top: 34%;
    right: -4%;
  }

  .mg-mark {
    width: 8%;
    height: 9%;
    right: 2%;
    bottom: 16%;
  }
}

/* I due accessi principali riusano i controlli originali dell'header. */
.private-area-button,
.book-button {
  min-width: 104px;
  min-height: 38px;
  padding: 0 13px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font: 700 0.69rem Arial, sans-serif;
}

.private-area-button {
  color: #fffaf2;
  background: rgba(25, 19, 14, 0.72);
  border: 1px solid rgba(255, 250, 242, 0.68);
  display: inline-flex;
}

.book-button {
  color: #24170c;
  background: rgba(238, 207, 159, 0.94);
  border: 1px solid rgba(99, 65, 28, 0.38);
  box-shadow: none;
}

.private-area-button svg,
.book-button svg {
  display: none;
}

/* La vecchia sezione editoriale diventa l'anticamera di Officina e Dispensa. */
.things-section {
  background: #eee1ce;
}

.things-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, 0.56fr);
  gap: 18px;
  border-top: 0;
}

.things-grid article,
.things-grid article:not(:first-child) {
  min-height: 430px;
  padding: clamp(34px, 4vw, 64px);
  border: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.things-grid article::before {
  content: "";
  width: clamp(170px, 20vw, 300px);
  aspect-ratio: 1;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.11;
  position: absolute;
  top: -20%;
  right: -12%;
}

.things-grid article:nth-child(1) {
  color: #f7efe3;
  background: linear-gradient(145deg, #18130f, #38291e);
}

.things-grid article:nth-child(2) {
  color: #24180f;
  background: linear-gradient(145deg, #d3ad77, #eed8b6 56%, #f5ead9);
}

.things-grid article:nth-child(3) {
  color: #2b2017;
  background: rgba(247, 240, 228, 0.76);
}

.things-grid article > span {
  opacity: 0.58;
}

.things-grid h2 {
  max-width: 520px;
  margin-top: 18px;
  font-size: clamp(2.35rem, 3.8vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: -0.025em;
}

.things-grid article:nth-child(3) h2 {
  font-size: clamp(2rem, 2.7vw, 3rem);
}

.things-grid p {
  max-width: 580px;
  margin-bottom: 0;
  font-size: clamp(1rem, 1.18vw, 1.16rem);
  line-height: 1.55;
  opacity: 0.82;
}

/* Sul pannello scuro il testo deve avere lo stesso contrasto netto del titolo. */
.things-grid article:nth-child(1) p {
  color: #f3e8da !important;
  opacity: 0.94;
}

#studio,
#dispensa {
  scroll-margin-top: 120px;
}

@media (max-width: 1200px) and (min-width: 841px) {
  .book-button {
    display: inline-flex;
  }

  .things-grid {
    grid-template-columns: 1fr 1fr;
  }

  .things-grid article:nth-child(3) {
    grid-column: 1 / -1;
    min-height: 280px;
  }
}

@media (max-width: 840px) {
  .private-area-button,
  .book-button {
    z-index: 4;
    min-width: 76px;
    min-height: 30px;
    width: auto;
    padding: 0 7px;
    display: inline-flex;
    position: absolute;
    top: 94px;
    font-size: 0.59rem;
  }

  .private-area-button {
    left: 8px;
  }

  .book-button {
    left: 88px;
    min-width: 94px;
  }

  .things-grid {
    grid-template-columns: 1fr;
  }

  .things-grid article,
  .things-grid article:not(:first-child) {
    min-height: 360px;
    padding: 34px 28px;
    border: 0;
  }

  .things-grid article:nth-child(3) {
    grid-column: auto;
    min-height: 280px;
  }
}

@media (max-width: 520px) {
  .private-area-button,
  .book-button {
    min-width: 67px;
    padding: 0 5px;
    font-size: 0.54rem;
  }

  .book-button {
    left: 78px;
    min-width: 86px;
  }

  .things-grid article,
  .things-grid article:not(:first-child) {
    min-height: 330px;
    padding: 30px 24px;
  }
}

/* Versione 13: homepage editoriale ispirata al layout approvato. */
@media (min-width: 841px) {
  .site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 108px;
    padding: 0 28px 0 38px;
    grid-template-columns: 42.5% 57.5%;
    gap: 0;
    background: linear-gradient(
      90deg,
      rgba(247, 240, 228, 0.98) 0%,
      rgba(247, 240, 228, 0.98) 42.5%,
      rgba(24, 18, 13, 0.22) 42.5%,
      rgba(24, 18, 13, 0.08) 100%
    );
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 24px rgba(24, 15, 8, 0.08);
  }

  .brand {
    justify-self: start;
    width: min(100%, 330px);
  }

  .main-nav {
    z-index: 60;
    background: var(--paper-light);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 18px 34px 30px;
    display: none;
    position: fixed;
    top: 108px;
    left: 0;
    right: 0;
    box-shadow: 0 18px 30px rgba(42, 27, 14, 0.15);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav button {
    color: var(--ink);
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 15px 0;
  }

  .main-nav button:first-child::after {
    display: none;
  }

  .header-actions {
    justify-content: flex-end;
    min-width: 0;
    gap: clamp(8px, 1vw, 14px);
  }

  .menu-button {
    color: #fffaf2;
    display: block;
  }

  .hero-main {
    height: min(860px, 100vh);
    min-height: 720px;
    grid-template-columns: 42.5% 57.5%;
  }

  .hero-background {
    inset: 0 0 0 42.5%;
    width: 57.5%;
    height: 100%;
    object-position: center center !important;
    transform: none;
    filter: saturate(0.98) contrast(1.02) brightness(1.01);
  }

  .hero-main::after {
    background: linear-gradient(
      90deg,
      rgba(247, 240, 228, 0.06) 0%,
      rgba(247, 240, 228, 0.02) 42.5%,
      rgba(40, 25, 13, 0.02) 58%,
      rgba(22, 14, 8, 0.08) 100%
    );
  }

  .hero-paper {
    background: rgba(247, 240, 228, 0.985);
    overflow: hidden;
  }

  .paper-grain {
    opacity: 0.28;
  }

  .true-handwriting-crop {
    top: 14%;
    left: 3.5%;
    width: 91%;
  }

  .house-sketch {
    width: 60%;
    height: auto;
    top: 25%;
    right: 1%;
    bottom: auto;
    opacity: 0.92;
    outline: 1px solid rgba(89, 60, 32, 0.08);
    box-shadow: 0 18px 28px rgba(39, 24, 12, 0.13);
    transform: perspective(1400px) rotateY(-1.2deg) rotateZ(-0.3deg);
  }

  .hero-copy {
    width: 34%;
    top: 38%;
    left: 4%;
  }

  .hero-copy p {
    margin-bottom: 24px;
    font-size: clamp(1.02rem, 1.25vw, 1.32rem);
    line-height: 1.48;
  }

  .personal-note {
    margin-top: 27px;
    font-size: clamp(1.32rem, 1.55vw, 1.72rem);
  }

  .marco-signature {
    font-size: clamp(1.38rem, 1.65vw, 1.82rem);
  }

  .mg-mark {
    width: 4.5%;
    height: 8%;
    right: 2.5%;
    bottom: 5%;
    opacity: 0.58;
  }
}

.private-area-button {
  display: none;
}

.portal-links {
  flex: none;
  align-items: center;
  gap: 7px;
  display: flex;
}

.portal-button {
  min-height: 38px;
  min-width: 104px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  white-space: nowrap;
  padding: 0 13px;
  font: 700 0.69rem Arial, sans-serif;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.portal-button:hover,
.portal-button:focus-visible {
  transform: translateY(-1px);
}

.portal-officina {
  color: #fffaf2;
  background: rgba(25, 19, 14, 0.72);
  border: 1px solid rgba(255, 250, 242, 0.68);
}

.portal-dispensa {
  color: #24170c;
  background: rgba(238, 207, 159, 0.94);
  border: 1px solid rgba(99, 65, 28, 0.38);
}

.worlds-section {
  background: #eee1ce;
}

.worlds-heading {
  max-width: 820px;
}

.worlds-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.world-card {
  min-height: 430px;
  padding: clamp(34px, 5vw, 72px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  scroll-margin-top: 120px;
}

.world-card::before {
  content: "";
  width: clamp(180px, 22vw, 330px);
  aspect-ratio: 1;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.11;
  position: absolute;
  top: -22%;
  right: -7%;
}

.world-officina {
  color: #f7efe3;
  background: linear-gradient(145deg, #18130f, #38291e);
}

.world-dispensa {
  color: #24180f;
  background: linear-gradient(145deg, #d3ad77, #eed8b6 56%, #f5ead9);
}

.world-status {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid currentColor;
  align-self: flex-start;
  padding: 8px 11px;
  position: absolute;
  top: 30px;
  left: 30px;
  font: 700 0.68rem Arial, sans-serif;
  opacity: 0.75;
}

.world-index {
  margin: 0 0 16px;
  font: 700 0.75rem Arial, sans-serif;
  letter-spacing: 0.14em;
  opacity: 0.58;
}

.world-card h2 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(2.55rem, 4.5vw, 5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.world-card > p:last-child {
  max-width: 620px;
  margin: 28px 0 0;
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  line-height: 1.55;
  opacity: 0.82;
}

@media (max-width: 1200px) and (min-width: 841px) {
  .book-button {
    display: none;
  }

  .languages button {
    min-width: 31px;
  }

  .portal-button {
    min-width: 94px;
  }
}

@media (max-width: 840px) {
  .site-header {
    height: 132px;
    background: rgba(247, 240, 228, 0.98);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  .main-nav {
    top: 132px;
  }

  .hero,
  .section,
  .services-section,
  .where-section,
  .contact-section,
  .world-card {
    scroll-margin-top: 132px;
  }

  .portal-links {
    z-index: 4;
    position: absolute;
    top: 94px;
    left: 12px;
    gap: 4px;
  }

  .portal-button {
    min-width: 80px;
    min-height: 30px;
    padding: 0 8px;
    font-size: 0.61rem;
  }

  .portal-officina {
    color: #f8efe3;
    background: #2b2119;
    border-color: #2b2119;
  }

  .languages {
    top: 94px;
    right: 8px;
    left: auto;
    padding: 3px;
  }

  .languages button {
    min-width: 25px;
    height: 30px;
  }

  .hero-main {
    background: #d7c2a3;
  }

  .hero-paper {
    background: rgba(247, 240, 228, 0.96);
    overflow: hidden;
  }

  .hero-background {
    inset: 0;
    width: 100%;
  }

  .house-sketch {
    width: 57%;
    height: auto;
    top: 31%;
    right: -2%;
    bottom: auto;
  }

  .hero-copy {
    width: 39%;
    top: 32%;
    left: 5%;
  }

  .mg-mark {
    width: 6%;
    height: 8%;
    right: 3%;
    bottom: 5%;
  }

  .worlds-grid {
    grid-template-columns: 1fr;
  }

  .world-card {
    min-height: 370px;
  }
}

@media (max-width: 520px) {
  .site-header {
    height: 132px;
  }

  .brand {
    width: 188px;
  }

  .portal-links {
    top: 94px;
    left: 8px;
    gap: 3px;
  }

  .portal-button {
    min-width: 68px;
    padding: 0 5px;
    font-size: 0.56rem;
  }

  .languages {
    justify-content: flex-end;
    top: 94px;
    left: auto;
    right: 6px;
    gap: 2px;
  }

  .languages button {
    min-width: 22px;
    width: 22px;
    height: 30px;
    padding: 0;
    font-size: 0.58rem;
  }

  .main-nav {
    top: 132px;
  }

  .true-handwriting-crop {
    width: 91%;
    top: 7%;
  }

  .house-sketch {
    width: 60%;
    top: 32%;
    right: -3%;
  }

  .hero-copy {
    width: 40%;
    top: 31%;
    left: 4%;
  }

  .hero-copy p {
    font-size: 0.82rem;
  }

  .hero-copy p span:nth-child(2) {
    display: block;
  }

  .personal-note {
    margin-left: -10px;
    margin-right: -10px;
    font-size: 1.16rem;
  }

  .marco-signature {
    font-size: 1.3rem;
  }

  .mg-mark {
    width: 8%;
    height: 8%;
    right: 3%;
    bottom: 4%;
  }

  .world-card {
    min-height: 330px;
    padding: 30px 24px;
  }

  .world-status {
    top: 22px;
    left: 24px;
  }
}

/* Correzione d'ordine: questi accessi devono prevalere sulle regole legacy. */
.site-header .private-area-button,
.site-header .book-button {
  display: inline-flex;
}

@media (max-width: 840px) {
  .site-header .private-area-button,
  .site-header .book-button {
    z-index: 4;
    min-width: 76px;
    min-height: 30px;
    width: auto;
    padding: 0 7px;
    position: absolute;
    top: 94px;
    font-size: 0.64rem;
    letter-spacing: 0.075em;
  }

  .site-header .private-area-button {
    left: 8px;
    color: #fffaf2;
    background: #2b2119;
    border-color: #2b2119;
  }

  .site-header .private-area-button span {
    display: inline !important;
    white-space: nowrap;
  }

  .site-header .book-button {
    left: 88px;
    min-width: 94px;
  }
}

@media (max-width: 520px) {
  .site-header .private-area-button,
  .site-header .book-button {
    min-width: 67px;
    padding: 0 5px;
    font-size: 0.6rem;
  }

  .site-header .book-button {
    left: 78px;
    min-width: 86px;
  }
}

/* Un solo marrone profondo per tutte le superfici scure di Casa Galdi. */
:root {
  --casa-dark: #201a14;
  --charcoal: var(--casa-dark);
}

.facts-band,
.services-section,
.contact-section,
footer,
.things-grid article:nth-child(1) {
  background: var(--casa-dark) !important;
}

.primary-cta,
.site-header .private-area-button {
  background: var(--casa-dark) !important;
  border-color: var(--casa-dark) !important;
}

.home-image span,
.nido-main-photo,
.nido-thumb-photo {
  background-color: var(--casa-dark) !important;
}
