/* ============================================================
   Discography Grid
   ============================================================ */
.discography-section {
    padding: 5rem 0 6rem;
}

.discography-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Album Card */
.album-card {
    position: relative;
    cursor: pointer;
    border-radius: 3px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform var(--transition), box-shadow var(--transition);
}

.album-card:hover,
.album-card:focus-visible {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    outline: none;
}

.album-card:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 3px;
}

.album-card__cover {
    width: 100%;
    height: 100%;
}

.album-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity var(--transition);
}

.album-card__placeholder {
    width: 100%;
    height: 100%;
    background: var(--color-main);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
}

/* Hover overlay */
.album-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(26, 22, 20, 0.92) 0%,
        rgba(26, 22, 20, 0.5) 50%,
        rgba(26, 22, 20, 0) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

.album-card:hover .album-card__overlay,
.album-card:focus-visible .album-card__overlay {
    opacity: 1;
}

.album-card__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    line-height: 1.25;
    display: block;
    text-align: left;
}

.album-card__year {
    font-family: var(--font-sans);
    font-size: 0.62rem;
    letter-spacing: 0.15em;
    color: var(--color-gold-light);
    display: block;
    margin-top: 0.25rem;
    text-align: left;
}


/* ============================================================
   Album Modal
   ============================================================ */
.album-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 1.5rem var(--gutter);
    display: none;
}

.album-modal.is-open {
    display: flex;
}

.album-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 17, 15, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: albumFadeIn 0.25s ease both;
}

.album-modal__container {
    position: relative;
    z-index: 1;
    background: var(--color-paper);
    border-radius: 4px;
    width: 100%;
    max-width: 920px;
    max-height: calc(100vh - 3rem);
    overflow: hidden;
    overscroll-behavior: none;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    animation: albumSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
    display: flex;
    flex-direction: column;
}

@keyframes albumFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes albumSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}


.album-modal__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2;
    background: var(--color-main);
    border: none;
    color: rgba(255, 255, 255, 0.75);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}

.album-modal__close:hover {
    background: var(--color-gold);
    color: #fff;
}

.album-modal__close:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 3px;
}

.album-modal__body {
    padding: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Modal interior layout */
.album-modal__layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    flex: 1;
    min-height: 0;
}

/* Left: cover + order */
.album-modal__cover-col {
    background: var(--color-main);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow: hidden;
}

.album-modal__cover-col .info-card__row {
    margin-bottom: 0;
}

.album-modal__cover-col .info-card__divider {
    margin: 0 0;
}

.album-modal__cover-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.album-modal__cover-placeholder {
    aspect-ratio: 1 / 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.2);
}

.album-modal__order {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.album-modal__price {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.album-modal__order-btn {
    margin-top: 0;
}

/* Right: details */
.album-modal__details {
    padding: 3rem 2.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--color-main-muted) transparent;
}

.album-modal__title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 500;
    color: var(--color-main);
    line-height: 1.2;
    padding-right: 2.5rem; /* avoid overlap with close btn */
}


.album-modal__section {
    border-top: 1px solid var(--color-rule);
    padding-top: 1.5rem;
}

.album-modal__section-title {
    font-family: var(--font-sans);
    font-size: 0.62rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--color-gold);
    margin-bottom: 0.9rem;
    font-weight: 400;
}

.album-modal__description {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--color-main);
}

.album-modal__description p {
    margin-bottom: 1rem;
}

.album-modal__description h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

.album-modal__description h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.album-modal__description a {
    color: var(--color-gold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .album-modal__layout {
        grid-template-columns: 220px 1fr;
    }
}

@media (max-width: 640px) {
    .discography-section {
        padding: 1.5rem 0 1.5rem;
    }

    .discography-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .album-card__overlay {
        opacity: 1;
        background: linear-gradient(
            to top,
            rgba(26, 22, 20, 0.85) 0%,
            rgba(26, 22, 20, 0.2) 60%,
            rgba(26, 22, 20, 0) 100%
        );
    }

    .album-modal {
        padding: 0;
        align-items: flex-end;
    }

    .album-modal__container {
        max-height: 92vh;
        border-radius: 12px 12px 0 0;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--color-main-muted) transparent;
        display: block;
    }

    .album-modal__body {
        display: block;
        min-height: auto;
    }

    .album-modal__layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .album-modal__cover-col {
        padding: 1.5rem;
        flex-direction: column;
        align-items: center;
        gap: 1.25rem;
        overflow-y: visible;
    }

    .album-modal__cover-img {
        width: 60%;
        max-width: 220px;
    }

    .album-modal__cover-placeholder {
        width: 60%;
        max-width: 220px;
        aspect-ratio: 1 / 1;
    }

    .album-modal__order {
        width: 100%;
    }

    .album-modal__order-btn {
        width: 100%;
    }

    .album-modal__price {
        text-align: center;
    }

    .album-modal__cover-col .info-card__divider {
        width: 100%;
    }

    .album-modal__cover-col .info-card__row {
        width: 100%;
    }

    .album-modal__details {
        padding: 1.5rem;
        gap: 1.25rem;
        overflow-y: visible;
    }

    .album-modal__title {
        font-size: 1.3rem;
        padding-right: 2rem;
    }

    .album-modal__close {
        position: sticky;
        top: 0.75rem;
        right: 0;
        margin-left: auto;
        margin-right: 0.75rem;
        margin-bottom: -36px;
        z-index: 3;
    }
}
