/* ==========================================================================
   NGO Gallery Module — Final Unified Cross-Browser Stylesheet
   ========================================================================== */

/* 1. GLOBAL FRAMEWORK & TYPOGRAPHY SETTINGS */
.ngo-gallery-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ngo-gallery-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1a202c;
    text-align: center;
    margin-bottom: 8px;
}

.ngo-gallery-subtitle {
    font-size: 1rem;
    color: #4a5568;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 400;
}

/* Empty Gallery State Visual Placeholder */
.ngo-gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    color: #64748b;
    font-size: 1.1rem;
}

/* 2. RESPONSIVE GRID & CARD MECHANICS */
.ngo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.ngo-gallery-card {
    position: relative;
    display: block; /* CRITICAL FOR CHROME: Gives absolute elements a reliable positioning anchor */
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ngo-gallery-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    transition: filter 0.25s ease;
}

/* Card Hover States */
.ngo-gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.ngo-gallery-card:hover img {
    filter: brightness(0.95);
}

/* --------------------------------------------------------------------------
   3. UNIVERSAL PURE CSS TOOLTIP ENGINE (NO JAVASCRIPT REQUIRED)
   -------------------------------------------------------------------------- */

/* The Floating Text Popup Bubble */
.ngo-gallery-card::after {
    content: attr(data-tooltip); /* Pulls text straight from the data-tooltip attribute */
    position: absolute;
    bottom: 112%; /* Floats perfectly above the card image */
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    
    /* Presentation Aesthetics */
    background-color: #1e293b;
    color: #ffffff;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    text-align: center;
    
    /* Layout & Auto-Wrapping Controls */
    white-space: normal;
    width: max-content;
    max-width: 240px;
    line-height: 1.4;
    
    /* Interactive Visibility Controls */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 99999;
}

/* Tiny Indicator Triangle Pointer Under the Bubble */
.ngo-gallery-card::before {
    content: "";
    position: absolute;
    bottom: 102%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    
    /* Border Triangle Logic */
    border-width: 6px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
    
    /* Interactive Visibility Controls */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 99999;
}

/* Trigger Visibility Smoothly on Hover Events */
.ngo-gallery-card:hover::after,
.ngo-gallery-card:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
