/* =========================
   Through the Library Doors — Stories
   /assets/css/stories.css
   ========================= */

/* ---------- Card shell (teaser) ---------- */
.storyteller-card {
  background: #fff;                 /* card bg */
  border: 1px solid #ccc;           /* outline continues on panel */
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  position: relative;
  overflow: visible;                 /* allow below-panel to render outside */
  transition: box-shadow .2s;
  height: 420px;                     /* default teaser height (rows align) */
}
.storyteller-card:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* When expanded: let the panel own the bottom edge */
.storyteller-card[aria-expanded="true"] {
  border-bottom: 0;                  /* panel becomes the bottom border */
  border-bottom-left-radius: 0;      /* panel supplies bottom corners */
  border-bottom-right-radius: 0;
  z-index: 9999;
}

/* Kill hover shadow while open to avoid a thicker outline look */
.storyteller-card[aria-expanded="true"],
.storyteller-card[aria-expanded="true"]:hover {
  box-shadow: none;
}

/* ---------- Header (with caret) ---------- */
.storyteller-header {
  background-color: #ba0c2f;
  color: #fff;
  padding: 8px;
  font-weight: bold;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  font-size: 1.75rem;
  text-align: center;
  position: relative;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.storyteller-card .storyteller-header::after,
.storyteller-card[aria-expanded="true"] .storyteller-header::after {
  content: "\25BE";                  /* ▾ */
  position: absolute;
  right: 10px;
  top: 8px;
  font-size: 1rem;
  transition: transform .2s;
}
.storyteller-card[aria-expanded="true"] .storyteller-header::after {
  transform: rotate(180deg);
}

/* ---------- Teaser image + name ---------- */
.storyteller-card img {
  width: 80%;
  object-fit: cover;
  display: block;
  height: 250px;                     /* fixed to align rows */
  max-height: 250px;
  margin: 15px auto;
  border-radius: 8px;
}
.storyteller-name {
  padding: 10px;
  text-align: center;
  font-weight: 500;
  font-size: 1.5rem;
  min-height: 68px;                  /* consistent teaser block height */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ---------- Click/keyboard affordance ---------- */
.storyteller-trigger { cursor: pointer; }
.storyteller-trigger:focus {
  outline: 2px solid #005C99;
  outline-offset: 2px;
}

/* ---------- Expanded panel (below-card “drawer”) ---------- */
/* Same color as the card, continuous border, zero seam */
.storyteller-panel {
  display: none;                     /* toggled by JS */
  position: absolute;
  left: 0; right: 0;
  top: calc(100% - 1px);            /* overlap upward by 1px to eliminate any gap */
  z-index: 10000;

  background: #fff;                  /* EXACT match to card bg */
  border: 1px solid #ccc;            /* same outline as card */
  border-top: 0;                     /* no double-thickness at the join */
  border-bottom-left-radius: 10px;   /* panel owns bottom corners */
  border-bottom-right-radius: 10px;

  /* No shadow on panel — the outline is the border above */
  box-shadow: none;

  padding: 12px 14px 16px;
  font-size: 1.20rem;
  color: #333;
  max-height: 48vh;                  /* scroll within the panel, not the page */
  overflow-y: auto;

  /* subtle open animation (optional) */
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
}
.storyteller-card[aria-expanded="true"] .storyteller-panel {
  opacity: 1;
  transform: translateY(0);
}

/* Remove pointer triangles to keep it one clean piece */
.storyteller-panel::before,
.storyteller-panel::after { display: none !important; }

/* Last-resort paint-over for ultra-high-DPI hairlines (kept, color now #fff) */
.storyteller-card[aria-expanded="true"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -1px;
  height: 2px;
  background: #fff;   /* match panel/card background exactly */
  pointer-events: none;
  z-index: 10001;
}

/* Make the panel’s left/right borders line up with the card’s border */
.storyteller-panel{
  left: -1px;        /* was 0 */
  right: -1px;       /* was 0 */
  /* keep: top: calc(100% - 1px); border:1px solid #ccc; border-top:0; */
}

/* If you’re extra cautious about mobile rounding, this keeps it in-bounds */
@media (max-width: 575.98px){
  .storyteller-panel{
    max-width: calc(100% + 2px);
  }
}

/* ---------- Grid safety ---------- */
.container,
.row { overflow: visible; }          /* panel must not be clipped */

/* ---------- Links ---------- */
a { text-decoration: none; }

/* Kill default container gutters for this one container only */
#c.container.layout {
  padding-left: 0 !important;
  padding-right: 0 !important; /* optional, usually you want both sides */
}

/* ---------- Responsive teaser heights (keep rows aligned) ---------- */
/* Default (≥1200px) uses .storyteller-card { height: 420px } above */

/* 992–1199px */
@media (max-width: 1199.98px) {
  .storyteller-card { height: 440px; }
  .storyteller-name { min-height: 72px; }
}

/* 768–991px */
@media (max-width: 991.98px) {
  .storyteller-card { height: 460px; }
  .storyteller-name { min-height: 76px; }
}

/* <768px */
@media (max-width: 767.98px) {
  .storyteller-card { height: 420px; }   /* more room for image/text on phones */
  .storyteller-card img { height: 260px; }
  .storyteller-name { min-height: 72px; }
}
