/* ============================================================
   KoTching : feuille de style des articles du blog
   Chargee par les 11 articles apres tailwind.css.
   Depend des variables typographiques definies dans chaque page
   (--font-display, --font-text, --h2-blog-*).
   ============================================================ */

/* En-tete aligne sur la colonne de lecture */
.post-header {
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

/* Colonne de lecture : environ 68 caracteres */
.post-body {
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #d1d5db;
}

@media (min-width: 768px) {
    .post-body {
        font-size: 1.125rem;
    }
}

.post-body > p,
.post-body > ul,
.post-body > ol,
.post-body > blockquote,
.post-body > figure,
.post-body > .table-wrap,
.post-body > .callout {
    margin-bottom: 1.75rem;
}

.post-body p {
    line-height: 1.8;
}

/* Titres */
.post-body h2 {
    font-family: var(--font-display, 'Bebas Neue', sans-serif);
    font-size: 2.125rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.05;
    color: #ffffff;
    margin-top: 3.5rem;
    margin-bottom: 1.25rem;
    padding-top: 1rem;
    position: relative;
}

.post-body h2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2.5rem;
    height: 3px;
    border-radius: 2px;
    background: #3a9a9a;
}

@media (min-width: 768px) {
    .post-body h2 {
        font-size: 2.5rem;
    }
}

.post-body h3 {
    font-family: var(--font-text, 'Inter', sans-serif);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
    color: #4aa8a8;
    margin-top: 2.25rem;
    margin-bottom: 0.9rem;
}

.post-body h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.post-body h2 + h3 {
    margin-top: 1.25rem;
}

/* Texte */
.post-body strong {
    color: #ffffff;
    font-weight: 600;
}

.post-body a {
    color: #3a9a9a;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.post-body a:hover {
    color: #4aa8a8;
}

.post-body hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 3rem 0;
}

/* Listes : puces teal */
.post-body ul,
.post-body ol {
    padding-left: 1.5rem;
    line-height: 1.75;
}

.post-body ul li,
.post-body ol li {
    margin-bottom: 0.6rem;
    padding-left: 0.25rem;
}

.post-body ul li {
    list-style-type: disc;
}

.post-body ol li {
    list-style-type: decimal;
}

.post-body li::marker {
    color: #3a9a9a;
    font-weight: 600;
}

.post-body li > ul,
.post-body li > ol {
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

/* Tableaux : en-tete noir, lignes fines, defilement horizontal sur mobile */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
}

.post-body table {
    width: 100%;
    min-width: 32rem;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.5;
}

.post-body table th {
    background: #050505;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(58, 154, 154, 0.5);
}

.post-body table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    vertical-align: top;
}

.post-body table tr:last-child td {
    border-bottom: none;
}

.post-body table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

/* Citations et encadres "a retenir" */
.post-body blockquote {
    margin-left: 0;
    margin-right: 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 3px solid #3a9a9a;
    color: #e5e7eb;
    font-style: italic;
}

.post-body blockquote p:last-child {
    margin-bottom: 0;
}

.callout {
    border: 1px solid rgba(58, 154, 154, 0.45);
    border-left: 4px solid #3a9a9a;
    background: rgba(58, 154, 154, 0.07);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
}

.callout > :last-child {
    margin-bottom: 0;
}

.callout-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #3a9a9a;
    margin-bottom: 0.5rem;
}

/* Images avec legende */
.post-body figure {
    margin-left: 0;
    margin-right: 0;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.post-body figcaption {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: #9ca3af;
    text-align: center;
}

/* Sommaire */
.post-toc {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
}

.post-toc-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #3a9a9a;
    margin-bottom: 0.75rem;
}

.post-toc ol {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.6;
}

.post-toc li {
    margin-bottom: 0.35rem;
    padding-left: 0.15rem;
}

.post-toc a {
    color: #d1d5db;
    text-decoration: none;
}

.post-toc a:hover {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Ancres : degager le titre du menu fixe */
.post-body h2[id] {
    scroll-margin-top: 6rem;
}

/* Meta en tete d'article */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.post-meta .sep {
    color: #4b5563;
}

.post-meta .cat {
    color: #9ca3af;
    font-weight: 600;
}

/* Signature de fin d'article */
.post-body .post-signature {
    font-style: italic;
    color: #9ca3af;
    font-size: 0.875rem;
    margin-top: 3rem;
}
