/* VISARA Phase 1B visual/commerce fixes — 2026-08-31 */

/* ---------- responsive cover thumbnails ---------- */
picture.cover-thumb { display:block; width:100%; }
picture.cover-thumb img { display:block; width:100%; height:auto; }

/* ---------- Fall of Rome: aligned hero covers ---------- */
.series-cover-stack {
  display:flex !important;
  align-items:flex-end !important;
  justify-content:center !important;
  gap:14px !important;
}
.series-cover-slot {
  width:160px !important;
  height:270px !important;
  display:flex !important;
  align-items:flex-end !important;
  justify-content:center !important;
  flex:0 0 160px !important;
}
.series-cover-slot .series-cover-link,
.series-cover-slot picture {
  width:100% !important;
  height:100% !important;
  display:flex !important;
  align-items:flex-end !important;
  justify-content:center !important;
}
.series-cover-slot img {
  display:block !important;
  width:auto !important;
  max-width:100% !important;
  height:auto !important;
  max-height:100% !important;
  object-fit:contain !important;
}
.series-cover-slot .volume-mini-placeholder {
  width:100% !important;
  height:100% !important;
  box-sizing:border-box !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
  line-height:1.7 !important;
  padding:18px !important;
}

/* ---------- Trilogy cards: same image area and same bottom line ---------- */
.trilogy-volume-grid { align-items:stretch !important; }
.trilogy-volume {
  display:flex !important;
  flex-direction:column !important;
  height:100% !important;
  box-sizing:border-box !important;
}
.trilogy-media {
  height:410px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  margin-bottom:16px !important;
}
.trilogy-media > a,
.trilogy-media > picture {
  display:flex !important;
  width:100% !important;
  height:100% !important;
  align-items:center !important;
  justify-content:center !important;
}
.trilogy-media img {
  width:auto !important;
  max-width:100% !important;
  height:auto !important;
  max-height:100% !important;
  object-fit:contain !important;
  display:block !important;
}
.trilogy-media .volume-mini-placeholder {
  width:100% !important;
  height:100% !important;
  box-sizing:border-box !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
  line-height:1.9 !important;
  padding:24px !important;
}
.trilogy-volume > .button,
.trilogy-volume > .button-row { margin-top:auto !important; }

/* ---------- Homepage release sequence: use the space ---------- */
.release-item {
  display:flex !important;
  flex-direction:column !important;
  justify-content:flex-start !important;
  gap:8px !important;
}
.release-item p { margin:0 !important; }
.release-mini-blurb { opacity:.88; line-height:1.45; font-size:.96rem; }
.release-mini-link { margin-top:auto; font-weight:700; text-transform:uppercase; letter-spacing:.06em; font-size:.82rem; }
.release-mini-link a { text-decoration:none; }

/* ---------- Store: repeatable book purchase blocks ---------- */
.purchase-section + .purchase-section { border-top:1px solid rgba(202,154,50,.34); }
.store-book-grid > picture.store-cover-picture,
.store-book-grid > img.store-cover-img {
  width:100% !important;
  max-width:300px !important;
  align-self:start !important;
  justify-self:center !important;
}
.store-book-grid > picture.store-cover-picture img { width:100%; height:auto; display:block; }
.edition-grid { align-items:stretch !important; }
.edition-card { display:flex !important; flex-direction:column !important; height:100% !important; }
.edition-card .edition-content { flex:1 1 auto !important; }
.edition-card .edition-cta { margin-top:auto !important; }
.edition-card .button,
.edition-card .button-disabled { width:100% !important; box-sizing:border-box !important; text-align:center !important; }
.edition-grid.edition-grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
.store-book-actions { margin-top:18px; }

/* ---------- Excerpt chooser: center the cards ---------- */
.excerpt-hero-inner { max-width:1040px !important; margin-left:auto !important; margin-right:auto !important; }
.excerpt-choice-grid {
  max-width:1040px !important;
  margin-left:auto !important;
  margin-right:auto !important;
  justify-content:center !important;
  align-items:stretch !important;
}
.excerpt-choice { height:100% !important; box-sizing:border-box !important; }

/* ---------- Direct excerpt pages: centered reading experience ---------- */
.reading-shell {
  max-width:980px !important;
  margin-left:auto !important;
  margin-right:auto !important;
  box-sizing:border-box !important;
}
.reading-header {
  max-width:780px !important;
  margin-left:auto !important;
  margin-right:auto !important;
  text-align:center !important;
}
.reading-header .breadcrumb,
.reading-header .context { text-align:center !important; }
.reading-panel {
  max-width:780px !important;
  margin-left:auto !important;
  margin-right:auto !important;
}
.reading-panel p,
.reading-panel blockquote,
.reading-panel .scene-heading { text-align:left !important; }

/* ---------- Excerpt modal ---------- */
.excerpt-modal-backdrop {
  position:fixed;
  inset:0;
  z-index:10000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
  background:rgba(0,0,0,.82);
  backdrop-filter:blur(3px);
}
.excerpt-modal-dialog {
  position:relative;
  width:min(940px, 96vw);
  max-height:92vh;
  overflow:auto;
  border:1px solid rgba(202,154,50,.6);
  background:#120b07;
  box-shadow:0 24px 80px rgba(0,0,0,.7);
}
.excerpt-modal-dialog .reading-shell {
  padding:46px 34px 56px !important;
  margin:0 auto !important;
  max-width:900px !important;
}
.excerpt-modal-dialog .excerpt-close { display:none !important; }
.excerpt-modal-close {
  position:sticky;
  top:14px;
  float:right;
  margin:14px 14px -58px 0;
  z-index:3;
  width:44px;
  height:44px;
  border-radius:50%;
  border:1px solid rgba(202,154,50,.72);
  background:#120b07;
  color:#e8bf62;
  font-size:30px;
  line-height:38px;
  cursor:pointer;
}
.excerpt-modal-loading { padding:70px 30px; text-align:center; color:#e8bf62; }
body.excerpt-modal-open { overflow:hidden; }

@media (max-width:900px) {
  .series-cover-stack { gap:9px !important; }
  .series-cover-slot { width:112px !important; flex-basis:112px !important; height:190px !important; }
  .trilogy-media { height:340px !important; }
  .edition-grid.edition-grid-3 { grid-template-columns:1fr !important; }
}
@media (max-width:640px) {
  .series-cover-stack { flex-wrap:wrap !important; align-items:flex-start !important; }
  .series-cover-slot { width:132px !important; flex-basis:132px !important; height:205px !important; }
  .excerpt-modal-backdrop { padding:10px; }
  .excerpt-modal-dialog { width:100%; max-height:95vh; }
  .excerpt-modal-dialog .reading-shell { padding:42px 14px 40px !important; }
}

/* ---------- Fall of Rome Books V and VI ---------- */
.release-grid .release-item:nth-last-child(-n+3) { border-bottom:1px solid var(--line); }
.release-grid .release-item:nth-last-child(-n+2) { border-bottom:0; }
.future-release-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:28px;
  margin-top:30px;
}
.future-release-card {
  display:grid;
  grid-template-columns:minmax(170px,235px) minmax(0,1fr);
  gap:26px;
  min-height:390px;
  padding:26px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:linear-gradient(145deg,rgba(32,22,14,.94),rgba(12,8,5,.98));
  box-shadow:0 16px 42px rgba(0,0,0,.28);
}
.future-release-card > picture {
  width:100%;
  max-width:235px;
  align-self:start;
}
.future-release-card img {
  width:100%;
  max-height:370px;
  object-fit:contain;
  border:1px solid var(--line);
  box-shadow:0 14px 34px rgba(0,0,0,.34);
}
.future-release-card > div { display:flex; flex-direction:column; align-items:flex-start; }
.future-release-card h3 { font-size:clamp(1.7rem,2.4vw,2.3rem); }
.future-release-card .button { margin-top:auto; }
.future-release-actions { margin-top:26px; }
.arc-card.upcoming { border-color:rgba(202,154,50,.58); }

@media (max-width:1040px) {
  .release-grid .release-item:nth-last-child(-n+2) { border-bottom:0; }
  .future-release-grid { grid-template-columns:1fr; }
}
@media (max-width:640px) {
  .future-release-card { grid-template-columns:1fr; min-height:0; padding:22px; }
  .future-release-card > picture { width:min(100%,290px); justify-self:center; }
  .future-release-card > div { align-items:stretch; }
  .future-release-card .button { width:100%; text-align:center; }
}

/* ---------- Definitive cover-size correction ---------- */
.trilogy-media {
  width:100% !important;
  height:410px !important;
  overflow:hidden !important;
}
.trilogy-media > a,
.trilogy-media > picture,
.trilogy-media > a > picture {
  display:flex !important;
  width:100% !important;
  height:100% !important;
  align-items:center !important;
  justify-content:center !important;
}
.trilogy-media img {
  display:block !important;
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  max-height:100% !important;
  margin:0 !important;
  object-fit:contain !important;
}
.trilogy-media .volume-mini-placeholder {
  width:100% !important;
  height:100% !important;
  min-height:0 !important;
  max-width:none !important;
  margin:0 !important;
}
.future-release-card > picture.cover-thumb {
  display:block !important;
  width:100% !important;
  max-width:235px !important;
  margin:0 !important;
  align-self:start !important;
}
.future-release-card > picture.cover-thumb img {
  display:block !important;
  width:100% !important;
  height:auto !important;
  max-width:235px !important;
  max-height:370px !important;
  margin:0 !important;
  object-fit:contain !important;
}

@media (max-width:900px) {
  .trilogy-media { height:360px !important; }
}
@media (max-width:640px) {
  .trilogy-media { height:390px !important; }
  .future-release-card > picture.cover-thumb,
  .future-release-card > picture.cover-thumb img {
    width:min(100%,290px) !important;
    max-width:290px !important;
    max-height:435px !important;
    margin-left:auto !important;
    margin-right:auto !important;
  }
}

/* ---------- Fall of Rome hero: Alaric, then Galla, then Attila ---------- */
.series-cover-showcase {
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:18px !important;
  width:100% !important;
}
.series-cover-row {
  display:flex !important;
  align-items:flex-end !important;
  justify-content:center !important;
  gap:14px !important;
  width:100% !important;
}
.series-cover-showcase .series-cover-slot {
  width:160px !important;
  height:270px !important;
  flex:0 0 160px !important;
}
.series-cover-showcase .series-cover-link,
.series-cover-showcase picture {
  display:flex !important;
  width:100% !important;
  height:100% !important;
  align-items:flex-end !important;
  justify-content:center !important;
}
.series-cover-showcase img {
  display:block !important;
  width:auto !important;
  height:auto !important;
  max-width:100% !important;
  max-height:100% !important;
  object-fit:contain !important;
}

@media (max-width:900px) {
  .series-cover-showcase { margin-top:22px !important; }
  .series-cover-showcase .series-cover-slot {
    width:112px !important;
    height:190px !important;
    flex-basis:112px !important;
  }
}
@media (max-width:640px) {
  .series-cover-showcase { gap:12px !important; }
  .series-cover-row { gap:8px !important; flex-wrap:nowrap !important; }
  .series-cover-showcase .series-cover-slot {
    width:96px !important;
    height:160px !important;
    flex-basis:96px !important;
  }
  .series-cover-showcase .volume-mini-placeholder {
    padding:9px !important;
    font-size:.72rem !important;
    line-height:1.45 !important;
  }
}
