/* ==========================================================================
   APAD Public Site — landing + help/KB
   Self-contained, no build step. Loaded directly via <link>.
   ========================================================================== */

:root {
    --apad-primary: #0B3C8C;
    --apad-dark:    #061d4a;
    --apad-light:   #1e5bbf;
    --apad-accent:  #f59e0b;
    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--slate-800);
    background: var(--slate-50);
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
}
a { color: var(--apad-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ----- Top nav ----- */
.site-nav {
    background: #fff;
    border-bottom: 1px solid var(--slate-200);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.site-brand {
    display: flex; align-items: center; gap: 0.75rem;
    font-weight: 700; color: var(--apad-primary); text-decoration: none;
    font-size: 1rem;
}
.site-brand img { height: 30px; width: auto; }
.site-brand:hover { text-decoration: none; }
.site-nav-links {
    display: flex; align-items: center; gap: 1.5rem;
    flex-wrap: wrap;
}
.site-nav-links a {
    color: var(--slate-700);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0;
}
.site-nav-links a:hover { color: var(--apad-primary); text-decoration: none; }
.site-nav-cta {
    background: var(--apad-primary);
    color: #fff !important;
    padding: 0.45rem 1rem !important;
    border-radius: 0.5rem;
    font-weight: 600;
}
.site-nav-cta:hover { background: var(--apad-dark); }

@media (max-width: 700px) {
    .site-nav-inner { flex-direction: column; align-items: flex-start; }
    .site-nav-links { width: 100%; justify-content: flex-start; gap: 1rem; }
}

/* ----- Hero ----- */
.hero {
    background: linear-gradient(135deg, #061d4a 0%, #0B3C8C 50%, #1e5bbf 100%);
    color: #fff;
    padding: 4rem 1.5rem 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before, .hero::after {
    content: ''; position: absolute; border-radius: 50%;
    background: rgba(255,255,255,0.06); pointer-events: none;
}
.hero::before { width: 320px; height: 320px; top: -100px; right: -120px; }
.hero::after  { width: 240px; height: 240px; bottom: -90px; left: -90px; }
.hero-eyebrow {
    display: inline-block;
    font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.2em;
    color: var(--apad-accent);
    margin-bottom: 1rem;
}
.hero h1 {
    font-size: 2.5rem; font-weight: 800; line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    position: relative;
}
@media (max-width: 700px) { .hero h1 { font-size: 1.75rem; } }
.hero p {
    font-size: 1rem; max-width: 38rem; margin: 0 auto 2rem;
    color: rgba(255,255,255,0.85); line-height: 1.6;
    position: relative;
}

/* Hero search */
.hero-search {
    max-width: 36rem; margin: 0 auto;
    background: rgba(255,255,255,0.95);
    border-radius: 0.75rem;
    padding: 0.5rem;
    display: flex; gap: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    position: relative;
}
.hero-search input {
    flex: 1;
    border: 0; background: transparent;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    color: var(--slate-900);
    font-family: inherit;
}
.hero-search input:focus { outline: none; }
.hero-search button {
    background: var(--apad-primary);
    color: #fff;
    border-radius: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s;
}
.hero-search button:hover { background: var(--apad-dark); }

/* ----- Containers / sections ----- */
.container {
    max-width: 1200px; margin: 0 auto; padding: 0 1.25rem;
}
.section {
    padding: 3rem 0;
}
.section-tight { padding: 2rem 0; }
.section h2 {
    font-size: 1.5rem; font-weight: 700; color: var(--slate-900);
    margin-bottom: 0.5rem;
}
.section .lead {
    color: var(--slate-600); font-size: 1rem;
    margin-bottom: 2rem;
}

/* ----- Quick action grid (home) ----- */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 64rem;
    margin: -3rem auto 0;
    padding: 0 1.25rem;
    position: relative;
    z-index: 5;
}
@media (max-width: 700px) { .actions-grid { grid-template-columns: 1fr; } }
.action-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(6,29,74,0.15), 0 4px 6px -2px rgba(6,29,74,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex; flex-direction: column; gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}
.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 30px -8px rgba(6,29,74,0.22), 0 10px 10px -5px rgba(6,29,74,0.10);
    text-decoration: none;
}
.action-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0B3C8C 0%, #1e5bbf 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.action-icon svg { width: 22px; height: 22px; }
.action-card h3 { font-size: 1rem; font-weight: 700; color: var(--slate-900); }
.action-card p { font-size: 0.875rem; color: var(--slate-600); line-height: 1.5; }

/* ----- KB category grid ----- */
.kb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
@media (max-width: 900px) { .kb-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .kb-grid { grid-template-columns: 1fr; } }
.kb-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid var(--slate-200);
    padding: 1.25rem;
    display: flex; gap: 0.875rem;
    align-items: flex-start;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
    color: inherit;
}
.kb-card:hover {
    text-decoration: none;
    border-color: var(--apad-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(6,29,74,0.10);
}
.kb-card-icon {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: rgba(11,60,140,0.10);
    color: var(--apad-primary);
    display: flex; align-items: center; justify-content: center;
}
.kb-card-icon svg { width: 20px; height: 20px; }
.kb-card-text h3 {
    font-size: 0.95rem; font-weight: 700; color: var(--slate-900);
    margin-bottom: 0.25rem;
}
.kb-card-text p {
    font-size: 0.825rem; color: var(--slate-500); line-height: 1.5;
    margin-bottom: 0.5rem;
}
.kb-card-text .count {
    font-size: 0.75rem; color: var(--slate-400);
}

/* ----- Article list ----- */
.article-list {
    display: flex; flex-direction: column;
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid var(--slate-200);
    overflow: hidden;
}
.article-list a {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--slate-200);
    color: inherit;
    transition: background 0.15s;
    display: flex; flex-direction: column; gap: 0.25rem;
}
.article-list a:last-child { border-bottom: 0; }
.article-list a:hover {
    text-decoration: none;
    background: var(--slate-50);
}
.article-list .title {
    font-size: 0.95rem; font-weight: 600; color: var(--slate-900);
}
.article-list .meta {
    font-size: 0.75rem; color: var(--slate-500);
    display: flex; gap: 0.625rem; align-items: center;
}
.article-list .summary {
    font-size: 0.875rem; color: var(--slate-600); line-height: 1.5;
}

/* ----- Two-column layout (help index, category, article) ----- */
.cols {
    display: grid;
    grid-template-columns: 1fr 18rem;
    gap: 2rem;
}
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

/* sidebar widget */
.sidebar-widget {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid var(--slate-200);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.sidebar-widget h4 {
    font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--slate-500);
    margin-bottom: 0.875rem;
}
.sidebar-widget ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-widget a {
    color: var(--slate-700);
    font-size: 0.875rem;
    line-height: 1.4;
    display: block;
    padding: 0.25rem 0;
}
.sidebar-widget a.active,
.sidebar-widget a:hover { color: var(--apad-primary); }
.sidebar-widget a.active { font-weight: 600; }

/* ----- Article (single) ----- */
.article {
    background: #fff;
    border-radius: 0.75rem;
    padding: 2.25rem;
    border: 1px solid var(--slate-200);
}
.article-header { margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--slate-200); }
.article-header .breadcrumb {
    font-size: 0.8rem; color: var(--slate-500);
    margin-bottom: 0.75rem;
}
.article-header .breadcrumb a { color: var(--apad-primary); }
.article-header h1 {
    font-size: 1.75rem; font-weight: 800; color: var(--slate-900);
    line-height: 1.2; letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}
.article-header .article-meta {
    display: flex; gap: 1rem; align-items: center;
    font-size: 0.8rem; color: var(--slate-500);
}
.article-summary {
    background: var(--slate-50);
    border-left: 3px solid var(--apad-primary);
    padding: 0.875rem 1.125rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin-bottom: 1.5rem;
    font-size: 0.95rem; color: var(--slate-700);
    line-height: 1.6;
}
.article-body {
    font-size: 1rem; color: var(--slate-800); line-height: 1.7;
}
.article-body h2 { font-size: 1.25rem; font-weight: 700; color: var(--slate-900); margin: 1.5rem 0 0.75rem; }
.article-body h3 { font-size: 1.1rem;  font-weight: 700; color: var(--slate-900); margin: 1.25rem 0 0.625rem; }
.article-body p, .article-body ul, .article-body ol, .article-body table { margin-bottom: 1rem; }
.article-body ul, .article-body ol { padding-left: 1.5rem; }
.article-body li { margin-bottom: 0.375rem; }
.article-body a { color: var(--apad-primary); }
.article-body a:hover { text-decoration: underline; }
.article-body table {
    width: 100%; border-collapse: collapse; font-size: 0.95rem;
}
.article-body th, .article-body td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--slate-200);
    text-align: left;
}
.article-body th { font-weight: 600; color: var(--slate-700); background: var(--slate-50); }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.5rem; }
.tag {
    background: var(--slate-100);
    color: var(--slate-600);
    font-size: 0.75rem;
    padding: 0.2rem 0.625rem;
    border-radius: 9999px;
}

/* ----- Search results ----- */
.search-bar {
    background: #fff;
    border: 1px solid var(--slate-300);
    border-radius: 0.75rem;
    padding: 0.5rem;
    display: flex; gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.search-bar input {
    flex: 1;
    border: 0; background: transparent;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    color: var(--slate-900);
    font-family: inherit;
}
.search-bar input:focus { outline: none; }
.search-bar button {
    background: var(--apad-primary);
    color: #fff;
    border-radius: 0.5rem;
    padding: 0.5rem 1.125rem;
    font-weight: 600;
}
.search-empty {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 0.75rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--slate-500);
}

/* ----- Footer ----- */
.site-footer {
    margin-top: 3rem;
    padding: 2rem 1.25rem;
    background: #fff;
    border-top: 1px solid var(--slate-200);
}
.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    color: var(--slate-500);
    font-size: 0.8rem;
}
.site-footer a { color: var(--apad-primary); }
