/* ============================================================
   Magazine Author Reader — mar-author-reader
   ============================================================ */

.mar-author-reader { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }

/* === En-tête auteur === */
.mar-author-reader__header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 32px;
    background: #f8f8f8;
}
@media (prefers-color-scheme: dark) { .mar-author-reader__header { background: #1a1a1a; } }
:root[data-theme="dark"] .mar-author-reader__header { background: #1a1a1a; }
:root[data-theme="light"] .mar-author-reader__header { background: #f8f8f8; }

.mar-author-reader__avatar {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #999;
}
.mar-author-reader__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 15%;
}

.mar-author-reader__info { flex: 1; min-width: 0; }
.mar-author-reader__name { margin: 0 0 6px; font-size: 1.5rem; font-weight: 700; }
.mar-author-reader__city { margin: 0 0 8px; font-size: .875rem; opacity: .65; }
.mar-author-reader__city i { margin-right: 4px; }
.mar-author-reader__bio { margin: 0 0 10px; font-size: .925rem; line-height: 1.5; opacity: .85; }
.mar-author-reader__profile-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid currentColor;
    text-decoration: none;
    opacity: .75;
    transition: opacity .15s;
}
.mar-author-reader__profile-link:hover { opacity: 1; }

@media (max-width: 600px) {
    .mar-author-reader__header { flex-direction: column; align-items: center; text-align: center; }
    .mar-author-reader__avatar { width: 72px; height: 72px; }
    .mar-author-reader__name { font-size: 1.25rem; }
}

/* === Filtres === */
.mar-author-reader__filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.mar-author-reader__filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.mar-author-reader__filter-label {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .6;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Chips catégories */
.mar-author-reader__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mar-author-reader__chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #ccc;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
}
.mar-author-reader__chip:hover { border-color: #e63535; color: #e63535; }
.mar-author-reader__chip.active { background: #e63535 !important; color: #fff !important; border-color: #e63535 !important; }
.mar-author-reader__chip-count {
    font-size: .75rem;
    opacity: .7;
    background: rgba(0,0,0,.1);
    border-radius: 10px;
    padding: 0 5px;
}
.mar-author-reader__chip.active .mar-author-reader__chip-count { background: rgba(255,255,255,.25); opacity: 1; }

@media (prefers-color-scheme: dark) {
    .mar-author-reader__chip { border-color: #444; color: #ddd; }
    .mar-author-reader__chip-count { background: rgba(255,255,255,.1); }
}
:root[data-theme="dark"] .mar-author-reader__chip { border-color: #444; color: #ddd; }
:root[data-theme="dark"] .mar-author-reader__chip-count { background: rgba(255,255,255,.1); }

/* Année + recherche */
.mar-author-reader__filter-row--search { margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.mar-author-reader__year-slot {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.mar-author-reader__search-form {
    flex: 1;
    max-width: 360px;
    position: relative;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 36px;
}

/* Dropdown année custom (<details>/<summary>) — pas de <select> natif */
.mar-author-reader__year-dropdown { position: relative; display: block; margin: 0; padding: 0; }

.mar-author-reader__year-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 36px;
    box-sizing: border-box;
    margin: 0;
    border-radius: 20px;
    border: 1px solid #444;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: border-color .15s, color .15s;
}
.mar-author-reader__year-summary::-webkit-details-marker { display: none; }
.mar-author-reader__year-summary::marker { display: none; }
.mar-author-reader__year-dropdown[open] .mar-author-reader__year-summary { border-color: #e63535; color: #e63535; }
.mar-author-reader__year-summary:hover { border-color: #e63535; color: #e63535; }

.mar-author-reader__year-chevron { font-size: .7rem; transition: transform .2s; }
.mar-author-reader__year-dropdown[open] .mar-author-reader__year-chevron { transform: rotate(180deg); }

.mar-author-reader__year-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 6px 0;
    min-width: 170px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.mar-author-reader__year-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 14px;
    font-size: .85rem;
    text-decoration: none;
    color: #ddd;
    transition: background .1s;
    white-space: nowrap;
}
.mar-author-reader__year-option:hover { background: rgba(255,255,255,.07); color: #fff; }
.mar-author-reader__year-option.active { color: #e63535; font-weight: 600; }
.mar-author-reader__year-count { opacity: .5; font-size: .78rem; }

:root[data-theme="light"] .mar-author-reader__year-summary { border-color: #ccc; color: inherit; }
:root[data-theme="light"] .mar-author-reader__year-options { background: #fff; border-color: #e0e0e0; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
:root[data-theme="light"] .mar-author-reader__year-option { color: #222; }
:root[data-theme="light"] .mar-author-reader__year-option:hover { background: rgba(0,0,0,.05); color: #000; }
@media (prefers-color-scheme: light) {
    .mar-author-reader__year-summary { border-color: #ccc; color: inherit; }
    .mar-author-reader__year-options { background: #fff; border-color: #e0e0e0; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
    .mar-author-reader__year-option { color: #222; }
    .mar-author-reader__year-option:hover { background: rgba(0,0,0,.05); }
}

.mar-author-reader__search-input {
    width: 100% !important;
    height: 36px !important;
    box-sizing: border-box !important;
    padding: 0 68px 0 16px !important;
    border-radius: 20px !important;
    border: 1px solid #444 !important;
    font-size: .82rem !important;
    font-weight: 500 !important;
    background: transparent !important;
    margin: 0 !important;
    line-height: 36px !important;
    transition: border-color .15s !important;
}
.mar-author-reader__search-input:focus { outline: none !important; border-color: #e63535 !important; box-shadow: none !important; }
.mar-author-reader__search-input::placeholder { opacity: .5; font-weight: 400; }
.mar-author-reader__search-btn {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    cursor: pointer;
    opacity: .5;
    padding: 4px;
    font-size: .82rem;
    margin: 0 !important;
}
.mar-author-reader__search-btn:hover { opacity: 1; }
.mar-author-reader__search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .4;
    font-size: .78rem;
    text-decoration: none;
    padding: 4px;
}
.mar-author-reader__search-clear:hover { opacity: 1; }
:root[data-theme="light"] .mar-author-reader__search-input { border-color: #ccc !important; }
@media (prefers-color-scheme: light) { .mar-author-reader__search-input { border-color: #ccc !important; } }

@media (max-width: 600px) {
    .mar-author-reader__filter-row--search { flex-direction: column; align-items: stretch; }
    .mar-author-reader__year-slot { width: 100%; }
    .mar-author-reader__year-dropdown { width: 100%; }
    .mar-author-reader__year-summary { width: 100%; justify-content: space-between; border-radius: 20px; box-sizing: border-box; }
    .mar-author-reader__year-options { min-width: 100%; }
    .mar-author-reader__search-form { max-width: 100%; width: 100%; }
    .mar-author-reader__search-input { border-radius: 20px !important; }
}

/* Cartes fantômes : utiles uniquement en grille 3 colonnes (desktop) */
@media (max-width: 900px) {
    .mar-author-reader__card--phantom { display: none; }
}

/* === Résultats === */
.mar-author-reader__results-header { margin-bottom: 16px; }
.mar-author-reader__count { font-size: .875rem; opacity: .65; margin: 0; }

/* === Grille articles === */
.mar-author-reader__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}
@media (max-width: 900px) { .mar-author-reader__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .mar-author-reader__grid { grid-template-columns: 1fr; } }

.mar-author-reader__card {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.mar-author-reader__card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); }

@media (prefers-color-scheme: dark) { .mar-author-reader__card { border-color: #333; } }
:root[data-theme="dark"] .mar-author-reader__card { border-color: #333; }

.mar-author-reader__card-link { display: flex; flex-direction: column; flex: 1; text-decoration: none; color: inherit; }

.mar-author-reader__card-img {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f0f0f0;
}
@media (prefers-color-scheme: dark) { .mar-author-reader__card-img { background: #2a2a2a; } }
:root[data-theme="dark"] .mar-author-reader__card-img { background: #2a2a2a; }

.mar-author-reader__card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.mar-author-reader__card:hover .mar-author-reader__card-img img { transform: scale(1.04); }

.mar-author-reader__card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2rem;
    opacity: .3;
}

.mar-author-reader__card-cat {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: #e63535;
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mar-author-reader__card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}
.mar-author-reader__card-date { font-size: .78rem; opacity: .55; }
.mar-author-reader__card-title { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.35; }
.mar-author-reader__card-teaser { margin: 0; font-size: .85rem; opacity: .7; line-height: 1.45; }

/* Carte fantôme : comble la dernière ligne pour garder la grille régulière */
.mar-author-reader__card--phantom { border: none !important; background: none !important; pointer-events: none; box-shadow: none !important; }
.mar-author-reader__card--phantom:hover { transform: none !important; }

/* Mobile : liste 1 col avec image à gauche */
@media (max-width: 540px) {
    .mar-author-reader__card-link { flex-direction: row; }
    .mar-author-reader__card-img { aspect-ratio: 1/1; width: 90px; flex-shrink: 0; }
    .mar-author-reader__card-body { padding: 10px 12px; }
    .mar-author-reader__card-title { font-size: .9rem; }
    .mar-author-reader__card-teaser { display: none; }
}

/* === Pagination === */
/* Framway génère <nav class="pagination"> avec btn-sm btn-bg-primary no-rad sur chaque lien.
   Structure : li.previous/next/last contiennent 2 <a> (desktop d-sm-inline-block + mobile d-sm-none).
   On ne touche qu'au centrage et à la taille des boutons numéros (.link). */
.mar-author-reader__pagination { display: flex; justify-content: center; margin-top: 32px; }

/* Boutons numéros de page : carrés 36px */
.mar-author-reader__pagination .pagination ul li a.link,
.mar-author-reader__pagination .pagination ul li span.current {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    min-height: 36px !important;
}

/* Boutons nav (Précédente/Suivante/Dernier) : largeur auto, texte visible */
.mar-author-reader__pagination .pagination ul li.previous a,
.mar-author-reader__pagination .pagination ul li.next a,
.mar-author-reader__pagination .pagination ul li.last a,
.mar-author-reader__pagination .pagination ul li.first a {
    width: auto !important;
    padding: 0 12px !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
}

/* === État vide === */
.mar-author-reader__empty {
    text-align: center;
    padding: 48px 16px;
    opacity: .6;
}
.mar-author-reader__empty i { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.mar-author-reader__empty p { margin: 0 0 16px; }

/* === Not found === */
.mar-author-reader__not-found { text-align: center; padding: 48px; opacity: .6; }
