/* =============================================
   PHILOTHÈQUE — CSS Principal
   ============================================= */

/* --- RESET & VARIABLES --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --ph-bg: #FAF8F3;
    --ph-ink: #2A2520;
    --ph-gold: #B8943E;
    --ph-gold-light: #F0E6C8;
    --ph-gold-hover: #D4B96A;
    --ph-parchment: #F3EDE0;
    --ph-muted: #7A7267;
    --ph-accent: #6B4C3B;
    --ph-border: #DDD6C8;
    --ph-card-bg: #FFFFFF;
    --ph-dark: #1E1A15;
    --ph-dark-deep: #1A1510;
    --ph-blue: #3D5A80;
    --ph-text-light: #B8A88A;
    --ph-font-display: 'Cormorant Garamond', Georgia, serif;
    --ph-font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
}

body {
    font-family: var(--ph-font-body);
    color: var(--ph-ink);
    background: var(--ph-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

/* --- BANNER --- */
.ph-banner {
    width: 100%;
    background: var(--ph-dark-deep);
    overflow: hidden;
}
.ph-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- NAVIGATION --- */
.ph-nav-bar {
    background: var(--ph-dark);
    padding: 0 32px;
    display: flex;
    justify-content: center;
    gap: 0;
    border-bottom: 1px solid #3A342A;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
}
.ph-nav-bar a {
    color: var(--ph-text-light);
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 12px 18px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.ph-nav-bar a:hover,
.ph-nav-bar a.current-cat {
    color: var(--ph-gold-hover);
    border-bottom-color: var(--ph-gold);
}

/* --- CITATION DU JOUR --- */
.ph-quote-bar {
    background: var(--ph-parchment);
    padding: 24px 40px;
    text-align: center;
    border-bottom: 1px solid var(--ph-border);
}
.ph-quote-text {
    font-family: var(--ph-font-display);
    font-size: 20px;
    font-style: italic;
    color: var(--ph-accent);
    line-height: 1.5;
}
.ph-quote-author {
    font-size: 13px;
    color: var(--ph-muted);
    margin-top: 6px;
    letter-spacing: 0.5px;
}

/* --- LAYOUT PRINCIPAL --- */
.ph-main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
}
.ph-feed { padding: 32px 36px; }
.ph-sidebar {
    background: var(--ph-parchment);
    border-left: 1px solid var(--ph-border);
    padding: 32px 22px;
}

/* --- SECTIONS CATÉGORIES (PAGE D'ACCUEIL) --- */
.ph-cat-section { margin-bottom: 40px; }
.ph-cat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.ph-cat-badge {
    font-size: 11px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 3px;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
}
.ph-cat-label {
    font-family: var(--ph-font-display);
    font-size: 24px;
    font-weight: 500;
}
.ph-cat-line {
    flex: 1;
    height: 1px;
    background: var(--ph-border);
}
.ph-cat-more {
    font-size: 13px;
    color: var(--ph-gold);
    white-space: nowrap;
}

/* --- CARTES ARTICLES --- */
.ph-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.ph-card {
    background: var(--ph-card-bg);
    border: 1px solid var(--ph-border);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.25s ease;
}
.ph-card:hover {
    border-color: var(--ph-gold);
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(42,37,32,0.08);
}
.ph-card-img {
    height: 140px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.ph-card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(26,21,16,0.5) 100%);
}
.ph-card-img .ph-card-cat-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 3px;
    color: #fff;
}
/* Fallback quand pas d'image */
.ph-card-img-fallback {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}
.ph-card-img-fallback .ph-card-fallback-title {
    font-family: var(--ph-font-display);
    font-size: 18px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    text-align: center;
    position: relative;
    z-index: 1;
    line-height: 1.3;
}
.ph-card-body { padding: 14px 16px; }
.ph-card-title {
    font-family: var(--ph-font-display);
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 6px;
    color: var(--ph-ink);
}
.ph-card-title a { color: inherit; }
.ph-card-title a:hover { color: var(--ph-gold); }
.ph-card-excerpt {
    font-size: 13px;
    color: var(--ph-muted);
    line-height: 1.5;
}
.ph-card-date {
    font-size: 12px;
    color: var(--ph-text-light);
    margin-top: 8px;
}

/* --- SIDEBAR WIDGETS --- */
.sb-sec { margin-bottom: 30px; }
.sb-h {
    font-family: var(--ph-font-display);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ph-border);
}

/* Philosophes récents */
.sb-phil {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    cursor: pointer;
    transition: color 0.2s;
}
.sb-phil:hover .sb-n { color: var(--ph-gold); }
.sb-av {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ph-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ph-font-display);
    font-size: 12px;
    font-weight: 500;
    color: var(--ph-accent);
    flex-shrink: 0;
}
.sb-n { font-size: 13px; font-weight: 500; transition: color 0.2s; }
.sb-d { font-size: 11px; color: var(--ph-muted); }

/* Tags concepts */
.sb-tag {
    display: inline-block;
    font-size: 12px;
    padding: 5px 12px;
    border: 1px solid var(--ph-border);
    border-radius: 18px;
    margin: 3px 4px 3px 0;
    color: var(--ph-muted);
    transition: all 0.2s;
}
.sb-tag:hover {
    border-color: var(--ph-gold);
    color: var(--ph-accent);
    background: var(--ph-gold-light);
}

/* Chronologie */
.sb-tl {
    padding: 9px 0 9px 18px;
    border-left: 2px solid var(--ph-border);
    position: relative;
    font-size: 12px;
}
.sb-tl::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ph-gold);
}
.sb-tl-d { font-weight: 500; color: var(--ph-accent); }
.sb-tl-t { color: var(--ph-muted); margin-top: 2px; }
.sb-tl-cat {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* --- ARTICLE PAGE --- */
.art-breadcrumb {
    padding: 12px 32px;
    font-size: 13px;
    color: var(--ph-muted);
    background: var(--ph-parchment);
    border-bottom: 1px solid var(--ph-border);
}
.art-breadcrumb a { color: var(--ph-gold); }

.art-hero {
    background: linear-gradient(135deg, var(--ph-dark-deep) 0%, #2A2520 40%, #1E2A3A 100%);
    padding: 44px 36px;
}
.art-hero-badge {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 3px;
    color: #fff;
    margin-bottom: 12px;
}
.art-hero-title {
    font-family: var(--ph-font-display);
    font-size: 40px;
    font-weight: 500;
    color: var(--ph-gold-light);
    line-height: 1.2;
    margin-bottom: 8px;
}
.art-hero-subtitle {
    font-family: var(--ph-font-display);
    font-size: 18px;
    color: var(--ph-text-light);
    font-style: italic;
}

/* Layout article avec sommaire sticky */
.art-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
}
.art-toc {
    padding: 24px 18px;
    background: var(--ph-parchment);
    border-right: 1px solid var(--ph-border);
    position: sticky;
    top: 44px; /* sous la nav sticky */
    align-self: start;
    max-height: calc(100vh - 44px);
    overflow-y: auto;
}
.art-toc-title {
    font-family: var(--ph-font-display);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ph-border);
}
.art-toc a {
    display: block;
    font-size: 12px;
    color: var(--ph-muted);
    padding: 4px 0;
    line-height: 1.4;
    transition: color 0.2s;
}
.art-toc a:hover { color: var(--ph-gold); }
.art-toc a.toc-h2 {
    font-weight: 500;
    color: var(--ph-accent);
    margin-top: 6px;
}
.art-toc a.toc-h3 { padding-left: 12px; }
.art-toc a.active {
    color: var(--ph-gold);
    font-weight: 500;
}

.art-body {
    padding: 32px 40px;
    max-width: 860px;
}

/* --- CONTENU ARTICLE — Typographie --- */
.art-body h2 {
    font-family: var(--ph-font-display);
    font-size: 26px;
    font-weight: 500;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ph-border);
    margin: 32px 0 16px;
}
.art-body h3 {
    font-family: var(--ph-font-display);
    font-size: 20px;
    font-weight: 500;
    color: var(--ph-accent);
    margin: 24px 0 12px;
}
.art-body h4 {
    font-size: 16px;
    font-weight: 500;
    margin: 18px 0 10px;
}
.art-body p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 16px;
}
.art-body ul, .art-body ol {
    margin: 0 0 16px 24px;
    font-size: 16px;
    line-height: 1.8;
}

/* --- CONTENU ARTICLE — Blocs structurés --- */

/* Propriétés (dates, nationalité...) */
.ph-props {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}
.ph-prop {
    background: var(--ph-card-bg);
    border: 1px solid var(--ph-border);
    border-radius: 6px;
    padding: 12px 14px;
}
.ph-prop-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ph-muted);
    margin-bottom: 3px;
}
.ph-prop-value {
    font-family: var(--ph-font-display);
    font-size: 16px;
    font-weight: 500;
}

/* Alternance 1 colonne / 2 colonnes */
.ph-full { margin-bottom: 28px; }
.ph-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

/* Encadré œuvres */
.ph-works {
    background: var(--ph-card-bg);
    border: 1px solid var(--ph-border);
    border-radius: 6px;
    padding: 18px 20px;
}
.ph-works-title {
    font-family: var(--ph-font-display);
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
}
.ph-works ul { list-style: none; margin: 0; columns: 2; column-gap: 20px; }
.ph-works li {
    font-size: 14px;
    padding: 3px 0 3px 14px;
    position: relative;
}
.ph-works li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 11px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ph-gold);
}

/* Concepts tags */
.ph-concepts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ph-concept-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 6px 14px;
    border: 1px solid var(--ph-border);
    border-radius: 20px;
    background: var(--ph-card-bg);
    transition: all 0.2s;
}
.ph-concept-tag:hover {
    border-color: var(--ph-gold);
    background: var(--ph-gold-light);
}
.ph-concept-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ph-gold);
}

/* Citations */
.ph-cite-box {
    background: var(--ph-parchment);
    border-left: 3px solid var(--ph-gold);
    border-radius: 0 6px 6px 0;
    padding: 20px 24px;
    margin-bottom: 28px;
}
.ph-cite-title {
    font-family: var(--ph-font-display);
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 14px;
}
.ph-cite {  margin-bottom: 16px; }
.ph-cite:last-child { margin-bottom: 0; }
.ph-cite-text {
    font-family: var(--ph-font-display);
    font-size: 17px;
    font-style: italic;
    color: var(--ph-accent);
    line-height: 1.5;
}
.ph-cite-source {
    font-size: 12px;
    color: var(--ph-muted);
    margin-top: 4px;
}

/* Anecdotes */
.ph-anecdote {
    background: var(--ph-card-bg);
    border: 1px solid var(--ph-border);
    border-radius: 6px;
    padding: 16px 18px;
}
.ph-anecdote-title {
    font-family: var(--ph-font-display);
    font-size: 16px;
    font-weight: 500;
    color: var(--ph-accent);
    margin-bottom: 6px;
}
.ph-anecdote-text {
    font-size: 14px;
    color: var(--ph-muted);
    line-height: 1.6;
}

/* Regards croisés */
.ph-peers {
    background: var(--ph-card-bg);
    border: 1px solid var(--ph-border);
    border-radius: 6px;
    padding: 20px 22px;
    margin-bottom: 28px;
}
.ph-peers-title {
    font-family: var(--ph-font-display);
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 14px;
}
.ph-peer {
    padding: 10px 0;
    border-bottom: 1px solid var(--ph-border);
}
.ph-peer:last-child { border-bottom: none; }
.ph-peer-name { font-weight: 500; font-size: 15px; }
.ph-peer-quote {
    font-size: 14px;
    font-style: italic;
    color: var(--ph-muted);
    line-height: 1.5;
}

/* FAQ */
.ph-faq {
    background: var(--ph-parchment);
    border-radius: 6px;
    padding: 22px 26px;
    margin-top: 32px;
}
.ph-faq-title {
    font-family: var(--ph-font-display);
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 16px;
}
.ph-faq-item {
    border-bottom: 1px solid var(--ph-border);
    padding: 12px 0;
}
.ph-faq-item:last-child { border-bottom: none; }
.ph-faq-q {
    font-size: 15px;
    font-weight: 500;
    color: var(--ph-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ph-faq-q::after {
    content: '▸';
    font-size: 14px;
    transition: transform 0.3s;
    flex-shrink: 0;
}
.ph-faq-item.open .ph-faq-q::after { transform: rotate(90deg); }
.ph-faq-a {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ph-muted);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding-top: 0;
}
.ph-faq-item.open .ph-faq-a {
    max-height: 500px;
    padding-top: 10px;
}

/* --- ACCORDÉONS (toggles Notion) --- */
.ph-toggle {
    border: 1px solid var(--ph-border);
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}
.ph-toggle-header {
    padding: 12px 16px;
    background: var(--ph-card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 15px;
    transition: background 0.2s;
}
.ph-toggle-header:hover { background: var(--ph-parchment); }
.ph-toggle-arrow {
    font-size: 12px;
    transition: transform 0.3s;
}
.ph-toggle.open .ph-toggle-arrow { transform: rotate(90deg); }
.ph-toggle-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 16px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--ph-muted);
}
.ph-toggle.open .ph-toggle-content {
    max-height: 1000px;
    padding: 0 16px 14px;
}

/* --- AUTO-LINKS --- */
a.ph-autolink {
    color: var(--ph-gold);
    border-bottom: 1px dotted var(--ph-gold);
    transition: all 0.2s;
}
a.ph-autolink:hover {
    color: var(--ph-gold-hover);
    border-bottom-style: solid;
}

/* --- ARTICLES LIÉS --- */
.ph-related {
    background: var(--ph-parchment);
    padding: 28px 32px;
    margin-top: 40px;
    border-radius: 6px;
}
.ph-related-title {
    font-family: var(--ph-font-display);
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 16px;
}
.ph-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* --- FOOTER --- */
.ph-footer {
    background: var(--ph-dark);
    color: var(--ph-text-light);
    padding: 32px 40px;
    text-align: center;
    font-size: 13px;
}
.ph-footer a { color: var(--ph-gold); }

/* --- ANIMATIONS SCROLL --- */
.ph-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.ph-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .ph-main-layout { grid-template-columns: 1fr; }
    .ph-sidebar {
        border-left: none;
        border-top: 1px solid var(--ph-border);
    }
    .art-layout { grid-template-columns: 1fr; }
    .art-toc {
        position: relative;
        top: 0;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--ph-border);
    }
}

@media (max-width: 768px) {
    .ph-cards-grid { grid-template-columns: 1fr; }
    .ph-two-col { grid-template-columns: 1fr; }
    .ph-props { grid-template-columns: 1fr 1fr; }
    .ph-related-grid { grid-template-columns: 1fr; }
    .ph-nav-bar { padding: 0 12px; }
    .ph-nav-bar a { padding: 10px 10px; font-size: 11px; }
    .ph-feed { padding: 20px 16px; }
    .art-body { padding: 20px 16px; }
    .art-hero { padding: 28px 16px; }
    .art-hero-title { font-size: 28px; }
    .ph-works ul { columns: 1; }
}

@media (max-width: 480px) {
    .ph-props { grid-template-columns: 1fr; }
    .ph-nav-bar a { font-size: 10px; letter-spacing: 1px; padding: 8px 6px; }
}
