.gaceta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.25rem);
}

.gaceta-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line, #d8e1e8);
  border-radius: 1.1rem;
  background: #fff;
  box-shadow: 0 18px 42px rgb(21 59 89 / 8%);
}

.gaceta-cover-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #edf3f6;
}

.gaceta-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gaceta-number {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: .38rem .68rem;
  border-radius: 999px;
  background: #153b59;
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.gaceta-card-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.25rem;
}

.gaceta-card-copy h3 {
  margin: .35rem 0 1.2rem;
  font-size: clamp(1.15rem, 2vw, 1.42rem);
  line-height: 1.18;
}

.gaceta-week,
.gaceta-advance {
  margin: 0;
  color: #486476;
  font-size: .9rem;
}

.gaceta-advance {
  margin-bottom: .5rem;
  color: #153b59;
  font-weight: 800;
}

.gaceta-read {
  margin-top: auto;
}

.home-gacetas-more {
  display: flex;
  justify-content: center;
  margin-top: clamp(1.25rem, 3vw, 2rem);
}

.reader-page {
  min-height: 100vh;
  margin: 0;
  background: #e9eff3;
  color: #153b59;
  font-family: "Public Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.reader-page * { box-sizing: border-box; }

.reader-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid #cedae2;
  background: #fff;
}

.reader-logo {
  display: block;
  width: min(180px, 42vw);
  height: auto;
}

.reader-back {
  color: #1f6f9f;
  font-weight: 750;
  text-decoration-thickness: .12em;
  text-underline-offset: .18em;
}

.reader-heading {
  padding: 1.15rem clamp(1rem, 3vw, 2rem);
  background: #f8fbfc;
}

.reader-heading h1 {
  max-width: 960px;
  margin: .25rem auto .3rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.15;
}

.reader-heading p {
  max-width: 960px;
  margin: .15rem auto;
}

.reader-kicker,
.reader-advance {
  color: #1f6f9f;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.reader-shell {
  position: relative;
  height: calc(100vh - 12.5rem);
  min-height: 500px;
  background: #dfe8ed;
}

.reader-toolbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 3.6rem;
  padding: .6rem 1rem;
  background: #153b59;
  color: #fff;
}

.reader-toolbar button,
.reader-toolbar input {
  min-height: 2.35rem;
  border: 1px solid rgb(255 255 255 / 44%);
  border-radius: .45rem;
  background: #fff;
  color: #153b59;
  font: inherit;
}

.reader-toolbar button {
  padding: .45rem .75rem;
  cursor: pointer;
  font-weight: 750;
}

.reader-toolbar .reader-close {
  margin-inline-start: .35rem;
  border-color: #c3d52d;
  background: #c3d52d;
  color: #153b59;
}

.reader-toolbar button:hover,
.reader-toolbar button:focus-visible {
  outline: 3px solid #fec346;
  outline-offset: 2px;
}

.reader-page-field {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.reader-page-field input {
  width: 4rem;
  padding: .35rem;
  text-align: center;
}

.reader-status {
  min-width: 8rem;
  font-size: .82rem;
  text-align: center;
}

.reader-status.is-error { color: #fff2a8; }

#pdf-viewer-container {
  position: absolute;
  inset: 3.6rem 0 0;
  overflow: auto;
  padding: 1rem 0 3rem;
}

#pdf-viewer.pdfViewer {
  --page-border: 1px solid rgb(21 59 89 / 18%);
}

#pdf-viewer .page {
  margin: 0 auto 1rem;
  box-shadow: 0 12px 34px rgb(21 59 89 / 18%);
}

.reader-error {
  max-width: 34rem;
  margin: 3rem auto;
  padding: 1rem;
  border-radius: .7rem;
  background: #fff;
  color: #8b2534;
}

.reader-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  background: #dfe8ed;
}

.reader-shell:fullscreen #pdf-viewer-container {
  inset-block-start: 3.6rem;
}

@media (max-width: 900px) {
  .gaceta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 580px) {
  .gaceta-grid { grid-template-columns: 1fr; }
  .reader-toolbar { justify-content: flex-start; }
  .reader-toolbar button { padding-inline: .58rem; }
  .reader-toolbar .reader-close {
    flex: 1 1 100%;
    margin-inline-start: 0;
    text-align: center;
  }
  .reader-shell { height: calc(100vh - 15rem); }
}

@media (prefers-reduced-motion: reduce) {
  .reader-page *, .gaceta-card * { scroll-behavior: auto !important; }
}
