/* Global site footer, shared by every page. */

.site-footer {
    margin-top: 80px;
    background: #292d33;
    color: #b9bec6;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

.site-footer__inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 24px 30px;
}

.site-footer__brand {
    min-width: 0;
    max-width: 520px;
}

.site-footer__logo {
    display: inline-block;
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.site-footer__tagline {
    margin: 10px 0 0;
    color: #d6d9de;
    font-size: 13px;
}

.site-footer__categories {
    flex-shrink: 0;
    text-align: right;
}

.site-footer__categories-label {
    margin: 2px 0 10px;
    color: #858c95;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-footer__categories-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px 14px;
}

.site-footer__category {
    color: #b9bec6;
    font-size: 12.5px;
    text-decoration: none;
    white-space: nowrap;
}

.site-footer__category:hover {
    color: #ffffff;
    text-decoration: underline;
}

.site-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px 22px;
    border-top: 1px solid #383d45;
    color: #858c95;
    font-size: 12px;
}

.site-footer__bottom p {
    margin: 0;
}

.site-footer__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.site-footer__meta a {
    color: #b9bec6;
    text-decoration: none;
}

.site-footer__meta a:hover,
.site-footer__meta a:focus-visible {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-footer__meta span {
    color: #5f666f;
}

.site-footer a:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

@media (max-width: 760px) {
    .site-footer {
        margin-top: 56px;
    }

    .site-footer__inner {
        flex-direction: column;
        gap: 22px;
        padding: 30px 18px 24px;
    }

    .site-footer__categories {
        text-align: left;
    }

    .site-footer__categories-list {
        justify-content: flex-start;
    }

    .site-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 18px 20px;
    }
}

/* The fixed-height editor flows into the shared footer. */
body.layout-tool-page {
    height: auto;
    min-height: 100vh;
}

/* Keep the footer at the viewport edge on short pages. */
body:not(.ui-editor) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body:not(.ui-editor) > .container {
    flex: 1 0 auto;
}

body:not(.ui-editor) > .site-footer {
    margin-top: auto;
}


/* Keep short tool pages vertically centered in the first screen. */
body:not(.ui-editor) > .container {
    min-height: calc(100vh - var(--site-nav-height, 48px));
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
}

.faq-scroll-hint {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.96);
    color: #6b7280;
    font-size: 12px;
    line-height: 1;
    text-decoration: none;
    transform: translateX(-50%);
    box-shadow: 0 4px 16px rgba(17, 24, 39, 0.08);
}

.faq-scroll-hint[hidden] {
    display: none !important;
}

.faq-scroll-hint:hover {
    color: #111111;
    border-color: #d1d5db;
}

.faq-scroll-hint__icon,
.faq-scroll-hint__icon svg {
    display: block;
    width: 14px;
    height: 14px;
}

@keyframes faq-hint-nudge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

.faq-scroll-hint__icon {
    animation: faq-hint-nudge 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .faq-scroll-hint__icon { animation: none; }
}

@media (max-width: 640px) {
    .faq-scroll-hint {
        bottom: 16px;
    }
}

#faq-title {
    scroll-margin-top: 56px;
}

/* Editor-style pages also use the FAQ block as the footer separator. */
body.ui-editor > .site-footer {
    margin-top: 0;
}


/* Category landing pages: centered heading with more space above than below. */
body.category-page .page-header {
    width: 100%;
    margin: 32px auto 24px;
    text-align: center;
}

body.category-page .page-title {
    text-align: center;
    transform-origin: center;
}

body.category-page .page-description {
    text-align: center;
}

/* Category landing pages are short; let the footer follow the cards instead of reserving a viewport. */
body.category-page {
    min-height: 100vh;
}

body.category-page > .container {
    min-height: 0;
    flex: 1 0 auto;
}

body.category-page > .site-footer {
    margin-top: 0;
}
