/* --- SOFT GALLERY DESIGN SYSTEM (Variables) --- */

:root {
    /* Define Colors if not already defined in style.css */
    --mha-primary: #59716c;       /* Main Action Color */
    --mha-dark: #212529;          /* Text/Active Color */
    --mha-light: #f8f9fa;         /* Backgrounds */
    --mha-border: #dee2e6;        /* Borders */
    --mha-text-muted: #6c757d;    /* Subtitles */
    --mha-white: #ffffff;
    --mha-shadow-soft: 0 10px 25px rgba(0,0,0,0.05);
    --mha-shadow-hover: 0 15px 35px rgba(0,0,0,0.1);
}

/* 1. Wrapper & Spacing */
.mha-gallery-wrapper {
    padding: 30px 0;
    font-family: 'Tajawal', sans-serif;
}

/* --- 2. SOFT DECADE FILTER (The Scroller) --- */
.mha-decade-scroller {
    overflow-x: auto;
    padding: 5px 5px 15px 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.mha-decade-scroller::-webkit-scrollbar {
    display: none;
}

.mha-decade-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--mha-light);
    color: var(--mha-text-muted);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    border: 1px solid transparent;
}

.mha-decade-card:hover {
    background: #e9ecef;
    color: var(--mha-dark);
    transform: translateY(-2px);
}

.mha-decade-card.active {
    color: white !important;
    background: var(--mha-dark);
    color: var(--mha-white);
    box-shadow: 0 4px 12px rgba(33, 37, 41, 0.3);
}

/* --- 3. SOFT PHOTO CARD --- */
.mha-photo-card {
    background: var(--mha-white);
    border: none;
    border-radius: 20px;
    box-shadow: var(--mha-shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.mha-photo-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--mha-shadow-hover);
}

/* Links inside card */
.mha-photo-card a.mha-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Image Area */
.mha-card-img-wrap {
    position: relative;
    padding-top: 70%;
    background: #f0f2f5;
    overflow: hidden;
}

.mha-card-img-wrap img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mha-photo-card:hover .mha-card-img-wrap img {
    transform: scale(1.08);
}

/* Card Body */
.mha-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: right;
}

.mha-card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--mha-dark);
    margin-bottom: 12px;
    line-height: 1.4;
    transition: color 0.2s;
}

.mha-photo-card:hover .mha-card-title {
    color: var(--mha-primary); /* Highlights title on hover */
}

/* --- 4. CLICKABLE META PILLS --- */
.mha-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.mha-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none; /* Remove underline */
    transition: background 0.2s, color 0.2s;
}

/* Decade Pill */
.mha-pill.decade {
    background: var(--mha-white);
    border: 1px solid var(--mha-border);
    color: var(--mha-text-muted);
}
.mha-pill.decade:hover {
    background: var(--mha-light);
    color: var(--mha-dark);
    border-color: #adb5bd;
}

/* Topic Pill */
.mha-pill.topic {
    background: var(--mha-light);
    color: var(--mha-text-muted);
}
.mha-pill.topic:hover {
    background: #e9ecef;
    color: var(--mha-primary);
}

.mha-pill.more {
    background: #e9ecef;
    color: var(--mha-text-muted);
    padding: 6px 10px;
    pointer-events: none; /* Just a counter, not clickable */
}

.mha-pill i {
    font-size: 1rem;
    color: #adb5bd;
}

/* Pagination */
.mha-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    margin: 0 4px;
    border-radius: 50%;
    background: var(--mha-white);
    color: var(--mha-dark);
    border: 1px solid var(--mha-border);
    text-decoration: none;
    transition: all 0.2s;
}

.mha-pagination .current,
.mha-pagination .page-numbers:hover {
    background: var(--mha-dark);
    border-color: var(--mha-dark);
    color: var(--mha-white);
}



/* --- Fix Mobile Edge-to-Edge Issue --- */
@media (max-width: 768px) {
    /* Add padding to the main container on mobile */
    .mha-gallery-wrapper.container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Ensure the grid columns also respect this */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .col-12, .col-md-6 {
        padding-left: 10px;
        padding-right: 10px;
    }
}