    :root {

	--forest-dark: #283B2A; 
	--forest-detail: #3A4C37;
	--forest-button: #495944;
	--surrey-hills: #5D6A53; 
	--bg-panel: #7B7F6A;
	--bg-fill: #ACAE9C;
	--heritage-red: #8E1F25;

      --bg: var(--bg-panel);            /* deep green background */
      --panel: var(--bg-panel);         /* card background */
      --panel-alt: #1c4b2a;     /* hover/alternate shade */
      --text: #e9f5ec;          /* near-white text */
      --muted: #b7d8c3;         /* muted text */
      --accent: #6fd18d;        /* accent green */
      --accent-2: #3bbf74;      /* darker accent */
      --border: #2a5a39;        /* border lines */
      --chip-bg: #0f2f1b;       /* tag chip bg */
      --chip-text: #bfe9cb;     /* tag chip text */
      --focus: #a6f3be;         /* focus ring */
      --shadow: 0 6px 20px rgba(0,0,0,0.25);
      --radius: 14px;
      --radius-sm: 10px;
      --gap: 16px;
      --maxw: 1200px;
    }
    * { box-sizing: border-box; }


.gallery-header {
  padding-left: 150px;
  padding-top: 4px;
  padding-bottom: 12px;
}

.title h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.2px;
  font-weight: 700;
  line-height: 1.2;      /* Ensures healthy spacing if text wraps */
}

.sub-title {
  font-size: 1.2rem;
  margin-top: 12px;     /* Sets a clean gap between title and subtitle */
}

    .toolbar {
      max-width: var(--maxw);
      margin: 12px auto 8px;
      padding: 0 16px;
      display: grid;
      grid-template-columns: 1fr auto;
      padding-top: 18px;

      gap: 10px;
    }
    .search {
      display: flex;
      gap: 10px;
      align-items: center;
      background: var(--bg-panel);
/*      background: linear-gradient(180deg, #153a22 0%, #112a1a 100%); */
      border: 1px solid var(--border);
      border-radius: var(--radius);
      max-width: 500px;

      padding: 10px 12px;
      box-shadow: var(--shadow);
    }
    .search input[type="text"] {
      border: none;
      outline: none;
      background: transparent;
      color: var(--text);
      width: 100%;
      font-size: 15px;
    }
    .search input::placeholder { color: var(--text); }

    .filters {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }
    .chip {
      border: 1px solid var(--border);
      background: var(--chip-bg);
      color: var(--chip-text);
      padding: 8px 12px;
      border-radius: 999px;
      font-size: 13px;
      cursor: pointer;
      transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 80ms ease;
      user-select: none;
    }
    .chip:hover { background: #134323; border-color: #346a45; }
    .chip:active { transform: translateY(1px); }
    .chip.active {
      background: var(--heritage-red);
      color: var(--muted);
      border-color: var(--heritage-red);
      font-weight: 600;
    }
    .chip.reset {
      background: transparent;
      color: var(--heritage-red);
      border-color: var(--heritage-red);
    }
    .chip.reset:hover { background: rgba(111, 209, 141, 0.12); }


    .gallery-wrap {
      max-width: var(--maxw);
      margin: 10px auto 40px;
      padding: 0 16px;
    }
	
	
    /* Responsive masonry using CSS columns */
    .masonry {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 16px;

    }

	.art-gallery-wrap {
      max-width: var(--maxw);
      margin: 10px auto 40px;
      padding: 0 16px;
    }
	
	
    /* Responsive masonry using CSS columns */
    .art-masonry {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
	gap: 16px;
	margin: 0 0 40px 0;

    }

.art-pic-card {
  /* background: #C8B9A6; */
  
/* background: #AEC6CF; */
/*  background: #EAE6E1 ; */
  background: #444 ;
  
  border: 1px solid var(--border);
  border-radius: var(--radius); 

  padding: 30px 30px;
	
  align-items: center;
  text-align: center;
  border: 1px solid rgba(172, 174, 156, 0.4);
   
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  
  break-inside: avoid;
  display: flex;
  flex-direction: column;
}


.art-pic-card figure {
  position: relative;
  width: 100%;             /* Ensure container takes full card width */
  height: 300px;
  margin: 0;
  overflow: hidden;
  display: flex;           /* Added */
  justify-content: center; /* Added: Centers image horizontally */
  align-items: center;     /* Added: Centers image vertically */
}


.art-pic-card img {
  display: block;
  /*
  width: 100%;
  height: auto;
  */
  width: auto;
  height: 300px;
  object-fit: cover;

  background:   #704214;
}



.art-meta {
	
	width: 100%;
	max-width: 450px;
	height: 300px; /* fixed height */
/*	background: #EAE6E1 ; */
	background: #444 ;
	color: #EAE6E1;
	
/*	border: 2px solid #333; */
	padding: 8px 0px;
	
	display: flex;
	flex-direction: column;
	justify-content: space-between; /* pushes 1st and last to the edge */
	box-sizing: border-box;
}

.top-group {
	display: flex;
	flex-direction: column;
}
	
.row {
	display:flex;
	width: 100%;
}

.split-50-50 > div {
	flex: 0 0 50%;
}

.split-25-75 > div:first-child  {
	flex: 0 0 50%;
}

.full-width  {
	width: 100%;
	text-align: left;
	padding-top: 10px;
}

.left {
	text-align: left;

}

.right {
	text-align: right;
	margin-left: auto;
}

.divider {
	width: 100%;
	border-bottom: 1px dashed #999;
	margin: 4px 0;
}



		
		
	
.pic-card {
  background: #C8B9A6;

  
  border: 1px solid var(--border);
  border-radius: var(--radius); 

  padding: 30px 30px;
	
  align-items: center;
  text-align: center;
  border: 1px solid rgba(172, 174, 156, 0.4);
   
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  
  break-inside: avoid;
  display: flex;
  flex-direction: column;
}

.pic-card figure {
  position: relative;
  width: 100%;
  margin: 0;
  overflow: hidden;
}

.pic-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
/*  background: #0a1a10; */
  background:   #704214;
}

.card {
  width: 100%;
  margin: 0 0 var(--gap);
  background: #222222;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  break-inside: avoid;

  /* FIX 1: Turn the card itself into a flex column */
  display: flex;
  flex-direction: column;
}

.card figure {
  position: relative;
  margin: 0;
  overflow: hidden;
}

.card img {
  display: block;
  width: 100%;
  object-fit: cover;
  background: #0a1a10;
}

.meta {
  display: flex;
  flex-direction: column;
  
  /* Fix 5: Use flex-grow so it fills the bottom area dynamically without breaking Firefox */
  flex-grow: 1; 
  padding: 12px 12px 10px; /* Optional: restored your padding safely */
  min-height: 180px; 
}

.meta .name {
  font-weight: 700;
  letter-spacing: 0.2px;

}

.meta .description {
  font-size: 13px;
}

/* TARGET ONLY THE VERY LAST ITEM */
.meta > .ref {
      font-size: 11px;
      padding: 6px 8px;
      border-radius: 999px;
      background: var(--bg-panel);
      border: 1px solid #234f34;
      color: white;
      margin-top: auto; 
}



    .tag {
      font-size: 12px;
      padding: 6px 8px;
      border-radius: 999px;
      background: #0e2a18;
      border: 1px solid #234f34;
      color: #a7d8b7;
      cursor: pointer;
      transition: background 120ms ease, transform 80ms ease;
    }
    .tag:hover { background: #144027; }
    .tag:active { transform: translateY(1px); }

    /* Accessibility focus */
    .chip:focus-visible,
    .tag:focus-visible,
    .search input:focus-visible {
      outline: 2px solid var(--focus);
      outline-offset: 2px;
    }


/* Footer / count */
    .count {
      max-width: var(--maxw);
      margin: 8px auto 24px;
      padding: 0 16px;

      color: var(--accent-green);
      font-size: 14px;
    }
 /*
  * Styles for overlay and zoom of the pictures
  */
 /* Full-screen dark overlay background configuration */
#pictureOverlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.95); 
    z-index: 10000;
    display: none; 
    justify-content: center;
    align-items: center;
}
#pictureOverlay.show {
    display: flex;
}

#overlay-content-container {
    display: flex;
    flex-direction: column;
    align-items: center;    /* Keeps everything perfectly aligned horizontally */
    justify-content: center; /* Keeps everything perfectly aligned vertically */
    width: 85vw;             
    height: 90vh;
}

#pic-and-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 70vh;            /* Strictly locks the image height sandbox boundaries */
    overflow: hidden;        /* Clips zoomed images so they cannot bleed down onto captions */
    position: relative; 
}

#overlayImage {
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain;
    display: block;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); 
}

#overlay-caption {
    color: rgba(255, 255, 255, 0.95);
    font-size: 20px;          
    font-weight: 500;         
    margin-top: 25px;        /* Guarantees a clean visual buffer space below the image */
    width: 100%;              
    text-align: left;         
    font-family: sans-serif;
    line-height: 1.4;
}

/* STEP 3 UPDATE: Space out the three controls evenly across the footer */
#overlay-footer {
    width: 100%;
    margin-top: 25px;
    display: flex;
    justify-content: center; 
    gap: 30px; /* Adds clean breathing space between buttons */
}

/* Give all buttons the exact same proven design styles */
.close-btn, .nav-btn {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover, .nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Subtle accent highlight when hovering over the navigation buttons */
.nav-btn:hover {
    background-color: #5D6A53;
    border-color: #5D6A53;
}
/*
 * END OF styles for overlay 
 */
 
/* --- MOBILE RESPONSIVE ADAPTATIONS --- */
@media screen and (max-width: 768px) {
    
    /* 1. Widen the content container to utilize small screens efficiently */
    #overlay-content-container {
        width: 92vw; /* Expands from 75vw to give the image maximum breathing room */
    }

    /* 2. Shorten the image box height slightly so the footer buttons aren't pushed off-screen */
    #pic-and-button {
        height: 55vh; /* Drop from 70vh to ensure caption + buttons fit on short screens */
    }

    /* 3. Scale down the caption font size for mobile reading */
    #overlay-caption {
        font-size: 16px; /* Shrinks from 20px so text blocks look balanced */
        margin-top: 15px;
        line-height: 1.3;
    }

    /* 4. Compact the footer dashboard layout */
    #overlay-footer {
        margin-top: 15px;
        gap: 10px; /* Tighten the gaps between your 3 buttons */
    }

    /* 5. Reduce button padding so they sit cleanly side-by-side without wrapping */
    .close-btn, .nav-btn {
        font-size: 12px; /* Slight typographic reduction */
        padding: 10px 14px; /* Narrower horizontal padding */
        letter-spacing: 0.5px;
    }
}


 
 
 

/* ─── MOBILE SPECIFIC LAYOUT (Screens 768px and smaller) ─── */
@media screen and (max-width: 768px) {
  /* Use explicit body tagging to smash any desktop specificity */
  .gallery-header {
  padding-left: 20px; 
  padding-right: 20px;
  padding-top: 4px;
  padding-bottom: 12px;
}
  
  body .title, 
  body .sub-title {
    display: block ;       /* Breaks flexbox layouts entirely */
    width: auto ;          /* Overrides any rigid widths */
    max-width: 100% ;      /* Forces container to stay on screen */
    height: auto ;         /* Annihilates the 70px height limit */
    margin: 0 ;            /* Removes conflicting desktop margins */
    box-sizing: border-box; /* Forces padding to stay INSIDE the box */
  }

  body .title h1 {
    font-size: 24px;
    line-height: 1.3t;     /* Ensures healthy vertical row space */
    margin: 0 0 8px 0 ;    /* Pushes sub-title down slightly */
  }
}


/* ============================================================== */
/* LARGE PHONES & HORIZONTAL VIEWPORTS (Down to 600px wide)       */
/* ============================================================== */
@media (max-width: 600px) {
  .art-masonry {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
  }

  .art-pic-card {
    padding: 16px;
  }

  .art-meta {
    height: auto; 
    min-height: 200px;
    padding: 12px 0 0 0;
  }

  .split-50-50 {
    flex-direction: column;
    gap: 4px;
  }

  .split-50-50 > div {
    flex: 0 0 100%;
  }

  .right {
    text-align: left;
    margin-left: 0;
  }
}

/* ============================================================== */
/* SMALL MOBILE PHONES (Down to 480px wide)                       */
/* ============================================================== */
@media (max-width: 480px) {
  .toolbar { 
    grid-template-columns: 1fr; 
  }
  
  .title h1 { 
    font-size: 22px; /* Gets a bit smaller on tiny screens */
  }
  
  .search { 
    padding: 8px 10px; 
  }

  /* Brings content closer to edges to maximize tiny screens */
  .title, .sub-title {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}
