/* =====================================================================
   Global site chrome (header + footer)
   Inspired by https://iot-obniz-com.pages.dev/
   Self-contained — no Tailwind. Scoped under .site-header / .site-footer
   so it doesn't leak into Bootstrap doc styles.
   ===================================================================== */

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1050;
    background: #ffffff;
    border-bottom: 1px solid #f3f4f6;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
        "Yu Gothic Medium", "游ゴシック Medium", "ヒラギノ角ゴ Pro W3",
        "メイリオ", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.site-header__container {
    width: 100%;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4.5rem;
    gap: 1.25rem;
}
@media (min-width: 640px) {
    .site-header__container { padding: 0 1.75rem; }
}
@media (min-width: 1024px) {
    .site-header__container { padding: 0 2.5rem; }
}
@media (min-width: 1536px) {
    .site-header__container { padding: 0 3rem; }
}

.site-header__logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.site-header__logo img {
    height: 2rem;
    width: auto;
    display: block;
}

/* desktop nav */
.site-header__nav {
    display: none;
    align-items: center;
    flex: 1;
    margin-left: 1.5rem;
}
@media (min-width: 1024px) {
    .site-header__nav { display: flex; }
}

.site-header__nav-item {
    position: relative;
}
.site-header__nav-button,
.site-header__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.875rem;
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.5;
    transition: color 0.15s ease;
}
.site-header__nav-button:hover,
.site-header__nav-link:hover,
.site-header__nav-button:focus,
.site-header__nav-link:focus {
    color: #2563eb;
    text-decoration: none;
    outline: none;
}
.site-header__nav-button svg,
.site-header__nav-link svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* dropdown */
.site-header__dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    padding-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
    z-index: 50;
    pointer-events: none;
}
.site-header__nav-item:hover .site-header__dropdown,
.site-header__nav-item:focus-within .site-header__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.site-header__dropdown-inner {
    background: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -4px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    min-width: 240px;
}
.site-header__dropdown--wide .site-header__dropdown-inner { min-width: 280px; }
.site-header__dropdown-link {
    display: block;
    padding: 0.625rem 1.125rem;
    font-size: 0.9375rem;
    color: #374151;
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease;
}
.site-header__dropdown-link:hover,
.site-header__dropdown-link:focus {
    background: #f9fafb;
    color: #2563eb;
    text-decoration: none;
    outline: none;
}
.site-header__external-icon {
    font-size: 0.8125rem;
    color: #9ca3af;
    margin-left: 0.25rem;
}

/* CTA cluster */
.site-header__cta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.site-header__cta-link {
    display: none;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color 0.15s ease;
}
@media (min-width: 640px) {
    .site-header__cta-link { display: inline-flex; }
}
.site-header__cta-link:hover {
    color: #111827;
    text-decoration: none;
}
.site-header__cta-link svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.15s ease;
}
.site-header__cta-link:hover svg { transform: translateX(2px); }

.site-header__cta-button {
    display: none;
    align-items: center;
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: #111827;
    border-radius: 0.5rem;
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
    transition: background 0.15s ease;
}
@media (min-width: 640px) {
    .site-header__cta-button { display: inline-flex; }
}
.site-header__cta-button:hover,
.site-header__cta-button:focus {
    background: #1f2937;
    color: #ffffff;
    text-decoration: none;
    outline: none;
}

.site-header__lang {
    position: relative;
}
.site-header__lang-button {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: #4b5563;
    background: transparent;
    border: 0;
    cursor: pointer;
    line-height: 1.5;
}
.site-header__lang-button:hover { color: #111827; }
.site-header__lang-button svg { width: 1rem; height: 1rem; }
.site-header__lang-menu {
    position: absolute;
    right: 0;
    top: 100%;
    padding-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
    pointer-events: none;
    z-index: 50;
}
.site-header__lang:hover .site-header__lang-menu,
.site-header__lang:focus-within .site-header__lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.site-header__lang-menu-inner {
    background: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    min-width: 140px;
}

.site-header__mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: transparent;
    border: 0;
    color: #4b5563;
    cursor: pointer;
}
.site-header__mobile-toggle:hover { color: #111827; }
.site-header__mobile-toggle svg { width: 1.5rem; height: 1.5rem; }
@media (min-width: 1024px) {
    .site-header__mobile-toggle { display: none; }
}

/* mobile menu (collapsed by default) */
.site-header__mobile-menu {
    display: none;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    max-height: 70vh;
    overflow-y: auto;
}
.site-header__mobile-menu.is-open { display: block; }
@media (min-width: 1024px) {
    .site-header__mobile-menu { display: none !important; }
}
.site-header__mobile-inner {
    width: 100%;
    margin: 0 auto;
    padding: 1rem 1.25rem;
}
@media (min-width: 640px) {
    .site-header__mobile-inner { padding: 1rem 1.75rem; }
}
.site-header__mobile-section { margin-bottom: 1rem; }
.site-header__mobile-section:last-child { margin-bottom: 0; }
.site-header__mobile-heading {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}
.site-header__mobile-link {
    display: block;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    color: #374151;
    text-decoration: none;
    border-radius: 0.375rem;
    line-height: 1.5;
}
.site-header__mobile-link:hover {
    color: #2563eb;
    background: #f9fafb;
    text-decoration: none;
}
.site-header__mobile-divider {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 0.75rem 0;
}
.site-header__mobile-cta-row {
    padding-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.site-header__mobile-cta-row .site-header__cta-button,
.site-header__mobile-cta-row .site-header__cta-link {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    padding: 0.625rem 1rem;
}

/* ---------- Footer ---------- */
.site-footer {
    background: #111827;
    color: #d1d5db;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
        "Yu Gothic Medium", "游ゴシック Medium", "ヒラギノ角ゴ Pro W3",
        "メイリオ", sans-serif;
    -webkit-font-smoothing: antialiased;
}
.site-footer__container {
    width: 100%;
    margin: 0 auto;
    padding: 3rem 1.25rem;
}
@media (min-width: 640px) {
    .site-footer__container { padding-left: 1.75rem; padding-right: 1.75rem; }
}
@media (min-width: 1024px) {
    .site-footer__container { padding: 4rem 2.5rem; }
}
@media (min-width: 1536px) {
    .site-footer__container { padding: 4.5rem 3rem; }
}

.site-footer__columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}
@media (min-width: 768px) {
    .site-footer__columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .site-footer__columns { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.site-footer__heading {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1.125rem;
    letter-spacing: 0.005em;
}
.site-footer__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.site-footer__list li { margin: 0; padding: 0; }
.site-footer__link {
    font-size: 0.9375rem;
    color: #9ca3af;
    text-decoration: none;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-align: left;
    line-height: 1.55;
    transition: color 0.15s ease;
}
.site-footer__link:hover,
.site-footer__link:focus {
    color: #ffffff;
    text-decoration: none;
    outline: none;
}
.site-footer__external-icon {
    font-size: 0.8125rem;
    margin-left: 0.125rem;
}

.site-footer__bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
@media (min-width: 640px) {
    .site-footer__bottom { flex-direction: row; }
}
.site-footer__bottom-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.site-footer__brand img {
    height: 2rem;
    width: auto;
    filter: brightness(0) invert(1);
    display: block;
}
.site-footer__sns {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.site-footer__sns-link {
    color: #9ca3af;
    transition: color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.site-footer__sns-link:hover,
.site-footer__sns-link:focus {
    color: #ffffff;
    text-decoration: none;
    outline: none;
}
.site-footer__sns-link svg {
    width: 1.5rem;
    height: 1.5rem;
    display: block;
    fill: currentColor;
}
.site-footer__bottom-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.site-footer__copyright {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
}

/* offset for the docs body that previously assumed a 58px fixed header */
body.docs-template-default { padding-top: 0 !important; }
