/* =========================
   CSS VARIABLES
   ========================= */
   :root {
    --color-header: #2f3e46;
    --color-footer: #2f3e46;
    --color-background: #ffffff;
  
    --color-cta-bg: #2f3e46;
    --color-cta-border: #2f3e46;
    --color-cta-hover: #cfa56e;
    --color-cta-border-hover: #cfa56e;
    --color-cta-text: #ffffff;
    --color-cta-shadow: rgba(0, 0, 0, 0.2);
    --color-bio:#ffd093;  
    --color-text-main: #344e41;
  }
  
  /* =========================
     RESET
     ========================= */
  *,
  *::before,
  *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  /* =========================
     BASE
     ========================= */
  html, body {
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--color-background);
  }
  
  .page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  /* =========================
     HEADER + NAV
     ========================= */
  .site-header {
    height: 10vh;
    background-color: var(--color-header);
  }
  
  .nav-bar {
    height: 100%;
    padding: 0 6vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
  }
  
  .nav-logo {
    color: white;
    font-weight: 600;
    letter-spacing: 0.1em;
  }
  
  .nav-links {
    list-style: none;
    display: flex;
    gap: 3vw;
  }
  
  .nav-links a {
    color: white;
    text-decoration: none;
    font-size: clamp(0.9rem, 2vw, 1rem);
    transition: color 0.25s ease;
  }
  
  .nav-links a:hover {
    color: var(--color-cta-hover);
  }
  
  #nav-toggle {
    display: none;
  }
  
  .nav-toggle-label {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
  }
  
  .nav-toggle-label span {
    width: 26px;
    height: 3px;
    background-color: white;
  }
  
  /* =========================
     MAIN
     ========================= */
  .site-main {
    flex: 1;
    padding: 0 6vw;
    padding-bottom: clamp(6vh, 8vh, 10vh);
  }

  /* =========================
     HOME PAGE SPECIFICA
     ========================= */
body.home-page .site-main {
  padding-bottom: 0 !important; /* rimuovi il margine extra che causa il rettangolo tra bio e footer */
}

body.home-page .bio-wrapper {
  margin-top: 0; /* Rimuove la distanza extra tra la bio e il footer nella home */
}


  /* =========================
     HERO
     ========================= */
  .hero {
    position: relative;
    min-height: 55vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    padding-top: 6vh;
    padding-bottom: clamp(6vh, 10vh, 14vh);
  }
  
  .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("img/foto sito.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center 10%;
    opacity: 0.18;
    z-index: 1;
  }

  .hero-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-top: 6vh;
  }

  .hero-text {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-text-main);
    text-align: center;
    opacity: 0;
    animation: heroFade 3.5s ease forwards;
  }

  @keyframes heroFade {
    0%   { opacity: 0; }
    70%  { opacity: 1; }
    100% { opacity: 0; }
  }

  /* =========================
     CTA
     ========================= */
  .cta-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.6vh, 2vh, 2.4vh);   
    margin-top: 4vh;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 2s ease forwards;
    animation-delay: 2.2s;
  }

  .cta-button {
    width: 90%;
    max-width: 800px;
    padding: clamp(0.8rem, 2.8vh, 1.8rem);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 600;
    background-color: var(--color-cta-bg);
    color: var(--color-cta-text);
    border: 3px solid var(--color-cta-border);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.35;
    letter-spacing: 0.01em;
  }

  @media (hover: hover) {
    .cta-button:hover {
      background-color: var(--color-cta-hover);
      border: 3px solid var(--color-cta-border-hover);
      transform: translateY(-4px);
      box-shadow: 0 10px 25px var(--color-cta-shadow);
    }
  }

  /* =========================
     BIO WRAPPER
     ========================= */
  .bio-wrapper {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    background-color: var(--color-bio);
    padding: 3.5rem 0;
    margin-top: clamp(6vh, 8vh, 10vh);
  }

  /* =========================
     BIO
     ========================= */
  .bio {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 clamp(2rem, 6vw, 8rem);
    font-size: clamp(1.05rem, 2.4vw, 1.2rem);
    line-height: 1.85;
    color: var(--color-text-main);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease forwards;
    animation-delay: 2.6s;
  }

  .bio p:first-of-type {
    margin-bottom: 2.4em;
  }

  .bio p + p {
    margin-top: 1.6em;
  }

  .bio p:last-of-type {
    margin-top: 2.8em;
  }

  /* =========================
     ROMANZI
     ========================= */
  .romanzi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(10vh, 14vh, 18vh);
    margin-top: clamp(14vh, 18vh, 22vh);
  }

  .romanzo-card {
    display: flex;
    gap: clamp(4vw, 6vw, 8vw);
    align-items: flex-start;
  }

  .romanzo-cover {
    width: clamp(140px, 22vw, 180px);
    flex-shrink: 0;
  }

  .romanzo-content {
    display: flex;
    flex-direction: column;
    gap: clamp(2vh, 3vh, 3.5vh);
  }

  .romanzo-copy {
    max-width: 70ch;
    line-height: 1.85;
  }

  .romanzo-content .cta-button.small {
    width: auto;
    align-self: flex-start;
    background: transparent;
    color: var(--color-cta-bg);
    border-width: 2px;
    box-shadow: none;
    padding: clamp(0.5rem, 1.5vh, 1rem);
  }

  @media (hover: hover) {
    .romanzo-content .cta-button.small:hover {
      background-color: var(--color-cta-hover);
      color: white;
      transform: translateY(-2px);
      box-shadow: 0 6px 15px var(--color-cta-shadow);
    }
  }

  /* =========================
     RACCONTI
     ========================= */
  .racconto-meta {
    margin-top: 0.8rem;
    text-align: center;
  }

  .racconto-titolo {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 0.2rem;
  }

  .racconto-genere {
    font-size: 0.9rem;
    opacity: 0.7;
  }

  /* =========================
     FOOTER
     ========================= */
  .site-footer {
    background-color: var(--color-footer);
    padding: 1.2rem 0;
  }

  .footer-text {
    color: white;
    font-size: 0.9rem;
    text-align: center;
    opacity: 0.85;
  }

  /* =========================
     ANIMAZIONI
     ========================= */
  @keyframes fadeUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* =========================
     MOBILE
     ========================= */
  @media (max-width: 768px) {

    .nav-toggle-label {
      display: flex;
    }

    .bio-wrapper {
      margin-top: 3.5vh;
    }

    .nav-links {
      position: absolute;
      top: 100%;
      right: 0;
      width: 100%;
      background-color: var(--color-header);
      flex-direction: column;
      padding: 4vh 0;
      gap: 4vh;
      display: none;
    }

    #nav-toggle:checked + .nav-toggle-label + .nav-links {
      display: flex;
    }

    .romanzo-card {
      flex-direction: column;
      align-items: center;
    }

    .romanzo-cover {
      width: 60%;
      max-width: 220px;
    }

    .romanzo-content .cta-button.small {
      align-self: center;
    }
  }

  /* =========================
     ACCESSIBILITÀ
     ========================= */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation: none !important;
      opacity: 1 !important;
      transform: none !important;
    }
  }

  @media (max-width: 1024px) {
    .site-main {
      padding-bottom: 8vh;
    }
  }  
  
  /* =========================
     STATI DOPO PRIMA VISITA
     ========================= */
  
  /* hero invisibile ma presente */
  body.hero-hidden .hero-text {
    animation: none !important;
    opacity: 0 !important;
  }

  /* CTA e BIO visibili senza animazioni */
  body.no-animations .cta-section,
  body.no-animations .bio {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
