/* =========================================================
   MICHELANGELO COMUNIDAD
   periodico.css
========================================================= */

html {
  scroll-padding-top: 100px;
}

.nav a.active:not(.nav-highlight) {
  color: var(--terracotta);
}

.visually-hidden {
  position: absolute;

  width: 1px;
  height: 1px;

  overflow: hidden;

  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}


/* =========================================================
   INTRODUCCIÓN
========================================================= */

.paper-intro {
  padding: 170px 5% 110px;

  background:
    radial-gradient(
      circle at 88% 30%,
      rgba(196, 154, 80, 0.2),
      transparent 32%
    ),
    radial-gradient(
      circle at 8% 85%,
      rgba(183, 101, 73, 0.12),
      transparent 30%
    ),
    var(--cream);

  overflow: hidden;
}

.paper-intro-inner {
  width: min(100%, var(--max-width));

  margin: auto;

  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);

  gap: 70px;
  align-items: center;
}

.paper-intro h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.045em;

  color: var(--ink);
}

.paper-intro h1 em {
  display: block;

  color: var(--green);
}

.paper-intro-lead {
  max-width: 560px;

  margin-top: 28px;

  font-size: 1.08rem;
  line-height: 1.7;

  color: var(--ink-soft);
}

.edition-meta {
  margin-top: 34px;
  padding: 18px 0;

  display: flex;
  flex-wrap: wrap;
  align-items: center;

  gap: 10px 16px;

  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.edition-badge {
  padding: 5px 12px;

  border-radius: 999px;

  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  color: #8c4c36;

  background: var(--terracotta-light);
}

.edition-meta strong {
  font-family: var(--serif);
  font-size: 1.25rem;

  color: var(--ink);
}

.edition-meta span:last-child {
  font-size: 0.88rem;

  color: var(--ink-soft);
}

.paper-intro-actions {
  margin-top: 34px;

  display: flex;
  flex-wrap: wrap;

  gap: 14px;
}

.paper-cover {
  justify-self: center;

  width: min(100%, 400px);

  display: block;

  border: 1px solid rgba(37, 49, 43, 0.12);

  background: #fff;

  box-shadow:
    0 2px 0 rgba(37, 49, 43, 0.05),
    0 30px 60px -20px rgba(52, 72, 59, 0.45);

  transform: rotate(2.5deg);

  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.paper-cover:hover {
  transform: rotate(0deg) translateY(-6px);

  box-shadow:
    0 2px 0 rgba(37, 49, 43, 0.05),
    0 40px 70px -20px rgba(52, 72, 59, 0.5);
}

.paper-cover img {
  width: 100%;
  height: auto;

  display: block;
}


/* =========================================================
   LECTOR
========================================================= */

.reader {
  padding: 90px 4% 100px;

  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(196, 154, 80, 0.16),
      transparent 45%
    ),
    #202923;
}

.reader-shell {
  width: min(100%, var(--max-width));

  margin: auto;

  color: #fff;
}

.reader-shell:fullscreen {
  width: 100%;
  height: 100%;

  padding: 24px 3%;

  display: flex;
  flex-direction: column;

  overflow: auto;

  background: #202923;
}

.reader-toolbar {
  margin-bottom: 40px;

  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;

  gap: 20px;
}

.reader-title .section-label {
  margin-bottom: 10px;

  color: var(--ochre);
}

.reader-title h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.05;
}

.reader-tools {
  display: flex;
  flex-wrap: wrap;

  gap: 10px;
}

.reader-tool,
.edition-select select {
  min-height: 44px;

  padding: 0 18px;

  display: inline-flex;
  align-items: center;

  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;

  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;

  color: #fff;

  background: rgba(255, 255, 255, 0.06);

  cursor: pointer;

  transition: background 0.2s ease, border-color 0.2s ease;
}

.reader-tool:hover,
.edition-select select:hover {
  border-color: var(--ochre);

  background: rgba(255, 255, 255, 0.12);
}

.edition-select select option {
  color: var(--ink);
}

.book-stage {
  position: relative;

  min-height: 360px;

  display: flex;
  justify-content: center;
}

.reader-shell:fullscreen .book-stage {
  flex: 1;

  align-items: center;
}

.book-frame {
  width: 100%;

  margin: auto;
}

.book-page {
  background: #fff;
}

.book-page img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: contain;

  user-select: none;
}

.book-loading {
  position: absolute;
  inset: 0;

  display: grid;
  place-items: center;

  font-size: 0.95rem;

  color: rgba(255, 255, 255, 0.7);
}

.reader-controls {
  width: min(100%, 620px);

  margin: 44px auto 0;

  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;

  gap: 22px;
}

.page-button {
  min-height: 48px;

  padding: 0 22px;

  border: 0;
  border-radius: 999px;

  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;

  color: var(--ink);

  background: var(--cream);

  cursor: pointer;

  transition: transform 0.2s ease, opacity 0.2s ease;
}

.page-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.page-button:disabled {
  opacity: 0.35;

  cursor: default;
}

.page-status {
  text-align: center;

  font-size: 0.85rem;
  font-weight: 600;

  color: rgba(255, 255, 255, 0.85);
}

.page-progress {
  height: 3px;

  margin-top: 10px;

  border-radius: 3px;

  background: rgba(255, 255, 255, 0.15);

  overflow: hidden;
}

.page-progress div {
  width: 0;
  height: 100%;

  background: var(--ochre);

  transition: width 0.4s ease;
}

.reader-hint {
  margin-top: 22px;

  text-align: center;

  font-size: 0.78rem;

  color: rgba(255, 255, 255, 0.5);
}


/* =========================================================
   LECTOR TÁCTIL
   El navegador mantiene el desplazamiento vertical y el zoom;
   los gestos horizontales los interpreta periodico.js.
========================================================= */

.reader {
  overflow-anchor: none;
}

@media (pointer: coarse) {
  .reader-controls button,
  .reader-tool {
    touch-action: manipulation;
  }

  .book-frame {
    overflow: clip;

    touch-action: pan-y pinch-zoom;

    -webkit-user-select: none;
    user-select: none;

    -webkit-touch-callout: none;
  }
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 950px) {
  .paper-intro {
    padding: 140px 6% 80px;
  }

  .paper-intro-inner {
    grid-template-columns: 1fr;

    gap: 56px;
  }

  .paper-cover {
    width: min(78%, 340px);
  }
}

@media (max-width: 600px) {
  .paper-intro {
    padding: 120px 6% 64px;
  }

  .paper-intro-actions .button {
    flex: 1 1 100%;
  }

  .reader {
    padding: 64px 4% 70px;
  }

  .reader-toolbar {
    margin-bottom: 28px;
  }

  .reader-tools {
    width: 100%;
  }

  .reader-controls {
    gap: 12px;
  }

  .page-button {
    padding: 0 18px;
  }

  .page-button span {
    display: none;
  }

}
