/*
 * Light CMS Custom Styles
 * Edit this file to customize the appearance of your published site
 */

/* === Font Size Override === */
/* Override Pico CSS responsive font sizing for a smaller base size */
:root {
    --pico-font-size: 87.5%; /* 14px base (87.5% of 16px) */
}

/* Desktop font sizes - gradually increase but stay smaller than default */
@media (min-width: 576px) {
    :root {
        --pico-font-size: 87.5%; /* ~14px */
    }
}

@media (min-width: 768px) {
    :root {
        --pico-font-size: 93.75%; /* ~15px */
    }
}

@media (min-width: 1024px) {
    :root {
        --pico-font-size: 93.75%; /* ~15px */
    }
}

@media (min-width: 1280px) {
    :root {
        --pico-font-size: 100%; /* 16px */
    }
}

@media (min-width: 1536px) {
    :root {
        --pico-font-size: 100%; /* 16px */
    }
}

/* === Header Image (Page Content) === */
.header-image-wrapper {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
}

.header-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    object-position: center;
    display: block;
}

@media (max-width: 768px) {
    .header-image-wrapper,
    .header-image {
        max-height: 250px;
    }
}

/* Full-width header image */
.header-image-wrapper.header-image-full {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
}

/* === Layout === */
html {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 2rem;
    flex: 1 0 auto;
    background: transparent;
}

/* === Site Header (Sticky) === */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--pico-background-color);
    border-bottom: 1px solid var(--pico-muted-border-color);
    padding: 0 0 1rem 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header h1 {
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.site-header h1 a {
    text-decoration: none;
    color: inherit;
}

.site-header h1 a:hover {
    color: inherit;
    opacity: 0.8;
}

.site-subtitle {
    margin: 0;
    margin-top: -0.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--pico-muted-color);
    font-weight: normal;
}

/* === Main Navigation === */
.site-header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.site-header nav li {
    margin: 0;
}

/* Navigation Links - Button Style */
.site-header nav a {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 0.375rem;
    background: var(--pico-muted-border-color);
    color: var(--pico-color);
    transition: background-color 0.2s ease, color 0.2s ease;
    font-weight: normal;
}

.site-header nav a:hover {
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
    text-decoration: none;
}

/* === Breadcrumbs === */
.site-header .breadcrumbs {
    margin-top: 0.75rem;
    margin-bottom: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--pico-muted-border-color);
    font-size: 0.85rem;
    color: var(--pico-muted-color);
}

.breadcrumbs a {
    text-decoration: none;
    color: var(--pico-muted-color);
}

.breadcrumbs a:hover {
    color: var(--pico-primary);
    text-decoration: none;
}

/* === Main Content Layout === */
main.has-sidebar {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 2rem;
    align-items: start;
}

.main-content {
    min-width: 0; /* Prevents grid blowout */
    order: 1;
}

/* === Sidebar === */
.sidebar {
    position: sticky;
    top: 20px;
    order: 2;
}

/* === Section Navigation (in sidebar) === */
.section-nav {
    background: var(--pico-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 0.5rem;
    padding: 1rem;
}

.section-nav h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
    font-size: 1rem;
    font-weight: 600;
}

.section-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.section-nav li {
    margin: 0;
}

/* Section Navigation Links */
.section-nav a,
.section-nav a:link,
.section-nav a:visited,
.section-nav a:hover,
.section-nav a:active,
.section-nav a:focus {
    display: block;
    padding: 0.4rem 0;
    --pico-text-decoration: none;
    text-decoration: none !important;
    -webkit-text-decoration: none !important;
    text-decoration-line: none !important;
    font-size: 0.85rem;
    line-height: 1.4;
    transition: color 0.2s ease, font-weight 0.2s ease;
}

.section-nav a,
.section-nav a:link,
.section-nav a:visited {
    color: var(--pico-muted-color);
    font-weight: normal;
}

.section-nav a:hover,
.section-nav a:focus,
.section-nav a:active {
    color: var(--pico-color);
    font-weight: 600;
}

/* === Links === */
/* Remove underlines from all links, use color change on hover */
a {
    text-decoration: none;
    color: var(--pico-primary);
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--pico-primary-hover);
    text-decoration: none;
}

/* Content area links should be distinguishable */
.content a {
    color: var(--pico-primary);
    font-weight: 500;
}

.content a:hover {
    color: var(--pico-primary-hover);
}

/* === Article Content === */
article {
    margin-bottom: 3rem;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.content {
    background: transparent;
}

.main-content {
    background: transparent;
}

/* === Code Blocks === */
pre {
    background: var(--pico-code-background-color);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

code {
    background: var(--pico-code-background-color);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

pre code {
    background: none;
    padding: 0;
}

/* === Content Sections === */
/* Use these classes with <div> in markdown for colored backgrounds */
.section {
    padding: 2rem;
    margin-left: -1rem;
    margin-right: -1rem;
    overflow: auto;
}

.section > *:first-child {
    margin-top: 0;
}

.section > *:last-child {
    margin-bottom: 0;
}

/* Dark backgrounds - light text */
.section-primary {
    background: var(--pico-primary-background);
}

.section-primary,
.section-primary h1, .section-primary h2, .section-primary h3,
.section-primary h4, .section-primary h5, .section-primary h6,
.section-primary p, .section-primary li, .section-primary span,
.section-primary strong, .section-primary em, .section-primary blockquote,
.section-primary td, .section-primary th, .section-primary label,
.section-primary small, .section-primary code {
    color: #fff !important;
}

.section-primary a {
    color: #fff !important;
    text-decoration: underline;
}

.section-secondary {
    background: var(--pico-secondary-background);
}

.section-secondary,
.section-secondary h1, .section-secondary h2, .section-secondary h3,
.section-secondary h4, .section-secondary h5, .section-secondary h6,
.section-secondary p, .section-secondary li, .section-secondary span,
.section-secondary strong, .section-secondary em, .section-secondary blockquote,
.section-secondary td, .section-secondary th, .section-secondary label,
.section-secondary small, .section-secondary code {
    color: #fff !important;
}

.section-secondary a {
    color: #fff !important;
    text-decoration: underline;
}

.section-dark {
    background: #1a1a2e;
}

.section-dark,
.section-dark h1, .section-dark h2, .section-dark h3,
.section-dark h4, .section-dark h5, .section-dark h6,
.section-dark p, .section-dark li, .section-dark span,
.section-dark strong, .section-dark em, .section-dark blockquote,
.section-dark td, .section-dark th, .section-dark label,
.section-dark small, .section-dark code {
    color: #f0f0f0;
}

.section-dark a {
    color: #8ab4f8;
}

.section-accent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.section-accent,
.section-accent h1, .section-accent h2, .section-accent h3,
.section-accent h4, .section-accent h5, .section-accent h6,
.section-accent p, .section-accent li, .section-accent span,
.section-accent strong, .section-accent em, .section-accent blockquote,
.section-accent td, .section-accent th, .section-accent label,
.section-accent small, .section-accent code {
    color: #ffffff;
}

.section-accent a {
    color: #ffffff;
    text-decoration: underline;
}

/* Light backgrounds - dark text */
.section-light {
    background: #f8f9fa;
}

.section-light,
.section-light h1, .section-light h2, .section-light h3,
.section-light h4, .section-light h5, .section-light h6,
.section-light p, .section-light li, .section-light span,
.section-light strong, .section-light em, .section-light blockquote,
.section-light td, .section-light th, .section-light label,
.section-light small, .section-light code {
    color: #1a1a1a;
}

.section-light a {
    color: var(--pico-primary);
}

.section-muted {
    background: var(--pico-muted-border-color);
}

.section-muted,
.section-muted h1, .section-muted h2, .section-muted h3,
.section-muted h4, .section-muted h5, .section-muted h6,
.section-muted p, .section-muted li, .section-muted span,
.section-muted strong, .section-muted em, .section-muted blockquote,
.section-muted td, .section-muted th, .section-muted label,
.section-muted small, .section-muted code {
    color: #1a1a1a;
}

.section-muted a {
    color: var(--pico-primary);
}

/* Full-width sections (break out of container) */
.section-full {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: calc(50vw - 50% + 1rem);
    padding-right: calc(50vw - 50% + 1rem);
}

@media (max-width: 768px) {
    .section {
        padding: 1.5rem 1rem;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .section-full {
        padding-left: calc(50vw - 50% + 0.5rem);
        padding-right: calc(50vw - 50% + 0.5rem);
    }
}

/* === Footer === */
footer {
    width: 100%;
    flex-shrink: 0;
    border-top: 1px solid var(--pico-muted-border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--pico-muted-color);
    font-size: 0.85rem;
    background: var(--pico-background-color);
}

footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

footer p {
    margin: 0;
}

/* === Responsive Design === */
@media (max-width: 1024px) {
    /* Stack sidebar below content on tablets and mobile */
    main.has-sidebar {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .sidebar {
        position: static;
    }

    .section-nav h2 {
        font-size: 0.95rem;
    }

    .section-nav a {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 10px;
    }

    .container {
        max-width: 100%;
        padding: 10px;
        padding-top: 1.5rem;
    }

    .site-header nav ul {
        gap: 0.25rem;
    }

    .site-header nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .site-header .breadcrumbs {
        font-size: 0.8rem;
    }

    footer {
        padding: 1.5rem 10px;
        font-size: 0.8rem;
    }
}
