/* Amer gallery, design 1 — "Shop Our Insta Glow" (home-cosmetic.html
 * ~2704-2787: section.flat-spacing > .sect-heading.text-center + a
 * .tf-swiper of .gallery-item.hover-img.hover-overlay). Measured on the
 * bought template at 1440/1024/768/390:
 *
 *   Container: .container, 1440px with 15px gutters — this theme's default
 *     --amer-page-width/--amer-gutter, nothing to set on the section.
 *   Section spacing: .flat-spacing (styles.css:1121) — 80px top/bottom,
 *     60px from 991px down, 40px from 425px down (its own breakpoints, not
 *     the theme's usual 767px mobile line — same tiers amer-testimonials-1
 *     and amer-benefits-1 already use for the same template class).
 *   Heading: .sect-heading.text-center (plain, not .type-2) — 24px under
 *     it below 992px, 40px from there (the shared .amer-head gives .type-2's
 *     44px, so this design sets its own); the title 8px above the text below
 *     992px, 12px from there (.sect-heading .s-title margin-bottom; the
 *     shared head's gap is 8px throughout). h3.s-title
 *     clamp(28px,3.8vw,40px) on a clamp(36px,4.5vw,48px) line — the shared
 *     head's 1.2 line matches at 1440 but is 2.4px short at phone width.
 *     .s-desc is plain body text, not the lead: 16px/26px in the text colour
 *     (#101010 = --amer-text), 14px/22px up to 575px.
 *   Slider: data-preview=5 data-tablet=3 data-mobile-sm=3 data-mobile=2,
 *     data-space=10 (all tiers), data-pagination 2/3/4/5 — carried onto our
 *     own swiper attributes (the md 4 clamped to the 3 in view, and a group
 *     of 1 where "Loop slides" cannot loop the template's group: the
 *     section's jinja says why); ui.js reads the same names at the same
 *     breakpoints (575/768/1200/1600) as the template's carousel.js.
 *   Item (.gallery-item): position:relative, overflow:hidden, display:flex,
 *     border-radius:8px — a literal template value, not --amer-radius-card
 *     (a different 12px token used for product cards elsewhere).
 *   Photo: 274x274 in the markup, a literal 1:1 crop (this block's own
 *     assets/images/gallery photos are all square). img width/height 100%,
 *     object-fit cover. .hover-img: transition opacity .5s ease, transform
 *     1.5s cubic-bezier(0,0,.44,1.18); scale(1.1) on hover. .hover-overlay:
 *     an rgba(0,0,0,.1) tint, .4s ease .1s, 0->1 opacity on hover.
 *   Icon button (.box-icon): 40x40 circle, white bg / black icon in the
 *     template (--white/--black) — tokenised here as --amer-bg/--amer-heading
 *     so the three looks recolour it, same pairing as .amer-sw-nav already
 *     uses. Centered absolute; hidden (opacity:0/visibility:hidden) and
 *     hover-revealed only from 992px, permanently visible below that (no
 *     hover on touch). Icon font-size: inherits the body's 16px until
 *     1200px, then 24px (styles.css: ".gallery-item .box-icon" has no
 *     font-size of its own below 1200px).
 *   Tooltip ("View product"): a dark pill, 12px/22px, padding 2px 12px,
 *     radius 8px, an arrow via ::before — entirely display:none below
 *     1200px (not just invisible), shown and hover-revealed from there.
 *   Dots (.sw-dot-default.tf-sw-pagination): the template's actual computed
 *     margin-top is 20px, not .sw-dot-default's own 24px alone — the more
 *     specific ".tf-swiper .tf-sw-pagination:not(.swiper-pagination-lock)"
 *     rule (styles.css:8273) wins. Overriding the shared .amer-dots
 *     24/35/56px scale down to a flat 20px, the same fix benefits-1.css
 *     already applies for the same template rule. With the demo's 5 photos
 *     the dots lock (hide) at >=1200px, exactly like the template (5 photos,
 *     5 per view) — a content-count effect, not a bug; a merchant with 6+
 *     photos sees dots again, same as the template would. Bullets 24px
 *     apart centre to centre: the template's Swiper gives each 16px bullet
 *     4px of margin on both sides (8px between two), the shared .amer-dots
 *     a 4px gap — so this design sets an 8px gap.
 *
 * The "follow us" button under the slider (handle_text/handle_link) has no
 * template counterpart: an added, off-by-default control so a merchant can
 * point at their real Instagram profile (NOTES-queue 7.3: "does not pull
 * from Instagram"). Built from the shared .amer-btn/.amer-head with the same
 * spacing blog-2.css already uses for its own "view all" action, so
 * there is no template number to match here.
 * Nav arrows (show_arrows, off by default — the template's own 5-photo demo
 * has no arrows, dots-only pagination): an optional merchant control, same
 * opt-in shape and floating side position as amer-category-carousel's
 * .amer-cat-slider__prev/__next and amer-product-carousel-1's
 * .amer-product-carousel__side — -14px outside the item edge, hidden below
 * 1280px (the tier those two sections use, chosen over amer-blog-2's 768px
 * cutoff because this slider's items, like the category tiles, sit flush to
 * the section edge with no card padding to tuck the arrow into).
 */
.mt-section.amer-gallery--d1 {
  padding-block: var(--mt-space-top, 80px) var(--mt-space-bottom, 80px);
}
@media (max-width: 991px) {
  .mt-section.amer-gallery--d1 {
    padding-block: var(--mt-space-top-mobile, var(--mt-space-top, 60px)) var(--mt-space-bottom-mobile, var(--mt-space-bottom, 60px));
  }
}
@media (max-width: 425px) {
  .mt-section.amer-gallery--d1 {
    padding-block: var(--mt-space-top-mobile, var(--mt-space-top, 40px)) var(--mt-space-bottom-mobile, var(--mt-space-bottom, 40px));
  }
}

.amer-gallery--d1 .amer-head { margin-block-end: 24px; }
.amer-gallery--d1 .amer-head__main { gap: 8px; }
.amer-gallery--d1 .amer-head__title { line-height: clamp(36px, 4.5vw, 48px); }
/* The template's h3.s-title tracks at .05em (styles.css h3: 2px at 40px,
   1.4px at 28px); amer-core's --amer-ls-heading is 0 in looks 1 and 2.
   Restated here, as amer-product-thumbs-3, amer-banner-grid and
   amer-hero-slider-1 already do, until the core token is corrected. The
   rendered width matches the template only once layout.jinja also loads
   DM Sans with its optical-size axis (the template's opsz 9..40): with the
   static cut the tracked title runs wider. Looks 1 and 2 only: look 3's
   heading face and its .01em tracking are ours by decision (look-3.css).
   Arabic is never tracked (the reset comes after, at the same weight). */
.amer-look--d1 .amer-gallery--d1 .amer-head__title,
.amer-look--d2 .amer-gallery--d1 .amer-head__title { letter-spacing: .05em; }
[dir="rtl"] .amer-gallery--d1 .amer-head__title { letter-spacing: 0; }
.amer-gallery--d1 .amer-head__text { font-size: 16px; line-height: 26px; color: var(--amer-text); }
@media (min-width: 992px) {
  .amer-gallery--d1 .amer-head { margin-block-end: 40px; }
  .amer-gallery--d1 .amer-head__main { gap: 12px; }
}
@media (max-width: 575px) {
  .amer-gallery--d1 .amer-head__text { font-size: 14px; line-height: 22px; }
}

.amer-gallery--d1 .amer-gallery__slider { position: relative; }
.amer-gallery--d1 .amer-gallery__prev,
.amer-gallery--d1 .amer-gallery__next {
  position: absolute;
  inset-block-start: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.amer-gallery--d1 .amer-gallery__prev { inset-inline-start: -14px; }
.amer-gallery--d1 .amer-gallery__next { inset-inline-end: -14px; }
@media (max-width: 1279px) {
  .amer-gallery--d1 .amer-gallery__prev,
  .amer-gallery--d1 .amer-gallery__next { display: none; }
}

.amer-gallery--d1 .amer-gallery__item { border-radius: 8px; }
.amer-gallery--d1 .amer-gallery__media { aspect-ratio: 1 / 1; background: var(--amer-surface); }
.amer-gallery--d1 .amer-gallery__media img {
  transform: scale(1); /* the template's global img { transform: scale(1) } — the zoom starts from it */
  transition: opacity .5s ease, transform 1.5s cubic-bezier(0, 0, .44, 1.18);
}
.amer-gallery--d1 .amer-gallery__item:hover .amer-gallery__media img { transform: scale(1.1); }
.amer-gallery--d1 .amer-gallery__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, .1);
  opacity: 0;
  visibility: hidden;
  transition: .4s ease .1s;
}
.amer-gallery--d1 .amer-gallery__item:hover .amer-gallery__media::before { opacity: 1; visibility: visible; }

.amer-gallery--d1 .amer-gallery__view {
  inline-size: 40px;
  block-size: 40px;
  border-radius: 50%;
  background: var(--amer-bg);
  color: var(--amer-heading);
  font-size: 16px;
  opacity: 1;
  visibility: visible;
  /* .box-icon's own `transition: all .3s ease`, property by property. */
  transition: opacity .3s ease, visibility .3s ease, background-color .3s ease, color .3s ease;
}
.amer-gallery--d1 .amer-gallery__view:hover { background: var(--amer-heading); color: var(--amer-bg); }
@media (min-width: 992px) {
  .amer-gallery--d1 .amer-gallery__view { opacity: 0; visibility: hidden; }
  .amer-gallery--d1 .amer-gallery__item:hover .amer-gallery__view { opacity: 1; visibility: visible; }
}
@media (min-width: 1200px) {
  .amer-gallery--d1 .amer-gallery__view { font-size: 24px; }
}

.amer-gallery--d1 .amer-gallery__tooltip {
  display: none;
  padding: 2px 12px;
  border-radius: 8px;
  background: var(--amer-heading);
  color: var(--amer-bg);
  font-size: 12px;
  line-height: 22px;
}
.amer-gallery--d1 .amer-gallery__tooltip::before {
  content: "";
  position: absolute;
  inset-block-start: 22px;
  left: 50%; /* centring, physical in both directions (see gallery.css) */
  transform: translateX(-50%) rotate(45deg);
  inline-size: 9px;
  block-size: 9px;
  background: var(--amer-heading);
  z-index: -1;
}
@media (min-width: 1200px) {
  .amer-gallery--d1 .amer-gallery__tooltip { display: block; }
}

.amer-gallery--d1 .amer-gallery__dots { margin-block-start: 20px; gap: 8px; }
/* With "Loop slides" on and a photo count that does not divide into the
   template's group, the slider moves one photo per press (see the section's
   jinja), so there is one dot per photo: up to 20, 472px of dots, wider than
   a phone. They wrap onto a second row instead of pushing the page sideways.
   Every count the template itself pages fits on one row, so this changes
   nothing there. */
.amer-gallery--d1 .amer-gallery__dots { flex-wrap: wrap; }
/* The template's own .sw-dot-default.swiper-pagination-lock{margin:0} — a
   locked pagination (not enough photos to page through) carries no margin.
   Visually moot here (the shared .amer-dots.swiper-pagination-lock in the
   off-limits core.css already display:none's the whole wrapper, so
   nothing shows either way), kept for numeric parity. */
.amer-gallery--d1 .amer-gallery__dots.swiper-pagination-lock { margin-block-start: 0; }

.amer-gallery--d1 .amer-gallery__action { margin-block-start: 32px; }
@media (min-width: 992px) {
  .amer-gallery--d1 .amer-gallery__action { margin-block-start: 40px; }
}
