/* Public layout contract: every page uses the same outer grid. */
:root {
    --site-max-width: 72rem;
    --site-gutter: 1rem;
    --site-nav-gap: clamp(0.7rem, 1vw, 0.95rem);
}

.site-container {
    width: 100%;
    max-width: var(--site-max-width);
    margin-inline: auto;
    padding-inline: var(--site-gutter);
}

.site-reading {
    width: 100%;
    max-width: 56rem;
    margin-inline: auto;
}

.site-reading--article {
    max-width: 48rem;
}

.site-footer__groups {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.site-footer__logo {
    margin-left: -3px !important;
}

.site-footer__groups > *,
.site-footer__groups form,
.site-footer__groups form input {
    min-width: 0;
}

.site-footer__groups form {
    display: flex;
    gap: 0.5rem;
}

.site-footer__groups form input[type="email"] {
    flex: 1 1 0%;
    padding: 0.375rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    background-color: #fff;
    color: #111;
    font-size: 0.75rem;
    line-height: 1rem;
    transition: border-color 150ms ease;
}

.site-footer__groups form input[type="email"]::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.site-footer__groups form input[type="email"]:focus {
    border-color: #111;
    outline: none;
}

.site-footer__groups form button[type="submit"] {
    flex: 0 0 auto;
    padding: 0.375rem 0.75rem;
    border: 0;
    border-radius: 0.25rem;
    background-color: #111;
    color: #fff;
    font-size: 0.75rem;
    line-height: 1rem;
    cursor: pointer;
    transition: background-color 150ms ease;
}

.site-footer__groups form button[type="submit"]:hover {
    background-color: #1f2937;
}

.site-footer__groups form .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.not-found-content {
    max-width: 28rem;
}

h1,
h2,
h3,
h4 {
    letter-spacing: -0.02em;
    text-wrap: balance;
}

h2 {
    margin-block-start: 2rem;
}

.site-nav-links {
    gap: var(--site-nav-gap);
}

.site-nav-links > a.nav-contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 2.125rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid transparent;
    line-height: 1.25rem;
    white-space: nowrap;
}

html[lang="sr"] .site-nav-links > a.nav-contact-link {
    padding: 5px;
}

@media (min-width: 640px) {
    :root {
        --site-gutter: 1.5rem;
    }
}

@media (min-width: 48rem) {
    .site-footer__groups {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    :root {
        --site-gutter: 2rem;
    }
}

#mobile-menu-btn {
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background-color: #fff;
    color: #111;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease;
}

#mobile-menu-btn:hover,
#mobile-menu-btn[aria-expanded="true"] {
    border-color: #d1d5db;
    background-color: #f9fafb;
}

#mobile-menu-btn:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

#mobile-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: var(--site-gutter);
    z-index: 60;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.3rem;
    width: min(38rem, calc(100vw - 2rem));
    max-height: calc(100vh - 6rem);
    max-height: calc(100dvh - 6rem);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.875rem;
    background-color: #fff;
    box-shadow: 0 16px 40px rgb(17 24 39 / 14%);
}

#mobile-menu.hidden {
    display: none !important;
}

#mobile-menu .site-mobile-menu__link {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
    color: #4b5563;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.25rem;
    text-decoration: none;
    transition: background-color 150ms ease, color 150ms ease;
}

#mobile-menu .site-mobile-menu__link:hover,
#mobile-menu .site-mobile-menu__link:focus-visible,
#mobile-menu .site-mobile-menu__subnav > a:hover,
#mobile-menu .site-mobile-menu__subnav > a:focus-visible {
    background-color: #f9fafb;
    color: #111;
}

#mobile-menu .site-mobile-menu__link:focus-visible,
#mobile-menu .site-mobile-menu__group-link:focus-visible,
#mobile-menu .site-mobile-menu__subnav > a:focus-visible,
#mobile-menu .site-mobile-menu__contact:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

#mobile-menu .site-mobile-menu__meta {
    color: #6b7280;
    font-size: 0.8125rem;
}

#mobile-menu .site-mobile-menu__group {
    min-width: 0;
    padding: 0.5rem;
    border: 1px solid #f3f4f6;
    border-radius: 0.75rem;
    background-color: #f9fafb;
}

#mobile-menu .site-mobile-menu__group-link {
    display: flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    color: #111;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25rem;
    text-decoration: none;
    transition: background-color 150ms ease, color 150ms ease;
}

#mobile-menu .site-mobile-menu__group-link:hover {
    background-color: #f3f4f6;
}

#mobile-menu .site-mobile-menu__group [data-analysis-nav-link] {
    max-width: 100%;
    margin-bottom: 0.25rem;
    text-decoration: none;
}

#mobile-menu .site-mobile-menu__subnav {
    display: grid;
    gap: 0.125rem;
    margin-top: 0.25rem;
    padding-left: 0.65rem;
    border-left: 1px solid #d1d5db;
}

#mobile-menu .site-mobile-menu__subnav > a {
    display: flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.5rem;
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.25rem;
    text-decoration: none;
    transition: background-color 150ms ease, color 150ms ease;
}

#mobile-menu .site-mobile-menu__search {
    grid-column: 1 / -1;
    min-width: 0;
    padding-block: 0.25rem;
}

#mobile-menu .site-mobile-menu__search form {
    display: flex;
    width: 100%;
}

#mobile-menu .site-mobile-menu__search input[type="search"] {
    box-sizing: border-box;
    flex: 1 1 0%;
    min-width: 0;
    height: 2.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.625rem 0 0 0.625rem;
    background-color: #fff;
    color: #111;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

#mobile-menu .site-mobile-menu__search input[type="search"]:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

#mobile-menu .site-mobile-menu__search button[type="submit"] {
    display: inline-flex;
    flex: 0 0 2.75rem;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    padding: 0.5rem;
    border-radius: 0 0.625rem 0.625rem 0;
    background-color: #111;
    color: #fff;
    cursor: pointer;
    transition: background-color 150ms ease;
}

#mobile-menu .site-mobile-menu__search button[type="submit"]:hover {
    background-color: #1f2937;
}

#mobile-menu .site-mobile-menu__search button[type="submit"] svg {
    display: block;
    width: 1rem;
    height: 1rem;
}

#mobile-menu .site-mobile-menu__contact {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0;
    background-color: #111;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25rem;
    text-align: center;
    text-decoration: none;
    transition: background-color 150ms ease;
}

#mobile-menu .site-mobile-menu__contact:hover {
    background-color: #1f2937;
}

@media (min-width: 640px) and (max-width: 1023px) {
    #mobile-menu {
        width: min(40rem, calc(100vw - 3rem));
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    #mobile-menu-btn {
        display: grid !important;
    }

    .site-nav-links {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    #mobile-menu,
    #mobile-menu-btn {
        display: none !important;
    }

    .site-nav-links {
        display: flex !important;
    }
}

/* Keep dark actions readable even when the utility bundle is loaded late. */
button.bg-dark,
a.bg-dark,
button.bg-gray-900,
a.bg-gray-900,
button.bg-black,
a.bg-black {
    color: #fff;
}