/* Explain: Styles for the news photo gallery and full-screen viewer. */
/* ------------------------------------------------------------------
   News photo album (ألبوم صور الخبر) and the full-screen photo viewer
   it opens on click.
   ------------------------------------------------------------------ */

.news-album {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.news-album-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.news-album-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.5;
    color: var(--primary-color);
}

.news-album-count {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.news-album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.news-album-item {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    overflow: hidden;
    background: var(--surface-strong);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: zoom-in;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.news-album-item:hover,
.news-album-item:focus-visible {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-soft);
}

.news-album-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-album-item:hover img {
    transform: scale(1.06);
}

.news-album-zoom {
    position: absolute;
    inset-inline-end: 0.45rem;
    bottom: 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    background: rgba(var(--scrim-rgb), 0.72);
    color: var(--on-dark);
    font-size: 0.72rem;
}

.news-album-hint {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---- Full-screen photo viewer ---- */
.news-viewer {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(var(--scrim-rgb), 0.93);
}

.news-viewer.is-open {
    display: flex;
}

.news-viewer-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(62rem, 96vw);
    max-height: 92vh;
}

.news-viewer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.news-viewer-caption {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--on-dark);
}

.news-viewer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    flex: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: var(--on-dark);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.news-viewer-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.news-viewer-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    max-height: 78vh;
    overflow: hidden;
    background: #000000;
    border-radius: var(--radius-lg);
}

.news-viewer-media img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    cursor: pointer;
}

.news-viewer-media img.is-loading {
    opacity: 0;
}

.news-viewer-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--on-dark);
    font-size: 1.6rem;
}

.news-viewer-loader.is-hidden {
    display: none;
}

.news-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--on-dark-soft);
    border-radius: 999px;
    background: rgba(var(--scrim-rgb), 0.62);
    color: var(--on-dark);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.news-viewer-nav:hover {
    background: rgba(var(--scrim-rgb), 0.92);
}

.news-viewer-nav.is-hidden {
    display: none;
}

.news-viewer-nav--prev {
    inset-inline-start: 0.75rem;
}

.news-viewer-nav--next {
    inset-inline-end: 0.75rem;
}

@media (max-width: 480px) {
    .news-album-grid {
        grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
        gap: 0.5rem;
    }

    .news-viewer {
        padding: 0.5rem;
    }
}