/* Dana gallery, design 1: the photo strip (sections/gallery.jinja).
   Template: .gallery-item.hover-img.hover-overlay (styles.css 14431-14485,
   19203-19207, 19581-19588, 20884-20888; hover 3615-3627, 3741-3760; the
   tooltip 3665-3704), canonical index.html:2829. Numbers:
   planning/evidence/content.md «gallery». */

/* Spacing: the canonical block's .flat-spacing-4 (60 over and under, 40
   under 768). Its pt-0 is the page's composition (the section above spaces
   it): a default of 0 let the strip touch a section placed over it (Phase 7
   L1); a preset that copies the page writes 00 on top. */
.mt-section.dana-gallery--d1 {
  padding-block-start: var(--mt-space-top, 60px);
  padding-block-end: var(--mt-space-bottom, 60px);
}
@media (max-width: 767px) {
  .mt-section.dana-gallery--d1 {
    padding-block-start: var(--mt-space-top-mobile, var(--mt-space-top, 40px));
    padding-block-end: var(--mt-space-bottom-mobile, var(--mt-space-bottom, 40px));
  }
}

.dana-gallery .dana-head__title { color: var(--dana-gallery-ink, var(--dana-heading)); overflow-wrap: anywhere; }
.dana-gallery .dana-head__text { color: var(--dana-gallery-ink, var(--dana-muted)); overflow-wrap: anywhere; }
/* .flat-title: 30px above the strip, 48px from 1200 (styles.css 20327). */
@media (min-width: 1200px) { .dana-gallery .dana-head { margin-block-end: 48px; } }
/* title_size: regular is the head's h4; large .display-lg-4 (39/49, 38/48 to
   1024, 28/38 under 768); extra large the h3 (48/60, 38/50, 28/40:
   furniture2, jewelry2), the same steps as the blog's heading. */
.dana-gallery__head--large .dana-head__title { font-size: 39px; line-height: 49px; letter-spacing: 0; }
.dana-gallery__head--xlarge .dana-head__title { font-size: 48px; line-height: 60px; letter-spacing: 0; }
@media (max-width: 1024px) {
  .dana-gallery__head--large .dana-head__title { font-size: 38px; line-height: 48px; }
  .dana-gallery__head--xlarge .dana-head__title { font-size: 38px; line-height: 50px; }
}
@media (max-width: 767px) {
  .dana-gallery__head--large .dana-head__title { font-size: 28px; line-height: 38px; }
  .dana-gallery__head--xlarge .dana-head__title { font-size: 28px; line-height: 40px; }
}
/* title_font text: the title in the page's text font (home-fashion-women's
   «Shop by @Gram» in Poppins 500, 36/44); title_weight: its own weight
   (footwear's Oswald 600), else the Look's heading weight. */
.dana-gallery__head--text-font .dana-head__title { font-family: var(--dana-font-body); }
.dana-gallery__head--weight .dana-head__title { font-weight: var(--dana-gallery-title-fw); }

/* Full width (florist, furniture2, glasses: .container-full px-0): the strip
   runs from edge to edge; the heading keeps a small gutter so a long title
   never touches the screen's edge. With peek (jewelry2 .px-30.pe-0) only the
   start keeps its gutter, 15px then 30px from 768, and the strip runs off
   the end edge. */
.dana-gallery.mt-section--full > .mt-section__content { padding-inline: 0; }
.dana-gallery.mt-section--full:not(.dana-gallery--peek) .dana-gallery__head { padding-inline: 15px; }
.dana-gallery--peek.mt-section--full > .mt-section__content { padding-inline-start: 15px; }
@media (min-width: 768px) { .dana-gallery--peek.mt-section--full > .mt-section__content { padding-inline-start: 30px; } }

.dana-gallery__frame { position: relative; }
/* A long account-button label never widens the page. */
.dana-gallery__slider { overflow-x: clip; }
/* Fewer photos than a view holds: centred at their own size, before the
   script too (Swiper's centerInsufficientSlides after it). */
.dana-gallery__swiper:not(.swiper-initialized) > .swiper-wrapper { justify-content: safe center; }

/* The photo: square, cropped from the centre, the corner radius of the
   section (--dana-gallery-radius, image_radius). */
.dana-gallery__item {
  position: relative;
  overflow: hidden;
  border-radius: var(--dana-gallery-radius, 8px);
  background: var(--dana-surface, #f6f6f6);
  container-type: inline-size;
}
.dana-gallery__media { display: block; overflow: hidden; aspect-ratio: 1 / 1; }
.dana-gallery__media > img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  transition: opacity .5s ease, transform 2s cubic-bezier(0, 0, .44, 1.18);
}
/* .hover-overlay: a 10% black veil over the photo while the mouse is on it. */
.dana-gallery__item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background-color: rgba(0, 0, 0, .1);
  opacity: 0;
  visibility: hidden;
  transition: .4s ease .1s;
  pointer-events: none;
}
.dana-gallery__item:hover::before,
.dana-gallery__item:has(:focus-visible)::before { opacity: 1; visibility: visible; }
.dana-gallery__item:hover .dana-gallery__media > img,
.dana-gallery__item:has(:focus-visible) .dana-gallery__media > img { transform: scale(1.06); }

/* The shop icon (.box-icon.hover-tooltip): a white circle in the middle of
   the photo, 32 / 40 from 768 / 48 from 1200, the dark cart glyph at 12 / 14
   / 19px; dark with a white glyph on hover. From 992 it shows only while the
   mouse is on the photo. It stays focusable while hidden (opacity only, not
   the template's visibility), so the keyboard reaches every photo's link and
   focus shows it. */
.dana-gallery__view {
  position: absolute;
  z-index: 2;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 32px;
  block-size: 32px;
  border-radius: 50%;
  background-color: #ffffff;
  color: var(--dana-heading);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  transform: translate(-50%, -50%);
  transition: all .3s ease-in-out;
}
[dir="rtl"] .dana-gallery__view { transform: translate(50%, -50%); }
.dana-gallery__view:hover, .dana-gallery__view:focus-visible {
  background-color: var(--dana-heading);
  color: #ffffff;
  text-decoration: none;
}
.dana-gallery__view:focus, .dana-gallery__handle:focus { outline: none; }
.dana-gallery__view .di { display: block; line-height: 1; }
/* The cart glyph at 12px draws its ink 0.6px low in the 32px circle (measured
   at 4x); lifted half a pixel. */
@media (max-width: 767px) { .dana-gallery__view .di { transform: translateY(-.5px); } }
@media (min-width: 768px) {
  .dana-gallery__view { inline-size: 40px; block-size: 40px; font-size: 14px; }
}
@media (min-width: 992px) {
  .dana-gallery__view { opacity: 0; }
  .dana-gallery__item:hover .dana-gallery__view,
  .dana-gallery__view:focus-visible { opacity: 1; }
}
@media (min-width: 1200px) {
  .dana-gallery__view { inline-size: 48px; block-size: 48px; font-size: 19px; }
}

/* The tooltip (.hover-tooltip .tooltip): a dark 23px pill 8px above the
   circle, its 8px diamond pointer, rising 8px into place on hover. It is
   centred by the circle's flex centring (an absolute child's static place). */
.dana-gallery__tip {
  position: absolute;
  inset-block-end: calc(100% + 8px);
  z-index: 100;
  inline-size: max-content;
  max-inline-size: 160px;
  /* Never wider than the photo that clips it (6 a view, gap 40, at 1200:
     158px); the template trims the label to 24 characters, two lines. */
  max-inline-size: min(160px, calc(100cqi - 8px));
  min-block-size: 23px;
  padding: 0 10px;
  border-radius: 4px;
  background-color: var(--dana-heading);
  color: #ffffff;
  font-size: 10px;
  line-height: 23px;
  font-weight: 500;
  text-align: center;
  overflow-wrap: anywhere;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .3s ease, visibility .3s ease, transform .3s cubic-bezier(.71, 1.7, .77, 1.24);
  pointer-events: none;
}
/* The pointer: the template's top 18px on the 23px pill, written from the
   bottom so a label that wraps keeps it under the pill. */
.dana-gallery__tip::before {
  content: "";
  position: absolute;
  inset-block-end: -3px;
  left: 50%;
  z-index: -1;
  inline-size: 8px;
  block-size: 8px;
  background: var(--dana-heading);
  transform: translateX(-50%) rotate(45deg);
}
.dana-gallery__view:hover .dana-gallery__tip,
.dana-gallery__view:focus-visible .dana-gallery__tip,
.dana-gallery__handle:hover .dana-gallery__tip,
.dana-gallery__handle:focus-visible .dana-gallery__tip {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: .1s;
}

/* The account button (furniture2 .wrap-gallery-icon): a 64px dark circle
   with the Instagram glyph at 20px over the middle of the strip, rising from
   55% to 50% as the mouse enters the strip; white on hover. Always shown
   under 992 (no mouse to reveal it); focusable while hidden. */
.dana-gallery__handle {
  position: absolute;
  z-index: 5;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 64px;
  block-size: 64px;
  border-radius: 50%;
  background-color: #252525;
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  transform: translate(-50%, -50%);
  transition: all .3s ease-in-out;
}
[dir="rtl"] .dana-gallery__handle { transform: translate(50%, -50%); }
.dana-gallery__handle .di { display: block; line-height: 1; }
.dana-gallery__handle:hover, .dana-gallery__handle:focus-visible { background-color: #ffffff; color: #252525; text-decoration: none; }
@media (min-width: 992px) {
  .dana-gallery__handle { inset-block-start: 55%; opacity: 0; }
  .dana-gallery__frame:hover .dana-gallery__handle,
  .dana-gallery__handle:focus-visible { inset-block-start: 50%; opacity: 1; }
}

/* Arrows (off in the template, `show_arrows`): the foundation's circles on
   the photos' sides, 20px in from the strip's ends. */
.dana-gallery__nav {
  position: absolute;
  z-index: 4;
  inset-block-start: 50%;
  transform: translateY(-50%);
}
.dana-gallery__nav--prev { inset-inline-start: 20px; }
.dana-gallery__nav--next { inset-inline-end: 20px; }

/* Photos that all fit a view: from the width where they fit, no arrows and
   no dots row, before the script too (gallery.jinja's --fit-* classes are
   the widths where Swiper's watchOverflow locks the slider), so the section
   does not shrink when Swiper starts. */
@media (min-width: 768px) {
  .dana-gallery--fit-md .dana-gallery__dots,
  .dana-gallery--fit-md .dana-gallery__nav { display: none; }
}
@media (min-width: 992px) {
  .dana-gallery--fit-lg .dana-gallery__dots,
  .dana-gallery--fit-lg .dana-gallery__nav { display: none; }
}
@media (min-width: 1200px) {
  .dana-gallery--fit-xl .dana-gallery__nav { display: none; }
}
