.portal-galleries-page {
    background: #f8fafc;
    color: #111827;
    padding: 2rem 0 4rem;
}

.portal-galleries-container {
    margin: 0 auto;
    max-width: 1120px;
    padding: 0 1rem;
}

.portal-galleries-breadcrumb {
    align-items: center;
    color: #9ca3af;
    display: flex;
    font-size: .85rem;
    font-weight: 700;
    gap: .35rem;
}

.portal-galleries-breadcrumb a {
    color: #9ca3af;
    text-decoration: none;
}

.portal-galleries-breadcrumb span {
    color: #64748b;
}

.portal-galleries-title {
    color: #111827;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.05;
}

.portal-galleries-subtitle {
    color: #64748b;
    font-size: 1.05rem;
    font-weight: 500;
    max-width: 680px;
}

.portal-galleries-action {
    align-items: center;
    border-radius: 12px;
    display: inline-flex;
    font-weight: 800;
    min-height: 44px;
    padding-left: 1.15rem;
    padding-right: 1.15rem;
}

.portal-galleries-top-search {
    min-width: min(280px, 100%);
    width: 280px;
}

.portal-galleries-top-search .input-group-text,
.portal-galleries-top-search .form-control {
    min-height: 44px;
}

.portal-galleries-filters {
    border-radius: 16px;
}

.portal-galleries-search .input-group-text,
.portal-galleries-search .form-control,
.portal-galleries-filters .form-select,
.portal-galleries-filters .btn {
    min-height: 52px;
}

.portal-gallery-stat {
    border-radius: 16px;
}

.portal-gallery-stat-icon {
    align-items: center;
    border-radius: 12px;
    display: inline-flex;
    font-size: 1.25rem;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.portal-gallery-stat strong {
    color: #111827;
    display: block;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.portal-gallery-stat span:last-child {
    color: #64748b;
    display: block;
    font-weight: 700;
    margin-top: .35rem;
}

.portal-galleries-section-title {
    color: #111827;
    font-size: 1.35rem;
    font-weight: 900;
}

.portal-galleries-featured-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-gallery-featured,
.portal-gallery-archive-card {
    border-radius: 16px;
}

.portal-gallery-featured-cover,
.portal-gallery-archive-cover {
    background: #e5e7eb;
    overflow: hidden;
    position: relative;
}

.portal-gallery-featured-cover {
    height: 210px;
}

.portal-gallery-archive-cover {
    height: 155px;
}

.portal-gallery-featured-cover img,
.portal-gallery-archive-cover img,
.portal-gallery-photo-card img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.portal-gallery-tag {
    border-radius: 10px;
    font-size: .72rem;
    font-weight: 900;
    left: 1rem;
    letter-spacing: .04em;
    padding: .5rem .65rem;
    position: absolute;
    text-transform: uppercase;
    top: 1rem;
}

.portal-gallery-photo-count {
    align-items: center;
    background: rgba(0, 0, 0, .72);
    border-radius: 8px;
    bottom: 1rem;
    color: #fff;
    display: inline-flex;
    font-size: .75rem;
    font-weight: 800;
    gap: .25rem;
    padding: .35rem .55rem;
    position: absolute;
    right: 1rem;
}

.portal-gallery-date {
    color: #94a3b8;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.portal-gallery-link {
    align-items: center;
    color: var(--portal-primary, #10b981);
    display: inline-flex;
    font-weight: 900;
    gap: .25rem;
    text-decoration: none;
}

.portal-gallery-avatar {
    border: 2px solid #fff;
    border-radius: 999px;
    display: inline-flex;
    margin-right: -8px;
    overflow: hidden;
}

.portal-gallery-project-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-gallery-project-card {
    background-color: #111827;
    background-position: center;
    background-size: cover;
    border-radius: 16px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: end;
    min-height: 145px;
    overflow: hidden;
    padding: 1.25rem;
    position: relative;
}

.portal-gallery-project-card::before {
    background: linear-gradient(180deg, rgba(15, 23, 42, .16), rgba(15, 23, 42, .82));
    content: "";
    inset: 0;
    position: absolute;
}

.portal-gallery-project-card span,
.portal-gallery-project-card small {
    position: relative;
    z-index: 1;
}

.portal-gallery-project-card span {
    font-size: 1rem;
    font-weight: 900;
}

.portal-gallery-project-card small {
    color: rgba(255, 255, 255, .78);
    font-weight: 700;
}

.portal-gallery-archive-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-gallery-archive-grid.is-list {
    grid-template-columns: 1fr;
}

.portal-gallery-archive-grid.is-list .portal-gallery-archive-card {
    display: grid;
    grid-template-columns: 220px 1fr;
}

.portal-gallery-archive-grid.is-list .portal-gallery-archive-cover {
    height: 100%;
    min-height: 150px;
}

.portal-gallery-view-toggle .btn {
    font-weight: 800;
}

.portal-gallery-view-toggle .btn.active,
.portal-gallery-page-button.active {
    background: var(--portal-primary, #10b981);
    border-color: var(--portal-primary, #10b981) !important;
    color: #fff;
}

.portal-gallery-page-button {
    border-radius: 12px;
    font-weight: 800;
    min-width: 40px;
}

.portal-gallery-show-hero {
    background-position: center;
    background-size: cover;
    color: #fff;
    min-height: 360px;
    overflow: hidden;
    padding: 5rem 0 4rem;
    position: relative;
}

.portal-gallery-show-hero::before {
    background: linear-gradient(90deg, rgba(15, 23, 42, .9), rgba(15, 23, 42, .55));
    content: "";
    inset: 0;
    position: absolute;
}

.portal-gallery-show-hero .portal-galleries-container {
    position: relative;
    z-index: 1;
}

.portal-gallery-show-copy {
    max-width: 760px;
}

.portal-gallery-show-copy h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.02;
}

.portal-gallery-description {
    border-radius: 16px;
}

.portal-gallery-photo-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-gallery-photo-card {
    aspect-ratio: 1 / .72;
    background: #e5e7eb;
    border-radius: 16px;
    display: block;
    overflow: hidden;
}

.portal-gallery-lightbox {
    cursor: zoom-in;
}

.portal-gallery-popup .mfp-img {
    border-radius: 12px;
}

.mfp-fade.mfp-bg {
    opacity: 0;
    transition: opacity .16s ease-out;
}

.mfp-fade.mfp-bg.mfp-ready {
    opacity: .86;
}

.mfp-fade.mfp-bg.mfp-removing {
    opacity: 0;
}

.mfp-fade.mfp-wrap .mfp-content {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .16s ease-out, transform .16s ease-out;
}

.mfp-fade.mfp-wrap.mfp-ready .mfp-content {
    opacity: 1;
    transform: translateY(0);
}

.mfp-fade.mfp-wrap.mfp-removing .mfp-content {
    opacity: 0;
    transform: translateY(8px);
}

.portal-gallery-empty {
    border-radius: 16px;
    color: #64748b;
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .portal-galleries-featured-grid,
    .portal-gallery-project-grid,
    .portal-gallery-archive-grid,
    .portal-gallery-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .portal-galleries-page {
        padding-top: 1rem;
    }

    .portal-galleries-featured-grid,
    .portal-gallery-project-grid,
    .portal-gallery-archive-grid,
    .portal-gallery-photo-grid,
    .portal-gallery-archive-grid.is-list .portal-gallery-archive-card {
        grid-template-columns: 1fr;
    }

    .portal-gallery-featured-cover {
        height: 190px;
    }

    .portal-gallery-archive-grid.is-list .portal-gallery-archive-cover {
        height: 155px;
    }
}
