/* Photo albums: homepage section, albums index, album page and lightbox */

/* ── Album card ───────────────────────────────────── */
.al-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    color: inherit;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
    transition: transform .35s ease, box-shadow .35s ease;
}

.al-card:hover {
    color: inherit;
    transform: translateY(-4px);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12);
}

.al-card__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--theme__color2);
}

.al-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.al-card:hover .al-card__media img { transform: scale(1.05); }

.al-card__count {
    position: absolute;
    bottom: 12px;
    inset-inline-start: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 20px;
    background: rgba(29, 44, 60, .82);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.al-card__count i { color: var(--theme__color1); }

.al-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px 20px;
}

.al-card__date {
    font-size: 13px;
    color: #8a9099;
}

.al-card__title {
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.6;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s;
}

.al-card:hover .al-card__title { color: var(--theme__color1); }

.al-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ── Homepage section ─────────────────────────────── */
.gl-section {
    padding: 72px 0 80px;
    background: #fff;
}

.gl-head { margin-bottom: 36px; }

.gl-feature {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
}

.gl-feature__cover {
    position: relative;
    display: block;
    min-height: 380px;
    overflow: hidden;
    background: var(--theme__color2);
}

.gl-feature__cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}

.gl-feature__cover:hover img { transform: scale(1.04); }

.gl-feature__badge {
    position: absolute;
    top: 16px;
    inset-inline-start: 16px;
    padding: 5px 14px;
    border-radius: 20px;
    background: var(--theme__color1);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

.gl-feature__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 30px 32px;
}

.gl-feature__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 13px;
    color: #8a9099;
}

.gl-feature__meta span,
.gl-feature__meta time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gl-feature__meta i { color: var(--theme__color1); }

.gl-feature__title {
    font-family: var(--elMessiri);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.5;
    margin: 10px 0 20px;
}

.gl-feature__title a { color: #111; transition: color .2s; }
.gl-feature__title a:hover { color: var(--theme__color1); }

.gl-feature__thumbs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.gl-feature__thumbs a {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: #eef0f3;
}

.gl-feature__thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease, opacity .2s;
}

.gl-feature__thumbs a:hover img { transform: scale(1.06); opacity: .9; }

.gl-feature__body .default-button {
    min-width: 0;
    margin-top: auto;
}

.gl-more { margin-top: 24px; }

.gl-section .news-bottom-row { margin-top: 36px; }

/* ── Album page ───────────────────────────────────── */
.al-page { padding: 56px 0 72px; background: #fff; }

.al-page__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 22px;
    margin: 0 0 30px;
    font-size: 14px;
    color: #6b737d;
}

.al-page__meta span,
.al-page__meta time {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.al-page__meta i { color: var(--theme__color1); }

.al-photos {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.al-photo {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: #eef0f3;
    cursor: zoom-in;
}

.al-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.al-photo::after {
    content: '\f00e';
    font-family: 'Font Awesome 5 Pro';
    font-weight: 300;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    background: rgba(29, 44, 60, .45);
    opacity: 0;
    transition: opacity .3s;
}

.al-photo:hover img,
.al-photo:focus-visible img { transform: scale(1.05); }

.al-photo:hover::after,
.al-photo:focus-visible::after { opacity: 1; }

.al-others {
    padding: 64px 0 80px;
    background: #F8F8FA;
}

.al-others__title {
    font-family: var(--elMessiri);
    font-size: 24px;
    font-weight: 700;
    color: var(--theme__color2);
    margin: 0 0 24px;
}

.al-index { padding: 56px 0 72px; background: #fff; }

.al-index .pagination-wrap,
.al-index nav[role="navigation"] { margin-top: 36px; }

/* ── Lightbox ─────────────────────────────────────── */
.al-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 32, .97);
    direction: ltr;
}

.al-lightbox[hidden] { display: none; }

.al-lightbox__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: calc(100vw - 160px);
    margin: 0;
}

.al-lightbox__img {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.al-lightbox__caption {
    margin-top: 14px;
    color: #fff;
    font-size: 15px;
    text-align: center;
}

.al-lightbox__counter {
    position: absolute;
    top: 22px;
    left: 24px;
    color: rgba(255, 255, 255, .75);
    font-size: 14px;
    font-weight: 600;
}

.al-lightbox__btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.al-lightbox__btn:hover,
.al-lightbox__btn:focus-visible {
    background: var(--theme__color1);
    border-color: var(--theme__color1);
}

.al-lightbox__close { top: 16px; right: 20px; }
.al-lightbox__prev { left: 24px; top: 50%; transform: translateY(-50%); }
.al-lightbox__next { right: 24px; top: 50%; transform: translateY(-50%); }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 991px) {
    .gl-feature { grid-template-columns: 1fr; }
    .gl-feature__cover { min-height: 0; aspect-ratio: 16 / 10; }
    .gl-feature__thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .al-grid { gap: 16px; }
    .al-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .al-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .al-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .al-lightbox__figure { max-width: calc(100vw - 24px); }
    .al-lightbox__prev,
    .al-lightbox__next { top: auto; bottom: 20px; transform: none; }
}

@media (max-width: 575px) {
    .gl-feature__body { padding: 22px 20px 24px; }
    .gl-feature__title { font-size: 20px; }
    .gl-feature__thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .al-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .al-card, .al-card__media img, .gl-feature__cover img, .gl-feature__thumbs img, .al-photo img { transition: none; }
}
