/* =========================================================
   Album detail page
   File: styles/album-detail.css
   ========================================================= */

.album-page-shell {
    max-width: 1480px;
    margin: 0 auto;
    padding: 18px 24px 36px;
}

.album-detail-header {
    margin-bottom: 18px;
}

.album-detail-root {
    display: grid;
    gap: 18px;
}

.album-detail-loading,
.album-detail-error,
.album-empty-state {
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    color: var(--muted);
}

.album-detail-error h1 {
    color: var(--text);
    margin-bottom: 10px;
}

.album-owner-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow);
}

.album-owner-left,
.album-owner-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.album-owner-avatar,
.album-liker-avatar,
.album-comment-avatar {
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand), #93a2ff);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    flex: 0 0 auto;
}

.album-owner-avatar {
    width: 54px;
    height: 54px;
}

.album-owner-avatar img,
.album-liker-avatar img,
.album-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-owner-left h2 {
    margin: 0;
    font-size: 1.1rem;
}

.album-owner-left p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.album-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.album-detail-hero h1 {
    font-size: clamp(2rem, 3.4vw, 3.2rem);
    letter-spacing: -0.05em;
    margin-bottom: 8px;
}

.album-description {
    color: var(--muted);
    line-height: 1.6;
}

.album-stats-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    color: var(--muted);
    white-space: nowrap;
}

.album-stats-row > span,
.album-like-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    border-radius: 999px;
    background: #f5f8ff;
    border: 1px solid var(--line);
    color: var(--brand-dark);
    font-weight: 700;
}

.album-like-count {
    cursor: pointer;
}

.album-main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 22px;
    align-items: start;
}

.album-main-column {
    display: grid;
    gap: 18px;
}

.album-side-column {
    display: grid;
    gap: 18px;
}

.album-photo-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.album-photo-item {
    aspect-ratio: 1 / 1.32;
    border-radius: 14px;
    overflow: hidden;
    background: #e6edf7;
    border: 1px solid var(--line);
    box-shadow: 0 10px 22px rgba(59, 89, 152, 0.08);
}

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

.album-photo-item:hover img {
    transform: scale(1.04);
}

.album-action-bar,
.related-content-card,
.album-comments-card,
.album-side-widget {
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.album-action-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.album-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #f7faff;
    color: var(--brand-dark);
    font-weight: 800;
}

.album-action-btn.is-liked {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(214, 73, 73, 0.25);
}

.related-content-card h2,
.album-comments-card h2,
.album-side-widget h3 {
    letter-spacing: -0.04em;
    margin-bottom: 14px;
}

.related-section-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.related-section-row:first-of-type {
    border-top: 0;
}

.related-label {
    color: var(--brand-dark);
    font-weight: 800;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.related-thumb,
.side-recommendation {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 12px;
    background: #e6edf7;
    border: 1px solid var(--line);
}

.related-thumb {
    aspect-ratio: 1 / 1.15;
}

.related-thumb img,
.side-recommendation img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.related-thumb span,
.side-recommendation span {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.45);
}

.related-thumb::after,
.side-recommendation::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 40%, rgba(0,0,0,0.72));
    z-index: 1;
}

.album-comments-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.album-comments-head span {
    color: var(--muted);
    font-weight: 600;
}

.album-comment-form {
    display: grid;
    grid-template-columns: 1fr 48px;
    gap: 10px;
    margin: 12px 0 18px;
}

.album-comment-form input {
    height: 50px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #f5f8ff;
    padding: 0 18px;
    outline: none;
}

.album-comment-form button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
}

.album-comments-list {
    display: grid;
    gap: 14px;
}

.album-comment {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: #f9fbff;
    border: 1px solid var(--line);
}

.album-comment-avatar {
    width: 46px;
    height: 46px;
}

.album-comment-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 5px;
}

.album-comment-meta span {
    color: var(--muted);
    font-size: 0.86rem;
}

.album-comment p {
    line-height: 1.5;
}

.album-comment-actions {
    margin-top: 8px;
    display: flex;
    gap: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.album-side-widget {
    display: grid;
    gap: 12px;
}

.side-recommendation {
    height: 195px;
}

.album-muted {
    color: var(--muted);
    line-height: 1.5;
}

.album-modal {
    position: fixed;
    inset: 0;
    z-index: 14000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(17, 26, 43, 0.55);
    backdrop-filter: blur(7px);
}

.album-modal.hidden {
    display: none;
}

.album-modal-panel {
    width: min(100%, 520px);
    max-height: 80vh;
    overflow: auto;
    position: relative;
    padding: 28px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 28px 70px rgba(32, 55, 105, 0.25);
}

.album-modal-panel h2 {
    margin-bottom: 16px;
    letter-spacing: -0.04em;
}

.album-likers-list {
    display: grid;
    gap: 10px;
}

.album-liker-row {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    background: #f7faff;
    border: 1px solid var(--line);
}

.album-liker-avatar {
    width: 44px;
    height: 44px;
}

@media (max-width: 1180px) {
    .album-main-layout {
        grid-template-columns: 1fr;
    }

    .album-side-column {
        display: none;
    }
}

@media (max-width: 900px) {
    .album-owner-strip,
    .album-detail-hero {
        flex-direction: column;
    }

    .album-stats-row {
        justify-content: flex-start;
    }

    .album-photo-grid,
    .related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .related-section-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .album-page-shell {
        padding: 12px;
    }

    .album-photo-grid,
    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .album-owner-actions {
        width: 100%;
    }

    .album-owner-actions .ghost-btn,
    .album-owner-actions .primary-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== v2 layout tweaks ===== */
.album-main-layout {
    grid-template-columns: 300px minmax(0, 1fr);
}

.album-side-column {
    order: -1;
}

.album-side-widget {
    position: sticky;
    top: 16px;
}

.album-photo-grid {
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.album-photo-item {
    width: 100%;
    min-width: 0;
    display: block;
    cursor: pointer;
}

.album-photo-item img {
    width: 100%;
    height: 100%;
}

.side-recommendation {
    margin-top: 10px;
    aspect-ratio: 1 / 1.05;
}

@media (max-width: 1200px) {
    .album-main-layout { grid-template-columns: 1fr; }
    .album-side-column { order: 0; }
}

@media (max-width: 920px) {
    .album-photo-grid,
    .related-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .album-photo-grid,
    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ===== v3 album detail: photos inside title/stat bubble ===== */
.album-detail-card {
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.album-detail-card .album-detail-hero {
    padding: 0 0 18px;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.album-detail-card .album-photo-grid {
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.album-main-layout.no-side {
    display: block;
}


/* v14.7: remove inner bubble around like count */
.album-like-count #album-likes-count {
    display: inline !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    font: inherit !important;
}
