/* ---------- PALETTE DEL SITO ---------- */
    :root {
      --primary-color: #b99304;
      --primary-color-hover: #836806;
      --secondary-color: #9a8871;
      --font-family: 'Jost', sans-serif;
      --font-special: 'Italianno', cursive;

      --gallery-radius: .75rem;
      --gallery-gap: 1.25rem;
    }

    body {
      background: #ffffff;
      color: #2c2c2c;
      font-family: var(--font-family);
    }

    /* ---------- GRIGLIA: 1 colonna mobile, 2 desktop ---------- */
    .gallery-mini {
      display: grid;
      grid-template-columns: 1fr;
      gap: var(--gallery-gap);
      /*max-width: 1000px;*/
      margin: 0 auto;
      align-items: start;         /* ← le card NON si stirano in altezza */
    }

    @media (min-width: 768px) {
      .gallery-mini {
        grid-template-columns: repeat(4, 1fr);
      }
    }

    /* ---------- ITEM ---------- */
    .gallery-mini__item {
      position: relative;
      display: block;
      width: 100%;
      margin: 0;
      padding: 0;
      border: 0;
      overflow: hidden;
      border-radius: var(--gallery-radius);
      background: #f4f0e8;        /* sfondo caldo dietro la foto */
      cursor: pointer;
      text-align: left;
      line-height: 0;             /* elimina gap sotto l'img */
      -webkit-tap-highlight-color: transparent;
      box-shadow: 0 6px 20px rgba(0,0,0,.08);
      transition: box-shadow .3s ease, transform .3s ease;
    }

    /* ---------- IMMAGINE SENZA CROP ---------- */
    .gallery-mini__item img {
      display: block;
      width: 100%;
      height: auto;               /* ← mantiene il rapporto naturale */
      /* nessun object-fit: la foto non viene mai tagliata */
      transition: transform .6s cubic-bezier(.2,.7,.3,1);
    }

    /* ---------- OVERLAY ---------- */
    .gallery-mini__overlay {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding: 1.1rem;
      pointer-events: none;
      line-height: 1.2;
      background: linear-gradient(
        to top,
        rgba(0, 0, 0, .78) 0%,
        rgba(0, 0, 0, .30) 50%,
        rgba(0, 0, 0, 0) 80%
      );
      opacity: 1;
      transition: opacity .35s ease;
    }

    .gallery-mini__title {
      font-family: var(--font-special);
      font-size: 2rem;
      line-height: 1.1;
      color: #fff;
      margin: 0;
    }

    .gallery-mini__tag {
      font-size: .65rem;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: var(--primary-color);
      font-weight: 600;
    }

    /* ---------- HOVER SOLO SU MOUSE ---------- */
    @media (hover: hover) and (pointer: fine) {
      .gallery-mini__item:hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 34px rgba(0,0,0,.16);
      }

      .gallery-mini__overlay { opacity: 0; }

      .gallery-mini__item:hover .gallery-mini__overlay,
      .gallery-mini__item:focus-visible .gallery-mini__overlay { opacity: 1; }

      .gallery-mini__item:hover img,
      .gallery-mini__item:focus-visible img { transform: scale(1.04); }
    }

    .gallery-mini__item:focus-visible {
      outline: 2px solid var(--primary-color);
      outline-offset: 3px;
    }

    /* ---------- LIGHTBOX ---------- */
    #lightbox .modal-content {
      background: #fff;
      border: 0;
      border-radius: var(--gallery-radius);
      box-shadow: 0 20px 60px rgba(0,0,0,.35);
      overflow: hidden;
    }

    #lightbox .modal-body {
      position: relative;
      padding: 0;
      background: #111;           /* letterbox elegante attorno alla foto */
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 200px;
    }

    #lightboxImg {
      display: block;
      max-width: 100%;
      max-height: 76vh;
      width: auto;
      height: auto;
      object-fit: contain;
    }

    #lightbox .modal-footer {
      border: 0;
      background: #fff;
      padding: .85rem 1.1rem;
      align-items: center;
    }

    #lightboxCaption {
      font-family: var(--font-special);
      font-size: 1.6rem;
      color: #2c2c2c;
      margin: 0;
    }

    #lightboxCounter {
      font-size: .75rem;
      letter-spacing: .08em;
      color: var(--secondary-color);
      font-weight: 500;
    }

    /* ---------- FRECCE NAVIGAZIONE ---------- */
    .lb-nav {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      width: 46px;
      height: 46px;
      display: grid;
      place-items: center;
      border: 0;
      border-radius: 50%;
      background: rgba(255,255,255,.92);
      color: #2c2c2c;
      box-shadow: 0 4px 14px rgba(0,0,0,.18);
      transition: background .2s ease, color .2s ease, transform .2s ease;
      z-index: 2;
    }
    .lb-nav:hover  { background: var(--primary-color); color: #fff; }
    .lb-nav:active { transform: translateY(-50%) scale(.92); }
    .lb-prev { left: .75rem; }
    .lb-next { right: .75rem; }

    /* ---------- CHIUDI ---------- */
    .lb-close {
      position: fixed;
      top: calc(.9rem + env(safe-area-inset-top, 0px));
      right: calc(.9rem + env(safe-area-inset-right, 0px));
      z-index: 1065;
      filter: invert(1) grayscale(1);
      opacity: .85;
    }
    .lb-close:hover { opacity: 1; }

    /* ---------- RIDUZIONE MOVIMENTO ---------- */
    @media (prefers-reduced-motion: reduce) {
      .gallery-mini__item,
      .gallery-mini__item img,
      .gallery-mini__overlay,
      .lb-nav { transition: none !important; }
      .gallery-mini__item:hover img { transform: none; }
    }