/* 1.4.9: group reading choices by country, with novel and webtoon work rows.
   Only marked controls counter-scale during pinch; native image zoom remains. */
.world-grid,
.world-card,
.world-bottom,
.format-buttons,
.poster-toolbar,
.poster-actions,
.reading-library,
.reading-options,
.reading-format,
.reading-country-heading,
.reading-format-row,
.hero-copy,
.hero-bottom,
.hero-bottom .actions,
.private-note,
.private-note > *,
.contact > .wrap,
.contact .actions {
  min-width: 0;
}

.world-card {
  container-type: inline-size;
  container-name: poster-card;
  max-width: 100%;
}

.world-bottom {
  padding: clamp(12px, 4.8cqi, 24px) clamp(12px, 5.2cqi, 26px);
}

.poster-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.poster-slide-info {
  flex: 1 1 100px;
  max-width: 100%;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.poster-toolbar > .poster-actions,
.poster-toolbar > .poster-controls-frame {
  flex: 1 1 230px;
  max-width: 100%;
}

.poster-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}

.poster-actions .btn {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  height: auto;
  padding: 8px clamp(6px, 2cqi, 12px);
  font-size: clamp(11px, 2.8cqi, 13px);
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}

.reading-library {
  margin-top: clamp(30px, 4vw, 48px);
  padding: clamp(20px, 3.5vw, 38px);
  border: 1px solid #d3c8b2;
  border-radius: 14px;
  background: #eee8db;
}

.reading-heading .eyebrow {
  font-size: 10px;
  letter-spacing: .16em;
}

#readingHeading {
  margin: 8px 0 12px;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

.reading-heading p {
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.reading-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.reading-format {
  container-type: inline-size;
  container-name: reading-format;
  padding: clamp(16px, 2.2vw, 26px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.reading-format h4 {
  margin: 0 0 18px;
  font-size: 20px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.reading-country-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.reading-country-heading h4 {
  margin: 0;
  font: 500 25px/1.2 var(--serif);
  letter-spacing: .035em;
}

.reading-country-heading small {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.reading-format-row + .reading-format-row {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.reading-format-row h5 {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.format-buttons.reading-work-buttons {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.format-buttons.reading-work-buttons .btn {
  min-height: 48px;
  padding: 10px 8px;
  font-size: clamp(12px, 3cqi, 13px);
  letter-spacing: 0;
}

.poster-motion-paused,
.poster-motion-paused * {
  animation-play-state: paused !important;
}

.reading-availability {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #d3c8b2;
}

.reading-availability .availability {
  min-width: 0;
  margin: 0;
  font-size: 11px;
  text-align: left;
  overflow-wrap: anywhere;
}

.reading-availability strong {
  display: inline-block;
  margin-right: .45em;
}

.format-buttons {
  gap: clamp(5px, 1.8cqi, 9px);
  align-items: stretch;
}

.format-buttons .btn {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  height: auto;
  padding: clamp(8px, 2.2cqi, 11px) clamp(4px, 1.4cqi, 7px);
  font-size: clamp(11px, 2.8cqi, 13px);
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}

.world-label {
  inset: auto clamp(12px, 6.4cqi, 32px) clamp(12px, 6cqi, 30px);
  min-width: 0;
  overflow-wrap: anywhere;
}

.world-label .eyebrow {
  max-width: 100%;
  font-size: clamp(9px, 2.2cqi, 11px);
  letter-spacing: .12em;
}

.world-label h3 {
  font-size: clamp(32px, 14cqi, 74px);
  margin-block: clamp(8px, 3.2cqi, 16px);
}

.world-label p {
  max-width: 100%;
  font-size: clamp(11px, 2.6cqi, 13px);
  line-height: 1.65;
  margin-block: .7em;
}

.world-poster .photo-count {
  top: clamp(9px, 3.6cqi, 18px);
  right: clamp(9px, 3.6cqi, 18px);
  max-width: calc(100% - clamp(18px, 7.2cqi, 36px));
  padding: 5px clamp(7px, 2.2cqi, 11px);
  font-size: clamp(10px, 2.2cqi, 11px);
  white-space: normal;
  overflow-wrap: anywhere;
}

.world-bottom .availability,
.poster-public-caption {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* A narrow reading card gives each work label its own complete row. */
@container reading-format (max-width: 165px) {
  .format-buttons.reading-work-buttons {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The existing buttons stay in the card, with their listeners and focus intact.
   JS measures the visible card width; this layer alone compensates for pinch. */
.poster-controls-frame {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.poster-controls-frame.is-pinch-adjusted {
  height: var(--poster-controls-height);
}

.poster-controls-frame.is-pinch-adjusted > [data-poster-control-group] {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--poster-controls-width);
  max-width: none;
  grid-template-columns: repeat(var(--poster-controls-columns), minmax(0, 1fr));
  transform: translateX(var(--poster-controls-x)) scale(var(--poster-controls-scale));
  transform-origin: 0 0;
}

.hero-actions .btn,
.hero-bottom .btn,
.private-note .btn,
.contact .actions .btn {
  min-width: 0;
  max-width: 100%;
  height: auto;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.hero-actions,
.hero-bottom .actions,
.contact .actions {
  max-width: 100%;
  flex-wrap: wrap;
}

.hero-bottom > *,
.hero-bottom .actions > * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.hero-bottom .btn {
  min-height: 44px;
  padding: 8px clamp(7px, 1.5vw, 19px);
  font-size: clamp(11px, 1.1vw, 13px);
}

.private-note {
  flex-wrap: wrap;
  gap: clamp(12px, 2vw, 25px);
  padding: clamp(14px, 3vw, 24px) clamp(14px, 3vw, 28px);
}

.private-note p {
  flex: 1 1 26rem;
  overflow-wrap: anywhere;
}

.private-note .btn {
  flex: 0 1 auto;
}

.contact > .wrap {
  padding-inline: clamp(14px, 3.2vw, 34px);
}

.contact .eyebrow,
.contact h2,
.contact .muted {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.contact h2 {
  font-size: clamp(24px, 4.2vw, 54px);
}

@media (max-width: 780px) {
  .private-note p {
    flex-basis: auto;
  }
}

@media (max-width: 640px) {
  .reading-options {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .reading-country-heading {
    margin-bottom: 16px;
    padding-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .hero-bottom .actions {
    width: 100%;
  }

  .hero-bottom #heroSlideInfo {
    flex-basis: 100%;
  }

  .hero-bottom .btn {
    flex: 1 1 0;
  }

  .hero-actions .btn,
  .contact .actions .btn {
    flex: 1 1 9rem;
    padding-inline: 10px;
    font-size: 12px;
  }
}
