/* ==============================================
   AS TIME GOES BY — Ghost Theme Stylesheet
   Minimal, contemplative, literary.
   ============================================== */

/* ===== VARIABLES ===== */
:root {
    --grey: #6B7280;
    --grey-light: #E5E7EB;
    --petrol: #1B4D5C;
    --bg: #FFFFFF;
    --text: #1A1A1A;
    --text-secondary: #6B7280;
    --shadow-polaroid: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-polaroid-hover: 0 4px 16px rgba(0,0,0,0.10);
}

[data-theme="dark"] {
    --bg: #0F1419;
    --text: #E8E6E1;
    --text-secondary: #9CA3AF;
    --grey-light: #1E2A30;
    --shadow-polaroid: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-polaroid-hover: 0 4px 16px rgba(0,0,0,0.4);
}

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

body {
    font-family: 'Source Sans 3', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* ===== DARK MODE TOGGLE ===== */
.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--grey-light);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.theme-toggle:hover { border-color: var(--petrol); }

/* ===== HEADER ===== */
.header-block {
    background: var(--bg);
    padding: 0;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 24px 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.blog-title {
    font-family: 'DM Serif Display', serif;
    font-size: 2.4rem;
    color: var(--text);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1;
    text-decoration: none;
}
.blog-title:hover { color: var(--text); }

.header-right {
    display: flex;
    align-items: baseline;
    gap: 28px;
}

/* Ghost {{navigation}} generates <ul class="nav"><li><a>...</a></li></ul> */
.header-right nav,
.header-right nav ul,
.header-right nav .nav {
    display: flex;
    gap: 24px;
    align-items: baseline;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-right nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-right nav a {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
    white-space: nowrap;
}
.header-right nav a:hover { color: var(--petrol); }

.search-icon-header {
    color: var(--text);
    cursor: pointer;
    font-size: 0.8rem;
    transition: color 0.2s;
    font-weight: 700;
    text-decoration: none;
}
.search-icon-header:hover { color: var(--petrol); }

/* Grand espacement apres le header */
.header-spacer {
    height: 56px;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== POLAROID ===== */
.polaroid {
    background: var(--bg);
    padding: 8px 8px 28px 8px;
    box-shadow: var(--shadow-polaroid);
    transition: box-shadow 0.3s ease;
    border: 1px solid var(--grey-light);
}
.polaroid:hover { box-shadow: var(--shadow-polaroid-hover); }

.polaroid-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}

.polaroid-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background-color: #c8d5da;
    background-image: linear-gradient(135deg, #d4dde1 0%, #a8bfc8 50%, #8da9b5 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

[data-theme="dark"] .polaroid-placeholder {
    background-image: linear-gradient(135deg, #1a2e36 0%, #253d47 50%, #1B4D5C 100%);
}

/* ===== HERO SECTION ===== */
.hero { padding: 0 0 40px; }

.hero-main {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: center;
    margin-bottom: 48px;
}
.hero-main .polaroid { cursor: pointer; }
.hero-main .polaroid-img,
.hero-main .polaroid-placeholder { aspect-ratio: 4/3; min-height: 320px; }

.hero-content h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.3;
}
.hero-content h2 a {
    text-decoration: none;
    color: inherit;
}
.hero-content h2 a:hover { color: var(--petrol); }

.hero-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    font-weight: 300;
}
.hero-meta a {
    color: var(--petrol);
    text-decoration: none;
}

.hero-excerpt {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.read-more {
    font-size: 0.85rem;
    color: var(--petrol);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: opacity 0.2s;
}
.read-more:hover { opacity: 0.7; }

.hero-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
}

.hero-secondary-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.hero-secondary-item a { text-decoration: none; }
.hero-secondary-item .polaroid {
    flex-shrink: 0;
    width: 120px;
    padding: 5px 5px 18px 5px;
}
.hero-secondary-item .polaroid-img,
.hero-secondary-item .polaroid-placeholder {
    aspect-ratio: 1/1;
    min-height: 90px;
}

.hero-secondary-content h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
}
.hero-secondary-content h3 a {
    text-decoration: none;
    color: inherit;
}
.hero-secondary-content h3 a:hover { color: var(--petrol); }
.hero-secondary-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.hero-secondary-content .hero-meta {
    font-size: 0.72rem;
    margin-bottom: 6px;
}

/* ===== DIVIDER ===== */
.divider {
    height: 1px;
    background: var(--petrol);
    opacity: 0.15;
    margin: 20px 0;
}

/* ===== ARTICLES GRID ===== */
.articles-section { padding: 20px 0 60px; }

.articles-section-title {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-secondary);
    margin-bottom: 36px;
}

.row-a {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 36px;
    margin-bottom: 36px;
}
.row-b {
    display: grid;
    grid-template-columns: 1fr 1fr 1.3fr;
    gap: 36px;
    margin-bottom: 36px;
}

.article-card { cursor: pointer; }
.article-card a { text-decoration: none; color: inherit; }
.article-card .polaroid { margin-bottom: 16px; }
.article-card .polaroid-img,
.article-card .polaroid-placeholder { aspect-ratio: 16/10; }

.article-card h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
}
.article-card h3 a {
    text-decoration: none;
    color: inherit;
}
.article-card h3 a:hover { color: var(--petrol); }

.card-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    font-weight: 300;
    margin-bottom: 8px;
}
.card-meta a {
    color: var(--petrol);
    text-decoration: none;
}

.article-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.article-card.small h3 { font-size: 0.95rem; }
.article-card.small p { font-size: 0.82rem; }
.article-card .tags { margin-top: 10px; }

.tag {
    font-size: 0.68rem;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    opacity: 0.6;
    text-decoration: none;
}
.tag::before { content: '#'; }
.tag + .tag { margin-left: 8px; }

.load-more { text-align: center; padding: 24px 0; }
.load-more a {
    font-size: 0.82rem;
    color: var(--petrol);
    text-decoration: none;
    letter-spacing: 0.08em;
}
.load-more a:hover { opacity: 0.7; }

/* ===== PAGINATION (Ghost) ===== */
.pagination {
    text-align: center;
    padding: 32px 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.pagination a {
    color: var(--petrol);
    text-decoration: none;
    letter-spacing: 0.08em;
}
.pagination a:hover { opacity: 0.7; }

/* ===== FOOTER ===== */
footer {
    border-top: 1px solid rgba(27, 77, 92, 0.2);
    padding: 48px 24px;
    text-align: center;
}

.newsletter-section { margin-bottom: 32px; }
.newsletter-section h4 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 16px;
}

.newsletter-form {
    display: flex;
    justify-content: center;
    gap: 8px;
    max-width: 380px;
    margin: 0 auto;
}
.newsletter-form input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--grey-light);
    background: var(--bg);
    color: var(--text);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}
.newsletter-form input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}
.newsletter-form input:focus { border-color: var(--petrol); }
.newsletter-form button {
    padding: 10px 20px;
    background: var(--petrol);
    color: #fff;
    border: none;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    cursor: pointer;
}
.newsletter-form button:hover { opacity: 0.85; }

.footer-nav { margin-bottom: 16px; }
.footer-nav ul,
.footer-nav .nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.footer-nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-nav li:not(:last-child)::after {
    content: '\00b7';
    margin-left: 8px;
    color: var(--grey-light);
}
.footer-nav a {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.1em;
}
.footer-nav a:hover { color: var(--petrol); }
.copyright {
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

/* ============================================
   POST PAGE — LAYOUT 33 / 66
   ============================================ */

/* Masquer le header global et le footer sur les articles et pages */
.post-template .header-block,
.post-template .header-spacer,
.post-template footer,
.page-template .header-block,
.page-template .header-spacer,
.page-template footer {
    display: none;
}

.post-template .content-wrap,
.page-template .content-wrap {
    display: flex;
    min-height: 100vh;
}

/* Colonne gauche — Sidebar fixe */
.article-sidebar {
    width: 33.333%;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 32px 28px;
    border-right: 1px solid var(--grey-light);
    flex-shrink: 0;
}

.sidebar-blog-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.4rem;
    color: var(--text);
    font-weight: 400;
    letter-spacing: 0.02em;
    text-decoration: none;
    margin-bottom: 32px;
    text-align: left;
    display: block;
    transition: color 0.2s;
}
.sidebar-blog-title:hover { color: var(--petrol); }

.article-sidebar .polaroid {
    width: 100%;
    max-width: none;
    padding: 8px 8px 28px 8px;
}
.article-sidebar .polaroid-img {
    width: 100%;
    min-height: 280px;
    object-fit: cover;
}
.article-sidebar .polaroid-placeholder {
    width: 100%;
    min-height: 280px;
}
.article-sidebar .polaroid-img.portrait,
.article-sidebar .polaroid-placeholder.portrait { aspect-ratio: 3/4; }
.article-sidebar .polaroid-img.landscape,
.article-sidebar .polaroid-placeholder.landscape { aspect-ratio: 4/3; }
.article-sidebar .polaroid-img.square,
.article-sidebar .polaroid-placeholder.square { aspect-ratio: 1/1; }
.article-sidebar .polaroid-img.wide,
.article-sidebar .polaroid-placeholder.wide { aspect-ratio: 16/9; }

.article-sidebar-meta {
    margin-top: 20px;
    text-align: left;
}
.article-sidebar-meta .article-cat {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--petrol);
    font-weight: 600;
    margin-bottom: 6px;
}
.article-sidebar-meta .article-cat a {
    color: inherit;
    text-decoration: none;
}
.article-sidebar-meta .article-date {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Colonne droite — contenu scrollable */
.article-body {
    width: 66.666%;
    min-height: 100vh;
    padding: 40px 60px 80px 60px;
}

/* Mini header article — nav only */
.article-page-header {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    margin-bottom: 48px;
    padding-bottom: 0;
}
.article-page-header nav,
.article-page-header nav ul,
.article-page-header nav .nav {
    display: flex;
    gap: 18px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.article-page-header nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}
.article-page-header nav a {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}
.article-page-header nav a:hover { color: var(--petrol); }

.article-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 24px;
}

.article-meta-line {
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--grey-light);
    font-weight: 300;
}
.article-meta-line a { color: var(--petrol); text-decoration: none; }

/* ===== ARTICLE CONTENT (Ghost) ===== */
.article-content,
.gh-content {
    font-family: 'Source Sans 3', sans-serif;
}

.article-content p,
.gh-content p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text);
    margin-bottom: 24px;
}

.article-content > p:first-of-type::first-letter,
.gh-content > p:first-of-type::first-letter {
    font-family: 'DM Serif Display', serif;
    font-size: 3.5rem;
    float: left;
    line-height: 0.8;
    margin-right: 8px;
    margin-top: 6px;
    color: var(--petrol);
}

.article-content blockquote,
.gh-content blockquote {
    border-left: 2px solid var(--petrol);
    padding: 8px 0 8px 24px;
    margin: 32px 0;
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.article-content h2,
.gh-content h2 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin: 48px 0 16px;
    line-height: 1.3;
}

.article-content h3,
.gh-content h3 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin: 36px 0 12px;
    line-height: 1.4;
}

.article-content ul, .article-content ol,
.gh-content ul, .gh-content ol {
    margin: 0 0 24px 24px;
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text);
}

.article-content a,
.gh-content a {
    color: var(--petrol);
    text-decoration: underline;
    text-decoration-color: rgba(27, 77, 92, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}
.article-content a:hover,
.gh-content a:hover {
    text-decoration-color: var(--petrol);
}

.article-content img,
.gh-content img {
    max-width: 100%;
    height: auto;
    margin: 32px 0;
}

.article-content figure,
.gh-content figure {
    margin: 32px 0;
}
.article-content figcaption,
.gh-content figcaption {
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 8px;
}

/* Ghost Koenig editor width classes (required) */
.kg-width-wide {
    margin-left: -40px;
    margin-right: -40px;
    width: calc(100% + 80px);
    max-width: none;
}
.kg-width-full {
    margin-left: calc(-60px);
    margin-right: calc(-60px);
    width: calc(100% + 120px);
    max-width: none;
}

/* Ghost-specific cards (bookmark, gallery, etc.) */
.kg-card { margin: 32px 0; }
.kg-image-card img { width: 100%; }
.kg-gallery-card { margin: 32px 0; }
.kg-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.kg-gallery-row {
    display: flex;
    gap: 8px;
}
.kg-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.kg-bookmark-card {
    border: 1px solid var(--grey-light);
    border-radius: 3px;
    overflow: hidden;
}
.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: var(--text);
}
.kg-bookmark-content {
    padding: 16px;
    flex: 1;
}
.kg-bookmark-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.kg-bookmark-description {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.kg-bookmark-metadata {
    margin-top: 8px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.kg-bookmark-icon {
    width: 16px;
    height: 16px;
}
.kg-bookmark-thumbnail {
    width: 180px;
    flex-shrink: 0;
}
.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .kg-width-wide {
        margin-left: -12px;
        margin-right: -12px;
        width: calc(100% + 24px);
    }
    .kg-width-full {
        margin-left: -24px;
        margin-right: -24px;
        width: calc(100% + 48px);
    }
    .kg-bookmark-container { flex-direction: column; }
    .kg-bookmark-thumbnail { width: 100%; height: 160px; }
}

.article-tags-bottom {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--grey-light);
}

.copy-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--petrol);
    cursor: pointer;
    letter-spacing: 0.06em;
    background: none;
    border: none;
    font-family: 'Source Sans 3', sans-serif;
}
.copy-link:hover { opacity: 0.7; }

.back-home {
    display: inline-block;
    margin-bottom: 32px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}
.back-home:hover { color: var(--petrol); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .header-inner {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .header-right nav { flex-wrap: wrap; gap: 14px; }
    .blog-title { font-size: 1.8rem; }
}

@media (max-width: 768px) {
    .hero-main { grid-template-columns: 1fr; gap: 24px; }
    .hero-secondary { grid-template-columns: 1fr; }
    .row-a, .row-b { grid-template-columns: 1fr; }

    .post-template .content-wrap,
    .page-template .content-wrap {
        flex-direction: column;
    }
    .article-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 24px;
        border-right: none;
        border-bottom: 1px solid var(--grey-light);
    }
    .article-body {
        width: 100%;
        min-height: auto;
        padding: 24px;
    }
}
