/* usefulinfo.css — Mobile-first, consistent with directory/feedback */
/* VS-friendly: no 'text-wrap' */

:root {
    /* Brand */
    --blue-500: #1a73e8;
    --blue-600: #155cc7;
    --blue-800: #0f3a7a;
    /* Surfaces */
    --bg-900: #0b0d10;
    --bg-800: #101418;
    --bg-700: #141a20;
    /* Text */
    --silver-50: #f3f6fa;
    --silver-100: #e7edf5;
    --silver-300: #c9d3e2;
    --silver-500: #98a6bd;
    /* Etc */
    --border: rgba(255,255,255,.08);
    --focus: #8ab4ff;
    --radius-8: 8px;
    --radius-12: 12px;
    --radius-16: 16px;
    --tap: 44px;
    --shadow-1: 0 2px 10px rgba(0,0,0,.35);
    --shadow-2: 0 8px 22px rgba(0,0,0,.45);
    --color-button-bg: var(--blue-600);
}

* {
    box-sizing: border-box
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg-900);
    color: var(--silver-100);
    font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
/* Better wrapping */
h1, h2, h3, p, a, button {
    overflow-wrap: break-word;
    word-wrap: break-word
}

/* ===== App Bar ===== */
.appbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 12px;
    background: linear-gradient(180deg,rgba(16,20,24,.95),rgba(16,20,24,.9));
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px
}

.brand__logo {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(120% 120% at 30% 30%,var(--blue-500),var(--blue-800));
    color: #fff;
    font-size: 16px;
    box-shadow: var(--shadow-1);
}

.brand__text {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .2px
}

.brand__beta {
    font-size: 11px;
    color: var(--silver-300);
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-12)
}

.appbar__actions {
    display: flex;
    gap: 8px
}

.btn {
    appearance: none;
    border: none;
    border-radius: var(--radius-12);
    min-height: var(--tap);
    padding: 0 12px;
    font-weight: 700;
    cursor: pointer;
    color: var(--silver-100);
    background: rgba(255,255,255,.08);
}

    .btn:focus-visible {
        outline: 2px solid var(--focus);
        outline-offset: 2px
    }

.btn--ghost {
    background: rgba(255,255,255,.08)
}

.btn--neutral {
    background: linear-gradient(180deg,rgba(26,115,232,.12),rgba(26,115,232,.08)),var(--bg-700);
    border: 1px solid var(--border);
}

/* ===== Container & Page Head ===== */
.info-container {
    max-width: 980px;
    margin: 0 auto;
    padding: clamp(12px,4vw,20px)
}

.page-head h1 {
    margin: 6px 2px 6px;
    font-size: clamp(20px,5vw,24px);
    font-weight: 800;
    color: var(--silver-50)
}

.page-head p {
    margin: 0 2px 14px;
    color: var(--silver-500);
    font-size: .98rem
}

/* ===== Section ===== */
.section {
    margin-top: 16px
}

.section__title {
    margin: 6px 2px 10px;
    font-size: clamp(18px,4.6vw,22px);
    font-weight: 700;
    color: var(--silver-50)
}

/* ===== Quick Links (cards) ===== */
.quick-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media(min-width:560px) {
    .quick-grid {
        grid-template-columns: 1fr 1fr
    }
}

@media(min-width:900px) {
    .quick-grid {
        grid-template-columns: 1fr 1fr 1fr
    }
}

.quick-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--silver-100);
    padding: 12px;
    min-height: 56px;
    border: 1px solid var(--border);
    border-radius: var(--radius-12);
    background: linear-gradient(180deg,rgba(26,115,232,.12),rgba(26,115,232,.08)),var(--bg-800);
    box-shadow: var(--shadow-1);
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

    .quick-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 18px rgba(26,115,232,.18);
        border-color: rgba(138,180,255,.35);
    }

.quick-card__icon {
    font-size: 20px
}

.quick-card__title {
    font-weight: 700
}

.quick-card__meta {
    font-size: .85rem;
    color: var(--silver-300)
}

/* ===== Docs grid ===== */
.doc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media(min-width:760px) {
    .doc-grid {
        grid-template-columns: 1fr 1fr
    }
}

.doc-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-16);
    background: var(--bg-800);
    box-shadow: var(--shadow-2);
    padding: 12px;
}

.doc-card__title {
    margin: 2px 0 4px;
    font-size: 16px;
    color: var(--silver-50);
    font-weight: 700
}

.doc-card__desc {
    margin: 0;
    color: var(--silver-300);
    font-size: .95rem
}

.doc-card__actions .btn {
    min-width: 84px
}

/* ===== Contacts ===== */
.contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.contact-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-16);
    background: var(--bg-800);
    box-shadow: var(--shadow-1);
    padding: 12px;
}

.contact-name {
    font-weight: 700;
    color: var(--silver-50);
    margin-bottom: 4px
}

.contact-meta a {
    color: #8ab4ff;
    text-decoration: none;
    border-bottom: 1px dashed rgba(138,180,255,.35)
}

    .contact-meta a:hover {
        border-bottom-style: solid
    }

/* ===== Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.65);
    z-index: 2000;
}

    .modal.open {
        display: flex;
    }

.modal__content {
    position: relative;
    width: min(980px,92vw);
    height: min(80vh,820px);
    background: var(--bg-800);
    border: 1px solid var(--border);
    border-radius: var(--radius-16);
    box-shadow: var(--shadow-2);
    overflow: hidden;
    /* NEW: stack toolbar + viewer; viewer grows to fill */
    display: flex;
    flex-direction: column;
}

.modal__close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: var(--silver-100);
    border: 1px solid var(--border);
    cursor: pointer;
}

    .modal__close:focus-visible {
        outline: 2px solid var(--focus);
        outline-offset: 2px;
    }

/* Toolbar pinned height */
.modal__toolbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-700);
    /* NEW: fix height so viewer can flex below it */
    flex: 0 0 48px;
    min-height: 48px;
}

.modal__title {
    font-weight: 700;
    margin-right: auto;
    color: var(--silver-50);
}

/* NEW: viewer fills remaining space */
.pdf-viewport {
    flex: 1 1 auto;
    width: 100%;
    height: auto; /* let flexbox control height */
    display: block;
    border: 0;
    background: var(--bg-700);
}

/* Fallback iframe inside object also fills the object box */
.pdf-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: var(--bg-700);
}

/* Remove/override any old rules that fought sizing */
.modal__content iframe {
    height: 100% !important;
}
/* keep width rule too */


/* Light mode */
@media (prefers-color-scheme: light) {
    :root {
        --bg-900: #fff;
        --bg-800: #f7f9fc;
        --bg-700: #fff;
        --border: rgba(0,0,0,.08);
        --silver-50: #0b1220;
        --silver-100: #1b2436;
        --silver-300: #3b4b69;
        --silver-500: #6b7a96;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .quick-card, .btn, .modal__content {
        transition: none !important
    }
}

#back-to-directory-container {
    text-align: center;
    margin-top: 1.25rem;
}

#back-to-directory-button {
    box-shadow: var(--shadow-1);
    border: 1px solid rgba(138,180,255,0.3);
}

    #back-to-directory-button:hover {
        filter: brightness(1.05);
        transform: translateY(-1px);
    }

    #back-to-directory-button:active {
        transform: translateY(0);
    }