/* Jurisprudence Styles */
/* Note: Toutes les variables de couleur sont définies dans theme.css */

/* --- Results counter spinner --- */
.results-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid color-mix(in srgb, var(--theme-primary) 25%, transparent);
    border-top-color: var(--theme-primary);
    border-radius: 50%;
    vertical-align: middle;
    animation: results-spin 0.65s linear infinite;
}

@keyframes results-spin {
    to { transform: rotate(360deg); }
}

/* --- Filters Bar --- */
.jurisprudence-filters-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--theme-white-color);
    border-bottom: 1px solid var(--theme-border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 6px 4px -4px rgba(0,0,0,0.05);
}

.jurisprudence-filters-bar .filter-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Dropdowns customization */
.filter-dropdown .dropdown-toggle {
    min-width: 150px;
    border-radius: 5px;
    border-color: var(--theme-border-color);
}

.filter-dropdown .dropdown-menu {
    max-height: 350px;
    overflow-y: auto;
    min-width: 250px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 5px;
}

.filter-dropdown .dropdown-toggle.active-filter {
    background-color: var(--theme-bg-light);
    border-color: var(--theme-primary);
    color: var(--theme-primary);
    font-weight: 600;
}

/* Custom Checkbox color */
.form-check-input:checked {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.jurisprudence-filters-bar .search-group {
    position: relative;
}

.jurisprudence-filters-bar .search-group .form-control {
    padding-right: 2.5rem;
    border-radius: 5px; /* Rounded corners requested */
    border-color: var(--theme-border-color);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.jurisprudence-filters-bar .search-group .form-control:not(:placeholder-shown) {
    border-color: var(--theme-primary);
}

.jurisprudence-filters-bar .search-group .form-control:not(:placeholder-shown):focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 0.15rem color-mix(in srgb, var(--theme-primary) 20%, transparent);
}

/* --- List Items --- */
.jurisprudence-list-container {
    min-height: 500px;
}

.jurisprudence-item {
    position: relative;
    margin-bottom: 48px;
    display: grid;
    grid-template-columns: 7fr 1fr;
    gap: 40px;
    align-items: start;
}
@media (max-width: 768px) {
    .jurisprudence-item {
        gap: 20px;
    }
}
@media (max-width: 480px) {
    .jurisprudence-item {
        gap: 10px;
    }
}
.jurisprudence-item > .item-content {
    grid-column: 1;
}
.jurisprudence-item > .item-pictos {
    grid-column: 2;
}
/* Identity Style from common-2025 - appliqué uniquement aux analyses, chroniques et brèves, pas aux résumés */
/* Exclu des vues détail */
.jurisprudence-item.is-analyse:not(.detail-view) > .item-content,
.jurisprudence-item.is-chronique:not(.detail-view) > .item-content
{
    border-left: 4px solid var(--theme-primary-light);
    padding-left: 18px;
    border-bottom: none; /* Pas de bordure en bas pour ces types */
}

.jurisprudence-item:last-child {
    border-bottom: none;
}

.jurisprudence-item .item-header {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 6px;
}

.jurisprudence-item .item-body {
    text-align: justify;
}

.jurisprudence-item .meta-top {
    font-size: 0.85rem;
    color: var(--theme-primary);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.jurisprudence-item .item-title {
    font-size: 22px; /* Matched to old CSS */
    font-weight: 700;
    color: var(--theme-primary);
    margin-bottom: 0.25rem;
}

.jurisprudence-item .item-title a {
    text-decoration: none;
    color: inherit;
}

.jurisprudence-item .item-title a:hover {
    text-decoration: underline;
}

.jurisprudence-item .item-subtitle {
    font-size: 18px; /* Slightly smaller than title */
    font-weight: 600;
    font-style: italic;
    color: var(--theme-text-muted);
    margin-bottom: 0.5rem;
}

.jurisprudence-item .item-meta-details {
    color: var(--theme-text-muted);
    margin-bottom: 6px;
}

.jurisprudence-item .item-content {
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: start;
    max-width: 700px;
}

.jurisprudence-item .content-main {
    flex: 1;
}

.jurisprudence-item .content-text {
    font-size: 15px; /* Matched to old CSS */
    color: var(--theme-text-color);
    text-align: justify;
}

/* Justify content text for cleaner look */
.jurisprudence-item .content-full {
    font-size: 15px;
    color: var(--theme-text-color);
    text-align: justify;
    margin-top: 1rem;
}

.jurisprudence-item .content-pictos {
    width: 100px; /* Increased width further for larger pictos */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    padding-top: 0.5rem; 
}

@media (max-width: 768px) {
    .jurisprudence-item .content-pictos {
        width: 80px;
    }
}
@media (max-width: 480px) {
    .jurisprudence-item .content-pictos {
        width: 60px;
    }
}

.jurisprudence-item .picto-item {
    text-align: center;
}

.jurisprudence-item .picto-item img {
    width: 100px;
    height: auto;
    margin-bottom: 4px;
}
@media (max-width: 768px) {
    .jurisprudence-item .picto-item img {
        width: 80px;
    }
}
@media (max-width: 480px) {
    .jurisprudence-item .picto-item img {
        width: 60px;
    }
}

.jurisprudence-item .picto-item span {
    display: block; 
    font-size: 12px;
    line-height: 1.25em;
    color: var(--theme-text-muted);
}
.jurisprudence-item .picto-item:first-child span {
    color: var(--theme-primary);
}
@media (max-width: 480px) {
    .jurisprudence-item .picto-item span {
        font-size: 8px;
    }
}
/* --- Brèves specific styles --- */
.jurisprudence-item .item-content-inline {
    font-size: 15px;
    color: var(--theme-text-color);
}

.jurisprudence-item .item-content-inline a {
    color: var(--theme-primary);
    font-weight: 600;
    text-decoration: none;
}

.jurisprudence-item .item-content-inline a:hover {
    text-decoration: underline;
}

.jurisprudence-item .breve-themes {
    font-style: italic;
    color: var(--theme-text-muted);
    margin: 0 0.25rem;
}

/* --- File links --- */
.jurisprudence-item .file-link {
    margin-top: 1rem;
}

.jurisprudence-item .file-link a {
    color: var(--theme-primary);
    text-decoration: none;
    font-weight: 500;
}

.jurisprudence-item .file-link a:hover {
    text-decoration: underline;
}

.jurisprudence-item .file-link i {
    margin-left: 0.25rem;
}

/* --- Analyses linked to arrêts --- */
.jurisprudence-item .item-date {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.jurisprudence-item .item-abstract {
    font-size: 15px;
    color: var(--theme-text-color);
    margin-bottom: 0.5rem;
}

/* --- Section Headings --- */
.section-heading {
    color: var(--theme-primary) !important;
}

/* --- Analyse Detail View --- */
.analyse-header {
    margin-bottom: 1.5rem;
    align-self: stretch;
}

.analyse-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-primary);
    margin-bottom: 0.5rem;
}

.analyse-authors {
    font-size: 1rem;
}

.analyse-author-name {
    color: var(--theme-primary);
    font-weight: 600;
}

.analyse-metadata-box {
    width: 100%;
    border-left: 4px solid var(--theme-primary-light);
    padding: 0.3rem 0.55rem;
    background-color: var(--theme-bg-off-white);
    color: var(--theme-text-light);
}

.citation-block {
    cursor: pointer;
}

.citation-copy-label {
    color: var(--theme-text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 1rem;
    user-select: none;
    transition: color 0.15s ease;
}

.citation-block:hover .citation-copy-label {
    color: var(--theme-primary);
}

.analyse-metadata-box p {
    color: var(--theme-text-light);
    font-size: 0.95rem;
}
.analyse-metadata-box p + p {
    margin-top: 0.5em;
}

.analyse-actions .btn {
    font-size: 0.875rem;
}

.analyse-pub-date {
    font-size: 0.95rem;
    color: var(--theme-text-muted);
}

.analyse-abstract {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--theme-primary);
}

.analyse-content p {
    text-align: justify;
}

.analyse-content img {
    max-width: 100%;
    height: auto;
}

.analyse-content .small-caps {
    font-variant: small-caps;
}

sup.footnote-ref a
{
    color: var(--theme-primary);
    text-decoration: none;
}

.footnotes
{
    margin-top: 2em;
    font-size: 0.9em;
}

.footnotes ol {
    list-style: none;
    counter-reset: footnote-counter;
    padding-left: 0;
}

.footnotes li {
    overflow-wrap: break-word;
    word-break: break-word;
    counter-increment: footnote-counter;
    position: relative;
    padding-left: 1.6em;
}

.footnotes li::before {
    content: counter(footnote-counter) ".";
    color: var(--theme-primary);
    font-size: 0.75em;
    vertical-align: super;
    position: absolute;
    left: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .jurisprudence-item .content-pictos {
        /*display: none; */
    }
    
    .jurisprudence-filters-bar .filter-group {
        align-items: stretch;
    }
    
    .filter-dropdown .dropdown-toggle {
        width: 100%;
        min-width: 100px;
    }

    .analyse-header {
        flex-direction: column;
    }

    .analyse-author-photo {
        width: 100px;
        height: 100px;
    }

    .analyse-actions {
        flex-direction: column;
    }

    .analyse-actions .btn {
        width: 100%;
    }
}
