/* Custom index landing page styles - minimal magazine layout */

@font-face {
  font-family: 'Cormorant';
  src: url('/fonts/Cormorant/Cormorant-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Cormorant';
  src: url('/fonts/Cormorant/Cormorant-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/Montserrat/Montserrat-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/Montserrat/Montserrat-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

:root {
  --bg-color: #FBF6F2;
  --text-color: #301D09;
  --accent-color: #8E2F22;
  --font-serif: 'Cormorant', Georgia, serif;
  --font-sans: 'Montserrat', sans-serif;
  --editorial-ease: cubic-bezier(0.25, 1, 0.5, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  background-color: #FBF6F2;
}

body.magazine-landing {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-sans);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 1.5rem 0;
  opacity: 0;
  animation: pageFadeIn 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.magazine-header,
.magazine-main {
  width: 90%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.legal-imprint {
  position: fixed;
  right: 0;
  top: 50vh;
  z-index: 20;
  display: flex;
  justify-content: center;
  width: 2.2rem;
  transform: translateY(-50%);
  pointer-events: none;
  animation: legalSlideIn 1.2s var(--editorial-ease) 1.35s both;
}

.legal-imprint-link {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  transform-origin: center;
  color: rgba(48, 29, 9, 0.62);
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.3s ease;
  pointer-events: auto;
}

.legal-imprint-link:hover {
  color: var(--accent-color);
}

/* Header */
.magazine-header {
  display: flex;
  justify-content: space-between;
  /* Allinea il logo brandmark a destra, con lo stesso margine del layout */
  align-items: center;
  z-index: 10;
  padding-top: 1.2rem;
  /* Padding top per distanziare il logo dal bordo superiore */
}

.landing-edition-switcher {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 1rem;
  color: var(--text-color);
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  animation: slideFromLeft 1.15s var(--editorial-ease) 0.18s both;
}

.landing-edition-label {
  color: var(--text-color);
  opacity: 0.6;
}

.landing-edition-links {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}

.landing-edition-link {
  color: var(--text-color);
  opacity: 0.6;
  text-decoration: none;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.landing-edition-link.active,
.landing-edition-link:hover {
  color: var(--text-color);
  opacity: 1;
}

.landing-edition-link.active {
  font-weight: 600;
}

.landing-edition-divider {
  color: var(--accent-color);
  opacity: 0.35;
  letter-spacing: 0;
}

.logo-wrap {
  display: flex;
  align-items: center;
  animation: slideFromRight 1.15s var(--editorial-ease) 0.28s both;
}

.logo-image {
  height: 60px;
  width: auto;
  object-fit: contain;
  filter: brightness(0.2);
  /* Make the brandmark logo dark brown to stand out on light sand background */
}

@media (max-width: 768px) {
  .logo-image {
    height: 42px;
  }
}

/* Main Layout */
.magazine-main {
  flex-grow: 1;
  display: grid;
  grid-template-columns: 0.97fr 1.53fr;
  /* Shift grid to give image 61% of the screen width */
  align-items: center;
  gap: 3rem;
  /* Reduced gap to fit wider content */
  margin: 0.5rem auto;
  /* Reduced margin to maximize vertical room */
}

/* Left Section: Text Content */
.magazine-text-section {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  position: relative;
  min-width: 0;
}

.title-year-vertical {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-color);
  transform: rotate(-90deg);
  transform-origin: left bottom;
  position: absolute;
  bottom: calc(100% + 2.5rem);
  /* Posizionato sopra la parte centrale/destra della parola VESSANO */
  left: clamp(8rem, 22vw, 18rem);
  white-space: nowrap;
  animation: slideUpVertical 1.35s var(--editorial-ease) 0.48s both;
}

.main-content-wrap {
  /* margin-left rimosso: i margini laterali sono gestiti solo dal body padding
     per garantire simmetria sinistra/destra */
  margin-left: 0;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 5.5rem;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: clamp(5.5rem, 14vw, 13rem);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: 0.05em;
  /* Widened the space between letters of VESSANO */
  color: var(--text-color);
  text-transform: uppercase;
  white-space: nowrap;
  /* Prevent wrapping so it spans horizontally and overlaps the image */
  position: relative;
  z-index: 5;
  animation: titleReveal 1.45s var(--editorial-ease) 0.62s both;
}

.divider-wavy {
  width: 120px;
  height: 12px;
  color: var(--accent-color);
  opacity: 0.8;
  animation: slideFromLeft 1.15s var(--editorial-ease) 0.8s both;
}

.divider-wavy svg {
  width: 100%;
  height: 100%;
}

.brand-description {
  position: relative;
  z-index: 6;
  width: 640px;
  max-width: calc(100vw - 14%);
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 400;
  color: var(--text-color);
  opacity: 0.85;
  /* Leggermente rientrato per allinearsi con la V di VESSANO */
  margin-left: 1.5rem;
  animation: slideFromBottom 1.15s var(--editorial-ease) 0.92s both;
}

.cta-wrap {
  margin-top: 0.8rem;
  /* Ridotto da 1.8rem per spostare il bottone più in alto */
  /* Leggermente rientrato per allinearsi con brand-description */
  margin-left: 1.5rem;
  animation: slideFromBottom 1.15s var(--editorial-ease) 1.08s both;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  text-decoration: none;
  color: var(--accent-color);
  font-weight: 600;
  letter-spacing: 0.25em;
  font-size: 0.98rem;
  line-height: 1.5;
  transition: all 0.4s ease;
}

.cta-button::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 100%;
  height: 1px;
  background: currentColor;
  opacity: 0.42;
  transform: scaleX(0.38);
  transform-origin: left center;
  animation: ctaEditorialPulse 3.8s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

.mobile-cta-break {
  display: none;
}

@media (hover: hover) {
  .cta-button:hover {
    color: var(--accent-color);
    padding-left: 0.5rem;
  }

  .cta-button:hover::after {
    opacity: 0.72;
    transform: scaleX(1);
  }
}

.cta-arrow {
  transition: transform 0.4s ease;
}

@media (hover: hover) {
  .cta-button:hover .cta-arrow {
    transform: translateX(6px);
  }
}

/* Right Section: Image */
.magazine-image-section {
  display: flex;
  justify-content: flex-start;
  /* Cambio da flex-end a flex-start */
  align-items: center;
  position: relative;
  height: 100%;
  animation: imageReveal 1.55s var(--editorial-ease) 0.38s both;
}

.image-panel {
  position: relative;
  width: 100%;
  max-width: 700px;
  /* Constrained to 700px to match the image section intent */
  height: 65vh;
  max-height: 670px;
  background-color: transparent;
  padding: 0;
  box-shadow: none;
  border: none;
  overflow: hidden;
  margin-left: 0;
  /* Forza l'immagine a sinistra della sua colonna */
  clip-path: inset(0 0 0 0);
  animation: imageEditorialMask 1.65s var(--editorial-ease) 0.34s both;
}

.image-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--bg-color);
  transform: translateX(0);
  animation: imageCurtain 1.45s var(--editorial-ease) 0.42s both;
  pointer-events: none;
}

.image-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: transparent;
  pointer-events: none;
  z-index: 1;
}

.screen-edge-barcode {
  --barcode-width: clamp(112px, 9vw, 156px);
  display: block;
  position: fixed;
  left: -30px;
  bottom: 5rem;
  z-index: 11;
  width: var(--barcode-width);
  height: auto;
  object-fit: contain;
  transform: rotate(90deg);
  transform-origin: center;
  opacity: 0.82;
  mix-blend-mode: multiply;
  pointer-events: none;
  animation: barcodeReveal 1.15s var(--editorial-ease) 1.18s both;
}

.editorial-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.image-panel:hover .editorial-image {
  transform: scale(1.02);
}

.image-label {
  position: absolute;
  right: -2rem;
  bottom: 4rem;
  transform: rotate(90deg);
  transform-origin: right bottom;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--text-color);
  opacity: 0.5;
  white-space: nowrap;
  animation: slideFromRightRotated 1.1s var(--editorial-ease) 1.2s both;
}

.cover-social-links {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
  animation: slideFromBottom 1.2s var(--editorial-ease) 1.3s both;
}

.social-link {
  text-decoration: none;
  color: var(--text-color);
  opacity: 0.6;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.social-link:hover {
  opacity: 1;
  color: var(--text-color);
}

.social-separator {
  color: var(--accent-color);
  opacity: 0.4;
}


/* Keyframes */
@keyframes pageFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes headerSettle {
  from {
    transform: translateY(-14px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes editorialSlideIn {
  from {
    transform: translateY(16px);
    opacity: 0;
    filter: blur(3px);
  }

  to {
    transform: translateY(0);
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes slideFromLeft {
  from {
    transform: translateX(-34px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideFromRight {
  from {
    transform: translateX(34px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideFromBottom {
  from {
    transform: translateY(28px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideFromRightRotated {
  from {
    transform: rotate(90deg) translate(28px, -18px);
    opacity: 0;
  }

  to {
    transform: rotate(90deg) translate(0, 0);
    opacity: 0.5;
  }
}

@keyframes slideUpVertical {
  from {
    transform: translateY(-34px) rotate(-90deg) translate(-2rem, -2rem);
    opacity: 0;
  }

  to {
    transform: translateY(0) rotate(-90deg) translate(-2rem, -2rem);
    opacity: 1;
  }
}

@keyframes slideUpVerticalMobile {
  from {
    transform: translateY(-34px) rotate(-90deg) translate(3.4rem, -2rem);
    opacity: 0;
  }

  to {
    transform: translateY(0) rotate(-90deg) translate(3.4rem, -2rem);
    opacity: 1;
  }
}


@keyframes titleReveal {
  from {
    transform: translateX(-42px);
    opacity: 0;
    letter-spacing: 0.16em;
  }

  to {
    transform: translateX(0);
    opacity: 1;
    letter-spacing: 0.05em;
  }
}

@keyframes textReveal {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes imageReveal {
  from {
    transform: scale(1.02) translateX(42px);
    opacity: 0;
    filter: saturate(0.6) contrast(0.92);
  }

  to {
    transform: scale(1) translateX(0);
    opacity: 1;
    filter: saturate(1) contrast(1);
  }
}

@keyframes imageEditorialMask {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes imageCurtain {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(104%);
  }
}

@keyframes fadeInDelay {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes detailFadeIn {
  from {
    transform: translateX(18px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes legalSlideIn {
  from {
    transform: translate(18px, -50%);
    opacity: 0;
  }

  to {
    transform: translate(0, -50%);
    opacity: 1;
  }
}

@keyframes barcodeReveal {
  from {
    transform: rotate(90deg) translateX(34px);
    opacity: 0;
  }

  to {
    transform: rotate(90deg) translateX(0);
    opacity: 0.82;
  }
}

@keyframes ctaEditorialPulse {
  0%,
  100% {
    opacity: 0.28;
    transform: scaleX(0.38);
  }

  50% {
    opacity: 0.68;
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .magazine-header,
  .landing-edition-switcher,
  .logo-wrap,
  .title-year-vertical,
  .brand-title,
  .divider-wavy,
  .brand-description,
  .cta-wrap,
  .magazine-image-section,
  .screen-edge-barcode,
  .image-label,
  .cover-social-links,
  .legal-imprint {
    animation-duration: 0.01ms;
    animation-delay: 0s;
  }

  .cta-button::after {
    animation: none;
    opacity: 0.58;
    transform: scaleX(1);
  }

}


/* Responsive / Mobile (Vertical) Layout */
@media (max-width: 900px) {
  body.magazine-landing {
    padding: 1rem 7%;
    overflow: hidden;
  }

  .magazine-header,
  .magazine-main {
    width: 100%;
    max-width: none;
  }

  .magazine-header {
    margin-bottom: 1rem;
    padding-top: 0.5rem;
    /* Nessun padding-right aggiuntivo: il body ha già padding simmetrico */
  }

  .landing-edition-switcher {
    grid-template-columns: auto auto;
    column-gap: 0.72rem;
    font-size: 0.58rem;
    letter-spacing: 0.1em;
  }

  .landing-edition-links {
    gap: 0.38rem;
  }

  .logo-image {
    height: 42px;
  }

  .magazine-main {
    grid-template-columns: 0.62fr 1.38fr;
    grid-template-rows: auto;
    gap: 0;
    margin: 1.5rem 0;
    position: relative;
  }

  .magazine-text-section {
    grid-column: 1 / -1;
    grid-row: 1;
    z-index: 10;
    align-items: flex-start;
    gap: 1rem;
    pointer-events: none;
  }

  .magazine-text-section * {
    pointer-events: auto;
  }

  .title-year-vertical {
    font-size: 1.1rem;
    top: 0.10rem;
    left: clamp(7rem, 17vw, 13rem);
    animation: slideUpVerticalMobile 1.35s var(--editorial-ease) 0.48s both;
  }

  .main-content-wrap {
    margin-left: 0;
    max-width: 66%;
    margin-top: 1.5rem;
    gap: 0.8rem;
  }

  .brand-title {
    font-size: clamp(3.9rem, 15vw, 6.5rem);
    white-space: nowrap;
    letter-spacing: 0.025em;
  }

  .brand-description {
    width: auto;
    max-width: 70%;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-left: 0.5rem;
    margin-top: 0.5rem;
  }

  .cta-wrap {
    margin-left: 0.5rem;
    margin-top: 0.55rem;
  }

  .cta-button {
    font-size: 0.82rem;
  }

  .mobile-cta-break {
    display: inline;
  }

  .magazine-image-section {
    grid-column: 2;
    grid-row: 1;
    z-index: 1;
    width: 100%;
    margin-top: 0;
    justify-content: flex-end;
  }

  .image-panel {
    width: 78%;
    height: 60vh;
    max-height: 520px;
    aspect-ratio: auto;
    margin-left: auto;
  }

  .editorial-image {
    object-position: 68% center;
  }

  .screen-edge-barcode {
    --barcode-width: clamp(88px, 24vw, 118px);
    left: -22px;
    bottom: 3.1rem;
  }

  .image-label {
    right: -1rem;
    bottom: 2rem;
    font-size: 0.5rem;
  }

  .cover-social-links {
    width: 100%;
    gap: 0.85rem;
    font-size: 0.58rem;
    letter-spacing: 0.1em;
  }

  .legal-imprint {
    display: flex;
    right: calc(3.5vw - 1.1rem);
    top: 50vh;
    width: 2.2rem;
    transform: translateY(-50%);
  }

  .legal-imprint-link {
    font-size: 0.5rem;
    letter-spacing: 0.14em;
  }

  .desktop-br {
    display: none;
  }
}
