/*------------------------------------*\
  #MEDIA QUERIES
\*------------------------------------*/

/* Mobile adjustments for 600px and below */
@media (max-width: 600px) {
    .essay-nav-container {
        flex-direction: column;
        align-items: center;
        padding: 0.25rem 0;
    }
    .essay-breadcrumb-list {
        justify-content: center;
    }
    .essay-breadcrumb-list li {
        white-space: normal;
        text-align: center;
        font-size: 0.9rem;
    }
    .essay-breadcrumb-list li:not(:first-child)::before {
        margin: 0 0.25rem;
    }
    .essay-home-link {
        margin: 0.25rem;
    }
    .essay-home-link img {
        width: 50px;
    }
    .essay-header.scrolled .essay-home-link img {
        width: 35px;
    }
    .author-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
        gap: 1.25rem;
    }
    .author-bio__image {
        width: 80px;
        height: 80px;
        margin-bottom: 0.75rem;
    }
    .author-bio__image img {
        width: 80px;
        height: 80px;
        object-fit: cover;
    }
    .author-bio__name {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
    .author-bio__description {
        font-size: 1rem;
        line-height: 1.5;
        margin-top: 0.25rem;
    }
    .author-bio__social {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 0.625rem !important;
        margin-top: 0.75rem !important;
    }
    .author-bio__social a {
        width: 32px !important;
        height: 32px !important;
        padding: 0.25rem !important;
    }
    .author-bio__social svg {
        width: 20px !important;
        height: 20px !important;
    }
    .article-footer {
        padding: 1.25rem 1rem;
        font-size: 0.7rem;
    }
    .article-footer__disclaimer {
        font-size: 0.7rem;
        padding: 0 0.5rem;
    }
    .article-footer__copyright {
        font-size: 0.65rem;
    }
}

/* Tablet adjustments for 768px and below */
@media (max-width: 768px) {
    :root {
        --padding: 1rem;
    }
    .site-intro {
        padding: 2rem var(--padding);
    }
    .site-intro h1 {
        font-size: 1.75rem;
    }
    .site-intro p {
        font-size: 1rem;
    }
    .primary-nav {
        padding: 0.75rem var(--padding);
    }
    .secondary-nav {
        padding: 0.5rem var(--padding);
        font-size: 0.75rem;
    }
    /* Essay and Forge header images, captions */
    .essay__header figure {
        aspect-ratio: 16 / 9;
        border-radius: var(--border-radius-md);
    }
    .essay__header figure figcaption {
        padding: 1.5rem;
        font-size: var(--font-size-sm);
    }
    .essay__content {
        font-size: var(--font-size-base);
    }
    .forge__header figure {
        aspect-ratio: 16 / 9;
        border-radius: var(--border-radius-md);
    }
}

/* Touch Device Handling: keep captions visible */
@media (hover: none) {
    .essay-card figure figcaption,
    .essay__header figure figcaption {
        transform: translateY(0);
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.85) 0%,
            rgba(0, 0, 0, 0.6) 50%,
            rgba(0, 0, 0, 0) 100%
        );
    }
}

/* Custom dark scrollbar for code blocks in dark mode */
@media (prefers-color-scheme: dark) {
    pre::-webkit-scrollbar-thumb {
        background: #434858;
    }
}


@media (max-width: 600px) {
    .essay-nav-container {
        flex-direction: column;
        align-items: center;
        padding: 0.25rem 0;
    }
    .essay-breadcrumb-list {
        justify-content: center;
    }
    .essay-breadcrumb-list li {
        white-space: normal;
        text-align: center;
        font-size: 0.9rem;
    }
    .essay-breadcrumb-list li:not(:first-child)::before {
        margin: 0 0.25rem;
    }
    .essay-home-link {
        margin: 0.25rem;
    }
    .essay-home-link img {
        width: 50px;
    }
    .essay-header.scrolled .essay-home-link img {
        width: 35px;
    }
}