/* ==========================================================================
   Selmo del Pupo (selmodelpupo.it)
   Foglio di stile unificato e modernizzato retro-preserving
   ========================================================================== */

:root {
  --site-max-width: 740px;
  --font-main: Verdana, Arial, Helvetica, sans-serif;
  --font-serif: 'Times New Roman', Times, Georgia, serif;
  --color-text: #000000;
  --color-bg: #ffffff;
  --color-gray-box: #cccccc;
  --color-muted: #555555;
  --color-border: #eeeeee;
  --color-focus: #b07d4b;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Accessibilità tastiera */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ==========================================================================
   Contenitori Principali e Intestazioni Condivise
   ========================================================================== */
.site-wrapper {
  width: 100%;
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 10px 16px 40px;
}

.site-url {
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: #333333;
  padding-bottom: 8px;
  font-family: var(--font-main);
  user-select: none;
}

.site-header {
  margin-bottom: 6px;
}
.site-header a {
  display: inline-block;
  line-height: 0;
}
.site-header img {
  display: block;
  max-width: 100%;
  height: auto;
}

.section-badge {
  margin: 6px 0;
}
.section-badge img {
  display: block;
}

.page-title-badge {
  margin-bottom: 12px;
}
.page-title-badge img {
  display: block;
}

/* Dropcap iniziale per i testi narrativi */
.dropcap {
  float: left;
  font-size: 34px;
  line-height: 0.85;
  padding-top: 2px;
  padding-right: 4px;
  font-weight: bold;
}

/* Didascalie immagini */
.caption {
  font-size: 11px;
  color: var(--color-muted);
  text-align: right;
  margin-top: 5px;
  font-style: normal;
}

/* ==========================================================================
   Pulsanti Immagine con Rollover CSS (Niente JS obsoleto)
   ========================================================================== */
.btn-img {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  line-height: 0;
  border: 0;
  text-decoration: none;
}
.btn-img img {
  display: block;
  border: 0;
}
.btn-img .img-hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
  pointer-events: none;
}
.btn-img:hover .img-hover,
.btn-img:focus .img-hover {
  opacity: 1;
}

/* Pulsante Entra (Splash page) */
.btn-enter {
  display: inline-block;
  position: relative;
  line-height: 0;
}
.btn-enter img {
  display: block;
  border: 0;
}
.btn-enter .img-hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.btn-enter:hover .img-hover,
.btn-enter:focus .img-hover {
  opacity: 1;
}

/* Navigazione inferiore pagine interne */
.bottom-nav {
  margin-top: 24px;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--color-border);
}
.bottom-nav .btn-home {
  margin-left: auto;
}

/* ==========================================================================
   Splash Page (default.htm / index.html)
   ========================================================================== */
.splash-container {
  max-width: 760px;
  margin: 10px auto;
  padding: 0 10px;
}

/* Layout a griglia CSS 1:1 con l'originale Macromedia */
.splash-grid {
  display: grid;
  grid-template-columns: 243px 119px 317px;
  grid-template-rows: 121px 460px;
  width: 679px;
  margin: 0 auto;
  line-height: 0;
}
.splash-grid img {
  display: block;
}
.splash-h1 {
  grid-column: 1;
  grid-row: 1;
}
.splash-title {
  grid-column: 2 / span 2;
  grid-row: 1;
}
.splash-h2 {
  grid-column: 1;
  grid-row: 2;
}
.splash-h3 {
  grid-column: 2;
  grid-row: 2;
}
.splash-interactive {
  grid-column: 3;
  grid-row: 2;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 460px;
  padding-left: 10px;
}
.enter-wrapper {
  text-align: right;
  padding-top: 40px;
  padding-right: 15px;
}

/* ==========================================================================
   Animazione nativa "l'uomo / le mani / il legno" (Sostituzione Flash)
   ========================================================================== */
.flash-replacement {
  width: 310px;
  max-width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flash-replacement .phrase {
  position: absolute;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 38px;
  font-weight: normal;
  color: #000000;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  animation-duration: 12s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

.flash-replacement .phrase-1 {
  animation-name: animPhrase1;
}
.flash-replacement .phrase-2 {
  animation-name: animPhrase2;
}
.flash-replacement .phrase-3 {
  animation-name: animPhrase3;
}

@keyframes animPhrase1 {
  0% { opacity: 0; transform: scale(0.92); }
  6% { opacity: 1; transform: scale(1); }
  26% { opacity: 1; transform: scale(1.02); }
  33% { opacity: 0; transform: scale(1.08); }
  100% { opacity: 0; }
}

@keyframes animPhrase2 {
  0%, 33% { opacity: 0; transform: scale(0.92); }
  39% { opacity: 1; transform: scale(1); }
  59% { opacity: 1; transform: scale(1.02); }
  66% { opacity: 0; transform: scale(1.08); }
  100% { opacity: 0; }
}

@keyframes animPhrase3 {
  0%, 66% { opacity: 0; transform: scale(0.92); }
  72% { opacity: 1; transform: scale(1); }
  92% { opacity: 1; transform: scale(1.02); }
  98%, 100% { opacity: 0; transform: scale(1.08); }
}

/* ==========================================================================
   Home Page (home.htm)
   ========================================================================== */
.home-container {
  max-width: 710px;
  margin: 10px auto;
  padding: 0 10px;
}
.uomo-section {
  margin-top: 10px;
  margin-left: 105px;
}
.uomo-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
}
.arte-section {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.arte-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
}
.arte-badge {
  margin-top: 6px;
  margin-right: 15px;
}

/* Mosaico fotografico panoramico 7 bande continuo */
.photo-strip {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 705px;
  margin: 12px 0;
  line-height: 0;
}
.photo-strip img {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  height: auto;
}
.photo-strip img:first-child {
  flex: 1.05 1 0;
}

/* ==========================================================================
   Chi è (chie.htm)
   ========================================================================== */
.bio-layout {
  display: flex;
  gap: 20px;
  margin: 15px 0 20px;
}
.bio-text {
  flex: 1 1 300px;
  font-size: 13.5px;
  line-height: 1.6;
}
.bio-text p {
  margin-top: 0;
  margin-bottom: 14px;
}
.photos-col {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: flex-end;
}
.photos-col img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   Le Origini (origini.htm)
   ========================================================================== */
.origini-layout {
  display: flex;
  gap: 20px;
  margin: 15px 0 20px;
}
.origini-box {
  flex: 1 1 260px;
  background-color: var(--color-gray-box);
  padding: 16px;
  font-size: 13.5px;
  line-height: 1.6;
}
.origini-box p:first-child {
  margin-top: 0;
}
.origini-box .dropcap {
  font-size: 28px;
  line-height: 0.9;
}
.origini-right {
  flex: 1 1 380px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.origini-right figure {
  margin: 0;
}
.origini-right img {
  display: block;
  max-width: 100%;
  height: auto;
}
.claut-stats {
  font-size: 13.5px;
  line-height: 1.6;
  padding: 8px 0;
}

/* ==========================================================================
   La Famiglia (famiglia.htm)
   ========================================================================== */
.famiglia-text {
  font-size: 14px;
  line-height: 1.6;
  margin: 15px 0;
}
.famiglia-text p {
  margin-top: 0;
  margin-bottom: 12px;
}
.family-photo-wrapper {
  text-align: right;
  margin: 15px 0 25px;
}
.family-photo-wrapper figure {
  margin: 0;
  display: inline-block;
  max-width: 100%;
}
.family-photo-wrapper img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Le Esperienze (esperienze.htm)
   ========================================================================== */
.esperienze-layout {
  display: flex;
  gap: 24px;
  margin: 15px 0 20px;
}
.quotes-col {
  flex: 1 1 320px;
  font-size: 13.5px;
  line-height: 1.6;
  font-style: italic;
}
.quotes-col p {
  margin-top: 0;
  margin-bottom: 18px;
}
.photo-col {
  flex: 0 0 350px;
  text-align: right;
}
.photo-col figure {
  margin: 0;
  display: inline-block;
}
.photo-col img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   La Storia (storia.htm)
   ========================================================================== */
.storia-box {
  background: url('images/scritto.jpg') no-repeat left top;
  background-size: cover;
  min-height: 460px;
  padding: 24px 20px;
  margin: 15px 0 25px;
  font-size: 14px;
  line-height: 1.6;
}
.storia-box p {
  margin-top: 0;
  margin-bottom: 16px;
  max-width: 580px;
}

/* ==========================================================================
   Le Lavorazioni (lavorazioni.htm)
   ========================================================================== */
.lavorazioni-intro {
  font-size: 14px;
  line-height: 1.6;
  margin: 15px 0 20px;
}
.lavorazioni-intro p {
  margin-top: 0;
  margin-bottom: 14px;
}
.fasi-overview {
  margin: 20px 0 30px;
  text-align: center;
}
.fasi-overview img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}
.link-utensili {
  color: #0000ee;
  text-decoration: underline;
  cursor: pointer;
}
.link-utensili:hover {
  color: #0000aa;
}

.phase-card {
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 24px;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 16px;
}
.phase-photo img {
  display: block;
  width: 200px;
  height: 200px;
  object-fit: cover;
}
.phase-number {
  background-color: var(--color-gray-box);
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: bold;
  flex-shrink: 0;
  user-select: none;
}
.phase-desc {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.6;
}
.phase-desc b {
  font-size: 15px;
  display: block;
  margin-bottom: 6px;
}

/* Link rapido al video nell'intro */
.video-jump-bar {
  margin-top: 12px;
  padding: 8px 12px;
  background-color: #f5f2eb;
  border-left: 3px solid var(--color-focus);
  font-size: 13px;
}
.video-jump-bar a {
  color: #7b4a1e;
  font-weight: bold;
  text-decoration: underline;
}
.video-jump-bar a:hover {
  color: #000000;
}

/* Sezione Video Documentario (L'ultimo Sedoner) */
.video-section {
  margin: 36px 0 24px;
  padding: 20px;
  background-color: #faf8f5;
  border: 1px solid #e0dacf;
  border-left: 4px solid var(--color-focus);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.video-header {
  margin-bottom: 12px;
}
.video-title {
  font-family: var(--font-serif);
  font-size: 19px;
  color: #3e3328;
  margin: 0 0 6px 0;
  font-weight: bold;
}
.video-subtitle {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--color-muted);
  margin: 0;
}
.video-embed-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* Rapporto 16:9 */
  height: 0;
  overflow: hidden;
  background-color: #000000;
  margin: 16px 0 8px;
  border: 1px solid #c8bead;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}
.video-embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-credits {
  font-size: 12px;
  color: #777777;
  text-align: right;
  margin-top: 8px;
}
.video-credits a {
  color: #7b4a1e;
  text-decoration: underline;
}
.video-credits a:hover {
  color: #000000;
}

/* Lightbox modale per utensili */
.modal-overlay {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: #ffffff;
  padding: 12px;
  max-width: 95vw;
  max-height: 90vh;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  position: relative;
  text-align: center;
}
.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  margin: 0 auto;
}
.modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  background: #000000;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  line-height: 28px;
  text-align: center;
}
.modal-close:hover {
  background: #333333;
}

/* ==========================================================================
   Gli Utensili (utensili.htm)
   ========================================================================== */
.utensili-text {
  font-size: 14px;
  line-height: 1.6;
  margin: 15px 0 20px;
}
.utensili-text p {
  margin-top: 0;
  margin-bottom: 14px;
}
.utensili-list {
  margin-top: 8px;
  padding-left: 0;
  list-style-type: none;
  font-weight: 500;
}
.utensili-photo {
  text-align: center;
  margin: 20px 0 25px;
}
.utensili-photo img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

/* ==========================================================================
   I Prodotti (prodotti.htm)
   ========================================================================== */
.prodotti-layout {
  display: flex;
  gap: 24px;
  margin: 15px 0 20px;
}
.prodotti-text {
  flex: 1 1 320px;
  font-size: 13.5px;
  line-height: 1.6;
}
.prodotti-text p {
  margin-top: 0;
  margin-bottom: 16px;
}
.prodotti-photo {
  flex: 0 0 360px;
  text-align: right;
}
.prodotti-photo img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

/* ==========================================================================
   Utensili Standalone (utensili2.htm)
   ========================================================================== */
.utensili-standalone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
}
.utensili-standalone img {
  max-width: 100%;
  height: auto;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.back-link {
  margin-top: 15px;
  font-size: 14px;
  color: #333333;
}
.back-link a {
  color: #0000ee;
  text-decoration: none;
}
.back-link a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Media Queries & Responsività
   ========================================================================== */
@media (max-width: 700px) {
  .site-wrapper {
    padding: 8px 12px 30px;
  }
  
  /* Splash page su mobile */
  .splash-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
  }
  .splash-grid img {
    max-width: 100%;
    height: auto;
  }
  .splash-interactive {
    height: auto;
    padding: 20px 0;
    align-items: center;
    width: 100%;
  }
  .enter-wrapper {
    text-align: center;
    padding-top: 20px;
    padding-right: 0;
  }

  /* Home page su mobile */
  .uomo-section {
    margin-left: 0;
  }
  .arte-section {
    align-items: flex-start;
  }
  .arte-nav {
    justify-content: flex-start;
  }
  .arte-badge {
    margin-right: 0;
  }

  /* Layout due colonne su mobile */
  .bio-layout,
  .origini-layout,
  .esperienze-layout,
  .prodotti-layout {
    flex-direction: column;
  }

  .photos-col,
  .photo-col,
  .prodotti-photo,
  .family-photo-wrapper {
    flex: auto;
    text-align: center;
    align-items: center;
  }
  .caption {
    text-align: center;
  }

  /* Lavorazioni su mobile */
  .phase-card {
    flex-direction: column;
  }
  .phase-photo img {
    width: 100%;
    height: auto;
  }
  .phase-number {
    width: 100%;
    height: 40px;
    font-size: 24px;
  }

  /* Navigazione inferiore */
  .bottom-nav {
    justify-content: center;
  }
  .bottom-nav .btn-home {
    margin-left: 0;
    width: 100%;
    text-align: center;
    margin-top: 8px;
  }
}

/* ==========================================================================
   Stili di Stampa
   ========================================================================== */
@media print {
  body {
    background: #ffffff;
    color: #000000;
    font-size: 12pt;
  }
  .site-url, .bottom-nav, .btn-img, .modal-overlay, .site-header {
    display: none !important;
  }
  .site-wrapper {
    max-width: 100%;
    padding: 0;
  }
  .storia-box {
    background: none !important;
    padding: 0 !important;
    min-height: auto !important;
  }
}
