/* =====================================================================
   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;
    /* No border/shadow here — the secondary-nav sits directly below and
       carries the single bottom divider so the two rows read as one nav. */
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

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

.site-header__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    flex-shrink: 0;
    text-decoration: none;
}
.site-header__logo:hover { text-decoration: none; }
.site-header__logo img {
    height: 1.75em;
    width: auto;
    display: block;
}
.site-header__logo-docs {
    font-size: 1.0625em;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: -0.01em;
    line-height: 1;
}

/* ---------- Centered search ---------- */
.site-header__search {
    position: relative;
    flex: 1 1 auto;
    max-width: 460px;
    margin: 0 auto;
}
/* Use absolute units here: Algolia instantsearch wrappers shrink the inherited
   font-size, so em-based sizing collapses. */
.site-header__searchbox .ais-SearchBox-form,
.site-header__searchbox .search-form {
    position: relative;
    height: 44px;
    margin: 0;
}
.site-header__searchbox .ais-SearchBox-form::before,
.site-header__searchbox .search-form::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    background: no-repeat center / contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}
.site-header__searchbox .ais-SearchBox-input,
.site-header__searchbox .search-input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 42px;
    font-size: 16px;
    line-height: 44px;
    color: #111827;
    background: #f3f4f6;
    border: 1px solid transparent;
    border-radius: 8px;
    box-shadow: none;
    outline: none;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.site-header__searchbox .ais-SearchBox-input::placeholder,
.site-header__searchbox .search-input::placeholder { color: #9ca3af; }
.site-header__searchbox .ais-SearchBox-input:focus,
.site-header__searchbox .search-input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.site-header__search-result {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.5em);
    z-index: 60;
    display: none;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.625em;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
@media (max-width: 575px) {
    .site-header__logo-docs { display: none; }
    .site-header__search { max-width: none; }
    .site-header__container { gap: 0.5em; padding: 0 0.875em; }
    .site-header__lang-label { display: none; }
    .site-header__cta { gap: 0.25em; }
    .site-header__cta-link { padding: 0.5em 0.5em; }
    .site-header__lang-button { padding: 0.5em 0.375em; }
}

/* desktop nav */
.site-header__nav {
    display: none;
    align-items: center;
    flex: 1;
    margin-left: 1.5em;
}
@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.25em;
    padding: 0.5em 0.875em;
    font-size: 1em;
    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.125em;
    height: 1.125em;
}

/* dropdown */
.site-header__dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    padding-top: 0.5em;
    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.5em;
    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.5em 0;
    min-width: 240px;
}
.site-header__dropdown--wide .site-header__dropdown-inner { min-width: 280px; }
.site-header__dropdown-link {
    display: block;
    padding: 0.625em 1.125em;
    font-size: 0.9375em;
    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.8125em;
    color: #9ca3af;
    margin-left: 0.25em;
}

/* CTA cluster */
.site-header__cta {
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-shrink: 0;
}
.site-header__cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375em;
    padding: 0.5em 0.875em;
    font-size: 1em;
    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: 1em;
    height: 1em;
    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.625em 1.25em;
    font-size: 1em;
    font-weight: 600;
    color: #ffffff;
    background: #111827;
    border-radius: 0.5em;
    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.375em;
    padding: 0.5em 0.75em;
    font-size: 1em;
    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: 1em; height: 1em; }
.site-header__lang-menu {
    position: absolute;
    right: 0;
    top: 100%;
    padding-top: 0.5em;
    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.5em;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 0.5em 0;
    min-width: 140px;
}

/* Sign in dropdown (choose obniz Cloud / obniz Now) */
.site-header__signin {
    position: relative;
}
.site-header__signin .site-header__cta-link svg {
    width: 1em;
    height: 1em;
}
.site-header__signin-menu {
    position: absolute;
    right: 0;
    top: 100%;
    padding-top: 0.5em;
    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__signin:hover .site-header__signin-menu,
.site-header__signin:focus-within .site-header__signin-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.site-header__signin-menu-inner {
    background: #ffffff;
    border-radius: 0.5em;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 0.5em 0;
    min-width: 180px;
}

.site-header__mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5em;
    background: transparent;
    border: 0;
    color: #4b5563;
    cursor: pointer;
}
.site-header__mobile-toggle:hover { color: #111827; }
.site-header__mobile-toggle svg { width: 1.5em; height: 1.5em; }
@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: 1em 1.25em;
}
@media (min-width: 640px) {
    .site-header__mobile-inner { padding: 1em 1.75em; }
}
.site-header__mobile-section { margin-bottom: 1em; }
.site-header__mobile-section:last-child { margin-bottom: 0; }
.site-header__mobile-heading {
    padding: 0.375em 0.75em;
    font-size: 0.75em;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}
.site-header__mobile-link {
    display: block;
    padding: 0.625em 0.75em;
    font-size: 1em;
    color: #374151;
    text-decoration: none;
    border-radius: 0.375em;
    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.75em 0;
}
.site-header__mobile-cta-row {
    padding-top: 0.5em;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}
.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.625em 1em;
}

/* ---------- Footer ---------- */
.site-footer {
    background: #111827;
    color: #d1d5db;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
.site-footer__container {
    width: 100%;
    margin: 0 auto;
    padding: 3em 1.25em;
}
@media (min-width: 640px) {
    .site-footer__container { padding-left: 1.75em; padding-right: 1.75em; }
}
@media (min-width: 1024px) {
    .site-footer__container { padding: 4em 2.5em; }
}
@media (min-width: 1536px) {
    .site-footer__container { padding: 4.5em 3em; }
}

.site-footer__columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2em;
}
@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: 1em;
    font-weight: 600;
    margin: 0 0 1.125em;
    letter-spacing: 0.005em;
}
.site-footer__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}
.site-footer__list li { margin: 0; padding: 0; }
.site-footer__link {
    font-size: 0.9375em;
    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.8125em;
    margin-left: 0.125em;
}

.site-footer__bottom {
    margin-top: 3em;
    padding-top: 2em;
    border-top: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1.5em;
}
@media (min-width: 640px) {
    .site-footer__bottom { flex-direction: row; }
}
.site-footer__bottom-left {
    display: flex;
    align-items: center;
    gap: 1.5em;
    flex-wrap: wrap;
    justify-content: center;
}
.site-footer__brand img {
    height: 2em;
    width: auto;
    filter: brightness(0) invert(1);
    display: block;
}
.site-footer__sns {
    display: flex;
    align-items: center;
    gap: 1em;
}
.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.5em;
    height: 1.5em;
    display: block;
    fill: currentColor;
}
.site-footer__bottom-right {
    display: flex;
    align-items: center;
    gap: 1em;
}
.site-footer__copyright {
    font-size: 0.9375em;
    color: #6b7280;
    margin: 0;
}

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