/* Section/page titles left-aligned on desktop */
@media (min-width: 992px) {
    h1.page-title,
    h2,
    h3,
    .section-title {
        text-align: left !important;
        justify-content: flex-start !important;
    }
}
/* Force stat card titles to 2 lines minimum for alignment (desktop only) */
@media (min-width: 992px) {
    .card-header {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 3.6em;
        padding: 0.5em 0.5em;
    }
    .card-header h2 {
        margin: 0;
        width: 100%;
        text-align: center;
        font-size: 0.95rem;
        font-weight: 600;
        line-height: 1.3em;
        min-height: 2.6em;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
/* LP badge: white disc on black background for contrast */
.lp-badge-contrast {
    display: inline-block;
    background: #222;
    border-radius: 50%;
    padding: 2px 2px 1px 2px;
    line-height: 1;
}
.lp-badge-contrast .bi-disc {
    color: #fff !important;
}

/* Album card label truncation: show ellipsis and ' ...' if too long */
.album-label-truncate {
    display: block;
    min-width: 0;
    vertical-align: middle;
    font-size: 0.75rem;
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}
/* Expert Search Buttons - Force Small Size */
.expert-search-btn, .expert-search-btn * {
    font-size: 0.7rem !important;
    padding: 0.15rem 0.5rem !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.1 !important;
}
/**
 * Roots Archives v2 - Styles principaux
 * Palette : beige, marron, crème
 */

/* ========================================
   VARIABLES CSS
   ======================================== */
:root {
    --color-primary: #8B6F47;      /* Marron doux */
    --color-secondary: #D4A574;    /* Beige doré */
    --color-accent: #F5E6D3;       /* Crème */
    --color-dark: #5C4A3A;         /* Marron foncé */
    --color-light: #FAF7F2;        /* Beige très clair */
    --color-text: #3D3D3D;         /* Texte principal */
    --color-muted: #888;           /* Texte secondaire */
    
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Override Bootstrap colors */
    --bs-primary: #8B6F47;
    --bs-primary-rgb: 139, 111, 71;
    --bs-info: #D4A574;
    --bs-info-rgb: 212, 165, 116;
}

/* ========================================
   STYLES GÉNÉRAUX
   ======================================== */
body {
    font-family: var(--font-family);
    color: var(--color-text);
    background-color: var(--color-light);
    line-height: 1.6;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-dark);
    text-decoration: underline;
}

/* ========================================
   HEADER
   ======================================== */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 0;
}

.navbar {
    padding: 1rem 0;
}

.navbar-brand {
    color: var(--color-primary) !important;
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-brand:hover {
    color: var(--color-dark) !important;
}

/* Logo in navbar - constrained and responsive */
.navbar-logo {
    max-height: 40px !important;
    height: auto !important;
    width: auto !important;
    object-fit: contain;
    display: inline-block;
}

/* Ensure navbar container centers items and keeps a compact height */
.navbar {
    padding: 0.5rem 0;
}
.navbar .container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 576px) {
    .navbar-logo {
        max-height: 34px !important;
    }
}

.nav-link {
    color: var(--color-dark) !important;
    font-weight: 700;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    color: var(--color-primary) !important;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    min-height: 60vh;
}

/* ========================================
   CARDS
   ======================================== */
.album-card-col {
    display: flex;
    min-width: 0; /* Prevent flex items from overflowing */
}

.album-card {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0; /* Prevent card from forcing column width */
}

/* Force album cover images to maintain aspect ratio and fill container */
.album-card .ratio {
    width: 100% !important;
}

.album-card .card-img-top {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    position: absolute;
    top: 0;
    left: 0;
}

/* Placeholder for albums without cover */
.album-card .bg-light {
    width: 100% !important;
    height: 100% !important;
}

.card {
    border: 1px solid rgba(139, 111, 71, 0.2);
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-title a {
    color: var(--color-primary);
    font-weight: 600;
}

.card-title a:hover {
    color: var(--color-dark);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

.btn-primary:hover {
    background-color: var(--color-dark) !important;
    border-color: var(--color-dark) !important;
}

.btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline-primary:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    background-color: #fff;
    border-top: 1px solid rgba(139, 111, 71, 0.2);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.site-footer h5,
.site-footer h6 {
    color: var(--color-primary);
    font-weight: 600;
}

.site-footer a {
    color: var(--color-text);
}

.site-footer a:hover {
    color: var(--color-primary);
}

.site-footer .list-unstyled li {
    margin-bottom: 0.5rem;
}

/* ========================================
   BADGES
   ======================================== */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Badge Bonus - Couleur beige doré */
.badge.bg-info {
    background-color: var(--color-secondary) !important;
    color: var(--color-dark) !important;
}

/* ========================================
   UTILITAIRES
   ======================================== */
.text-primary {
    color: var(--color-primary) !important;
}

.text-muted {
    color: var(--color-muted) !important;
}

.bg-light {
    background-color: var(--color-accent) !important;
}

.bg-primary {
    background-color: var(--color-primary) !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
}

/* ================================================
   ALBUM PAGE - Styles additionnels
   ================================================ */

/* Container avec marges */
.container {
    padding-left: 15px;
    padding-right: 15px;
}

/* Artist links avec effet hover */
.artist-link {
    color: var(--color-primary);
    transition: all 0.3s ease;
}

.artist-link:hover {
    color: var(--color-dark);
    text-decoration: underline !important;
}

/* Sticky sidebar pour l'artwork */
@media (min-width: 992px) {
    .sticky-top {
        position: sticky;
        top: 20px;
        z-index: 1020;
    }
}

/* Card headers - Couleurs personnalisées */
.card-header.bg-primary {
    background-color: var(--color-primary) !important;
    border-bottom: 2px solid var(--color-dark);
}

.card-header.bg-primary h3,
.card-header.bg-primary h5 {
    margin: 0;
    color: white !important;
}

/* Boutons Expand/Collapse All */
.expand-collapse-btns {
    display: flex;
    gap: 0.5rem;
}

.expand-collapse-btns .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    white-space: nowrap;
    background-color: white;
    color: var(--color-primary);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.expand-collapse-btns .btn:hover {
    background-color: var(--color-accent);
    color: var(--color-dark);
    border-color: var(--color-accent);
}

.expand-collapse-btns .btn i {
    font-size: 0.9rem;
}

/* Release content with display toggle */
.release-content {
    display: none;
}

.release-content.open {
    display: block;
}

/* Accordion customisé */
.accordion-button {
    background-color: var(--color-light) !important;
    color: var(--color-dark) !important;
    font-size: 0.95rem;
    padding: 1rem;
}

.accordion-button:not(.collapsed) {
    background-color: var(--color-secondary) !important;
    color: white !important;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(139, 111, 71, 0.25);
    border-color: var(--color-primary);
}

.accordion-button::after {
    filter: brightness(0.5);
}

.accordion-button:not(.collapsed)::after {
    filter: brightness(2);
}

.accordion-item {
    border: 1px solid rgba(139, 111, 71, 0.2);
    margin-bottom: 0.5rem;
}

/* Release summary (visible même collapsed) */
.release-summary {
    font-size: 0.875rem;
    color: #666;
}

.accordion-button:not(.collapsed) .release-summary {
    color: rgba(255, 255, 255, 0.8);
}

/* Artwork gallery dans releases */
.card-img-top {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Tracklist styling */
ol.list-unstyled li {
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

ol.list-unstyled li:last-child {
    border-bottom: none;
}

/* Breadcrumb custom */
.breadcrumb {
    background-color: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--color-secondary);
}

.breadcrumb-item a {
    color: var(--color-primary);
}

.breadcrumb-item.active {
    color: var(--color-muted);
}

/* Placeholder cover */
.placeholder-cover {
    min-height: 300px;
    background: linear-gradient(135deg, var(--color-light) 0%, var(--color-secondary) 100%);
}

/* Album header */
.album-header {
    animation: fadeInUp 0.6s ease-out;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-secondary);
    margin-bottom: 2rem;
}

.album-header h1 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.album-header h2 {
    color: var(--color-muted);
}

/* Animation d'entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.row > .col-lg-8 > .card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.row > .col-lg-8 > .card:nth-child(1) { animation-delay: 0.1s; }
.row > .col-lg-8 > .card:nth-child(2) { animation-delay: 0.2s; }
.row > .col-lg-8 > .card:nth-child(3) { animation-delay: 0.3s; }

/* Credits section */
.credits-section .border-bottom {
    border-color: var(--color-secondary) !important;
    color: var(--color-primary);
}

/* Responsive adjustments pour page album */
@media (max-width: 768px) {
    .album-header h1 {
        font-size: 1.75rem;
    }
    
    .album-header h2 {
        font-size: 1.25rem;
    }
    
    .accordion-button {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .expand-collapse-btns {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .expand-collapse-btns .btn {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Print styles */
@media print {
    .sticky-top {
        position: static !important;
    }
    
    .accordion-collapse {
        display: block !important;
        height: auto !important;
    }
    
    .accordion-button::after {
        display: none;
    }
    
    .expand-collapse-btns {
        display: none !important;
    }
}

/* ========================================
   ARTIST TABLE (UNIFIED)
   ======================================== */
.artist-table {
    font-size: 0.95rem;
}

.artist-table a {
    color: var(--color-primary);
    font-weight: 500;
}

.artist-table a:hover {
    color: var(--color-dark);
    text-decoration: underline;
}

/* Column widths */
.artist-table th:nth-child(1) { width: 6% !important; }   /* Cover */
.artist-table th:nth-child(2) { width: 22% !important; }  /* Artist */
.artist-table th:nth-child(3) { width: 22% !important; }  /* Album */
.artist-table th:nth-child(4) { width: 10% !important; }  /* Release */
.artist-table th:nth-child(5) { width: 6% !important; }   /* Type */
.artist-table th:nth-child(6) { width: 20% !important; }  /* Label */
.artist-table th:nth-child(7) { width: 8% !important; text-align: center !important; }   /* Rec */
.artist-table th:nth-child(8) { width: 6% !important; text-align: center !important; }   /* Rel */

.artist-table td:nth-child(7),
.artist-table td:nth-child(8) { text-align: center; }

.artist-table {
    table-layout: fixed;
}

.artist-table th,
.artist-table td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    white-space: nowrap;
}

/* Force headers on a single line even with Bootstrap overrides */
.artist-table th {
    white-space: nowrap !important;
    overflow: visible;
    text-overflow: unset;
}

/* Truncate long text with ellipsis on all columns except cover */
.artist-table td:not(:first-child) {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Center badges in Type column */
.artist-table td:nth-child(5) {
    text-align: center !important;
    vertical-align: middle;
}

/* LEGACY - Keep for backward compatibility */
/* ========================================
   DISCOGRAPHY TABLE (DEPRECATED)
   ======================================== */
.discog-table {
    font-size: 0.95rem;
}

.discog-table a {
    color: var(--color-primary);
    font-weight: 500;
}

.discog-table a:hover {
    color: var(--color-dark);
    text-decoration: underline;
}

/* ========================================
   CREDITS TABLE (DEPRECATED)
   ======================================== */
.credits-table {
    font-size: 0.95rem;
}

.credits-table .credit-cell {
    padding: 0.5rem 0.3rem 0.5rem 50px !important; /* TEST */
    vertical-align: middle;
    line-height: 1.5;
}

.credits-table .role-label {
    color: var(--color-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

.credits-table a {
    color: var(--color-primary);
    font-weight: 500;
}

.credits-table a:hover {
    color: var(--color-dark);
    text-decoration: underline;
}

/* ========================================
   FORUM POSTS - LARGEURS DES COLONNES
   ======================================== */
#search-advanced-posts table {
    table-layout: fixed !important;
    width: 100% !important;
}

#search-advanced-posts thead th:nth-child(1),
#search-advanced-posts tbody td:nth-child(1) {
    width: 30% !important;
}

#search-advanced-posts thead th:nth-child(2),
#search-advanced-posts tbody td:nth-child(2) {
    width: 40% !important;
}

#search-advanced-posts thead th:nth-child(3),
#search-advanced-posts tbody td:nth-child(3) {
    width: 15% !important;
}

#search-advanced-posts thead th:nth-child(4),
#search-advanced-posts tbody td:nth-child(4) {
    width: 15% !important;
}

/* Limiter la colonne Preview à 2 lignes max */
#search-advanced-posts tbody td:nth-child(2) {
    max-height: 2.4em;
    overflow: hidden;
}

#search-advanced-posts tbody td:nth-child(2) small {
    display: block;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
}