/* ========================================
   CONTENT.CSS
   Rich content styles for project pages & articles
   ======================================== */

/* ----------------------------------------
   TYPOGRAPHY
   ---------------------------------------- */

/* Lead / Big Intro Paragraph */
.lead {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Stat Highlight */
.stat-highlight {
    display: inline-block;
    font-weight: 700;
    color: var(--accent);
}

[data-theme="dark"] .stat-highlight {
    color: #40e0d0;
}

/* Marked / Highlighted Text */
.marked {
    background: rgba(250, 204, 21, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
}

[data-theme="dark"] .marked {
    background: rgba(250, 204, 21, 0.2);
}

/* Accent Underline */
.underline-accent {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

[data-theme="dark"] .underline-accent {
    text-decoration-color: #40e0d0;
}

/* Inline Code */
code.inline {
    font-family: "SF Mono", "Fira Code", Menlo, monospace;
    font-size: 0.85em;
    background: rgba(75, 85, 99, 0.1);
    color: var(--accent);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--card-border);
}

[data-theme="dark"] code.inline {
    background: rgba(64, 224, 208, 0.1);
    color: #40e0d0;
}

/* ----------------------------------------
   MARKER HEADLINE - Hand-drawn highlighter effect
   ---------------------------------------- */

.marker-headline {
    position: relative;
    display: inline;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0.1rem 0.4rem;
    background: rgba(250, 204, 21, 0.3);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    border-radius: 4px;
}

[data-theme="dark"] .marker-headline {
    background: rgba(250, 204, 21, 0.25);
}

/* Color variations */
.marker-headline.marker-teal {
    background: rgba(64, 224, 208, 0.25);
}

.marker-headline.marker-pink {
    background: rgba(244, 114, 182, 0.3);
}

.marker-headline.marker-blue {
    background: rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .marker-headline.marker-blue {
    background: rgba(59, 130, 246, 0.2);
}

/* Edge-breaking variations */
.marker-headline.poke-left {
    margin-left: -2rem;
    padding-left: 2rem;
}

.marker-headline.poke-right {
    margin-right: -2rem;
    padding-right: 2rem;
}

.marker-headline.poke-both {
    display: inline-block;
    margin-left: -2rem;
    margin-right: -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Centered marker (for titles) */
.marker-headline-center {
    display: block;
    text-align: center;
}

.marker-headline-center .marker-headline {
    display: inline-block;
}

.marker-headline-center .article-title {
    margin-bottom: 0;
}

/* Centered subtitle (pairs with marker title) */
.article-header:has(.marker-headline-center) .article-subtitle {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 600;
    max-width: 500px;
    margin: 0.75rem auto 0 auto;
    line-height: 1.4;
}

/* ----------------------------------------
   IMPORTANT - Checkered margin accent
   ---------------------------------------- */

.important {
    position: relative;
}

.important::after {
    content: "";
    position: absolute;
    top: 0;
    right: -2rem;
    width: 8px;
    height: 100%;
    background: repeating-conic-gradient(
        var(--text-primary) 0% 25%, 
        var(--bg-primary) 0% 50%
    ) 50% / 8px 8px;
    opacity: 0.6;
}

[data-theme="dark"] .important::after {
    background: repeating-conic-gradient(
        #fff 0% 25%, 
        #000 0% 50%
    ) 50% / 8px 8px;
    opacity: 0.4;
}

/* ----------------------------------------
   SECTION LABELS
   ---------------------------------------- */

.section-label {
    font-size: 0.65rem;
    font-family: "SF Mono", "Fira Code", Menlo, monospace;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-label::before {
    content: "";
    height: 1px;
    width: 20px;
    background: var(--card-border);
}

/* ----------------------------------------
   PROJECT META BAR
   ---------------------------------------- */

.project-meta-bar {
    display: flex;
    gap: 2.5rem;
    margin: 1.5rem 0;
    padding: 1.25rem 0;
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}

.project-meta-bar .meta-item label {
    display: block;
    font-size: 0.65rem;
    font-family: "SF Mono", "Fira Code", Menlo, monospace;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.project-meta-bar .meta-item span {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.project-meta-bar .meta-item a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.project-meta-bar .meta-item a:hover {
    text-decoration: underline;
}

[data-theme="dark"] .project-meta-bar .meta-item a {
    color: #40e0d0;
}

/* ----------------------------------------
   BLOCKQUOTE
   ---------------------------------------- */

blockquote {
    border-left: 3px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--section-bg);
    border-radius: 0 12px 12px 0;
}

[data-theme="dark"] blockquote {
    border-left-color: #40e0d0;
}

blockquote p {
    margin-bottom: 0;
    font-style: italic;
    color: var(--text-secondary);
}

blockquote cite {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    font-style: normal;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ----------------------------------------
   TIP BOX
   ---------------------------------------- */

.tip-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}

[data-theme="dark"] .tip-box {
    background: rgba(64, 224, 208, 0.1);
    border-color: rgba(64, 224, 208, 0.25);
}

.tip-box-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #10b981;
}

[data-theme="dark"] .tip-box-header {
    color: #40e0d0;
}

.tip-box-header svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.tip-box-header span {
    font-size: 0.65rem;
    font-family: "SF Mono", "Fira Code", Menlo, monospace;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tip-box p {
    margin-bottom: 0;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* ----------------------------------------
   WARNING BOX
   ---------------------------------------- */

.warning-box {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}

[data-theme="dark"] .warning-box {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.25);
}

.warning-box-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #f59e0b;
}

[data-theme="dark"] .warning-box-header {
    color: #fbbf24;
}

.warning-box-header svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.warning-box-header span {
    font-size: 0.65rem;
    font-family: "SF Mono", "Fira Code", Menlo, monospace;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.warning-box p {
    margin-bottom: 0;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* ----------------------------------------
   CODE BLOCK
   ---------------------------------------- */

.content-pre {
    background: #1e1e2e;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

[data-theme="dark"] .content-pre {
    background: #0d0d14;
}

.content-pre code {
    font-family: "SF Mono", "Fira Code", Menlo, monospace;
    font-size: 0.85rem;
    color: #cdd6f4;
    line-height: 1.6;
}

.code-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c7086;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ----------------------------------------
   FIGURES & IMAGES
   ---------------------------------------- */

figure {
    margin: 2rem 0;
}

figure img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

figcaption {
    text-align: center;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

/* Image Placeholder (for demos/mockups) */
.img-placeholder {
    width: 100%;
    height: 220px;
    background: var(--section-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Image Row (3-up grid) */
.image-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.image-row img,
.image-row .img-placeholder {
    height: 140px;
    border-radius: 12px;
}

.image-row-caption {
    text-align: center;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

/* ----------------------------------------
   HORIZONTAL RULE
   ---------------------------------------- */

hr {
    border: none;
    height: 1px;
    background: var(--card-border);
    margin: 2.5rem 0;
}

/* ----------------------------------------
   CONTENT CARD
   ---------------------------------------- */

.content-card {
    background: var(--section-bg);
    border: 1px solid var(--section-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.content-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content-card p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content-card p:last-child {
    margin-bottom: 0;
}

/* ----------------------------------------
   TAGS (content context)
   ---------------------------------------- */

.content-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1rem 0;
}

.content-tag {
    font-size: 0.65rem;
    font-family: "SF Mono", "Fira Code", Menlo, monospace;
    color: var(--text-secondary);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.content-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

[data-theme="dark"] .content-tag:hover {
    border-color: #40e0d0;
    color: #40e0d0;
}

/* ----------------------------------------
   PROJECT BODY AUTO-STYLING
   Styles markdown output inside .project-body
   ---------------------------------------- */

/* First paragraph as lead */
.project-body > p:first-of-type,
.article-body > p:first-of-type {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Headings */
.project-body h2,
.article-body h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    scroll-margin-top: 90px;
}
.project-body h2:first-child,
.article-body h2:first-child {
    margin-top: 0;
}
.project-body h3,
.article-body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    scroll-margin-top: 90px;
}

/* Paragraphs */
.project-body p,
.article-body p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* Links */
.project-body a,
.article-body a {
    color: var(--accent);
    text-decoration: none;
}

.project-body a:hover,
.article-body a:hover {
    text-decoration: underline;
}

[data-theme="dark"] .project-body a,
[data-theme="dark"] .article-body a {
    color: #40e0d0;
}

/* Lists */
.project-body ul,
.project-body ol,
.article-body ul,
.article-body ol {
    margin-bottom: 1rem;
    padding-left: 1.25rem;
}

.project-body li,
.article-body li {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.project-body ul,
.article-body ul {
    padding-left: 1.5rem;
    list-style: none;
}

.project-body ul li,
.article-body ul li {
    padding-left: 0;
    position: relative;
}

/* Default arrow — normal */
.project-body ul li::before,
.article-body ul li::before {
    content: "→";
    position: absolute;
    left: -1.25rem;
    color: var(--accent);
}

/* First arrow — big, bold, outdented */
.project-body ul li:first-child::before,
.article-body ul li:first-child::before {
    left: -2.5rem;
    font-size: 1.75em;
    font-weight: 700;
    top: -0.35em;
}

/* Simple list — no big first arrow */
.project-body ul.simple li:first-child::before,
.article-body ul.simple li:first-child::before {
    left: -1.25rem;
    font-size: 1em;
    font-weight: 400;
    top: 0;
}

[data-theme="dark"] .project-body ul li::before,
[data-theme="dark"] .article-body ul li::before {
    color: #40e0d0;
}

/* Inline code */
.project-body code,
.article-body code {
    font-family: "SF Mono", "Fira Code", Menlo, monospace;
    font-size: 0.85em;
    background: rgba(75, 85, 99, 0.1);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--card-border);
}

[data-theme="dark"] .project-body code,
[data-theme="dark"] .article-body code {
    background: rgba(64, 224, 208, 0.1);
    color: #40e0d0;
}

/* Code blocks */
.project-body pre,
.article-body pre {
    background: #1e1e2e;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

[data-theme="dark"] .project-body pre,
[data-theme="dark"] .article-body pre {
    background: #0d0d14;
}

.project-body pre code,
.article-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: #cdd6f4;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Blockquotes */
.project-body blockquote,
.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--section-bg);
    border-radius: 0 12px 12px 0;
}

[data-theme="dark"] .project-body blockquote,
[data-theme="dark"] .article-body blockquote {
    border-left-color: #40e0d0;
}

.project-body blockquote p,
.article-body blockquote p {
    margin-bottom: 0;
    font-style: italic;
}

/* Horizontal rule */
.project-body hr,
.article-body hr {
    border: none;
    height: 1px;
    background: var(--card-border);
    margin: 2.5rem 0;
}

/* Images */
.project-body img,
.article-body img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    margin: 1.5rem 0;
}

/* Strong/Bold */
.project-body strong,
.article-body strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* ----------------------------------------
   ARTICLE CARDS (list page)
   ---------------------------------------- */

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.article-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--card-hover-shadow);
}

[data-theme="dark"] .article-card:hover {
    border-color: #40e0d0;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-family: "SF Mono", "Fira Code", Menlo, monospace;
    color: var(--text-secondary);
}

.article-card-tag {
    color: var(--accent);
}

[data-theme="dark"] .article-card-tag {
    color: #40e0d0;
}

.article-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.article-card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.article-card-link {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.article-card:hover .article-card-link {
    color: var(--accent);
}

[data-theme="dark"] .article-card:hover .article-card-link {
    color: #40e0d0;
}

/* ----------------------------------------
   ARTICLE (detail page)
   ---------------------------------------- */

.article {
    margin-bottom: 2rem;
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    font-family: "SF Mono", "Fira Code", Menlo, monospace;
    color: var(--text-secondary);
}

.article-tag {
    color: var(--accent);
}

[data-theme="dark"] .article-tag {
    color: #40e0d0;
}

.article-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.article-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

.article-body {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem 3.5rem;
    overflow: visible;
}

/* ----------------------------------------
   RESPONSIVE
   ---------------------------------------- */

@media (max-width: 768px) {
    .lead {
        font-size: 1.1rem;
    }

    .project-meta-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .image-row {
        grid-template-columns: 1fr;
    }

    .image-row img,
    .image-row .img-placeholder {
        height: 180px;
    }

    .article-title {
        font-size: 1.5rem;
    }
}