/* ================================
   GALLERY.CSS - GRID & LAYOUT STYLES
   ================================ */

/* ================================
   HERO SECTION ENHANCEMENTS
   ================================ */

.galleries-hero .hero-gallery-bg {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    filter: blur(1px);
    opacity: 0.6;
}

.galleries-hero .hero-overlay {
    background: linear-gradient(
        135deg, 
        rgba(15, 15, 15, 0.8) 0%, 
        rgba(26, 26, 26, 0.6) 50%, 
        rgba(15, 15, 15, 0.8) 100%
    );
}

.hero-image-credit {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--secondary-gold);
    font-style: italic;
}

.credit-link {
    color: var(--primary-gold);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.credit-link:hover {
    border-bottom-color: var(--primary-gold);
    color: var(--accent-gold);
}

.gallery-stats-hero {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--secondary-gold);
    justify-content: center;
    flex-wrap: wrap;
}

.gallery-stats-hero span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(10px);
}

/* ================================
   VIEW CONTROLS
   ================================ */

.gallery-view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: var(--gradient-dark);
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(20px);
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: transparent;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s var(--ease-elegant);
    font-size: 1.1rem;
}

.view-toggle.active,
.view-toggle:hover {
    background: var(--gradient-primary);
    color: var(--warm-black);
    border-color: var(--primary-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-select {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    min-width: 150px;
    transition: all 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-gold);
    background: rgba(255, 255, 255, 0.08);
}

/* ================================
   MASONRY GRID VIEW
   ================================ */

.galleries-grid-masonry {
    display: none;
    columns: 3;
    column-gap: 2rem;
    margin-bottom: 4rem;
}

.galleries-grid-masonry.active {
    display: block;
}

.gallery-item-masonry {
    display: inline-block;
    width: 100%;
    margin-bottom: 2rem;
    break-inside: avoid;
    page-break-inside: avoid;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s var(--ease-elegant) forwards;
}

.gallery-item-masonry .gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    transition: all 0.6s var(--ease-elegant);
    background: var(--gradient-dark);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.gallery-item-masonry .gallery-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(212, 175, 55, 0.3);
    border-color: var(--primary-gold);
}

/* ================================
   STANDARD GRID VIEW
   ================================ */

.galleries-grid-standard {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.galleries-grid-standard.active {
    display: grid;
}

.gallery-item-grid {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s var(--ease-elegant) forwards;
}

.gallery-item-grid .gallery-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.6s var(--ease-elegant);
    border-radius: 20px;
    overflow: hidden;
    background: var(--gradient-dark);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.gallery-item-grid .gallery-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.3);
    border-color: var(--primary-gold);
}

.gallery-card-link {
    text-decoration: none;
    color: inherit;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gallery-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gallery-item-grid .gallery-title {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.gallery-card-link:hover .gallery-title {
    color: var(--primary-gold);
}

.gallery-item-grid .gallery-description {
    flex-grow: 1;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ================================
   LIST VIEW
   ================================ */

.galleries-list {
    display: none;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 4rem;
}

.galleries-list.active {
    display: flex;
}

.gallery-item-list {
    display: flex;
    gap: 2rem;
    align-items: stretch;
    padding: 2rem;
    opacity: 0;
    transform: translateX(-30px);
    animation: slideInLeft 0.8s var(--ease-elegant) forwards;
    min-height: 200px;
}

.gallery-list-image {
    flex-shrink: 0;
    width: 300px;
    height: 200px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.gallery-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-elegant);
}

.gallery-item-list:hover .gallery-list-image img {
    transform: scale(1.1);
}

.gallery-list-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gallery-list-header {
    margin-bottom: 1rem;
}

.gallery-list-header .gallery-title {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.gallery-list-header .gallery-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.gallery-list-header .gallery-title a:hover {
    color: var(--primary-gold);
}

.gallery-list-content .gallery-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 1rem 0;
    flex-grow: 1;
}

.gallery-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

/* ================================
   SHARED GALLERY COMPONENTS
   ================================ */

.gallery-image-container {
    position: relative;
    height: 250px;
    overflow: hidden;
    border-radius: 15px;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s var(--ease-elegant);
}

.gallery-image-link:hover .gallery-image {
    transform: scale(1.1);
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary-gold);
    font-size: 2rem;
    border: 2px dashed rgba(212, 175, 55, 0.3);
    border-radius: 10px;
}

.gallery-placeholder span {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

.image-count-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: var(--primary-gold);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    z-index: 3;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(15, 15, 15, 0.9) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transition: all 0.6s var(--ease-elegant);
    z-index: 2;
    padding: 2rem;
    border-radius: 15px;
}

.gallery-item-masonry:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-content {
    color: white;
    transform: translateY(20px);
    transition: transform 0.6s var(--ease-elegant);
}

.gallery-item-masonry:hover .gallery-overlay-content {
    transform: translateY(0);
}

.gallery-overlay-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--primary-gold);
    margin-bottom: 1rem;
}

.gallery-overlay-description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    opacity: 0.9;
}

.gallery-overlay-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.gallery-overlay-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.gallery-overlay-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.gallery-info {
    padding: 1.5rem;
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gallery-category,
.gallery-date,
.gallery-views {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--primary-gold);
    font-weight: 500;
}

.gallery-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.gallery-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.gallery-title a:hover {
    color: var(--primary-gold);
}

.gallery-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.gallery-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-top: 1rem;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ================================
   FILTER ENHANCEMENTS
   ================================ */

.filter-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: transparent;
    border: 2px solid var(--primary-gold);
    color: var(--primary-gold);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s var(--ease-elegant);
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--gradient-primary);
    color: var(--warm-black);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
}

.filter-btn i {
    font-size: 1rem;
}

/* ================================
   BUTTON ENHANCEMENTS
   ================================ */

.btn-small {
    padding: 0.8rem 1.5rem;
    font-size: 0.85rem;
    min-height: 40px;
}

.btn-luxury i {
    margin-right: 0.5rem;
}

/* ================================
   PAGINATION ENHANCEMENTS
   ================================ */

.pagination-ellipsis {
    color: var(--text-secondary);
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
}

.pagination-prev,
.pagination-next {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.5rem;
    border-radius: 25px;
    white-space: nowrap;
    min-width: auto;
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 1200px) {
    .galleries-grid-masonry {
        columns: 2;
    }
    
    .galleries-grid-standard {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 968px) {
    .gallery-view-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .view-options {
        justify-content: center;
    }
    
    .sort-options {
        justify-content: center;
    }
    
    .gallery-item-list {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .gallery-list-image {
        width: 100%;
        height: 250px;
    }
    
    .gallery-list-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .gallery-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 200px;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .galleries-grid-masonry {
        columns: 1;
        column-gap: 0;
    }
    
    .galleries-grid-standard {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .gallery-view-controls {
        padding: 1rem;
        margin-bottom: 2rem;
    }
    
    .view-toggle {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .gallery-image-container {
        height: 200px;
    }
    
    .gallery-overlay {
        padding: 1rem;
    }
    
    .gallery-overlay-title {
        font-size: 1.2rem;
    }
    
    .gallery-overlay-description {
        font-size: 0.9rem;
    }
    
    .gallery-info {
        padding: 1rem;
    }
    
    .gallery-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .gallery-stats-hero {
        gap: 1rem;
        flex-direction: column;
        align-items: center;
    }
    
    .pagination-prev,
    .pagination-next {
        padding: 0 1rem;
        font-size: 0.8rem;
    }
    
    .pagination-numbers {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .gallery-item-masonry {
        margin-bottom: 1.5rem;
    }
    
    .gallery-view-controls {
        padding: 0.8rem;
    }
    
    .view-toggle {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .sort-select {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
        min-width: 130px;
    }
    
    .gallery-overlay {
        padding: 0.8rem;
    }
    
    .gallery-overlay-title {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .gallery-overlay-link {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .gallery-info {
        padding: 0.8rem;
    }
    
    .gallery-title {
        font-size: 1.1rem;
    }
    
    .gallery-description {
        font-size: 0.9rem;
    }
    
    .gallery-meta {
        font-size: 0.75rem;
    }
    
    .gallery-category,
    .gallery-date,
    .gallery-views {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .filter-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.8rem;
        width: 180px;
    }
    
    .btn-small {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .image-count-badge {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .hero-image-credit {
        font-size: 0.8rem;
        text-align: center;
    }
    
    .gallery-stats-hero span {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* ================================
   ACCESSIBILITY ENHANCEMENTS
   ================================ */

@media (prefers-reduced-motion: reduce) {
    .gallery-item-masonry,
    .gallery-item-grid,
    .gallery-item-list {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .gallery-image,
    .gallery-overlay,
    .gallery-overlay-content {
        transition: none !important;
    }
    
    .view-toggle,
    .filter-btn,
    .gallery-card {
        transition: none !important;
    }
    
    .gallery-card:hover {
        transform: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gallery-card {
        border: 2px solid var(--primary-gold);
    }
    
    .gallery-placeholder {
        border: 3px solid var(--primary-gold);
    }
    
    .view-toggle,
    .filter-btn {
        border-width: 3px;
    }
    
    .image-count-badge {
        border: 2px solid var(--primary-gold);
        background: var(--warm-black);
    }
}

/* Focus styles for keyboard navigation */
.gallery-image-link:focus,
.gallery-card-link:focus,
.gallery-title a:focus,
.view-toggle:focus,
.filter-btn:focus {
    outline: 3px solid var(--primary-gold);
    outline-offset: 2px;
    border-radius: 5px;
}

/* Print styles */
@media print {
    .gallery-view-controls,
    .filter-section,
    .pagination,
    .gallery-overlay,
    .floating-elements {
        display: none !important;
    }
    
    .galleries-grid-masonry,
    .galleries-grid-standard,
    .galleries-list {
        display: block !important;
        columns: 2;
        column-gap: 1rem;
        page-break-inside: avoid;
    }
    
    .gallery-item-masonry,
    .gallery-item-grid,
    .gallery-item-list {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 1rem;
        opacity: 1 !important;
        transform: none !important;
    }
}