/* Responsive-only rules. The 1920x1080 layout is intentionally unchanged. */
@media (max-width: 1799px) {
    .navbar,
    .content {
        margin-left: 12%;
        margin-right: 12%;
    }

    .content {
        height: auto;
        min-height: calc(100vh - 170px);
        padding-bottom: 145px; /* fixed-footer clearance */
        overflow-wrap: anywhere;
    }

    /* Decorative embeds shouldn't float over the main content on laptops. */
    #nerdtest,
    #john {
        position: static;
        left: auto;
        top: auto;
        transform: none;
        display: block;
        max-width: 100%;
        margin: 12px auto;
    }

    .melon-stamp {
        position: static;
        display: block;
        width: min(200px, 40%);
        max-width: 100%;
        margin: 14px auto;
    }

    .sillyring,
    .sillyring iframe,
    #bucket-webring {
        max-width: 100%;
    }

    /* Maintain image-map click coordinates instead of scaling the image. */
    #noaiwebring {
        max-width: 100%;
        overflow-x: auto;
    }
}

@media (max-width: 900px) {
    .navbar {
        margin: 0 10px;
        flex-wrap: wrap;
        gap: 8px;
        overflow: visible;
    }

    .navbar div {
        padding: 8px;
    }

    .navbar-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 8px 18px;
        height: auto;
        min-width: 0;
    }

    .navbar-list a {
        padding-right: 0;
    }

    .navbar-list a:last-child {
        float: none !important; /* overrides the legacy inline float */
    }

    #navbar-clock,
    #statuscafe {
        position: static;
        flex: 1 1 100%;
        width: auto;
        max-width: 100%;
        min-width: 0;
        margin: 0 auto;
    }

    #navbar-clock {
        animation: none;
        justify-self: center;
    }

    #statuscafe {
        overflow-wrap: anywhere;
    }

    .content {
        margin: 10px;
        padding: 12px;
        height: auto;
        min-height: 0;
    }

    .content h1 {
        font-size: clamp(1.35rem, 5.5vw, 2rem);
        overflow-wrap: anywhere;
    }

    .content p {
        margin: 18px 0 0;
        font-size: 16px;
    }

    .content > img:first-child,
    .content p img,
    .sillyring img {
        max-width: 100%;
        height: auto;
    }

    .content iframe {
        max-width: 100%;
    }

    .content #nerdtest img {
        max-width: 100%;
        height: auto;
    }

    .opti-note,
    .counterbox,
    .imood {
        position: static;
        margin: 0;
        text-align: center;
    }

    .footer .imood {
        align-self: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    #navbar-clock {
        animation: none;
    }
}
