/* Public E-Catalogue page (/e-catalogue/gift-catalogue-2026). Scoped to
   body.ecat-page; uses the site's tokens. The flipbook gets a large,
   responsive reading area; its height comes from a validated number. */

body.ecat-page .site-main { max-width: 1320px; padding-top: var(--space-5); }

.ecat { display: grid; gap: var(--space-4); min-width: 0; }
.ecat__head { display: grid; gap: 6px; justify-items: center; text-align: center; max-width: 820px; margin: 0 auto; }
.ecat__back {
  justify-self: start; display: inline-flex; align-items: center; gap: 4px;
  font-weight: 700; font-size: 14px; color: var(--color-primary);
  padding: 8px 14px 8px 8px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-surface);
  margin-bottom: var(--space-2);
}
.ecat__back:hover { text-decoration: none; border-color: var(--color-primary); }
.ecat__eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-gold, #c9a45c); }
.ecat__title {
  margin: 0; font-family: "Playfair Display", Georgia, serif; font-weight: 700;
  font-size: clamp(28px, 4vw, 44px); line-height: 1.1; color: var(--color-navy-deep, #10243a);
}
.ecat__subtitle { margin: 0; font-family: "Playfair Display", Georgia, serif; font-style: italic; font-size: clamp(16px, 2vw, 20px); color: var(--color-primary); }
.ecat__desc { margin: 4px 0 0; color: var(--color-text-muted); font-size: 15px; line-height: 1.6; }

.ecat__viewer {
  position: relative; width: 100%; min-width: 0;
  height: min(var(--ecat-h, 720px), calc(100vh - 140px));
  min-height: 420px;
  border-radius: 18px; overflow: hidden;
  background: radial-gradient(ellipse at center, #fffdf8 0%, #f1e9d8 100%);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(16, 36, 58, 0.06), 0 18px 44px rgba(16, 36, 58, 0.12);
}
.ecat__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.ecat__status {
  position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 10px;
  text-align: center; padding: var(--space-5); color: var(--color-text-muted); pointer-events: none;
}
.ecat__status[hidden] { display: none; }
.ecat__status--error { background: rgba(255, 253, 248, 0.96); pointer-events: auto; color: var(--color-text); }
.ecat__spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(8, 127, 109, 0.2); border-top-color: var(--color-primary);
  animation: ecat-spin 0.9s linear infinite;
}
@keyframes ecat-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ecat__spinner { animation: none; } }
.ecat__hint { text-align: center; margin: 0; }
.ecat__off { max-width: 640px; margin: 0 auto; text-align: center; display: grid; gap: var(--space-3); justify-items: center; }

/* Tablet: use the width, keep a tall reading area. */
@media (max-width: 1024px) {
  .ecat__viewer { height: min(var(--ecat-h, 720px), 72vh); }
}
/* Phones: edge-to-edge viewer with enough height for the flipbook controls. */
@media (max-width: 640px) {
  body.ecat-page .site-main { padding: var(--space-3) var(--space-2) var(--space-5); }
  .ecat__head { justify-items: start; text-align: left; }
  .ecat__viewer { height: 72vh; min-height: 460px; border-radius: 12px; }
}
@media (max-width: 640px) and (orientation: landscape), (max-height: 500px) {
  .ecat__viewer { height: calc(100vh - 24px); min-height: 300px; }
}
