/* ─── Weekly Navbar Override ─────────────────────────────────────────── */

#navbar .nav-container {
    position: relative;
}

.weekly-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.weekly-logo a {
    pointer-events: auto;
    display: flex;
    align-items: center;
}

.weekly-logo img {
    height: 14px;
    width: auto;
    display: block;
}

/* ─── Issue Header ───────────────────────────────────────────────────── */
.issue-header {
    text-align: center;
    padding: 10rem 1.5rem 5rem;
    padding-top: calc(var(--nav-h) + 20dvh);
}

.issue-number {
    font-family: 'PPEditorialNew', serif;
    font-weight: 200;
    font-size: 2.5rem;
    color: #EFEAE8;
    margin: 0 0 0.5rem;
    line-height: 1;
}

.issue-tagline {
    font-family: 'PPTelegraf', sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(239, 234, 232, 0.5);
    margin: 0;
}

/* ─── Weekly Content ─────────────────────────────────────────────────── */
.weekly-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 3.5rem 10rem;
    display: flex;
    flex-direction: column;
    gap: 8rem;
}

.weekly-block {
    display: grid;
    align-items: center;
    gap: 5rem;
}

.weekly-block--img-left {
    grid-template-columns: 3fr 2fr;
}

.weekly-block--img-right {
    grid-template-columns: 2fr 3fr;
}

.weekly-block--img-right .weekly-block-img {
    order: 2;
}

.weekly-block--img-right .weekly-block-text {
    order: 1;
}

.weekly-block-img img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.weekly-block-text h2 {
    font-family: 'PPTelegraf', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: #EFEAE8;
    margin: 0 0 0.875rem;
}

.weekly-block-text p {
    font-family: 'PPTelegraf', sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(239, 234, 232, 0.55);
    margin: 0;
}

.weekly-block-text a {
    font-family: 'PPTelegraf', sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(239, 234, 232, 0.55);
    margin: 0;
}

/* ─── Photo Stack ───────────────────────────────────────────────────── */
.photo-stack {
    position: relative;
    width: 100%;
    cursor: pointer;
}

.photo-stack-item {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.075);
    will-change: transform, box-shadow;
    transform-origin: center center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.photo-stack-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

/* ── Stacked (collapsed) state ── */
.photo-stack:not(.is-expanded) .photo-stack-item:nth-child(1) {
    position: relative;
    z-index: 3;
    transform: rotate(0deg) scale(1);
}
.photo-stack:not(.is-expanded) .photo-stack-item:nth-child(2) {
    z-index: 2;
    transform: rotate(3deg) scale(0.96) translate(6px, 4px);
}
.photo-stack:not(.is-expanded) .photo-stack-item:nth-child(3) {
    z-index: 1;
    transform: rotate(-2.5deg) scale(0.92) translate(-4px, 8px);
}
.photo-stack:not(.is-expanded) .photo-stack-item:nth-child(4) {
    z-index: 0;
    transform: rotate(4.5deg) scale(0.88) translate(8px, 12px);
}

/* Badge showing image count */
.photo-stack:not(.is-expanded)::after {
    content: attr(data-count);
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-family: 'PPTelegraf', sans-serif;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* ── Expanded (fanned-out) state ── */
.photo-stack.is-expanded {
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    cursor: default;
}

.photo-stack.is-expanded .photo-stack-item {
    position: relative;
    inset: auto;
    transform: rotate(0deg) scale(1) translate(0, 0);
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.photo-stack.is-expanded .photo-stack-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transform: scale(1.02);
}

.photo-stack.is-expanded .photo-stack-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.photo-stack.is-expanded::after {
    display: none;
}

/* ── Fullscreen lightbox ── */
.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: background 0.4s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    cursor: zoom-out;
}

.photo-lightbox.is-open {
    background: rgba(0, 0, 0, 0.85);
    opacity: 1;
    pointer-events: auto;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.photo-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 10px;
    object-fit: contain;
    transform: scale(0.92);
    transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.photo-lightbox.is-open img {
    transform: scale(1);
}

/* ─── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .weekly-logo {
        display: none;
    }

    .issue-header {
        padding: 7rem 1.5rem 3rem;
    }

    .issue-number {
        font-size: 2.25rem;
    }

    .weekly-content {
        padding: 0 1.5rem 6rem;
        gap: 4rem;
    }

    .weekly-block--img-left,
    .weekly-block--img-right {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .weekly-block--img-right .weekly-block-img { order: 1; }
    .weekly-block--img-right .weekly-block-text { order: 2; }

    .photo-stack.is-expanded {
        grid-template-columns: 1fr;
    }
}
