/* About page — tabs & panels. Base: tokens.css + site.css
   Nav position is owned by site.css (must match Home). */

/*
 * Fill remaining page-wrapper under the shared nav, then center the
 * tab bar + content box both horizontally and vertically.
 * "safe center" avoids clipping the top when content is taller than the slot.
 */
body.site.page-about .page-wrapper {
    /* ensure children can flex-fill; page-wrapper is already a flex column */
    justify-content: flex-start;
}

.about-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    justify-content: safe center;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1rem 0.75rem;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 auto;
    -webkit-overflow-scrolling: touch;
}

/*
 * Tab bar: horizontal by default (desktop / wide).
 * Stack only when three labels cannot fit without force-squeezing (~≤640px).
 */
.tab-bar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    width: min(100%, 800px);
    max-width: 100%;
    border-radius: 5px;
    margin: 0 auto 1rem;
    overflow: visible;
    box-sizing: border-box;
    gap: 0;
    flex: 0 0 auto;
}

.tab {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 15px 10px;
    color: #FFFFFF;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s, text-shadow 0.2s;
    text-shadow: 1px 1px 0 #000000;
    font-size: clamp(0.7rem, 1.8vw, 1rem);
    line-height: 1.25;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

/* Match site nav hover/active: accent red on black GIF */
.tab:hover {
    color: var(--accent-red);
    text-shadow: 2px 2px 2px #000000, -1px -1px 1px #FFFFFF;
}

.tab.active {
    color: var(--accent-red);
    text-shadow: 2px 2px 2px #000000, -1px -1px 1px #FFFFFF;
}

.content-box {
    width: min(100%, 800px);
    max-width: 100%;
    max-height: min(400px, 45dvh);
    padding: 10px;
    border-radius: 5px;
    overflow-x: hidden;
    overflow-y: auto;
    text-align: center;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    flex: 0 1 auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.content-box::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Narrow: stack tabs — long labels no longer share one cramped row */
@media (max-width: 640px) {
    .tab-bar {
        flex-direction: column;
        width: min(100%, 28rem);
        gap: 0.1rem;
        margin-bottom: 0.55rem;
    }
    .tab {
        flex: 0 0 auto;
        width: 100%;
        padding: 0.55rem 0.75rem;
        font-size: clamp(0.85rem, 3.5vw, 1.05rem);
    }
    .about-container {
        padding: 0.4rem 0.45rem;
        justify-content: center;
        justify-content: safe center;
    }
    .content-box {
        width: min(100%, 28rem);
        max-height: min(320px, 42dvh);
    }
}

@media (min-width: 641px) and (max-height: 900px) {
    .about-container {
        padding: 0.5rem 0.75rem;
    }
    .tab-bar {
        margin-bottom: 0.65rem;
    }
    .tab {
        padding: 10px 8px;
    }
    .content-box {
        max-height: min(320px, calc(100dvh - 16rem));
    }
}
