/* =========================================================
   GALLERY PAGE STYLING
   ========================================================= */

/* --- Page Background --- */
.gallery-body {
    background: linear-gradient(to bottom, var(--bg-0), var(--bg-1));
    font-family: 'Georgia', 'Libre Baskerville', serif;
  }
  
  /* =========================================
   GALLERY VARIABLES & PAGE SETUP
   ========================================= */
:root {
  --gallery-gold: #cfaa6e; 
  --overlay-bg: rgba(0, 0, 0, 0.75);
  --glass-border: rgba(255, 255, 255, 0.1);
  /* Ensure these exist if not inherited */
  --bg-1: #f4f4f4; 
  --text-primary: #333;
}

.gallery-body {
  background-color: var(--bg-0);
  color: var(--text-primary);
  /* The subtle texture you asked for */
  background-image: radial-gradient(rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* =========================================
   MASONRY GRID LAYOUT
   ========================================= */
.gallery-main {
  padding: 4rem 5%;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 80vh;
  
  /* Masonry Setup */
  column-count: 3;
  column-gap: 2rem;
}

/* =========================================
   ART CARD (Adapted to your HTML)
   ========================================= */
.gallery-item {
  /* CRITICAL MASONRY FIX: Prevents invisible/glitchy items */
  display: inline-block;
  width: 100%;
  vertical-align: top;
  break-inside: avoid;

  /* Card Styling */
  position: relative;
  margin-bottom: 2rem;
  background-color: var(--bg-1);
  border-radius: 4px; /* Slightly sharper corner from your requested style */
  overflow: hidden;
  cursor: pointer;
  
  /* Shadow for depth */
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1); 
  
  /* Initial Animation State */
  opacity: 0; 
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Reveal State (Triggered by JS) */
.gallery-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fix for Picture tag spacing */
.gallery-item picture {
  display: block;
  line-height: 0;
}

/* =========================================
   IMAGE STYLING
   ========================================= */
.gallery-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Zoom Effect on Hover */
.gallery-item:hover .gallery-image {
  transform: scale(1.05);
}

/* =========================================
   TAG / OVERLAY STYLING
   ========================================= */
.gallery-tag {
  /* Position absolute over the image */
  position: absolute;
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0;
  z-index: 10;
  
  /* Flexbox to center the text */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  
  /* Visual Style */
  background: var(--overlay-bg);
  backdrop-filter: blur(2px);
  
  /* Text Style */
  color: #fff;
  font-family: var(--font-serif); /* e.g., Georgia */
  font-style: italic;
  font-size: 1.2rem;
  
  /* Animation: Hidden by default */
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Slide text up slightly on hover */
.gallery-tag::after {
  content: ''; /* Helper for animation stability */
  display: block;
}

.gallery-item:hover .gallery-tag {
  opacity: 1;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  .gallery-main { column-count: 2; }
}

@media (max-width: 600px) {
  .gallery-main { 
    column-count: 1; 
  }
  
  .gallery-item {
    margin-bottom: 1.5rem;
    /* Force visible on mobile */
    opacity: 1;
    transform: translateY(0);
  }
}
  
  /* =========================================================
     ART BANNER (BOTTOM FLOAT PROMPT)
     ========================================================= */
  
  /* --- Banner Container --- */
  .art-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    border: 1px solid var(--ink);
    background: linear-gradient(to bottom right, var(--panel-0), var(--panel-1));
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1000;
    font-family: 'Georgia', 'Libre Baskerville', serif;
    font-size: 14px;
    max-width: 90vw;
    flex-wrap: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.5s ease;
  }
  
  /* Trigger show animation */
  .art-banner.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    visibility: visible;
    pointer-events: auto;
  }
  
  /* --- Banner Text --- */
  .art-text {
    color: var(--ink);
    flex-grow: 1;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* --- Banner CTA Button --- */
  .art-btn {
    padding: 6px 12px;
    background-color: var(--ink);
    color: var(--text-4) !important;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
  }
  
  .art-btn:hover {
    background-color: var(--ink-2);
    color: #fcfbf9;
  }
  
  /* --- Banner Close Icon --- */
  .art-close {
    cursor: pointer;
    margin-left: 8px;
    font-size: 16px;
    color: #777;
    flex-shrink: 0;
  }
  
/* --- Banner Mobile Adjustments (slightly bigger, same proportions) --- */
@media (max-width: 768px) {
  .art-banner {
    bottom: 18px;          /* was 16 */
    padding: 7px 9px;     /* was 6px 8px */
    gap: 11px;            /* was 10 */
    font-size: 13px;      /* was 12 */
    max-width: 78vw;      /* was 75 */
  }

  .art-text {
    max-width: 55vw;      /* was 50 */
    font-size: 13px;      /* was 12 */
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .art-btn {
    font-size: 11px;      /* was 10 */
    padding: 5px 9px;     /* was 4px 8px */
  }

  .art-close {
    font-size: 15px;      /* was 14 */
  }
}

  
  /* =========================================================
     ART MODAL
     ========================================================= */
  
  /* --- Overlay --- */
  #art-modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    -webkit-overflow-scrolling: touch;
  }
  
  /* --- Modal Window --- */
  #art-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(to bottom right, var(--panel-0), var(--panel-1));
    border-radius: 14px;
    padding: 30px 25px;
    width: 90%;
    max-width: 460px;
    text-align: center;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
    font-family: 'Georgia', 'Libre Baskerville', serif;
    animation: fadeInModal 0.4s ease-out;
    border: none;
    transition: transform 0.3s ease;
  }
  
  /* --- Modal Close Button --- */
  #art-modal .close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: #777;
    background: none;
    border: none;
    transition: color 0.3s ease;
  }
  
  #art-modal .close-btn:hover {
    color: var(--ink);
  }
  
  /* --- Modal Title --- */
  #art-modal #modal-message {
    font-family: 'Georgia', 'Libre Baskerville', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
    border-bottom: 2px solid var(--ink);
    padding-bottom: 6px;
    margin-bottom: 20px;
    display: inline-block;
    letter-spacing: 0.3px;
  }
  
  /* --- Modal Fade Animation --- */
  @keyframes fadeInModal {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
  }
  
  /* =========================================================
    Quotes
     ========================================================= */

  .quote-container {
    color: var(--ink); /* Deep blue for consistency */
    font-family: 'Georgia', 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    display: block;
    margin: 30px auto;
    padding: 10px 20px;
    max-width: 700px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 1.5s ease, visibility 1.5s ease;
    pointer-events: none;
    box-sizing: border-box;
    overflow: hidden;
    line-height: 1.7;
  }
  
