/* ==========================================================================
   ♡  collection-embed.css
   Everything from shelf.css, scoped to #collection-embed so it can't touch
   the rest of your page. Link this INSTEAD of /styles/shelf.css.
   ========================================================================== */
 
/* ----- the 600px frame (replaces the iframe) ----- */
#collection-embed {
  position: relative;
  width: 100%;
  height: 600px;                 /* same as the iframe */
  max-width: 100%;
  overflow: hidden;              /* clips pop-ups to the frame */
 
  /* Lets the old "@media (max-width…)" rules keep working the way they did
     in the iframe: they now respond to this box's width, not the whole window. */
  container-type: inline-size;
 
  /* what the iframe's <body> used to set (font-size was .6em of 16px = 9.6px) */
  font-family: "PixelatedElegance", Verdana;
  color: rgb(164, 135, 116);
  font-size: 9.6px;
  line-height: 22px;
  text-align: center;
 
  --shelf-face: #e0c7d3;
  --shelf-top: #eee4e9;
}
 
[data-theme='dark'] #collection-embed {
  --shelf-face: #d7c8e0;
  --shelf-top: #e9e4ed;
}
 
/* The part that scrolls (this was the iframe's <body>) */
#collection-embed .embed-scroll {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
#collection-embed .embed-scroll::-webkit-scrollbar { display: none; }
 
#collection-embed *,
#collection-embed *::before,
#collection-embed *::after {
  box-sizing: border-box;
}
 
 
/* Your main stylesheet resets every margin and padding to 0.
   The iframe page had the browser's normal defaults, so they are restored here. */
#collection-embed p  { margin: 1em 0; text-align: center; }
#collection-embed h2 { margin: 0.83em 0; }
#collection-embed button { padding: 1px 6px; }
 
 
/* ----- title ----- */
#collection-embed h1 {
  margin-top: 50px;
  background: linear-gradient(to top, #dab2c6 2%, #e2bed0 8%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px #bea28e) drop-shadow(2px 0 #bea28e) drop-shadow(0 -1px #bea28e) drop-shadow(-1px 0 #bea28e) drop-shadow(0 5px white) drop-shadow(3px 0 white) drop-shadow(0 -3px white) drop-shadow(-3px 0 white) drop-shadow(1px 1px 0 rgba(172,172,172,0.6)) drop-shadow(1px 1px 0 rgba(172,172,172,0.6)) drop-shadow(0 0 2px #424242);
  color: #FDE6FF;
  font-family: pixel;
  font-size: 2em;                /* browser default for h1 */
  font-weight: bold;
  margin-bottom: 0.67em;
  text-align: center;
}
 
#collection-embed #shelves-container {
  padding: 35px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(234, 155, 194, 0.18);
  position: relative;
  margin-top: 20px;
}
 
#collection-embed #shelves-container::before {
  content: "";
  position: absolute;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background-image: url(/media/decor/1edea17e511329b068cd9c8e2050caac-removebg-preview.png);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 10;
}
 
 
/* ----- shelves ----- */
#collection-embed .shelf-row-wrap {
  position: relative;
}
 
#collection-embed .shelf-cards-track {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 18px 20px 22px 20px;
  position: relative;
  z-index: 20;
}
 
#collection-embed .shelf-card,
#collection-embed .book-item {
  flex-shrink: 0;
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
  z-index: 1;
}
 
#collection-embed .shelf-card:hover,
#collection-embed .book-item:hover {
  transform: translateY(-5px) rotate(-2deg);
  filter: drop-shadow(0 0 10px rgba(223, 189, 206, 0.8));
}
 
#collection-embed .glossy-shelf {
  height: 20px;
  width: 100%;
  background: var(--shelf-face);
  position: relative;
  z-index: 1;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, .1);
  margin-top: -18px;
  margin-bottom: 12px;
}
 
#collection-embed .glossy-shelf::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 0;
  right: 0;
  height: 15px;
  background: var(--shelf-top);
  transform: perspective(100px) rotateX(25deg);
  transform-origin: bottom;
  box-shadow: inset 0 -2px 5px rgba(0, 0, 0, .05);
}
 
#collection-embed .glossy-shelf::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, .6) 0%, rgba(255, 255, 255, 0) 20%, rgba(0, 0, 0, .05) 100%);
  border-radius: inherit;
}
 
/* was @media (max-width: 860px); now measured against the frame, like the iframe */
@container (max-width: 860px) {
  .shelf-cards-track {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }
  #shelves-container::before {
    width: 200px;
    height: 200px;
    top: -80px;
  }
  .shelf-card,
  .book-item {
    width: 84px;
  }
}
 
 
/* ----- pop-ups (sit inside the frame, not over the whole window) ----- */
#collection-embed .modal {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 9999;
  padding-top: 50px;
  overflow: auto;
  background: rgba(253, 226, 236, 0.59);
}
 
#collection-embed .modal.show {
  display: flex;
  opacity: 1;
}
 
#collection-embed .modal-content {
  position: relative;
  background-color: #fefefe;
  margin: auto;
  padding: 0;
  border: 1px solid #888;
  width: 80%;
  max-width: 50em;
  border-width: 15px;
  border-image: url('/media/borders/whitelace.png') round 30;
  background-clip: padding-box;
  animation: collection-drop 0.4s;
}
 
#collection-embed .modal-content::before {
  content: "";
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  background-image: url('/placeholder.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 10;
}
 
/* same slide-down as before, but animating transform (smoother than "top") */
@keyframes collection-drop {
  from { transform: translateY(-300px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
 
#collection-embed .close {
  color: white;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
#collection-embed .close:hover,
#collection-embed .close:focus {
  color: #cba3b9;
  text-decoration: none;
}
 
#collection-embed .modal-header {
  padding: 2px 16px;
  background-color: #ebc6d5;
  background-image: url('/media/background/invertedpinkpolka.gif');
  color: white;
  font-size: 15px;
}
 
#collection-embed .modal-body { padding: 2px 16px; }
 
#collection-embed .modal-footer {
  padding: 2px 16px;
  background-color: #ebc6d5;
  background-image: url('/media/background/invertedpinkpolka.gif');
  color: white;
}
 
#collection-embed .scripted {
  background: linear-gradient(to top, #cca2b7 2%, #e2bed0 8%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px #a3846e) drop-shadow(2px 0 #a3846e) drop-shadow(0 -1px #dbb79e) drop-shadow(-1px 0 #a3846e) drop-shadow(0 5px white) drop-shadow(3px 0 white) drop-shadow(0 -3px white) drop-shadow(-3px 0 white) drop-shadow(1px 1px 0 rgba(172,172,172,0.6)) drop-shadow(1px 1px 0 rgba(172,172,172,0.6)) drop-shadow(0 0 2px #424242);
  color: #FDE6FF;
  font-family: pixel;
  font-size: 1.5em;              /* browser default for h2 */
  font-weight: bold;
  text-align: center;
}
 
 
/* ----- ticker ----- */
#collection-embed .ticker {
  width: 100%;
  overflow: hidden;
  border: 1px solid #e7d0dd;
  border-radius: 4px;
  background: #fbf3f8;
  background-image: url('/media/background/back.png');
  background-size: 70px;
  padding: 10px 0;
  color: #c7a68f;
  font-family: pixelatedelegance;
  font-size: 0.6em;
}
 
#collection-embed .ticker-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  animation: collection-tick 14s linear infinite;
  will-change: transform;
}
#collection-embed .ticker .ticker-track span { padding: 0 24px; }
 
#collection-embed .ticker-track::after {
  content: "";
  z-index: 10;
  position: absolute;
  top: -12px;
  left: -3px;
  width: 100%;
  height: 120%;
  border: solid;
  border-width: 10px 15px;
  border-image: url(/media/decor/floral-divider.png) 35 round;
  background-clip: padding-box;
  filter: drop-shadow(0 2px 3px #E0CAD4) drop-shadow(0 -1px #AD97A1) drop-shadow(0 1px #AD97A1);
  overflow: hidden;
}
 
@keyframes collection-tick {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
 
#collection-embed .ticker:hover .ticker-track { animation-play-state: paused; }
 
@media (prefers-reduced-motion: reduce) {
  #collection-embed .ticker-track { animation: none; }
}
 
 
/* ----- pop-up layout ----- */
#collection-embed .grid {
  display: grid;
  grid-template-columns: 80px 1fr 90px;
  gap: 18px;
  align-items: stretch;
}
 
#collection-embed .col-left,
#collection-embed .col-center,
#collection-embed .col-right {
  display: flex;
  flex-direction: column;
}
 
/* was @media (max-width: 460px) */
@container (max-width: 460px) {
  .grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "profile   calendar"
      "content   content";
  }
  .col-left, .col-center, .col-right { display: contents; }
}
 
#collection-embed .pill {
  font-family: 'mademoiselle';
  font-size: 1em;
  letter-spacing: 0.3px;
  color: #c095a9;
  background: #fff4f9;
  margin-top: 0.5em;
  border: 1px solid #dbafc1;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  height: 1.5em;
  box-shadow: rgba(255, 255, 255, 0.8) 4px 4px 0px inset, rgba(215, 127, 171, 0.15) -4px -4px 4px inset;
}
 
#collection-embed .modal-image {
  position: relative;
  margin: auto;
  margin-top: 1em;
  margin-bottom: 3em;
  padding: 0;
  border: 1px solid #888;
  border-width: 10px;
  border-image: url('/media/borders/image%20(19).png') round 30;
  background-clip: padding-box;
  width: 100%;
  max-width: 50em;
}
 
#collection-embed .pin {
  position: relative;
  float: left;
  top: -0.2em;
  left: -3em;
  z-index: 5;
  rotate: -25deg;
  margin-bottom: -50%;
  filter: drop-shadow(0.5px 0.5px 0 rgba(172, 172, 172, 0.6)) drop-shadow(0.5px 0.5px 0 rgba(172, 172, 172, 0.6)) drop-shadow(0 0 2px #424242a1);
}
 
#collection-embed .special {
  font-family: "Spirit", sans-serif;
  font-size: 1.5em;
  color: #ecd5dd;
}
 
 
/* ----- buttons ----- */
#collection-embed button {
  font-family: 'willow';
  font-size: 1.5em;
  letter-spacing: 0.3px;
  color: #c095a9;
  background: #fff4f9;
  margin-top: 0.5em;
  margin-bottom: 1em;
  border: 1px solid #dbafc1;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
  line-height: 1;
  height: 1.5em;
  box-shadow: rgba(255, 255, 255, 0.8) 4px 4px 0px inset, rgba(215, 127, 171, 0.15) -4px -4px 4px inset;
}
 
[data-theme='dark'] #collection-embed button {
  color: #a087ad;
  background: #e5ddeb;
  border: 1px solid #92799e;
  box-shadow: rgba(255, 255, 255, 0.8) 4px 4px 0px inset, rgba(207, 190, 219, 0.15) -4px -4px 4px inset;
}
 