/* =========================================================
   Inmate Population - themeable design system
   ---------------------------------------------------------
   ONE stylesheet, many looks. Appearance is driven entirely by
   CSS custom properties. The build agent sets a theme by adding
   classes to <body> and (for non-system fonts) one <link> in
   <head>. See PHASE-B-BUILD.md > "Theme Selection (de-footprint)".

   Knobs (pick one of each per subdomain; combine for a unique look):
     palette-*   : graphite | forest | maroon | indigo | steel | plum
     type-*      : system | grotesk | serif | slab | humanist
     shape-*     : soft | sharp | pill
     div-*       : dots | mark | slash | plain
     layout-*    : (default sidebar right) | sidebar-left

   With no body classes the page still renders (defaults below):
   graphite palette, system fonts, soft shape, dot dividers.

   DO NOT rename: .search-widget .search-form .search-input
   .search-select .search-button  (search.js depends on them).
   ========================================================= */

:root {
    /* ---- neutrals (shared across palettes) ---- */
    --text: #20262e;
    --text-soft: #444b55;
    --text-muted: #6b7280;
    --bg: #ffffff;
    --bg-soft: #f5f7f9;
    --bg-panel: #eceff3;
    --border: #d3dae1;
    --border-soft: #e6eaef;

    /* ---- default palette: graphite + teal ---- */
    --primary: #243140;
    --primary-dark: #18222e;
    --primary-light: #3a5366;
    --accent: #0f9d8f;
    --accent-strong: #0c7e73;
    --accent-soft: #e3f4f1;
    --on-accent: #ffffff;
    --link: #0c7e73;
    --link-hover: #b0431f;
    --footer-bg: #1b2530;
    --footer-legal-bg: #141c25;
    --footer-bottom-bg: #0e151c;
    --footer-text: #c2cad6;
    --footer-head: #ffffff;
    --footer-muted: #8c97a6;

    /* ---- default fonts: system stack (no external request) ---- */
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-head: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --head-weight: 700;
    --head-spacing: 0;

    /* ---- default shape: soft ---- */
    --radius: 8px;
    --radius-lg: 12px;
    --btn-radius: 8px;
    --card-shadow: 0 2px 10px rgba(0,0,0,.06);
    --card-shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --card-accent-w: 3px;

    /* ---- default divider ---- */
    --divider-glyph: "\2022 \2022 \2022"; /* dots */
    --divider-color: var(--accent);

    --max: 1200px;
}

/* =========================================================
   PALETTES
   ========================================================= */
body.palette-forest {
    --primary: #2f4533; --primary-dark: #1f3122; --primary-light: #4a6b4f;
    --accent: #d98a1f; --accent-strong: #b67115; --accent-soft: #fbeedd; --on-accent: #3a2600;
    --link: #356b41; --link-hover: #b6480f;
    --footer-bg: #243528; --footer-legal-bg: #1a271c; --footer-bottom-bg: #121b14;
}
body.palette-maroon {
    --primary: #6a1f2b; --primary-dark: #4f161f; --primary-light: #8a3a44;
    --accent: #4a6b7c; --accent-strong: #395562; --accent-soft: #e8eef1; --on-accent: #ffffff;
    --link: #6a1f2b; --link-hover: #2f4f5e;
    --footer-bg: #2a1a1d; --footer-legal-bg: #1f1316; --footer-bottom-bg: #160d0f;
}
body.palette-indigo {
    --primary: #36306b; --primary-dark: #221d4d; --primary-light: #524c8c;
    --accent: #157f93; --accent-strong: #0f6678; --accent-soft: #e1f3f6; --on-accent: #ffffff;
    --link: #157f93; --link-hover: #b8456f;
    --footer-bg: #241f47; --footer-legal-bg: #1a1636; --footer-bottom-bg: #120f24;
}
body.palette-steel {
    --primary: #33485c; --primary-dark: #243545; --primary-light: #4f6a82;
    --accent: #e06d1f; --accent-strong: #bf5712; --accent-soft: #fcebdd; --on-accent: #2a1500;
    --link: #2f5f80; --link-hover: #bf5712;
    --footer-bg: #25323f; --footer-legal-bg: #1b242e; --footer-bottom-bg: #131a21;
}
body.palette-plum {
    --primary: #4a2c4f; --primary-dark: #361e3a; --primary-light: #6b4870;
    --accent: #5e9b3f; --accent-strong: #4a7d31; --accent-soft: #ecf4e3; --on-accent: #18300a;
    --link: #6b4870; --link-hover: #4a7d31;
    --footer-bg: #322236; --footer-legal-bg: #251828; --footer-bottom-bg: #19101b;
}

/* =========================================================
   FONT SETS
   (non-system sets need the matching Google Fonts <link> in
    <head> - see PHASE-B "Theme Selection")
   ========================================================= */
body.type-grotesk  { --font-head: 'Manrope', system-ui, sans-serif; --font-body: 'Inter', system-ui, sans-serif; --head-weight: 800; --head-spacing: -.01em; }
body.type-serif    { --font-head: 'Lora', Georgia, serif; --font-body: 'Source Sans 3', system-ui, sans-serif; --head-weight: 700; }
body.type-slab     { --font-head: 'Roboto Slab', Georgia, serif; --font-body: 'Roboto', system-ui, sans-serif; --head-weight: 700; }
body.type-humanist { --font-head: 'Work Sans', system-ui, sans-serif; --font-body: 'Nunito Sans', system-ui, sans-serif; --head-weight: 700; }

/* =========================================================
   SHAPE SCALES
   ========================================================= */
body.shape-sharp { --radius: 0; --radius-lg: 0; --btn-radius: 0; --card-shadow: none; --card-shadow-sm: none; --card-accent-w: 4px; }
body.shape-pill  { --radius: 6px; --radius-lg: 10px; --btn-radius: 999px; --card-shadow: 0 1px 3px rgba(0,0,0,.08); --card-accent-w: 3px; }

/* =========================================================
   DIVIDER GLYPHS
   ========================================================= */
body.div-mark  { --divider-glyph: "\25C6 \25C6 \25C6"; }
body.div-slash { --divider-glyph: "/ / /"; }
body.div-plain .section-divider::after { display: none; }

/* =========================================================
   BASE
   ========================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--link); text-decoration: underline; }
a:hover { color: var(--link-hover); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5 { font-family: var(--font-head); }

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 24px;
}

/* =========================================================
   TOP DISCLAIMER BAR (optional)
   ========================================================= */
.top-disclaimer {
    background: var(--bg-warn, #fff8e1);
    border-bottom: 1px solid #e8d68a;
    font-size: 13px;
    color: #5a4500;
    padding: 8px 0;
}
.top-disclaimer .container { display: flex; align-items: center; gap: 10px; }
.top-disclaimer svg { width: 16px; height: 16px; flex-shrink: 0; fill: #b08400; }
.top-disclaimer a { color: #5a4500; text-decoration: underline; }

/* =========================================================
   HEADER
   ========================================================= */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border-soft);
    padding: 14px 0;
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.logo img { height: 52px; width: auto; }
.logo-text {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: var(--head-weight);
    color: var(--primary);
    letter-spacing: var(--head-spacing);
    line-height: 1.15;
}
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a {
    padding: 8px 14px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    transition: background .15s, color .15s;
}
.nav a:hover { background: var(--bg-soft); color: var(--primary); }
.nav a.active {
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    border-radius: var(--radius) var(--radius) 0 0;
}

/* =========================================================
   HERO BANNER (optional, index only)
   ========================================================= */
.hero { position: relative; background: var(--primary); color: #fff; overflow: hidden; }
.hero-image { position: relative; min-height: 360px; background-color: var(--primary); background-size: cover; background-position: center; }
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.30) 0%, rgba(0,0,0,.72) 100%);
    display: flex; flex-direction: column; justify-content: flex-end; padding: 40px 0;
}
.hero-overlay .container { color: #fff; }
.hero h1 { font-size: 40px; font-weight: var(--head-weight); line-height: 1.15; margin-bottom: 8px; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.hero-address { font-size: 16px; color: #e9eef3; font-weight: 400; }
.hero-address strong { color: #fff; }

/* Inner-page banner */
.page-banner {
    background: var(--primary);
    color: #fff;
    padding: 36px 0 28px;
    border-bottom: 4px solid var(--accent);
}
.page-banner h1 { font-size: 32px; font-weight: var(--head-weight); line-height: 1.2; margin: 0; letter-spacing: var(--head-spacing); }
.page-banner .breadcrumbs-inline { color: rgba(255,255,255,.7); font-size: 13px; margin-bottom: 8px; }
.page-banner .breadcrumbs-inline a { color: rgba(255,255,255,.85); text-decoration: none; }
.page-banner .breadcrumbs-inline a:hover { color: #fff; text-decoration: underline; }

/* =========================================================
   INTRO BAND + SEARCH STRIP
   ========================================================= */
.intro-band { background: var(--bg); padding: 28px 0 16px; }
.intro-band p { font-size: 17px; line-height: 1.7; color: var(--text); margin: 0; }

.search-strip {
    background: var(--bg-panel);
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    padding: 22px 0;
}
.search-strip-inner { display: flex; flex-direction: column; gap: 12px; }
.search-strip h2 { font-size: 18px; font-weight: var(--head-weight); color: var(--primary); margin: 0; }
.search-strip .search-form-note { font-size: 12px; color: var(--text-muted); margin: 0; }

/* =========================================================
   MAIN CONTENT - article + sidebar
   ========================================================= */
.main { padding: 36px 0 48px; }

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    align-items: start;
}
.content-layout.single { grid-template-columns: minmax(0, 1fr); }

/* sidebar-left variant (CSS-only, no markup change) */
body.layout-sidebar-left .content-layout:not(.single) { grid-template-columns: 300px minmax(0, 1fr); }
body.layout-sidebar-left .content-body { order: 2; }
body.layout-sidebar-left .sidebar { order: 1; }

.content-body { min-width: 0; }
.content-body > section { margin-bottom: 24px; }

.content-body img {
    max-width: 100%;
    max-height: 460px;
    width: auto;
    height: auto;
    margin: 18px 0;
    border-radius: var(--radius);
}
.content-body h2 { font-size: 26px; font-weight: var(--head-weight); color: var(--primary); line-height: 1.25; margin: 8px 0 14px; letter-spacing: var(--head-spacing); }
.content-body h3 { font-size: 19px; font-weight: var(--head-weight); color: var(--text); margin: 18px 0 10px; }
.content-body p { margin-bottom: 14px; color: var(--text-soft); }
.content-body ul, .content-body ol { margin: 12px 0 18px 22px; color: var(--text-soft); }
.content-body li { margin-bottom: 6px; }
.content-body ol li { padding-left: 4px; }
.content-body .intro { font-size: 17px; color: var(--text); margin-bottom: 24px; }

/* Section dividers */
.section-divider {
    border: 0; height: 0;
    border-top: 1px solid var(--border-soft);
    margin: 28px 0;
    position: relative;
    text-align: center;
}
.section-divider::after {
    content: var(--divider-glyph);
    color: var(--divider-color);
    background: var(--bg);
    padding: 0 14px;
    position: relative;
    top: -10px;
    font-size: 10px;
    letter-spacing: 6px;
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 16px; }
.sidebar-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: var(--card-accent-w) solid var(--accent);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    box-shadow: var(--card-shadow-sm);
}
.sidebar-card h4 {
    font-size: 14px; font-weight: var(--head-weight); color: var(--primary);
    text-transform: uppercase; letter-spacing: .8px;
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
}
.sidebar-card ul { list-style: none; margin: 0; }
.sidebar-card li { border-bottom: 1px solid var(--border-soft); padding: 6px 0; font-size: 14px; }
.sidebar-card li:last-child { border-bottom: 0; }
.sidebar-card li a { text-decoration: none; color: var(--text); display: block; }
.sidebar-card li a::before { content: "\203A  "; color: var(--accent); font-weight: 700; }
.sidebar-card li a:hover { color: var(--primary); }
.sidebar-card img { border-radius: var(--radius); margin-bottom: 12px; }
.sidebar-card .mini-address { font-size: 13px; color: var(--text-soft); line-height: 1.55; }
.sidebar-card .mini-address strong { color: var(--text); display: block; margin-bottom: 4px; }

.sidebar-search .search-widget .search-form { grid-template-columns: 1fr; gap: 8px; }
.sidebar-search .search-form-note { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 6px; }

/* =========================================================
   CONTACT / FACILITY ADDRESS CARDS
   ========================================================= */
.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin: 18px 0 24px;
}
.address-card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.address-card h4 { font-size: 16px; font-weight: var(--head-weight); color: var(--primary); margin-bottom: 8px; line-height: 1.3; }
.address-card p { font-size: 14px; color: var(--text-soft); margin-bottom: 4px; line-height: 1.5; }
.address-card .phone { color: var(--text); font-weight: 600; }
.address-card a { color: var(--link); }

/* =========================================================
   DATA / INFO TABLES
   ========================================================= */
.data-table, .info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0 24px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 15px;
}
.data-table th, .data-table td, .info-table th, .info-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
}
.data-table thead th, .info-table thead th {
    background: var(--primary); color: #fff;
    font-weight: 600; font-size: 14px;
    border-bottom: 1px solid var(--primary-dark);
}
.data-table th, .info-table th {
    background: var(--bg-soft); color: var(--text);
    font-weight: 600; width: 38%;
}
.info-table thead th { background: var(--primary); color: #fff; width: auto; }
.data-table tr:last-child td, .info-table tr:last-child td, .info-table tr:last-child th { border-bottom: 0; }
.data-table tbody tr:nth-child(even) td, .info-table tbody tr:nth-child(even) td { background: var(--bg-soft); }

/* =========================================================
   NOTICE BOXES
   ========================================================= */
.notice {
    padding: 14px 16px;
    border-radius: var(--radius);
    margin: 18px 0;
    font-size: 15px;
    line-height: 1.55;
    border-left: 4px solid var(--primary);
    background: var(--bg-soft);
    color: var(--text);
}
.notice strong { color: var(--text); }
.notice-info { border-left-color: var(--accent); background: var(--accent-soft); color: var(--primary-dark); }
.notice-warning { border-left-color: #e0a82e; background: #fff8e1; color: #6b4f00; }
.notice-important { border-left-color: #c0392b; background: #fdecea; color: #6b1a1a; }

/* =========================================================
   QUICK STATS
   ========================================================= */
.quick-stats { background: var(--bg); border-bottom: 1px solid var(--border-soft); padding: 20px 0; }
.quick-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; text-align: center; }
.quick-stats .stat-number { font-family: var(--font-head); font-size: 26px; font-weight: var(--head-weight); color: var(--primary); display: block; }
.quick-stats .stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; margin-top: 2px; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
    display: inline-block;
    padding: 10px 22px;
    font-size: 15px; font-weight: 600;
    text-align: center;
    border-radius: var(--btn-radius);
    border: none; cursor: pointer; text-decoration: none;
    transition: background .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--bg); color: var(--primary); border: 1px solid var(--primary); }
.btn-secondary:hover { background: var(--bg-soft); }

/* =========================================================
   SEARCH WIDGET (markup from search.js - DO NOT rename classes)
   ========================================================= */
.search-widget { width: 100%; }
.search-widget .search-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.search-widget .search-input,
.search-widget .search-select,
.search-widget .search-button {
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}
.search-widget .search-button {
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
    border: none; cursor: pointer;
    padding: 12px 14px;
    border-radius: var(--btn-radius);
    text-transform: uppercase;
    letter-spacing: .6px;
}
.search-widget .search-button:hover { background: var(--accent-strong); }
.search-widget .search-input:focus,
.search-widget .search-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0,0,0,.12);
}

/* =========================================================
   DIRECTIONS BAND + EMBEDDED MAP (index page)
   ========================================================= */
.directions {
    background: var(--bg-soft);
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    padding: 36px 0 32px;
}
.directions h2 { font-size: 26px; font-weight: var(--head-weight); color: var(--primary); margin: 0 0 16px; }
.directions > .container > p { color: var(--text-soft); margin-bottom: 22px; }
.directions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 6px; }
.directions-grid h3 {
    font-size: 14px; font-weight: var(--head-weight); color: var(--primary);
    text-transform: uppercase; letter-spacing: .8px;
    margin: 0 0 8px; padding-bottom: 6px;
    border-bottom: 2px solid var(--accent);
}
.directions-grid p { font-size: 14px; line-height: 1.55; color: var(--text-soft); margin: 0; }
.map-embed { line-height: 0; }
.map-embed iframe { display: block; width: 100%; border: 0; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { background: var(--footer-bg); color: var(--footer-text); margin-top: 40px; }
.footer-legal {
    background: var(--footer-legal-bg);
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding: 18px 0;
    font-size: 13px;
    color: var(--footer-muted);
    line-height: 1.6;
}
.footer-legal strong { color: #fff; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding: 32px 0; }
.footer-cols h5 { font-size: 13px; font-weight: var(--head-weight); color: var(--footer-head); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.footer-cols ul { list-style: none; }
.footer-cols li { margin-bottom: 7px; font-size: 14px; }
.footer-cols a { color: var(--footer-text); text-decoration: none; }
.footer-cols a:hover { color: #fff; text-decoration: underline; }
.footer-brand p { font-size: 13px; line-height: 1.6; margin-bottom: 8px; }
.footer-bottom {
    background: var(--footer-bottom-bg);
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 14px 0;
    text-align: center;
    font-size: 12px;
    color: var(--footer-muted);
}
.footer-bottom a { color: var(--footer-muted); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
    .content-layout { grid-template-columns: 1fr; }
    body.layout-sidebar-left .content-layout:not(.single) { grid-template-columns: 1fr; }
    body.layout-sidebar-left .content-body { order: 0; }
    body.layout-sidebar-left .sidebar { order: 0; }
    .sidebar { position: static; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
    .hero h1 { font-size: 30px; }
    .hero-image { min-height: 260px; }
    .directions-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
    .nav a { padding: 6px 10px; font-size: 13px; }
    .search-widget .search-form { grid-template-columns: 1fr; }
    .search-widget .search-button { padding: 14px; }
    .content-body h2 { font-size: 22px; }
    .hero h1 { font-size: 24px; }
    .footer-cols { grid-template-columns: 1fr; gap: 24px; }
    .page-banner { padding: 24px 0 20px; }
    .page-banner h1 { font-size: 24px; }
}

@media (max-width: 560px) {
    .directions-grid { grid-template-columns: 1fr; }
    .map-embed iframe { height: 220px; }
}
