/* ============================================
   VITAMINE P — Ghost Theme
   Magazine / Editorial + Minimal
   Fonts: Instrument Serif, Inter, JetBrains Mono
   Palette: Violet #5B21B6 / #7C3AED, Warm White #FAF9F6
   ============================================ */

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

:root {
    --violet-deep: #5B21B6;
    --violet: #7C3AED;
    --violet-light: #A78BFA;
    --violet-bg: #F5F3FF;
    --bg: #FAF9F6;
    --bg-dark: #1A1A2E;
    --text: #1A1A2E;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --border: #E5E7EB;
    --white: #FFFFFF;
    /* Category colors */
    --tag-recherche: #3B82F6;
    --tag-societe: #10B981;
    --tag-politique: #F59E0B;
    --tag-experience: #EC4899;
    /* Typography */
    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    /* Spacing */
    --gap: 2rem;
    --max-width: 1200px;
    --content-width: 720px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    background: rgba(250, 249, 246, 0.9);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem var(--gap);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo { display: flex; align-items: center; }
.site-logo img { height: 32px; width: auto; }
.site-title-text {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--violet-deep);
    letter-spacing: -0.02em;
}

.site-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.site-nav a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.site-nav a:hover { color: var(--violet); }

.btn-subscribe {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    background: var(--violet);
    color: var(--white);
    border-radius: 100px;
    transition: background 0.2s, transform 0.2s;
    letter-spacing: 0.02em;
}

.btn-subscribe:hover { background: var(--violet-deep); transform: translateY(-1px); }

.btn-account {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--violet);
}

.menu-toggle { display: none; background: none; border: none; cursor: pointer; }
.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    margin: 4px 0;
    transition: 0.3s;
}

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 5rem var(--gap) 4rem;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #2D1B69 100%);
    color: var(--white);
}

.hero-inner { max-width: 700px; margin: 0 auto; }

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.hero-description {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.btn-hero {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 0.875rem 2rem;
    background: var(--violet);
    color: var(--white);
    border-radius: 100px;
    transition: background 0.2s, transform 0.2s;
}

.btn-hero:hover { background: var(--violet-light); transform: translateY(-2px); }

/* --- Featured Post --- */
.featured-post {
    max-width: var(--max-width);
    margin: 3rem auto;
    padding: 0 var(--gap);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

/* When no image, single column layout */
.featured-post:not(:has(.featured-image)) {
    grid-template-columns: 1fr;
    text-align: center;
    max-width: 800px;
}

.featured-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--violet);
    display: block;
    margin-bottom: 0.75rem;
}

.featured-title {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.featured-title a:hover { color: var(--violet); }

.featured-excerpt {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.featured-image {
    border-radius: 12px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.5s;
}

.featured-post:hover .featured-image img { transform: scale(1.03); }

/* --- Filter Bar --- */
.filter-bar {
    max-width: var(--max-width);
    margin: 2rem auto 0;
    padding: 0 var(--gap);
}

.filter-inner {
    display: flex;
    gap: 0.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.filter-btn {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    color: var(--text-secondary);
}

.filter-btn:hover { border-color: var(--violet); color: var(--violet); }
.filter-btn.active {
    background: var(--violet);
    border-color: var(--violet);
    color: var(--white);
}

.filter-substance { border-style: dashed; }
.filter-substance.active {
    background: var(--violet-light);
    border-color: var(--violet-light);
    border-style: solid;
    color: var(--white);
}

.filter-group-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    align-self: center;
    white-space: nowrap;
}

.filter-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    align-self: center;
    margin: 0 0.25rem;
}

/* --- Tag Pills --- */
.tag-pill {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    transition: opacity 0.2s;
}

.tag-pill:hover { opacity: 0.8; }

.tag-science { background: rgba(59, 130, 246, 0.1); color: var(--tag-recherche); }
.tag-societe { background: rgba(16, 185, 129, 0.1); color: var(--tag-societe); }
.tag-politique { background: rgba(245, 158, 11, 0.1); color: var(--tag-politique); }
.tag-experience { background: rgba(236, 72, 153, 0.1); color: var(--tag-experience); }

/* Substance tags */
.tag-psilocybine, .tag-mdma, .tag-dmt, .tag-5-meo-dmt,
.tag-ketamine, .tag-lsd, .tag-ibogaine {
    background: rgba(91, 33, 182, 0.08);
    color: var(--violet);
}

/* --- Post Grid --- */
.post-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem var(--gap);
}

.grid-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.post-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.post-card-image {
    display: block;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    transition: transform 0.5s;
}

.post-card:hover .post-card-image img { transform: scale(1.05); }

.post-card-content { padding: 1.25rem; }

.post-card-content .tag-pill { margin-bottom: 0.5rem; }

.substance-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.5rem; }

.substance-pill {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    background: rgba(91, 33, 182, 0.08);
    color: var(--violet);
    letter-spacing: 0.03em;
    transition: opacity 0.2s;
}

.substance-pill:hover { opacity: 0.7; }

.post-card-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.post-card-title a:hover { color: var(--violet); }

.post-card-excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.post-card-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    gap: 1rem;
}

/* --- Single Post --- */
.post-header {
    text-align: center;
    padding: 4rem var(--gap) 2rem;
}

.post-header-inner { max-width: var(--content-width); margin: 0 auto; }

.post-header .tag-pill { margin-bottom: 1.25rem; }

.post-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.post-excerpt {
    font-size: 1.1875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.post-meta-header {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-light);
}

.post-meta-header .sep { margin: 0 0.5rem; }

.post-feature-image {
    max-width: 960px;
    margin: 0 auto 3rem;
    padding: 0 var(--gap);
}

.post-feature-image img {
    width: 100%;
    border-radius: 12px;
}

.post-feature-image figcaption {
    font-size: 0.8125rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 0.75rem;
}

/* --- Post Content --- */
.post-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--gap);
    font-size: 1.0625rem;
    line-height: 1.8;
}

.post-content h2 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    margin: 2.5rem 0 1rem;
    letter-spacing: -0.02em;
}

.post-content h3 {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    margin: 2rem 0 0.75rem;
}

.post-content p { margin-bottom: 1.5rem; }

.post-content a { color: var(--violet); text-decoration: underline; text-underline-offset: 2px; }
.post-content a:hover { color: var(--violet-deep); }

.post-content blockquote {
    border-left: 3px solid var(--violet);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text-secondary);
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background: var(--violet-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.post-content pre {
    background: var(--bg-dark);
    color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-content pre code { background: none; padding: 0; color: inherit; }

/* --- Ghost width classes (required) --- */
.kg-width-wide {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.kg-width-full {
    max-width: none;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
}

.kg-width-wide img,
.kg-width-full img {
    width: 100%;
}

.post-content figure { margin: 2rem 0; }
.post-content figcaption {
    font-size: 0.8125rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 0.75rem;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 3rem auto;
    width: 60%;
}

/* --- Post Footer --- */
.post-footer {
    max-width: var(--content-width);
    margin: 3rem auto 0;
    padding: 2rem var(--gap);
    border-top: 1px solid var(--border);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.author-bio {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.post-share {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.post-share a {
    font-weight: 500;
    color: var(--violet);
}

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

/* --- Related Posts --- */
.related-posts {
    max-width: var(--max-width);
    margin: 3rem auto;
    padding: 3rem var(--gap);
    border-top: 1px solid var(--border);
}

.related-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* --- Tag Page --- */
.tag-header {
    text-align: center;
    padding: 4rem var(--gap) 2rem;
}

.tag-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tag-description {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 0.75rem;
}

.tag-count {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* --- Page --- */
.page-header {
    text-align: center;
    padding: 4rem var(--gap) 2rem;
}

.page-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

/* --- Subscribe CTA --- */
.subscribe-cta {
    text-align: center;
    padding: 4rem var(--gap);
    margin: 3rem 0 0;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #2D1B69 100%);
    color: var(--white);
}

.cta-inner { max-width: 500px; margin: 0 auto; }

.cta-inner h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.cta-inner p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.btn-subscribe-large {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem 2.5rem;
    background: var(--violet);
    color: var(--white);
    border-radius: 100px;
    transition: background 0.2s, transform 0.2s;
}

.btn-subscribe-large:hover { background: var(--violet-light); transform: translateY(-2px); }

/* --- Pagination --- */
.pagination {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem var(--gap);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.pagination a {
    font-weight: 500;
    color: var(--violet);
    transition: opacity 0.2s;
}

.pagination a:hover { opacity: 0.7; }

.pagination-info {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    margin-top: 3rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gap);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--violet-deep);
    display: block;
    margin-bottom: 0.5rem;
}

.footer-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-nav a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.footer-nav a:hover { color: var(--violet); }

.footer-subscribe p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.footer-meta {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-light);
}

.footer-meta a { color: var(--violet); }

/* --- Responsive --- */
@media (max-width: 900px) {
    .grid-inner, .related-grid { grid-template-columns: repeat(2, 1fr); }
    .featured-post { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    :root { --gap: 1.25rem; }
    .grid-inner, .related-grid { grid-template-columns: 1fr; }
    .site-nav { display: none; }
    .menu-toggle { display: block; }
    .hero { padding: 3rem var(--gap) 2.5rem; }
    .hero-title { font-size: 2.5rem; }
    .post-title { font-size: 1.75rem; }
}

/* --- Ghost specific: Bookmark cards, Gallery, etc. --- */
.kg-bookmark-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin: 2rem 0;
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.kg-bookmark-content { padding: 1.25rem; flex: 1; }
.kg-bookmark-title { font-weight: 600; margin-bottom: 0.5rem; }
.kg-bookmark-description { font-size: 0.875rem; color: var(--text-secondary); }
.kg-bookmark-metadata { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; font-size: 0.75rem; }
.kg-bookmark-icon { width: 16px; height: 16px; }
.kg-bookmark-author, .kg-bookmark-publisher { color: var(--text-light); }
.kg-bookmark-thumbnail { width: 200px; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.kg-gallery-container { display: flex; flex-direction: column; gap: 0.75rem; margin: 2rem 0; }
.kg-gallery-row { display: flex; gap: 0.75rem; }
.kg-gallery-image img { border-radius: 4px; }

.kg-callout-card {
    background: var(--violet-bg);
    border-left: 3px solid var(--violet);
    padding: 1.25rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 2rem 0;
}

.kg-button-card { text-align: center; margin: 2rem 0; }
.kg-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--violet);
    color: var(--white);
    border-radius: 100px;
    font-weight: 600;
    transition: background 0.2s;
}

.kg-btn:hover { background: var(--violet-deep); }
