/* Custom styles for scherhak.com - Pico.css enhancements */

/* Custom color scheme - Gray for light mode, Orange for dark mode */
:root {
    --primary: #ff8c42;
    --primary-hover: #ff7026;
    --primary-focus: rgba(255, 140, 66, 0.125);
    --primary-inverse: #fff;
    --link-color: #495057;
    --link-hover-color: #212529;
    --headline-color: #343a40;
}

[data-theme="dark"] {
    --primary: #ffa366;
    --primary-hover: #ffb380;
    --primary-focus: rgba(255, 163, 102, 0.125);
    --primary-inverse: #000;
    --link-color: #ffa366;
    --link-hover-color: #ffb380;
    --headline-color: #ffa366;
}

/* Apply colors to links */
a {
    color: var(--link-color);
}

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

/* Apply colors to headlines */
h1, h2, h3, h4, h5, h6 {
    color: var(--headline-color);
}

/* Header Logo */
.header-logo {
    height: 40px;
    width: auto;
    display: block;
    margin: 0;
}

/* Improved spacing for kbd tags in tech stack */
kbd {
    margin: 0.25rem;
    display: inline-block;
}

/* Better grid layout for technology cards */
.grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

/* Ensure mark elements stand out for highlighted quotes */
mark {
    padding: 0.125rem 0.25rem;
}

/* Section styling with spacing, border and gradient background */
main.container > section {
    margin-bottom: 3rem;
    padding: 2rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 5px;
    background: linear-gradient(135deg,
        var(--pico-background-color) 0%,
        color-mix(in srgb, var(--pico-background-color) 95%, var(--pico-primary) 5%) 100%
    );
}

/* First section should have no top margin */
main.container > section:first-child {
    margin-top: 0;
}

/* Article sections in opinion pages */
main.container > article {
    margin-bottom: 3rem;
    padding: 2rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 5px;
    background: linear-gradient(135deg,
        var(--pico-background-color) 0%,
        color-mix(in srgb, var(--pico-background-color) 95%, var(--pico-primary) 5%) 100%
    );
}

/* Theme toggle button styling */
#theme-toggle {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    margin-bottom: 0;
    border: none;
    background: transparent;
}

#theme-toggle:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
    background: transparent;
}

/* Headlines size reduction - 1/3 smaller */
h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
}

.hero-p {
    margin-top: 1rem;
}

.article-meta {
    color: var(--pico-muted-color);
    font-size: 0.95rem;
}

.article-nav {
    gap: 0.5rem;
    flex-wrap: wrap;
}

.article-nav a[role="button"] {
    margin-bottom: 0;
}

.back-link {
    display: inline-block;
    margin-top: 1rem;
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    margin-bottom: 0;
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

.nav-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: auto;
    min-width: 250px;
    max-width: 80%;
    height: 100%;
    background: var(--pico-background-color);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 2rem 1.5rem;
}

.nav-sidebar.active {
    right: 0;
}

.nav-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.nav-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    margin-bottom: 0;
}

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

.nav-sidebar nav ul li {
    margin-bottom: 0;
    display: block;
    width: 100%;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.nav-sidebar nav ul li a {
    display: block;
    padding: 1rem 0;
    font-size: 1.1rem;
    text-decoration: none;
    width: 100%;
    white-space: nowrap;
}

/* Button styling with custom colors */
[role="button"].primary,
button.primary,
input[type="submit"].primary,
input[type="button"].primary,
input[type="reset"].primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--primary-inverse);
}

[role="button"].primary:hover,
button.primary:hover,
input[type="submit"].primary:hover,
input[type="button"].primary:hover,
input[type="reset"].primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

[role="button"].primary:focus,
button.primary:focus,
input[type="submit"].primary:focus,
input[type="button"].primary:focus,
input[type="reset"].primary:focus {
    box-shadow: 0 0 0 0.25rem var(--primary-focus);
}

[role="button"].outline,
button.outline,
input[type="button"].outline {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

[role="button"].outline:hover,
button.outline:hover,
input[type="button"].outline:hover {
    background-color: var(--primary-focus);
    border-color: var(--primary-hover);
    color: var(--primary-hover);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block !important;
    }

    /* Hide the entire second navigation list on mobile */
    header nav ul:nth-child(2) {
        display: none !important;
    }

    header nav {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    header nav > ul:first-child {
        margin: 0 !important;
    }
}
