/* ==========================================================================
   Package cards open a details window (gifts.html). See assets/js/pkg-modal.js.
   ========================================================================== */

/* The whole photo is the button; a small "לפרטים" chip sits in the corner */
.package__open {
  position: absolute; inset: 0; z-index: 2; margin: 0; padding: 0; border: 0; background: transparent; cursor: zoom-in;
  display: flex; align-items: flex-end; justify-content: flex-start;
}
.package__open-chip {
  margin: 12px; padding: 0.4rem 0.85rem; border-radius: 99px; background: rgba(255,255,255,.94); color: var(--g-ink);
  font-size: 0.85rem; font-weight: 600; line-height: 1.2; box-shadow: 0 6px 16px -8px rgba(0,0,0,.45);
  display: inline-flex; align-items: center; gap: 0.35rem; transition: transform .25s var(--ease), background-color .25s;
}
/* the plus is drawn, not typed, so it sits exactly in the middle */
.package__open-chip::before {
  content: ""; flex: none; width: 11px; height: 11px;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
}
.package__open:hover .package__open-chip { transform: translateY(-2px); background: #fff; }
.package__open:focus-visible { outline: 3px solid #ffbf00; outline-offset: -3px; }
/* phones: a small round "+" in the bottom corner, clear of the award label and the photo dots */
@media (max-width: 599px) {
  .package__open-chip {
    position: absolute; bottom: 8px; left: 8px; margin: 0; padding: 0; width: 32px; height: 32px; justify-content: center;
    font-size: 0; border-radius: 50%;
  }
  .package__open-chip { gap: 0; }
  .package__open-chip::before { width: 13px; height: 13px; }
}

/* ---- The window ---------------------------------------------------------- */
html.pkg-open { overflow: hidden; }
.pkg-modal {
  width: min(1040px, 94vw); max-width: none; max-height: 92vh; max-height: 92dvh; padding: 0; border: 0; border-radius: 10px;
  background: #fbf8f4; color: var(--g-ink); overflow: auto; overscroll-behavior: contain;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.6);
}
.pkg-modal::backdrop { background: rgba(6, 12, 38, .78); backdrop-filter: blur(3px); }
.pkg-modal[open] { animation: pkgIn .35s var(--ease); }
@keyframes pkgIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

.pkg-modal__close {
  position: absolute; z-index: 3; top: 12px; left: 12px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(35,31,32,.18); background: rgba(255,255,255,.92); color: var(--g-ink);
  display: grid; place-items: center; cursor: pointer;
}
.pkg-modal__close svg { width: 20px; height: 20px; }
.pkg-modal__close:hover { background: #fff; border-color: var(--g-ink); }

.pkg-modal__grid { display: grid; grid-template-columns: 1fr; }
.pkg-modal__gallery { background: var(--tales-navy-deep, #0f1d4a); padding: 0 0 12px; }
.pkg-modal__stage { position: relative; aspect-ratio: 4 / 5; max-height: 58vh; max-height: 58dvh; width: 100%; overflow: hidden; }
.pkg-modal__stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pkg-modal__stage.is-white { background: #fff; }
.pkg-modal__stage.is-white img { object-fit: contain; padding: 8%; }
.pkg-modal__stage .pkg-badge { z-index: 2; }

.pkg-modal__thumbs { display: flex; gap: 10px; justify-content: center; padding: 12px 16px 0; }
.pkg-modal__thumb {
  width: 64px; height: 80px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden;
  background: rgba(255,255,255,.08); cursor: pointer; opacity: .65; transition: opacity .2s, border-color .2s;
}
.pkg-modal__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pkg-modal__thumb img.is-white { object-fit: contain; background: #fff; padding: 6px; }
.pkg-modal__thumb[aria-pressed="true"] { opacity: 1; border-color: #fff; }
.pkg-modal__thumb:hover { opacity: 1; }
.pkg-modal__thumb:focus-visible { outline: 3px solid #ffbf00; outline-offset: 2px; }

.pkg-modal__info { padding: 1.5rem 1.25rem 1.75rem; }
.pkg-modal__kind { margin: 0 0 0.35rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; color: #6b5f5a; }
.pkg-modal__name {
  margin: 0 0 0.35rem; font-family: var(--font-latin); font-weight: 200; font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem);
  line-height: 1.1; unicode-bidi: plaintext; text-align: right;
}
.pkg-modal__spec { margin: 0 0 1.1rem; font-size: 1rem; color: #4d4446; }
.pkg-modal__text p { margin: 0 0 0.85rem; font-size: 1.02rem; line-height: 1.7; }
.pkg-facts { margin: 1.25rem 0 1.5rem; padding: 0; border-top: 1px solid rgba(35,31,32,.14); }
.pkg-facts > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid rgba(35,31,32,.14); }
.pkg-facts dt { font-size: 0.88rem; font-weight: 600; color: #6b5f5a; }
.pkg-facts dd { margin: 0; font-size: 0.95rem; line-height: 1.55; }
.pkg-modal__cta { width: 100%; justify-content: center; }

@media (min-width: 900px) {
  .pkg-modal__grid { grid-template-columns: 1fr 1fr; min-height: 560px; }
  .pkg-modal__gallery { display: flex; flex-direction: column; padding-bottom: 16px; }
  .pkg-modal__stage { max-height: none; flex: 1; aspect-ratio: auto; min-height: 440px; }
  .pkg-modal__info { padding: 3rem 2.5rem 2.5rem; display: flex; flex-direction: column; justify-content: center; }
  .pkg-modal__cta { width: auto; align-self: flex-start; }
  .pkg-modal__close { left: 16px; top: 16px; }
}
@media (max-width: 599px) {
  /* phones: a window that pops up over the page, with the page still showing around it */
  .pkg-modal { width: calc(100vw - 28px); max-height: 86vh; max-height: 86dvh; border-radius: 16px; margin: auto; }
  .pkg-modal[open] { animation: pkgPop .3s cubic-bezier(.2,.8,.2,1); }
  @keyframes pkgPop { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
  .pkg-modal__stage { aspect-ratio: 4 / 3; max-height: 34vh; max-height: 34dvh; }
  .pkg-modal__gallery { padding-bottom: 10px; }
  .pkg-modal__thumbs { padding-top: 10px; }
  .pkg-modal__thumb { width: 52px; height: 52px; }
  .pkg-modal__close { top: 10px; left: 10px; width: 40px; height: 40px; }
  .pkg-modal__info { padding: 1.25rem 1.1rem 1.4rem; }
  .pkg-modal__name { font-size: 1.75rem; }
  .pkg-modal__text p { font-size: 0.97rem; line-height: 1.65; }
  .pkg-facts > div { grid-template-columns: 6.25rem minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .pkg-modal[open] { animation: none; } .package__open-chip { transition: none; } }
html.a11y-still .pkg-modal[open] { animation: none; }
