/* ──────────────────────────────────────────────────────────────────
   book-page-ui.css  —  UI condivisa pagine IT + EN del libro
   Caricato da entrambe le index: it/suono-elettronico/ e en/play-with-sound/
   ────────────────────────────────────────────────────────────────── */

/* ── Accent token per capitolo ──────────────────────────────────── */
.section.green  { --accent: #27ae60; }
.section.orange { --accent: #e67e22; }
.section.red    { --accent: #e74c3c; }
.section.teal   { --accent: #1abc9c; }
.section.navy   { --accent: #2c3e50; }

/* ── Interactive Graphics block: ig-block / ig-grid / ig-card ───── */
.ig-block { margin-top: 5px; padding-top: 5px;  }
.ig-block-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.2rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}

.ig-block-label .play {
  width: 24px; height: 24px;
  display: none; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border-radius: 50%; font-size: 11px;
}
.ig-block-label .count { margin-left: auto; color: #9aa1a8; font-weight: 500; letter-spacing: 0.08em; }
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 768px) { .ig-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } 
.ig-block {padding-left: 12px; padding-right: 0px;} }
.ig-card {
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit; background: #fff;
  border: 4px solid var(--accent);
  transition: background 0.2s;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
}
.ig-card:hover { background: var(--accent); }
.ig-card .preview {
  aspect-ratio: 16/8; background: #fafafa;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 0px solid var(--accent);
  overflow: hidden; transition: background 0.2s; position: relative;
}
.ig-card .preview img {
  width: 100%; height: 100%; object-fit: contain; background: #fff;
  transform: scale(1.4);
  transition: transform 0.4s ease;
}
.ig-card:hover .preview img { transform: scale(1.4); }
.ig-card .label {
  padding: 10px 12px 12px;
  font-size: 16.5px; font-weight: 800; letter-spacing: 0.02em;
  color: var(--accent); line-height: 1.2;
  transition: color 1.0s;
}
.ig-card:hover .label { color: #fff; }
.ig-card:hover { text-decoration: none; }

@media (max-width: 768px) {
  .ig-card {
    display: block;
    aspect-ratio: 16 / 7;
    border-width: 3px;
  }

  .ig-card .preview {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }

  .ig-card .preview img,
  .ig-card:hover .preview img {
    object-fit: cover;
    transform: scale(1.4);
  }

  .ig-card .label,
  .ig-card:hover .label {
    position: absolute;
    top: 50%;
    left: 50%;
    right: auto;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    max-width: calc(100% - 16px);
    min-height: 20px;
    padding: 4px 5px;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.15;
    text-align: center;
    color: var(--accent);
    background: #fff;
    transform: translate(-50%, -50%);
  }
}

/* ── Icone bottoni via ::before ─────────────────────────────────── */

/* .btn-slide — icona slide (rect 16:9 + header line)
   Usa CSS mask per ereditare currentColor automaticamente. */
.btn-slide::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background-color: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='5' width='19' height='14'/%3E%3Cline x1='2.5' y1='9.5' x2='21.5' y2='9.5'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='5' width='19' height='14'/%3E%3Cline x1='2.5' y1='9.5' x2='21.5' y2='9.5'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

/* .btn-interactive — gif animata */
.btn-interactive::before {
  content: '';
  display: inline-block;
  width: 30px;
  height: 25px;
  flex-shrink: 0;
  background-image: url('/img/book/ico_anim.gif');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  mix-blend-mode: multiply;
}

/* .btn-zip — icona ZIP */
.btn-zip::before {
  content: '';
  display: inline-block;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background-image: url('/img/book/icon_zip.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* .ear-training-link — SVG orecchio via mask (stesso di eartraining-link-btn) */
.ear-training-link::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background-color: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52.53 52.53' fill='none' stroke='white' stroke-linecap='round' stroke-width='3'%3E%3Cpath stroke-miterlimit='10' d='M30.2,39.85c0,4-3.24,7.24-7.24,7.24s-6.26-3.36-7.24-7.24c-2.53-10.06-12.31-8.53-12.31-21.02,0-7.4,6-13.39,13.39-13.39s13.39,6,13.39,13.39'/%3E%3Cpath stroke-linejoin='round' stroke-miterlimit='10' d='M22.15,29.07c-2.32,0-4.21-1.88-4.21-4.21s1.88-4.21,4.21-4.21c0-2.95-2.39-5.34-5.34-5.34s-5.34,2.39-5.34,5.34'/%3E%3Cpath stroke-miterlimit='10' d='M49.02,23.64c-3.4,0-3.4,10.85-6.8,10.85s-3.4-10.85-6.81-10.85-3.4,10.85-6.81,10.85'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52.53 52.53' fill='none' stroke='white' stroke-linecap='round' stroke-width='3'%3E%3Cpath stroke-miterlimit='10' d='M30.2,39.85c0,4-3.24,7.24-7.24,7.24s-6.26-3.36-7.24-7.24c-2.53-10.06-12.31-8.53-12.31-21.02,0-7.4,6-13.39,13.39-13.39s13.39,6,13.39,13.39'/%3E%3Cpath stroke-linejoin='round' stroke-miterlimit='10' d='M22.15,29.07c-2.32,0-4.21-1.88-4.21-4.21s1.88-4.21,4.21-4.21c0-2.95-2.39-5.34-5.34-5.34s-5.34,2.39-5.34,5.34'/%3E%3Cpath stroke-miterlimit='10' d='M49.02,23.64c-3.4,0-3.4,10.85-6.8,10.85s-3.4-10.85-6.81-10.85-3.4,10.85-6.81,10.85'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}
