/* Office landing page and the database-driven mega menu. */

.office-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.office-shell {
    max-width: 1380px;
    margin: 0 auto;
    padding: 28px 24px 64px;
}

.office-hero {
    display: flex;
    gap: 32px;
    justify-content: space-between;
    align-items: flex-end;
    padding: 26px 28px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        radial-gradient(900px 260px at 90% -30%, rgba(15, 111, 222, .14), transparent 60%),
        linear-gradient(135deg, #ffffff, #f4f8fc);
    box-shadow: var(--shadow);
}

.office-kicker {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.office-hero h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -.02em;
}

.office-lede {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13.5px;
}

.office-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(74px, 1fr));
    gap: 10px;
    margin: 0;
    flex: 0 0 auto;
}

.office-stats div {
    padding: 12px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: rgba(255, 255, 255, .82);
}

.office-stats dt {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.office-stats dd {
    margin: 2px 0 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
}

.office-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 20px 0 14px;
}

.office-search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: min(520px, 70vw);
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
}

.office-search span {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.office-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
}

.office-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11.5px;
    white-space: nowrap;
}

.office-legend .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
}

.office-legend .dot.ported { background: var(--accent-2); }
.office-legend .dot.placeholder { background: #b6c2cf; }

.office-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    align-items: start;
}

.office-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    box-shadow: 0 1px 2px rgba(10, 37, 64, .04);
    overflow: hidden;
}

.office-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg, #fbfdff, #f4f8fc);
}

.office-card-head h2 {
    font-size: 15px;
    letter-spacing: -.01em;
}

.office-code {
    display: block;
    margin-top: 2px;
    color: #91a1b3;
    font-family: var(--mono);
    font-size: 9.5px;
}

.office-open,
.office-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.office-open:hover,
.office-primary:hover { background: #0b5fc0; }

.office-tree {
    list-style: none;
    margin: 0;
    padding: 6px;
}

.office-tree-nested {
    margin: 0 0 0 14px;
    padding: 0 0 0 8px;
    border-left: 1px dashed var(--line);
}

.office-leaf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    font-size: 12.5px;
}

.office-leaf em {
    display: block;
    color: #93a2b3;
    font-family: var(--mono);
    font-size: 9.5px;
    font-style: normal;
}

.office-leaf:hover {
    background: #eef5fd;
    color: var(--accent);
}

.office-leaf.is-placeholder:hover {
    background: #f4f6f8;
    color: var(--ink);
}

.office-state {
    flex: 0 0 auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eaf4f2;
    color: #0b7669;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.office-leaf.is-placeholder .office-state {
    background: #f0f3f6;
    color: #7c8b9c;
}

.office-empty {
    padding: 30px;
    text-align: center;
    color: var(--muted);
}

/* ---------------- mega menu ---------------- */

body.office-menu-open { overflow: hidden; }

.office-mega {
    position: fixed;
    z-index: 90;
    left: 50%;
    top: 68px;
    width: min(1180px, calc(100vw - 36px));
    max-height: min(74vh, 760px);
    transform: translateX(-50%) translateY(-6px);
    display: flex;
    flex-direction: column;
    border: 1px solid #cfdae6;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(5, 28, 52, .28);
    opacity: 0;
    pointer-events: none;
    transition: opacity .14s ease, transform .14s ease;
    overflow: hidden;
}

.office-mega.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.office-mega-head {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg, #fbfdff, #f2f7fc);
}

.office-mega-head h2 {
    font-size: 14px;
    white-space: nowrap;
}

.office-mega-head .office-search {
    margin-left: auto;
    min-width: 280px;
    padding: 5px 10px;
}

.office-mega-close {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 7px;
}

.office-mega-close:hover { background: #e8eef5; color: var(--ink); }

.office-mega-body {
    overflow: auto;
    padding: 12px;
    columns: 4 220px;
    column-gap: 12px;
    background: #f7fafd;
}

.office-mega-group {
    break-inside: avoid;
    margin: 0 0 10px;
    padding: 9px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: #fff;
}

.office-mega-group h3 {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 5px;
    font-size: 12px;
    color: var(--navy);
}

.office-mega-group h3 a {
    color: inherit;
    text-decoration: none;
}

.office-mega-group h3 a:hover { color: var(--accent); }

.office-mega-group h3 span {
    color: #a1afbf;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 400;
}

.office-mega-list,
.office-mega-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.office-mega-list a {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 5px;
    border-radius: 5px;
    color: #34495e;
    text-decoration: none;
    font-size: 11.5px;
    line-height: 1.3;
}

.office-mega-list a:hover {
    background: #edf5fe;
    color: var(--accent);
}

.office-mega-list a.is-placeholder {
    color: #71808f;
}

.office-mega-list a.is-placeholder::after,
.office-mega-list a.is-ported::after {
    flex: 0 0 auto;
    font-family: var(--mono);
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding-top: 1px;
}

.office-mega-list a.is-placeholder::after {
    content: "soon";
    color: #a3afbc;
}

.office-mega-list a.is-ported::after {
    content: "open";
    color: #0f9d8c;
}

.office-mega-list ul {
    margin-left: 9px;
    padding-left: 7px;
    border-left: 1px solid #e7eef6;
}

.office-mega-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 16px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 10.5px;
    background: #fbfdff;
}

.office-mega-foot a { color: var(--accent); font-weight: 700; text-decoration: none; }

.office-mega-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(7, 22, 38, .22);
    backdrop-filter: blur(1px);
}

/* ---------------- placeholder page ---------------- */

.office-crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 12px;
}

.office-crumbs a { color: var(--accent); text-decoration: none; }

.module-placeholder {
    max-width: 860px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        radial-gradient(700px 220px at 100% 0, rgba(15, 157, 140, .09), transparent 60%),
        #fff;
    box-shadow: var(--shadow);
}

.module-badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    background: #fff4e5;
    color: #9a5a05;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.module-placeholder h1 {
    margin: 14px 0 8px;
    font-size: 30px;
    letter-spacing: -.02em;
}

.module-lede {
    max-width: 670px;
    color: var(--muted);
}

.module-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 8px 22px;
    margin: 22px 0;
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: #f8fbfe;
}

.module-meta dt {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.module-meta dd { margin: 2px 0 10px; font-weight: 600; }
.module-meta code { font-family: var(--mono); font-size: 11px; color: var(--navy); }

.module-subhead { margin: 20px 0 8px; font-size: 14px; }

.module-children {
    padding: 4px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: #fbfdff;
}

.module-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 24px;
}

.office-secondary {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
}

.office-secondary:hover { border-color: #b9c9da; background: #f7fafd; }

@media (max-width: 820px) {
    .office-hero { flex-direction: column; align-items: stretch; }
    .office-stats { grid-template-columns: repeat(2, 1fr); }
    .office-toolbar { flex-direction: column; align-items: stretch; }
    .office-search { min-width: 0; }
    .office-legend { justify-content: flex-end; }
    .office-mega { top: 8px; max-height: calc(100vh - 16px); }
    .office-mega-body { columns: 1; }
    .office-mega-head { flex-wrap: wrap; }
    .office-mega-head .office-search { margin-left: 0; width: 100%; }
}
