/* =============================================
   Nendoroid.fr - CSS moderne (2024)
   Orange : #FF9933 / #e67e00
   ============================================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --orange:        #FF9933;
    --orange-dark:   #e67e00;
    --orange-light:  #fff3e0;
    --orange-border: #ffcc80;
    --text:          #222222;
    --text-light:    #555555;
    --bg:            #f9f5f0;
    --white:         #ffffff;
    --border:        #e0d5c8;
    --font:          'Segoe UI', Arial, sans-serif;
    --radius:        6px;
}

/* ---- Base ---- */
html { font-size: 16px; }

body {
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
}

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

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}
h2 { font-size: 1.2rem; border-left: 4px solid var(--orange); padding-left: 10px; margin-bottom: 14px; }
h3 { font-size: 1rem; color: var(--orange-dark); margin-bottom: 8px; }

/* ---- Header ---- */
#header {
    background: var(--white);
    border-bottom: 3px solid var(--orange);
    padding: 18px 0 0;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-title {
    display: inline-block;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--orange);
    letter-spacing: -1px;
    text-decoration: none;
    margin-bottom: 4px;
}
.site-title span { color: var(--text); font-weight: 300; }

.site-subtitle {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 16px;
    font-style: italic;
}

/* ---- Navigation principale ---- */
#nav {
    background: var(--orange);
}

#nav ul {
    list-style: none;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

#nav ul li { position: relative; }

#nav ul li a {
    display: block;
    padding: 10px 14px;
    color: var(--white);
    font-size: 0.83rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: background 0.15s;
}
#nav ul li a:hover,
#nav ul li a.active { background: var(--orange-dark); }

/* Sous-menu */
#nav ul li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--white);
    border: 1px solid var(--orange-border);
    border-top: 3px solid var(--orange);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 999;
    flex-direction: column;
    gap: 0;
}
#nav ul li:hover > ul { display: flex; }
#nav ul li ul li a {
    color: var(--text);
    font-weight: 400;
    padding: 8px 14px;
    text-transform: none;
    font-size: 0.82rem;
}
#nav ul li ul li a:hover { background: var(--orange-light); color: var(--orange-dark); }

/* ---- Layout principal ---- */
#wrapper {
    max-width: 1100px;
    margin: 28px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 28px;
    align-items: start;
}

/* Page sans sidebar */
#wrapper.full { grid-template-columns: 1fr; }

/* ---- Contenu principal ---- */
#main { min-width: 0; }

/* ---- Blocs génériques ---- */
.bloc {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 20px;
}

.bloc-titre {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    background: var(--orange);
    margin: -18px -20px 16px;
    padding: 10px 16px;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.bloc-titre a { color: var(--white); }
.bloc-titre a:hover { opacity: 0.85; text-decoration: none; }

/* ---- Page d'accueil : colonnes ---- */
.accueil-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ---- Fiches Nendoroid : liste grille ---- */
.fiches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
}

.fiche-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    text-align: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.fiche-card:hover {
    border-color: var(--orange);
    box-shadow: 0 3px 10px rgba(255,153,51,0.18);
}
.fiche-card img {
    margin: 0 auto 8px;
    border-radius: 3px;
    width: 100px;
    height: 100px;
    object-fit: contain;
    background: var(--orange-light);
}
.fiche-card .fiche-ref {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 2px;
}
.fiche-card .fiche-nom {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.fiche-card a { text-decoration: none; color: inherit; }
.fiche-card a:hover .fiche-nom { color: var(--orange-dark); }

/* Type header dans liste */
.type-header {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--orange);
    border-bottom: 2px solid var(--orange-border);
    padding-bottom: 6px;
    margin: 24px 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.type-header:first-child { margin-top: 0; }

/* ---- Fiche détail ---- */
.fiche-detail { }

.fiche-header {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.fiche-header img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    background: var(--orange-light);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.fiche-header .fiche-infos { flex: 1; }
.fiche-header .fiche-infos h1 {
    font-size: 1.5rem;
    color: var(--orange-dark);
    margin-bottom: 4px;
}
.fiche-header .ref-badge {
    display: inline-block;
    background: var(--orange);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 10px;
}
.fiche-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.fiche-table th {
    text-align: left;
    width: 160px;
    padding: 6px 10px 6px 0;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.82rem;
    vertical-align: top;
}
.fiche-table td {
    padding: 6px 0;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
}
.fiche-table tr:last-child td { border-bottom: none; }

/* Navigation prev/next */
.fiche-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 10px;
}
.fiche-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--orange-light);
    color: var(--orange-dark);
    border: 1px solid var(--orange-border);
    padding: 7px 14px;
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.15s;
}
.fiche-nav a:hover { background: var(--orange); color: var(--white); text-decoration: none; }

/* Photos galerie */
.galerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.galerie a img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
    transition: opacity 0.15s;
}
.galerie a:hover img { opacity: 0.85; }

/* ---- News ---- */
.news-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: none; }
.news-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--orange-light);
}
.news-item .news-body { flex: 1; min-width: 0; }
.news-item .news-titre {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 3px;
}
.news-item .news-meta {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 5px;
}
.news-item .news-meta span {
    background: var(--orange-light);
    color: var(--orange-dark);
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 6px;
}
.news-item .news-extrait {
    font-size: 0.82rem;
    color: var(--text-light);
}
.news-item .news-lire {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--orange-dark);
    margin-top: 4px;
    display: inline-block;
}

/* ---- Sidebar ---- */
#sidebar { }

.sidebar-bloc {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 18px;
    overflow: hidden;
}
.sidebar-titre {
    background: var(--orange);
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sidebar-body { padding: 12px 14px; }

.sidebar-bloc ul { list-style: none; }
.sidebar-bloc ul li {
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.83rem;
}
.sidebar-bloc ul li:last-child { border-bottom: none; }

/* Top/Flop sidebar */
.top-grid {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}
.top-grid .top-item { text-align: center; flex: 1; }
.top-grid .top-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin: 0 auto 4px;
    background: var(--orange-light);
    border-radius: 3px;
    border: 1px solid var(--border);
}
.top-grid .top-item a { font-size: 0.72rem; color: var(--text); }
.top-grid .top-item a:hover { color: var(--orange-dark); }

/* Commentaires sidebar */
.comm-item {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}
.comm-item:last-child { border-bottom: none; }
.comm-item .comm-nom { font-weight: 600; color: var(--orange-dark); }
.comm-item .comm-date { color: var(--text-light); font-size: 0.72rem; }

/* ---- Articles ---- */
.article-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.article-item:last-child { border-bottom: none; }
.article-item h3 { font-size: 0.9rem; margin-bottom: 4px; }
.article-item .article-meta { font-size: 0.75rem; color: var(--text-light); margin-bottom: 6px; }

/* ---- Recherche ---- */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.search-bar input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.15s;
}
.search-bar input[type="text"]:focus { border-color: var(--orange); }
.search-bar button,
.btn {
    background: var(--orange);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn-outline {
    background: transparent;
    color: var(--orange-dark);
    border: 1px solid var(--orange);
}
.search-bar button:hover,
.btn:hover { background: var(--orange-dark); text-decoration: none; }
.btn-outline:hover { background: var(--orange); color: var(--white); }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.82rem;
    color: var(--text);
}
.pagination a:hover { background: var(--orange-light); border-color: var(--orange); text-decoration: none; }
.pagination .current {
    background: var(--orange);
    color: var(--white);
    border-color: var(--orange);
    font-weight: 700;
}

/* ---- Stats ---- */
.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}
.stat-item:last-child { border-bottom: none; }
.stat-count {
    font-weight: 700;
    color: var(--orange-dark);
}

/* ---- Footer ---- */
#footer {
    background: var(--text);
    color: #aaa;
    text-align: center;
    padding: 28px 20px;
    font-size: 0.78rem;
    margin-top: 40px;
}
#footer a { color: var(--orange); }
#footer a:hover { color: var(--orange-dark); }
#footer .footer-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

/* ---- Tags ---- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
    background: var(--orange-light);
    color: var(--orange-dark);
    border: 1px solid var(--orange-border);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
}
.tag:hover { background: var(--orange); color: var(--white); text-decoration: none; }

/* ---- Breadcrumb ---- */
.breadcrumb {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 16px;
}
.breadcrumb a { color: var(--orange-dark); }

/* ---- Table générique ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.data-table th {
    background: var(--orange-light);
    color: var(--text);
    padding: 8px 10px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--orange-border);
    font-size: 0.78rem;
    text-transform: uppercase;
}
.data-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:hover td { background: var(--orange-light); }

/* ---- Alerts / messages ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.88rem;
}
.alert-info { background: #e3f2fd; border-left: 4px solid #1976d2; color: #1565c0; }
.alert-success { background: #e8f5e9; border-left: 4px solid #388e3c; color: #2e7d32; }

/* ---- Lightbox basique (CSS only pour les galeries) ---- */
.lb-overlay { display: none; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    #wrapper {
        grid-template-columns: 1fr;
        padding: 0 12px;
        margin-top: 16px;
    }
    .accueil-grid { grid-template-columns: 1fr; }
    #nav ul { gap: 0; }
    #nav ul li a { padding: 9px 10px; font-size: 0.78rem; }
    .fiche-header { flex-direction: column; }
    .fiche-header img { width: 140px; height: 140px; }
    .fiches-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    #sidebar { order: -1; }
}

@media (max-width: 480px) {
    #nav ul { flex-direction: column; }
    .site-title { font-size: 1.4rem; }
}
