/* ==========================================================================
   fl0rian.fr — style public
   Esprit "old school", carré, noir & blanc, inspiré du damier d'échecs.
   Design pensé desktop (boxed ~800px) puis adapté proprement au mobile.
   ========================================================================== */

:root {
    --bg: #f4f4f2;
    --paper: #ffffff;
    --fg: #111111;
    --muted: #555555;
    --border: #111111;
    --border-light: #cccccc;
    --accent: #000000;
    --accent-contrast: #ffffff;
    --square-a: #111111;
    --square-b: #ffffff;
    --font-serif: Georgia, 'Times New Roman', serif;
    --font-mono: 'Courier New', Courier, monospace;
    --max-width: 800px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 1.65;
    background-image:
        linear-gradient(45deg, #00000006 25%, transparent 25%),
        linear-gradient(-45deg, #00000006 25%, transparent 25%);
    background-size: 40px 40px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

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

/* --- Conteneur "boxed" central, largeur fixe desktop --- */
.wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Bandeau damier décoratif (échecs) --- */
.chess-stripe {
    height: 10px;
    width: 100%;
    background: repeating-linear-gradient(
        90deg,
        var(--square-a) 0, var(--square-a) 10px,
        var(--square-b) 10px, var(--square-b) 20px
    );
}

/* --- En-tête --- */
.site-header {
    background: var(--paper);
    border-bottom: 3px solid var(--border);
}

.site-header__inner {
    padding: 32px 20px 20px;
    text-align: center;
}

.site-title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 40px;
    letter-spacing: 1px;
    font-weight: 700;
}

.site-title a { text-decoration: none; color: var(--fg); }

.site-subtitle {
    margin: 8px 0 0;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
}

/* --- Navigation --- */
.site-nav {
    border-top: 1px solid var(--border);
    background: var(--fg);
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.site-nav li { border-right: 1px solid #333; }
.site-nav li:last-child { border-right: none; }

.site-nav a {
    display: block;
    padding: 12px 18px;
    color: var(--accent-contrast);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.site-nav a:hover { background: var(--accent); text-decoration: underline; }

/* --- Contenu principal --- */
main {
    padding: 36px 0 60px;
    flex: 1 0 auto;
    width: 100%;
}

.page-title {
    font-size: 30px;
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 3px double var(--border);
}

/* --- Liste d'articles (accueil / blog) --- */
.post-list { list-style: none; margin: 0; padding: 0; }

.post-card {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    min-height: 110px;
}

.post-card__thumb-link {
    flex: 0 0 110px;
    width: 110px;
    border-right: 1px solid var(--border);
    display: block;
    align-self: stretch;
}

.post-card__thumb {
    width: 100%;
    height: 100%;
    min-height: 110px;
    object-fit: cover;
    display: block;
    border: none;
    margin: 0;
    filter: grayscale(15%);
}

.post-card__thumb--placeholder {
    width: 100%;
    height: 100%;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%),
        linear-gradient(45deg, #000 25%, #fff 25%, #fff 75%, #000 75%);
    background-size: 28px 28px;
    background-position: 0 0, 14px 14px;
    font-size: 30px;
    color: #fff;
    text-shadow: 0 0 3px #000, 0 0 3px #000;
}

.post-card__body {
    flex: 1 1 auto;
    padding: 16px 20px;
    min-width: 0;
}

.post-card__meta {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 6px;
}

.post-card__meta a { color: var(--muted); }

.post-card__title {
    margin: 0 0 8px;
    font-size: 21px;
    line-height: 1.25;
}

.post-card__title a { text-decoration: none; }
.post-card__title a:hover { text-decoration: underline; }

.post-card__excerpt {
    margin: 0 0 10px;
    color: #222;
    font-size: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__more {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    padding-bottom: 1px;
}

.post-card__more:hover { background: var(--fg); color: var(--accent-contrast); }

/* --- Article / page seule : boîte "papier" distincte du fond --- */
.single-box {
    background: var(--paper);
    border: 1px solid var(--border);
    padding: 30px 34px 40px;
}

.single-header { margin-bottom: 24px; }

.single-title {
    font-size: 32px;
    margin: 0 0 10px;
}

.single-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.single-meta a { color: var(--muted); }

.single-image {
    margin: 0 -34px 24px;
    border: none;
    border-bottom: 1px solid var(--border);
    max-width: none;
    width: calc(100% + 68px);
    height: 220px;
    object-fit: cover;
    display: block;
    filter: grayscale(10%);
}

.content { font-size: 18px; }
.content h2 { font-size: 24px; margin-top: 36px; border-bottom: 1px solid var(--border-light); padding-bottom: 6px; }
.content h3 { font-size: 20px; margin-top: 28px; }
.content p { margin: 0 0 18px; }
.content blockquote {
    margin: 20px 0;
    padding: 12px 20px;
    border-left: 4px solid var(--border);
    background: var(--paper);
    font-style: italic;
}
.content pre {
    background: #111;
    color: #eee;
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 14px;
}
.content ul, .content ol { margin: 0 0 18px 22px; padding: 0; }
.content p:empty,
.content p:has(> br:only-child) { display: none; }
.content .ql-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 1px solid var(--border);
    margin: 20px 0;
}
.content img { border: 1px solid var(--border); margin: 12px 0; }

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    font-family: var(--font-mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pagination a, .pagination span {
    border: 1px solid var(--border);
    padding: 8px 14px;
    text-decoration: none;
}

.pagination a:hover { background: var(--fg); color: var(--accent-contrast); }
.pagination .disabled { color: var(--border-light); border-color: var(--border-light); }

/* --- Pied de page --- */
.site-footer {
    border-top: 3px solid var(--border);
    background: var(--paper);
    padding: 24px 0;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--muted);
}

/* --- Boîte "catégorie" --- */
.category-intro {
    background: var(--paper);
    border: 1px solid var(--border);
    padding: 18px 22px;
    margin-bottom: 28px;
    font-family: var(--font-mono);
    font-size: 14px;
}

/* ==========================================================================
   Mobile : le boxed garde son esprit "carré" mais s'adapte,
   sans jamais imposer une largeur mobile au desktop.
   ========================================================================== */
@media (max-width: 840px) {
    .wrap { padding: 0 16px; }
    body { font-size: 16.5px; }
    .site-title { font-size: 30px; }
    .single-title { font-size: 26px; }
    .page-title { font-size: 24px; }
    .single-box { padding: 22px 20px 30px; }
    .single-image { margin: 0 -20px 20px; width: calc(100% + 40px); height: 160px; }
    .post-card__thumb-link, .post-card__thumb, .post-card__thumb--placeholder { flex-basis: 84px; width: 84px; height: 84px; }
    .post-card__body { padding: 12px 14px; }
    .post-card__title { font-size: 18px; }
    .site-nav a { padding: 10px 12px; font-size: 12px; }
}

@media (max-width: 480px) {
    .site-header__inner { padding: 24px 16px 16px; }
    .site-title { font-size: 26px; }
    .post-card { flex-direction: column; }
    .post-card__thumb-link, .post-card__thumb, .post-card__thumb--placeholder { width: 100%; flex-basis: auto; height: 130px; border-right: none; border-bottom: 1px solid var(--border); }
    .post-card__excerpt { -webkit-line-clamp: 3; }
    .pagination { font-size: 12px; }
}
