/* ==========================================================================
   DHARMIKAM — GALLERY (inner page)
   Page-specific blocks only. The banner, breadcrumb and header-over-banner
   treatment come from inner-page.css; tokens, buttons and section shells come
   from base.css / sections.css.

   The grid here is a copy of the Ashram page's tile component under `.gal-*`
   names, so the two pages look identical without this file being able to reach
   ashram.html (or any page that does not load it).

   Load order: base.css → sections.css → animations.css → responsive.css
               → inner-page.css → gallery.css (last, so it can refine)
   ========================================================================== */

/* ==========================================================================
   1. BANNER REFINEMENT
   ========================================================================== */
.page-hero--gallery{min-height:clamp(350px,44vw,540px)}
.page-hero--gallery .page-hero__bg img{object-position:center 46%}

/* ==========================================================================
   2. GALLERY GRID
   Square tiles — the crop the ashram's own galleries use — four across on
   desktop, three on tablet, two on phones. Content-agnostic: adding or
   removing a figure needs no CSS change.
   ========================================================================== */
.gal-grid{
  display:grid;
  gap:clamp(.6rem,1.1vw,1rem);
  grid-template-columns:repeat(4,1fr);
}
@media (max-width:991.98px){.gal-grid{grid-template-columns:repeat(3,1fr)}}
@media (max-width:575.98px){.gal-grid{grid-template-columns:repeat(2,1fr);gap:.55rem}}

.gal-tile{
  position:relative;overflow:hidden;
  margin:0;                       /* figure carries a default margin */
  aspect-ratio:1;
  border-radius:var(--r-sm);
  box-shadow:var(--sh-sm);
  background-image:linear-gradient(150deg,var(--mist),var(--sand));
  transition:transform .55s var(--ease-out),box-shadow .55s var(--ease-out);
}
.gal-tile img{
  width:100%;height:100%;object-fit:cover;display:block;
  transition:transform 1.2s var(--ease-out);
}
.gal-tile::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(180deg,rgba(15,46,30,.06),rgba(15,46,30,.26));
  opacity:.55;transition:opacity .5s var(--ease);
}
.gal-tile:hover,.gal-tile:focus-within{
  transform:translateY(-5px);
  box-shadow:var(--sh-md);
}
.gal-tile:hover img,.gal-tile:focus-within img{transform:scale(1.07)}
.gal-tile:hover::after,.gal-tile:focus-within::after{opacity:1}

/* thin gold hairline that draws in on hover */
.gal-tile__edge{
  position:absolute;z-index:3;inset:0;pointer-events:none;
  border:1px solid rgba(226,200,138,0);
  border-radius:inherit;
  transition:border-color .5s var(--ease);
}
.gal-tile:hover .gal-tile__edge,
.gal-tile:focus-within .gal-tile__edge{border-color:rgba(226,200,138,.55)}

.section--dark .gal-tile{
  box-shadow:0 18px 40px -24px rgba(0,0,0,.75);
  background-image:linear-gradient(150deg,#1B4332,#123722);
}

/* ==========================================================================
   3. LONG ACCENT HEADINGS
   `.accent` clips a gradient to the text. Across a line break the span is cut
   into fragments and the trailing side bearing is dropped, shaving the
   italic's terminal. Making it an atomic box keeps one unbroken clip region.
   ========================================================================== */
.section-head .accent{display:inline-block;padding-inline:.06em .16em}

/* ==========================================================================
   4. DECORATIVE BLOBS
   ========================================================================== */
.blob--gal-a{
  width:min(54vw,600px);aspect-ratio:1;top:-12%;right:-15%;
  background:radial-gradient(circle,rgba(169,201,182,.5),transparent 68%);
  animation:driftB 27s ease-in-out infinite;
}
.blob--gal-b{
  width:min(48vw,520px);aspect-ratio:1;bottom:-16%;left:-13%;
  background:radial-gradient(circle,rgba(226,200,138,.42),transparent 68%);
  animation:driftA 31s ease-in-out infinite;
}

@media print{
  .gal-grid{grid-template-columns:repeat(4,1fr)}
  .gal-tile{break-inside:avoid;box-shadow:none}
}
