/* ============================================================
   viewNotice.css - View Notice page card-based styling

   Two-column layout with sticky sidebar TOC and section cards.
   Theme accent color inherited via CSS custom properties.
   ============================================================ */

/* Theme accent inheritance - portals can override --theme-accent */
.notice-page {
    --vn-accent: var(--theme-accent, #1d70b8);
    --vn-accent-light: var(--theme-accent-light, #e8f0fe);
    --vn-text-primary: #1a2332;
    --vn-text-secondary: #5a6577;
    --vn-text-muted: #6b7585;
    --vn-bg-page: #f5f6f8;
    --vn-bg-card: #ffffff;
    --vn-border: #e1e5e9;
    --vn-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --vn-radius: 8px;
}

/* ---- Back link (top) ---- */
.notice-back-top {
    margin: 16px 0 0;
}
.notice-back-top a,
.notice-back-bottom a {
    color: var(--vn-accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.notice-back-top a:hover,
.notice-back-bottom a:hover {
    text-decoration: underline;
}

/* ---- Metadata header card ---- */
.notice-header-card {
    background: var(--vn-bg-card);
    border: 1px solid var(--vn-border);
    border-radius: var(--vn-radius);
    padding: 20px 24px;
    box-shadow: var(--vn-shadow);
    margin-top: 12px;
    position: relative;
}
.notice-meta-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.notice-meta-row > * {
    margin-right: 10px;
}
@supports (gap: 10px) {
    .notice-meta-row {
        gap: 10px;
    }
    .notice-meta-row > * {
        margin-right: 0;
    }
}
.notice-type-badge {
    display: inline-block;
    background: var(--vn-accent-light);
    color: var(--vn-accent);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 12px;
    text-transform: capitalize;
}
.notice-date {
    font-size: 13px;
    color: var(--vn-text-muted);
}
.notice-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--vn-text-primary);
    line-height: 1.3;
    margin: 0 0 6px;
    padding: 0;
}
.notice-generated-title {
    font-size: 14px;
    color: var(--vn-text-muted);
    font-weight: 400;
    margin: 2px 0 6px;
    line-height: 1.4;
}
.notice-org {
    font-size: 15px;
    color: var(--vn-text-secondary);
    font-weight: 500;
    margin: 0;
}
.notice-respond-btn {
    position: absolute;
    top: 20px;
    right: 24px;
    text-decoration: none;
}
.notice-respond-btn:hover {
    text-decoration: none;
}

/* ---- Two-column layout ---- */
.notice-layout {
    display: flex;
    align-items: flex-start;
    margin-top: 16px;
}
.notice-layout > .notice-sidebar {
    margin-right: 20px;
}
@supports (gap: 20px) {
    .notice-layout {
        gap: 20px;
    }
    .notice-layout > .notice-sidebar {
        margin-right: 0;
    }
}

/* ---- Sidebar ---- */
.notice-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 16px;
}
.sidebar-card {
    background: var(--vn-bg-card);
    border: 1px solid var(--vn-border);
    border-radius: var(--vn-radius);
    padding: 16px 18px;
    box-shadow: var(--vn-shadow);
}
.sidebar-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--vn-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0;
    margin-bottom: 10px;
}
.sidebar-link {
    display: block;
    font-size: 13px;
    color: var(--vn-accent);
    text-decoration: none;
    padding: 4px 0 4px 10px;
    border-left: 3px solid transparent;
    margin-bottom: 2px;
    transition: border-color 0.15s;
}
.sidebar-link:hover {
    text-decoration: underline;
}
.sidebar-link.active {
    border-left-color: var(--vn-accent);
    font-weight: 600;
    color: var(--vn-text-primary);
}

/* ---- Main content ---- */
.notice-content {
    flex: 1;
    min-width: 0;
}

/* ---- Section cards ---- */
.section-card {
    background: var(--vn-bg-card);
    border: 1px solid var(--vn-border);
    border-radius: var(--vn-radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--vn-shadow);
}
.section-card:focus {
    outline: none;
}
.section-card:focus-visible {
    outline: 2px solid var(--vn-accent);
    outline-offset: 2px;
}
.section-heading {
    font-size: 17px;
    font-weight: 700;
    color: var(--vn-text-primary);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--vn-accent);
    margin-bottom: 16px;
    margin-top: 0;
}

/* ---- Key-value grid ---- */
.kv-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 16px;
    font-size: 14px;
}
.kv-label {
    color: var(--vn-text-muted);
    font-weight: 600;
    font-size: 13px;
}
.kv-value {
    color: var(--vn-text-primary);
    word-break: break-word;
}
.kv-value a {
    color: var(--vn-accent);
    text-decoration: none;
}
.kv-value a:hover {
    text-decoration: underline;
}

/* ---- Sub-section headings ---- */
.subsection-heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--vn-text-primary);
    margin: 16px 0 10px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}
.subsection-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--vn-text-secondary);
    margin: 12px 0 4px;
}

/* ---- Prose text ---- */
.section-prose {
    font-size: 14px;
    color: var(--vn-text-primary);
    line-height: 1.65;
}
.section-prose p {
    margin-bottom: 8px;
}

/* ---- Back button (bottom) ---- */
.notice-back-bottom {
    margin: 8px 0 40px;
}
.notice-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--vn-bg-card);
    border: 1px solid var(--vn-border);
    border-radius: var(--vn-radius);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--vn-accent);
    text-decoration: none;
    box-shadow: var(--vn-shadow);
    cursor: pointer;
    transition: background 0.15s;
}
.notice-back-btn:hover {
    background: var(--vn-accent-light);
    text-decoration: none;
}

/* ---- Fallback: raw content before JS runs ---- */
.notice-content .completeentry {
    font-size: 14px;
    line-height: 1.65;
    color: var(--vn-text-primary);
}
.notice-content .completeentry p {
    margin: 0;
}

/* ---- Responsive: mobile (<768px) ---- */
@media (max-width: 768px) {
    .notice-sidebar {
        display: none;
    }
    .notice-layout {
        flex-direction: column;
    }
    .notice-title {
        font-size: 18px;
    }
    .notice-header-card {
        padding: 16px;
    }
    .notice-respond-btn {
        position: static;
        display: block;
        margin-top: 12px;
        text-align: center;
    }
    .section-card {
        padding: 16px;
    }
    .kv-grid {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .kv-label {
        margin-top: 8px;
    }
}
