
/* MOBILE + ACCESSIBILITY + PERFORMANCE V47 */
html { -webkit-text-size-adjust: 100%; }
img { max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }

/* Mobile navigation: full-width, readable, touch-friendly menu. */
@media (max-width: 768px) {
  nav { padding-top: max(18px, env(safe-area-inset-top)); padding-left: 20px; padding-right: 20px; }
  nav.scrolled { padding-left: 20px; padding-right: 20px; }
  .nav-menu { width: 44px; height: 44px; align-items: center; justify-content: center; padding: 10px; margin: -10px; }
  .nav-menu span { width: 22px; }
  .nav-links.mobile-open {
    display: flex !important;
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    min-height: 100dvh;
    padding: 96px 28px 32px !important;
    margin: 0 !important;
    gap: 0 !important;
    justify-content: flex-start;
    background: rgba(10,10,10,.98) !important;
    border: 0 !important;
    overflow-y: auto;
    z-index: 99;
  }
  .nav-links.mobile-open li { width: 100%; }
  .nav-links.mobile-open a {
    display: block;
    padding: 15px 0;
    font-size: 12px;
    letter-spacing: .16em;
    border-bottom: 1px solid rgba(245,242,238,.08);
  }
  .nav-menu.is-open { position: relative; z-index: 101; }
  .nav-menu.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
  .nav-menu.is-open span:nth-child(2) { opacity: 0; }
  .nav-menu.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

  body.menu-open { overflow: hidden; }
  .hero { min-height: 100svh; height: 100svh; }
  .hero-content { max-width: calc(100vw - 48px); }
  .hero-title { font-size: clamp(32px, 10vw, 48px); }
  .hero-label { font-size: 9px; }
  .hero-nav { gap: 8px; }
  .hero-btn { width: 42px; height: 42px; }
  .scroll-hint { bottom: max(24px, env(safe-area-inset-bottom)); }

  section { padding-left: 20px; padding-right: 20px; }
  .section-header { margin-bottom: 36px; }
  .section-title { font-size: clamp(30px, 9vw, 42px); }
  .gallery-categories { gap: 8px; margin-bottom: 28px; }
  .cat-btn { min-height: 40px; padding: 9px 13px; }

  .gallery-home .grid-masonry, .gallery-full .grid-masonry {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 2px !important;
  }
  .gallery-home .grid-item, .gallery-full .grid-item { aspect-ratio: 3 / 2; }
  .grid-item-info { padding: 12px; }
  .grid-item-info p { font-size: 9px; }

  .about-strip { gap: 32px; }
  .about-img-wrap { max-width: 360px; }
  .project-current-grid { width: 100%; }

  .lightbox { padding: 64px 12px 24px; }
  .lightbox img { max-width: 96vw; max-height: 76svh; }
  .lightbox-close { top: max(18px, env(safe-area-inset-top)); right: 18px; padding: 10px; }
  .lightbox-caption { max-width: 88vw; text-align: center; line-height: 1.5; }
}

@media (max-width: 480px) {
  .nav-brand { font-size: 20px; }
  .hero-content { left: 20px; bottom: 48px; }
  .hero-nav { right: 20px; bottom: 48px; }
  .gallery-home .grid-masonry, .gallery-full .grid-masonry { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .cookie-banner { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* On touch devices Progetti has no mouse torcia: keep the page clean and usable. */
@media (hover: none), (pointer: coarse) {
  .projects-v10 .projects-light-spot { display: none !important; }
  .projects-v10, .projects-v10 * { cursor: auto !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Improve keyboard focus without changing the visual language. */
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

/* V48 — Home "Il fotografo": ritratto più compatto e circolare. */
.about-strip .about-img-wrap {
  flex: 0 0 250px;
  width: 250px;
  max-width: 250px;
  height: 250px;
  position: relative;
  box-shadow: 0 28px 80px rgba(0,0,0,.3);
}
.about-strip .about-img-wrap img {
  display: block;
  width: 250px;
  height: 250px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center center;
  border-radius: 50%;
  filter: grayscale(20%);
}
.about-strip .about-img-wrap::before {
  top: -10px;
  left: -10px;
  right: 10px;
  bottom: 10px;
  border-radius: 50%;
}

@media (max-width: 768px) {
  .about-strip .about-img-wrap {
    flex: 0 0 220px;
    width: 220px;
    max-width: 220px;
    height: 220px;
  }
  .about-strip .about-img-wrap img {
    width: 220px;
    height: 220px;
  }
}
