/* ==========================================================================
   LAADS Contracting - Schools Gallery
   Clean Gallery (No Header, No Banner, No Footer)
   - EXACT OFFICE & RESTAURANT SPACING SYSTEM (--gap: 26px, --padding: 50px)
   - ZERO CROPPING: 100% of Natural Image Content Visible (Picnic Table Intact)
   - 100% FLUSH HORIZONTAL BASELINES & BOTTOMS ACROSS ALL SCREEN SIZES
   - RESPONSIVE: SAME MULTI-COLUMN DESIGN PRESERVED (NO 1-COL COLLAPSE)
   - HIGH IMAGE CLARITY WITH GPU SHARPENING FILTER
   - PURE HTML & CSS (NO BOOTSTRAP, NO FANCYBOX)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens (Matching Office & Restaurant)
   -------------------------------------------------------------------------- */
:root {
  --bg-color: #F8F5EE;          /* Light warm ivory / travertine matching office & restaurant */
  --bg-card: #EFECE6;           /* Placeholder card color */
  
  --gap: 26px;                  /* Exact 26px inter-image spacing matching office & restaurant */
  --padding-x: 50px;            /* Exact 50px left & right side padding */
  --padding-y: 50px;            /* Equal 50px top & bottom container padding */
}

/* --------------------------------------------------------------------------
   2. Reset & Global Base
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #1A1A1A;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   3. Main Gallery Container (Full Width with Exact Side & Top/Bottom Padding)
   -------------------------------------------------------------------------- */
.gallery-wrapper {
  background-color: var(--bg-color);
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.gallery-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: var(--padding-y) var(--padding-x);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* --------------------------------------------------------------------------
   4. Universal Gallery Item & Uncropped High-Clarity GPU Image Pipeline
   -------------------------------------------------------------------------- */
.gallery-item {
  display: block;
  line-height: 0;
  font-size: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: default;
  position: relative;
  width: 100%;
}

img.gallery-img {
  width: 100%;
  height: auto;                 /* 100% natural height: ZERO CROPPING */
  display: block;
  object-fit: contain;          /* Never cut or crop any part of the image */
  /* Maximum Clarity Pipeline: Hardware-Accelerated Sharpening & Enhanced Dynamic Range */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  filter: url(#clarity-filter) contrast(1.08) brightness(1.02) saturate(1.06);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  margin: 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Section 1: Asymmetric 2-Column Continuous Mosaic Grid (Original Design)
   Left:  6 2.png, 6 5.png, 6 2-1.png, 6 7.png (4 images + 3 gaps)
   Right: 6 3.png, 6 4.png, 6 6.png           (3 images + 2 gaps)
   Exact mathematical balance:
   Left sum of (H/W)  = 1345/1005 + 560/994 + 558/994 + 413/994 = 2.878550
   Right sum of (H/W) = 970/726 + 972/726 + 970/728             = 4.007349
   Formula with gap compensation:
   W_left  = calc((100% - var(--gap)) * 0.581965 - (var(--gap) * 0.145224))
   W_right = calc((100% - var(--gap)) * 0.418035 + (var(--gap) * 0.145224))
   Result: Bottoms of 6 7.png and 6 6.png match 100% to 0.00px with ZERO cropping!
   -------------------------------------------------------------------------- */
.gallery-row-mosaic {
  display: flex;
  justify-content: space-between;
  gap: var(--gap);
  width: 100%;
  margin: 0;
}

.gallery-row-mosaic .mosaic-col-left {
  width: calc((100% - var(--gap)) * 0.581965 - (var(--gap) * 0.145224));
  flex: 0 0 calc((100% - var(--gap)) * 0.581965 - (var(--gap) * 0.145224));
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.gallery-row-mosaic .mosaic-col-right {
  width: calc((100% - var(--gap)) * 0.418035 + (var(--gap) * 0.145224));
  flex: 0 0 calc((100% - var(--gap)) * 0.418035 + (var(--gap) * 0.145224));
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* --------------------------------------------------------------------------
   Section 2: 2-Column Row (6 8.png & 6 9.png)
   Both images share identical native 652px height (1157 : 587 ratio)
   Result: Heights match 100% to 0.00px with ZERO image cropping!
   -------------------------------------------------------------------------- */
.gallery-row-s2 {
  display: flex;
  justify-content: space-between;
  gap: var(--gap);
  width: 100%;
  margin: 0;
}

.gallery-row-s2 .item-s2-1 {
  width: calc((100% - var(--gap)) * 0.663417);
  flex: 0 0 calc((100% - var(--gap)) * 0.663417);
}

.gallery-row-s2 .item-s2-2 {
  width: calc((100% - var(--gap)) * 0.336583);
  flex: 0 0 calc((100% - var(--gap)) * 0.336583);
}

/* --------------------------------------------------------------------------
   Section 3: 2-Column Row (6 11.png & 6 12.png)
   Both images share identical native 408px height (787 : 972 ratio)
   Result: Heights match 100% to 0.00px with ZERO image cropping!
   -------------------------------------------------------------------------- */
.gallery-row-s3 {
  display: flex;
  justify-content: space-between;
  gap: var(--gap);
  width: 100%;
  margin: 0;
}

.gallery-row-s3 .item-s3-1 {
  width: calc((100% - var(--gap)) * 0.447413);
  flex: 0 0 calc((100% - var(--gap)) * 0.447413);
}

.gallery-row-s3 .item-s3-2 {
  width: calc((100% - var(--gap)) * 0.552587);
  flex: 0 0 calc((100% - var(--gap)) * 0.552587);
}

/* --------------------------------------------------------------------------
   Section 4: 2-Column Row (6 13.png & 6 14.png)
   Both images share identical native 708px height (982 : 793 ratio)
   Result: Heights match 100% to 0.00px with ZERO image cropping!
   -------------------------------------------------------------------------- */
.gallery-row-s4 {
  display: flex;
  justify-content: space-between;
  gap: var(--gap);
  width: 100%;
  margin: 0;
}

.gallery-row-s4 .item-s4-1 {
  width: calc((100% - var(--gap)) * 0.553239);
  flex: 0 0 calc((100% - var(--gap)) * 0.553239);
}

.gallery-row-s4 .item-s4-2 {
  width: calc((100% - var(--gap)) * 0.446761);
  flex: 0 0 calc((100% - var(--gap)) * 0.446761);
}

/* --------------------------------------------------------------------------
   5. Responsive Adaptations (Matching Office & Restaurant Implementation)
   - Multi-column layout remains 100% IDENTICAL on mobile, tablet, and desktop
   - NO 1-column vertical stacking; side-by-side collage columns preserved
   - Proportional spacing scales down smoothly across all viewport widths
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root {
    --gap: 20px;
    --padding-x: 35px;
    --padding-y: 35px;
  }
}

@media (max-width: 768px) {
  :root {
    --gap: 16px;
    --padding-x: 25px;
    --padding-y: 25px;
  }
}

@media (max-width: 480px) {
  :root {
    --gap: 12px;
    --padding-x: 16px;
    --padding-y: 16px;
  }
}

@media (max-width: 360px) {
  :root {
    --gap: 8px;
    --padding-x: 10px;
    --padding-y: 10px;
  }
}
