/**
 * DocuPoint Custom Styles
 * Based on DocuPoint Design Guide v4.2 (Josefin Sans Edition)
 *
 * Color Palette:
 * - Deep Slate:     #36565F (dark mode bg, light mode headlines)
 * - Ocean Steel:    #5F8190 (secondary text, hover states)
 * - Ocean Steel Lt: #8BA8B8 (dark mode links, lead text)
 * - Cloud Mist:     #E2F0F0 (light mode bg, dark mode text)
 * - Jet Black:      #141414 (light mode text)
 * - Deep Saffron:   #FF9932 (CTA accent)
 */

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
    /* DocuPoint Color Palette */
    --dp-deep-slate: #36565F;
    --dp-ocean-steel: #5F8190;
    --dp-ocean-steel-light: #8BA8B8;
    --dp-cloud-mist: #E2F0F0;
    --dp-jet-black: #141414;
    --dp-deep-saffron: #FF9932;

    /* Light Mode (default) */
    --dp-bg: var(--dp-cloud-mist);
    --dp-text: var(--dp-jet-black);
    --dp-text-secondary: var(--dp-ocean-steel);
    --dp-headline: var(--dp-deep-slate);
    --dp-link: var(--dp-deep-slate);
    --dp-accent: var(--dp-deep-saffron);
}

/* Dark Mode - only triggered by explicit toggle */
html.dark-mode,
html.dark-mode body {
    --dp-bg: var(--dp-deep-slate);
    --dp-text: var(--dp-cloud-mist);
    --dp-text-secondary: var(--dp-cloud-mist);
    --dp-headline: var(--dp-cloud-mist);
    --dp-link: var(--dp-ocean-steel-light);
}

/* ==========================================================================
   Dark Mode Toggle Button
   ========================================================================== */

.gh-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.gh-theme-toggle .icon-sun {
    display: none;
}

.gh-theme-toggle .icon-moon {
    display: block;
}

html.dark-mode .gh-theme-toggle .icon-sun {
    display: block;
}

html.dark-mode .gh-theme-toggle .icon-moon {
    display: none;
}


/* ==========================================================================
   Content Width by Template
   ========================================================================== */

/* Content uses full available width - no max-width constraints */

/* ==========================================================================
   Typography Overrides (Josefin Sans Headlines)
   ========================================================================== */

h1, h2, h3, h4, h5, h6,
.gh-article-title {
    font-family: 'Josefin Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dp-headline);
}

h1, .gh-article-title {
    font-size: 2.25rem;
    line-height: 1.3;
    letter-spacing: 0.08em;
}

h2 {
    font-size: 1.5rem;
    line-height: 1.35;
    letter-spacing: 0.06em;
}

h3 {
    font-size: 1.2rem;
    line-height: 1.4;
    letter-spacing: 0.05em;
}

h4 {
    font-size: 1rem;
    line-height: 1.4;
    letter-spacing: 0.04em;
}

h5, h6 {
    font-size: 0.9rem;
    line-height: 1.4;
    letter-spacing: 0.04em;
}

/* Body text - Inter */
body,
.gh-content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.75;
    color: var(--dp-text);
    background-color: var(--dp-bg);
}

/* Secondary text */
.gh-article-excerpt,
.gh-article-meta,
figcaption {
    color: var(--dp-text-secondary);
}

/* Code blocks - JetBrains Mono */
code, pre, kbd {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

pre {
    font-size: 0.875rem;
}

code:not(pre code) {
    font-size: 0.9em;
}

/* ==========================================================================
   Links and Accents
   ========================================================================== */

a {
    color: var(--dp-link);
}

a:hover {
    color: var(--dp-accent);
}

/* Tags */
.gh-article-tag {
    color: var(--dp-deep-slate);
    background: rgba(54, 86, 95, 0.1);
}

html.dark-mode .gh-article-tag {
    color: var(--dp-cloud-mist);
    background: rgba(233, 241, 241, 0.2);
}


/* CTA Buttons */
.gh-btn,
.gh-portal-btn,
[data-portal] {
    background-color: var(--dp-accent) !important;
    color: var(--dp-jet-black) !important;
}

.gh-btn:hover,
.gh-portal-btn:hover {
    background-color: #e88a2d !important;
}

/* ==========================================================================
   Table of Contents (Tocbot)
   ========================================================================== */

.toc-wrapper {
    grid-column: 10 / span 3;
    position: sticky;
    top: 100px;
    align-self: start;
    display: none;
}

@media (min-width: 1200px) {
    .toc-wrapper {
        display: block;
    }
}

.toc-link {
    color: var(--dp-ocean-steel);
    font-size: 0.875rem;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}

.toc-link:hover,
.is-active-link {
    color: var(--dp-accent);
}

/* ==========================================================================
   Reading Progress Bar
   ========================================================================== */

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 9999;
    appearance: none;
    border: none;
}

.progress-bar::-webkit-progress-bar {
    background: transparent;
}

.progress-bar::-webkit-progress-value {
    background: var(--dp-accent);
}

.progress-bar::-moz-progress-bar {
    background: var(--dp-accent);
}

/* ==========================================================================
   Header & Navigation Dark Mode
   ========================================================================== */

html.dark-mode .gh-head,
html.dark-mode .gh-foot {
    background-color: var(--dp-bg);
    color: var(--dp-text);
}

html.dark-mode .gh-head-logo,
html.dark-mode .gh-head-menu a,
html.dark-mode .gh-foot a {
    color: var(--dp-text);
}

/* ==========================================================================
   Typographic Feed Layout (Bryce Bladon style)
   ========================================================================== */

.has-typographic-feed .gh-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 720px;
    margin: 0 auto;
}

.has-typographic-feed .gh-card {
    padding: 2rem 0;
    border-bottom: 1px solid rgba(54, 86, 95, 0.15);
}

.has-typographic-feed .gh-card:last-child {
    border-bottom: none;
}

.has-typographic-feed .gh-card-link {
    display: block;
    text-decoration: none;
}

.has-typographic-feed .gh-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.has-typographic-feed .gh-card-date {
    color: var(--dp-text-secondary);
}

.has-typographic-feed .gh-card-tag {
    color: var(--dp-accent);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.has-typographic-feed .gh-card-title {
    font-size: 1.5rem;
    margin: 0 0 0.75rem 0;
    color: var(--dp-headline);
    transition: color 0.2s ease;
}

.has-typographic-feed .gh-card-link:hover .gh-card-title {
    color: var(--dp-accent);
}

.has-typographic-feed .gh-card-excerpt {
    color: var(--dp-text-secondary);
    font-size: 1em;
    line-height: 1.6;
    margin: 0;
}

/* Dark mode typographic feed */
html.dark-mode .has-typographic-feed .gh-card {
    border-bottom-color: rgba(226, 240, 240, 0.15);
}

/* ==========================================================================
   Archive Page Styles
   ========================================================================== */

.gh-archive-header {
    text-align: center;
    padding: 4rem 0 2rem;
}

.gh-archive-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.gh-archive-description {
    color: var(--dp-text-secondary);
    font-size: 1.125rem;
}

.gh-archive-year {
    font-size: 1.25rem;
    color: var(--dp-headline);
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--dp-accent);
    display: inline-block;
}

.gh-archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gh-archive-item {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(54, 86, 95, 0.1);
}

.gh-archive-item:hover {
    background: rgba(54, 86, 95, 0.03);
}

.gh-archive-date {
    flex-shrink: 0;
    width: 80px;
    color: var(--dp-text-secondary);
    font-size: 0.875rem;
}

.gh-archive-link {
    color: var(--dp-headline);
    text-decoration: none;
    font-weight: 500;
}

.gh-archive-link:hover {
    color: var(--dp-accent);
}

/* ==========================================================================
   Minimal Tagline (Stratechery/Daring Fireball style)
   ========================================================================== */

.gh-tagline {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid rgba(54, 86, 95, 0.15);
}

.gh-tagline-text {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--dp-text-secondary);
    font-style: italic;
}

html.dark-mode .gh-tagline {
    border-bottom-color: rgba(226, 240, 240, 0.15);
}

/* ==========================================================================
   Subscribe CTA (inline between posts)
   ========================================================================== */

.gh-subscribe-cta {
    max-width: 720px;
    margin: 1rem 0rem;
    padding: 2rem;
    background: rgba(54, 86, 95, 0.05);
    border-radius: 8px;
    text-align: left;
}

.gh-subscribe-title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
    color: var(--dp-headline);
}

.gh-subscribe-description {
    font-size: 1rem;
    color: var(--dp-text-secondary);
    margin: 0 0 1rem 0;
}

.gh-subscribe-form {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.gh-subscribe-cta .gh-subscribe-input {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(54, 86, 95, 0.2);
    border-radius: 4px;
    font-size: 1rem;
    background: var(--dp-bg);
    color: var(--dp-text);
}

.gh-subscribe-cta .gh-subscribe-input:focus {
    outline: none;
    border-color: var(--dp-accent);
}

.gh-subscribe-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
    line-height: 1.5;
}

.gh-subscribe-cta .gh-subscribe-input,
.gh-subscribe-cta .gh-subscribe-btn {
    height: 48px;
}

html.dark-mode .gh-subscribe-cta {
    background: rgba(226, 240, 240, 0.05);
}

html.dark-mode .gh-subscribe-cta .gh-subscribe-input {
    border-color: rgba(226, 240, 240, 0.2);
}

