/**
 * Public Website Layout — Phase 1 (Public Layout and Navigation Foundation)
 *
 * Fully namespaced under `.pub-*` / `#pub*` so nothing here can collide
 * with the existing NKST Community app shell (`.fb-*` in header.php) or
 * the design system's own components (`.nkst-*`). Built on top of the
 * existing design-system.css tokens (--nkst-font-*, --nkst-space-*,
 * --nkst-color-*) rather than inventing a parallel scale.
 *
 * Breakpoint: 900px, matching the cutoff already used everywhere else
 * in this app (header.php's own nav, about.php/contact.php overrides,
 * Phase 14's desktop layout).
 */

.pub-page {
    background: var(--nkst-color-surface-alt, #f7f7f8);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pub-main {
    flex: 1 0 auto;
}

/* ── Skip link (keyboard accessibility) ── */
.pub-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--nkst-color-primary, #1e3a8a);
    color: #fff;
    padding: .75rem 1.25rem;
    z-index: 10000;
    border-radius: 0 0 8px 0;
    font-size: var(--nkst-font-sm);
    text-decoration: none;
}
.pub-skip-link:focus {
    left: 0;
}

/* ══════════════════════════════════
   HEADER
══════════════════════════════════ */
.pub-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: #ffffff;
    border-bottom: 1px solid var(--nkst-color-border, #e5e7eb);
    box-shadow: var(--nkst-shadow-sm, 0 1px 2px rgba(0,0,0,.08));
}

.pub-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.pub-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
}

.pub-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.pub-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.pub-brand-name {
    font-weight: 800;
    font-size: 14px;
    color: var(--nkst-color-text, #1f2937);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46vw;
}

.pub-brand-tagline {
    font-size: var(--nkst-font-2xs, 12px);
    color: var(--nkst-color-text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46vw;
}

/* Desktop nav — center */
.pub-nav-desktop {
    display: none;
    align-items: center;
    gap: .15rem;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.pub-nav-link {
    display: inline-flex;
    align-items: center;
    padding: .55rem .7rem;
    border-radius: var(--nkst-radius-sm, 8px);
    font-size: var(--nkst-font-xs, 13px);
    font-weight: 600;
    color: var(--nkst-color-text-muted, #6b7280);
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.pub-nav-link:hover,
.pub-nav-link:focus-visible {
    background: var(--nkst-color-surface-alt, #f0f2f5);
    color: var(--nkst-color-text, #1f2937);
}
.pub-nav-link.is-active {
    color: var(--nkst-color-primary, #1e3a8a);
    background: rgba(30, 58, 138, .08);
}

/* Right side: Login / Join Us (desktop) + menu button (mobile) */
.pub-nav-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

.pub-btn {
    font-size: var(--nkst-font-xs, 13px);
    font-weight: 700;
    padding: .5rem .9rem;
    border-radius: var(--nkst-radius-sm, 8px);
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.2;
}
.pub-btn-ghost {
    display: none;
    color: var(--nkst-color-primary, #1e3a8a);
    border-color: var(--nkst-color-primary, #1e3a8a);
    background: transparent;
}
.pub-btn-ghost:hover { background: rgba(30, 58, 138, .06); }

.pub-btn-primary {
    display: none;
    color: #fff;
    background: var(--nkst-color-primary, #1e3a8a);
}
.pub-btn-primary:hover { background: #16296b; }

.pub-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--nkst-color-surface-alt, #f0f2f5);
    color: var(--nkst-color-text, #1f2937);
    font-size: 1.05rem;
    cursor: pointer;
}
.pub-menu-btn:hover { background: #e4e6eb; }

@media (min-width: 901px) {
    .pub-nav-desktop { display: flex; }
    .pub-btn-ghost, .pub-btn-primary { display: inline-flex; align-items: center; }
    .pub-menu-btn { display: none; }
}

/* ══════════════════════════════════
   MOBILE SLIDE-OUT NAV
══════════════════════════════════ */
.pub-mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(84vw, 340px);
    background: #fff;
    z-index: 1200;
    box-shadow: -8px 0 24px rgba(0,0,0,.18);
    transform: translateX(100%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.pub-mobile-nav.is-open { transform: translateX(0); }

.pub-mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--nkst-color-border, #e5e7eb);
    flex-shrink: 0;
}
.pub-mobile-nav-title {
    font-size: var(--nkst-font-md, 16px);
    font-weight: 800;
}
.pub-mobile-nav-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--nkst-color-surface-alt, #f0f2f5);
    color: var(--nkst-color-text, #1f2937);
    font-size: 1rem;
    cursor: pointer;
}

.pub-mobile-nav-section-label {
    font-size: var(--nkst-font-2xs, 12px);
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--nkst-color-text-muted, #6b7280);
    padding: 1rem 1rem .35rem;
}

.pub-mobile-nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1rem;
    box-sizing: border-box; /* without this, padding + min-height stack
        under the page's default content-box model, inflating each row
        to ~65px instead of the intended 44px tap target and leaving a
        visible gap below the label */
    min-height: var(--nkst-tap-min, 44px);
    font-size: var(--nkst-font-sm, 14px);
    font-weight: 600;
    color: var(--nkst-color-text, #1f2937);
    text-decoration: none;
}
.pub-mobile-nav-item i {
    width: 20px;
    text-align: center;
    color: var(--nkst-color-text-muted, #6b7280);
    font-size: .95rem;
}
.pub-mobile-nav-item:active { background: var(--nkst-color-surface-alt, #f0f2f5); }
.pub-mobile-nav-item.is-active {
    color: var(--nkst-color-primary, #1e3a8a);
    background: rgba(30, 58, 138, .06);
}
.pub-mobile-nav-item.is-active i { color: var(--nkst-color-primary, #1e3a8a); }

.pub-mobile-nav-divider {
    height: 1px;
    background: var(--nkst-color-border, #e5e7eb);
    margin: .5rem 0;
}

.pub-mobile-nav-cta {
    padding: .85rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.pub-mobile-nav-cta .pub-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box; /* same content-box overflow as .pub-mobile-nav-item above */
    padding: .7rem;
    font-size: var(--nkst-font-sm, 14px);
}

.pub-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1150;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
}
.pub-mobile-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

body.pub-nav-open {
    overflow: hidden;
}

@media (min-width: 901px) {
    .pub-mobile-nav, .pub-mobile-overlay { display: none !important; }
}

/* ══════════════════════════════════
   FOOTER
══════════════════════════════════ */
.pub-footer {
    background: #1a2036;
    color: rgba(255,255,255,.82);
    margin-top: 2.5rem;
    flex-shrink: 0;
}

.pub-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.pub-footer-brand {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin-bottom: .85rem;
}
.pub-footer-brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.pub-footer-brand-name {
    font-weight: 800;
    font-size: var(--nkst-font-sm, 14px);
    color: #fff;
    line-height: 1.3;
}

.pub-footer-desc {
    font-size: var(--nkst-font-xs, 13px);
    line-height: 1.6;
    color: rgba(255,255,255,.68);
    margin: 0;
}

.pub-footer-heading {
    font-size: var(--nkst-font-xs, 13px);
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 .9rem;
}

.pub-footer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.pub-footer-list a {
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: var(--nkst-font-xs, 13px);
}
.pub-footer-list a:hover { color: #fff; text-decoration: underline; }

.pub-footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-size: var(--nkst-font-xs, 13px);
    color: rgba(255,255,255,.75);
    margin: 0 0 .6rem;
}
.pub-footer-contact-item i {
    margin-top: .2rem;
    width: 14px;
    flex-shrink: 0;
    color: rgba(255,255,255,.55);
}

.pub-footer-social {
    display: flex;
    gap: .6rem;
    margin-top: .9rem;
}
.pub-footer-social a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
}
.pub-footer-social a:hover { background: rgba(255,255,255,.2); }

.pub-footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    text-align: center;
    padding: 1.1rem 1.25rem;
    font-size: var(--nkst-font-2xs, 12px);
    color: rgba(255,255,255,.6);
}

@media (max-width: 480px) {
    .pub-header-inner { gap: .75rem; }
    .pub-brand-tagline { display: none; }
}
