/* Gallery Feed Styles - Version 2.0.4 */
/* Font: Roboto, Border Radius: 8px - Al Sermeno Photography Brand */

:root {
    --gf-primary: #0d3b66;
    --gf-primary-dark: #0a4269;
    --gf-secondary: #4ecdc4;
    --gf-accent: #1976d2;
    --gf-teal: #00a878;
    --gf-bg-main: #f5f5f5;
    --gf-bg-card: #ffffff;
    --gf-text-primary: #333333;
    --gf-text-secondary: #646970;
    --gf-border: #dddddd;
    --gf-medium-gray: #e9ecef;
    --gf-radius: 8px;
    --gf-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --gf-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --gf-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --gf-transition: 0.2s ease;
}

.gallery-feed-container {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1200px;   /* Constrain to 1200px */
    width: 90%;          /* Or 90% on smaller screens */
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.gallery-feed-container * {
    box-sizing: border-box;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* HEADER */
.gallery-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563a8 100%);
    color: white;
    padding: 40px 30px 80px 30px;
    border-radius: var(--gf-radius);
    margin-bottom: 0;
    box-shadow: var(--gf-shadow-md);
    position: relative;
    z-index: 1;
}

.gallery-title {
    font-size: 36px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: white;
    text-align: center;
}

.gallery-subtitle {
    font-size: 14px;
    opacity: 0.9;
    color: white;
    margin: 0 0 30px 0;
    text-align: center;
}

.gallery-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.stat-card {
    text-align: center;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--gf-radius);
    min-width: 120px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    color: #40e0d0;
}

.stat-label {
    font-size: 11px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
}

/* CONTROLS BAR */
.gallery-controls {
    background: white;
    padding: 10px;
    border-radius: var(--gf-radius);
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    margin: -35px 20px 30px 20px;
    position: relative;
    z-index: 90;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Search Wrapper */
.search-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 14px;
    color: #9ca3af;
    font-size: 18px;
    pointer-events: none;
    z-index: 10;
}

.search-wrapper .search-input {
    width: 100%;
    padding: 12px 12px 12px 45px;
    border: 1px solid #e5e7eb;
    border-radius: var(--gf-radius);
    font-size: 15px;
    outline: none;
    transition: var(--gf-transition);
    background: white;
    height: 46px;
    color: var(--gf-text-primary);
}

.search-wrapper .search-input::placeholder {
    color: #9ca3af;
}

.search-wrapper .search-input:focus {
    border-color: var(--gf-primary);
    box-shadow: 0 0 0 3px rgba(13, 59, 102, 0.1);
}

.search-wrapper .search-clear {
    position: absolute;
    right: 10px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
}

/* Right Controls */
.controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-dropdown {
    padding: 0 16px;
    border: 1px solid #e5e7eb;
    border-radius: var(--gf-radius);
    font-size: 14px;
    cursor: pointer;
    background: white;
    color: var(--gf-text-secondary);
    height: 46px;
}

.view-toggle {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: var(--gf-radius);
    overflow: hidden;
    height: 46px;
}

.view-toggle .view-btn {
    background: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 1px solid #e5e7eb;
    letter-spacing: 0.5px;
}

.view-toggle .view-btn:last-child {
    border-right: none;
}

.view-toggle .view-btn.active {
    background: var(--gf-primary);
    color: white;
}

/* FILTERS */
.gallery-filters {
    background: var(--gf-bg-card);
    padding: 20px 30px;
    border-radius: var(--gf-radius);
    margin-bottom: 25px;
    box-shadow: var(--gf-shadow-sm);
    border: 1px solid var(--gf-border);
}
.filters-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; }
.filters-title { font-size: 15px; font-weight: 600; color: var(--gf-text-primary); display: flex; align-items: center; gap: 10px; }
.filter-toggle-icon { font-size: 12px; transition: transform 0.3s ease; color: var(--gf-text-secondary); }
.filter-toggle-icon.collapsed { transform: rotate(-90deg); }
.filter-content { max-height: 800px; overflow: hidden; transition: max-height 0.3s ease, opacity 0.3s ease; opacity: 1; padding-top: 20px; border-top: 1px solid var(--gf-medium-gray); margin-top: 15px; }
.filter-content.collapsed { max-height: 0; opacity: 0; padding-top: 0; margin-top: 0; border-top: none; }
.clear-all-filters { font-size: 11px; color: #ef4444; background: transparent; border: none; cursor: pointer; font-weight: 600; padding: 6px 12px; text-transform: uppercase; letter-spacing: 0.5px; transition: all 0.2s ease; }
.clear-all-filters:hover { color: #dc2626; text-decoration: underline; }
.filter-row { display: grid; grid-template-columns: 100px 1fr; gap: 15px; align-items: start; margin-bottom: 16px; }
.filter-label { font-size: 13px; font-weight: 600; color: var(--gf-text-secondary); padding-top: 8px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--gf-border); background: #f9fafb; font-size: 13px; color: var(--gf-text-secondary); cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; gap: 4px; }
.chip:hover { border-color: var(--gf-primary); background: white; color: var(--gf-primary); }
.chip.active { background: var(--gf-primary); border-color: var(--gf-primary); color: white; }
.chip .count { font-size: 11px; opacity: 0.7; background: rgba(0,0,0,0.05); padding: 1px 5px; border-radius: 10px; }
.chip.active .count { background: rgba(255,255,255,0.2); color: white; }

/* CARDS */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 40px; }
.gallery-grid.columns-1 { grid-template-columns: repeat(1, 1fr); }
.gallery-grid.columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }

.gallery-card {
    background: var(--gf-bg-card);
    border-radius: var(--gf-radius);
    overflow: hidden;
    box-shadow: var(--gf-shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid var(--gf-border);
    display: flex;
    flex-direction: column;
}
.gallery-card:hover { transform: translateY(-4px); box-shadow: var(--gf-shadow-lg); border-color: var(--gf-primary); }

/* FIX: Updated to match mockup grid-card-single.html */
.card-header {
    background: #2563a8; /* Specific Blue from Mockup */
    padding: 10px 16px;  /* Matching mockup padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* FIX: Updated font size to match mockup */
.sport-label { 
    font-size: 13px; 
    font-weight: 700; 
    color: white; 
    letter-spacing: 0.5px; 
    text-transform: uppercase; 
}

.card-image-wrapper { position: relative; width: 100%; background: #f0f0f0; overflow: hidden; }
.card-image-wrapper.ratio-2-3 { padding-bottom: 66.67%; }
.card-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-card:hover .card-image { transform: scale(1.05); }

.date-label {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #00a878;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 15px; font-weight: 600; color: var(--gf-text-primary); margin: 0 0 12px 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.card-meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: auto; }
.meta-badge { padding: 4px 10px; background: #f3f4f6; color: #4b5563; border-radius: 15px; font-size: 11px; font-weight: 500; }

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid var(--gf-medium-gray);
}
.photographer { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--gf-text-secondary); }
.photographer-avatar { display: none; }
.photographer::before { content:''; width: 6px; height: 6px; background: #10b981; border-radius: 50%; margin-right: 2px; }

.click-hint { display: flex; align-items: center; gap: 4px; color: #4ecdc4; font-size: 11px; font-weight: 600; text-transform: uppercase; }

/* List View - Header bar on top, then horizontal: image left + content right */
.gallery-grid.list-view { grid-template-columns: 1fr !important; }

.gallery-card.list-layout { 
    flex-direction: column;
    height: auto;
    max-width: 100%;
}

.gallery-card.list-layout .card-header { 
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2563a8;
    padding: 12px 20px;
    border-radius: var(--gf-radius) var(--gf-radius) 0 0;
}

.gallery-card.list-layout .list-content-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    background: white;
    border-radius: 0 0 var(--gf-radius) var(--gf-radius);
    padding: 20px;
    gap: 24px;
}

.gallery-card.list-layout .card-image-wrapper { 
    width: 180px;
    height: 120px;
    padding-bottom: 0;
    flex-shrink: 0;
    position: relative;
    border-radius: var(--gf-radius);
    overflow: hidden;
}

.gallery-card.list-layout .card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-card.list-layout .date-label-header {
    background: #00a878;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.gallery-card.list-layout .card-body { 
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.gallery-card.list-layout .card-title {
    font-size: 18px;
    margin-bottom: 14px;
    text-align: left;
}

.gallery-card.list-layout .meta-badge {
    font-size: 13px;
    padding: 6px 12px;
}

.gallery-card.list-layout .card-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-card.list-layout .photographer {
    font-size: 14px;
}

.gallery-card.list-layout .click-hint {
    font-size: 13px;
    display: flex;
    align-items: center;
}

/* RESULTS INFO */
.results-info {
    padding: 15px 0;
    margin-bottom: 25px;
    font-size: 14px;
    color: var(--gf-text-secondary);
}

.results-count {
    font-weight: 500;
}

/* STATES */
.gallery-loading, .no-results { grid-column: 1 / -1; text-align: center; padding: 60px; color: var(--gf-text-secondary); background: white; border-radius: var(--gf-radius); box-shadow: var(--gf-shadow-sm); }
.load-more-section { text-align: center; padding: 30px; }
.load-more-btn, .load-all-btn { padding: 12px 24px; margin: 0 8px; border-radius: var(--gf-radius); font-weight: 600; cursor: pointer; border: 2px solid var(--gf-primary); background: white; color: var(--gf-primary); transition: all 0.2s ease; }
.load-more-btn:hover, .load-all-btn:hover { background: var(--gf-primary); color: white; }

@media (max-width: 768px) {
    .gallery-header { padding: 25px 20px 70px 20px; }
    .gallery-stats { 
        display: grid; 
        grid-template-columns: repeat(2, 1fr); 
        gap: 15px; 
        max-width: 400px;
        margin: 0 auto;
    }
    .stat-card { min-width: auto; }
    .gallery-controls { flex-direction: column; align-items: stretch; padding: 15px; margin: -50px 15px 20px 15px; gap: 10px; }
    .controls-right { display: grid; grid-template-columns: 1fr 1fr; }
    .sort-dropdown { width: 100%; }
    .gallery-grid.columns-3, .gallery-grid.columns-2 { grid-template-columns: 1fr !important; }
    .gallery-card.list-layout .list-content-wrapper { flex-direction: column; }
    .gallery-card.list-layout .card-image-wrapper { width: 100%; height: 200px; }
}

/* PHOTO STATS COMPONENT */
.photo-stats-container {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 80px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563a8 100%);
    margin: 0;
    position: relative;
}

.photo-stats-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 168, 120, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(78, 205, 196, 0.15) 0%, transparent 50%);
}

.photo-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.photo-stat-card {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--gf-radius);
    transition: all 0.3s ease;
}

.photo-stat-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.photo-stat-number {
    font-size: 42px;
    font-weight: 700;
    color: #4ecdc4;
    line-height: 1;
    margin-bottom: 8px;
}

.photo-stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Image Count Badge Styling */
.meta-badge.image-count-badge {
    background: #10b981;
    color: white;
    font-weight: 600;
}

@media (max-width: 768px) {
    .photo-stats-container {
        padding: 60px 20px;
    }
    
    .photo-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .photo-stat-number {
        font-size: 32px;
    }
    
    .photo-stat-label {
        font-size: 11px;
    }
}

/* EMBED MODE OVERRIDES */
.gallery-feed-container.embed-mode .gallery-controls {
    margin: -35px 20px 30px 20px !important;
    position: relative !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    background: white !important;
    z-index: 90 !important;
    display: flex !important;
    border-top: none !important;
}

.gallery-feed-container.embed-mode .view-btn {
    background-color: white !important;
    color: #6b7280 !important;
    border: none !important;
    border-right: 1px solid #e5e7eb !important;
    opacity: 1 !important;
}

.gallery-feed-container.embed-mode .view-btn:last-child {
    border-right: none !important;
}

.gallery-feed-container.embed-mode .view-btn.active {
    background-color: var(--gf-primary) !important;
    color: white !important;
    opacity: 1 !important;
}

.gallery-feed-container.embed-mode .search-input,
.gallery-feed-container.embed-mode .sort-dropdown {
    background-color: white !important;
    color: #333 !important;
    border: 1px solid #e5e7eb !important;
    opacity: 1 !important;
    height: 46px !important;
}

.gallery-feed-container.embed-mode .gallery-card {
    background: white !important;
    display: flex !important;
    flex-direction: column !important;
}