/* =========================================================
   Local Residents Directory - "directory book" template
   (cream paper, walnut ink, deep green accents, slab-serif
    headings, centered masthead over a dark navline, right
    panel column styled as index cards, light footer)
   ========================================================= */

:root {
    --ink: #2b241c;
    --ink-soft: #55483a;
    --ink-mute: #80735f;
    --brand: #4d3b2f;
    --brand-deep: #33271e;
    --brand-wash: #efe9dd;
    --leaf: #2e6e4e;
    --leaf-deep: #1f5238;
    --leaf-wash: #e5efe8;
    --cream: #faf7f0;
    --card: #ffffff;
    --line: #dcd2c0;
    --line-soft: #eae2d3;
    --alert: #9c3b2e;
    --ok: #2e6e4e;
    --frame: 1160px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Rubik', 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    font-size: 16.5px;
    line-height: 1.68;
    color: var(--ink);
    background: var(--cream);
}

h1, h2, h3, h4, h5 {
    font-family: 'Bitter', 'Georgia', serif;
}

a { color: var(--leaf-deep); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--brand); }

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

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

/* =========================================================
   CROWN - centered brand block + full-width navline below
   ========================================================= */
.crown {
    background: var(--cream);
    padding: 20px 0 14px;
    text-align: center;
}

.crown .brandmark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--ink);
}

.crown .brandmark img { height: 48px; width: auto; }

.brand-title {
    font-family: 'Bitter', Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--brand-deep);
    line-height: 1.1;
    letter-spacing: .2px;
}

.brand-title em {
    font-style: normal;
    color: var(--leaf);
}

.navline {
    background: var(--brand-deep);
    border-top: 3px solid var(--leaf);
}

.navline .frame {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
}

.navline a {
    padding: 11px 16px;
    color: #ede5d8;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .8px;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.navline a:hover { background: rgba(255,255,255,.08); color: #fff; }

.navline a.open {
    background: var(--leaf);
    color: #fff;
}

/* =========================================================
   TITLE BLOCK - print-style page head on paper
   ========================================================= */
.title-block {
    background: var(--cream);
    padding: 30px 0 18px;
    border-bottom: 4px double var(--brand);
}

.title-block h1 {
    font-size: 33px;
    font-weight: 700;
    color: var(--brand-deep);
    line-height: 1.2;
    margin: 0;
}

.title-block .trail {
    color: var(--ink-mute);
    font-size: 13px;
    margin-bottom: 6px;
}

.title-block .trail a { color: var(--ink-soft); text-decoration: none; }
.title-block .trail a:hover { color: var(--leaf-deep); text-decoration: underline; }

/* Opening paragraph band */
.opening {
    background: var(--cream);
    padding: 20px 0 14px;
}

.opening p {
    font-size: 17px;
    line-height: 1.72;
    color: var(--ink-soft);
    margin: 0;
}

/* =========================================================
   LOOKUP BAND - dark search strip (protected widget inside)
   ========================================================= */
.lookup-band {
    background: var(--brand-deep);
    padding: 24px 0;
    border-top: 1px solid var(--brand);
    border-bottom: 3px solid var(--leaf);
}

.lookup-box {
    background: var(--card);
    border-radius: 4px;
    padding: 18px 20px 12px;
    box-shadow: 0 2px 10px rgba(30,20,10,.25);
}

.lookup-box h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-deep);
    margin: 0 0 12px;
}

.lookup-box .spons-note {
    font-size: 11.5px;
    color: var(--ink-mute);
    margin: 8px 0 0;
    text-align: right;
}

/* Bottom repeat of the lookup band */
.lookup-band.lookup-close {
    border-top: 3px solid var(--leaf);
    border-bottom: 0;
}

/* =========================================================
   MAIN LAYOUT - article left, panel column RIGHT
   ========================================================= */
.body-main {
    padding: 32px 0 44px;
    background: var(--cream);
}

.columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 296px;
    gap: 36px;
    align-items: start;
}

/* Single-column (about / legal pages) */
.columns.single { grid-template-columns: minmax(0, 1fr); }

.entry { min-width: 0; }

.entry > section { margin-bottom: 26px; }

/* Content images */
.entry img {
    max-width: 100%;
    max-height: 440px;
    width: auto;
    height: auto;
    margin: 16px 0;
    border: 1px solid var(--line);
    background: #fff;
    padding: 4px;
}

.entry h2 {
    font-size: 25px;
    font-weight: 700;
    color: var(--brand-deep);
    line-height: 1.28;
    margin: 6px 0 14px;
}

.entry h2::after {
    content: "";
    display: block;
    width: 54px;
    height: 3px;
    background: var(--leaf);
    margin-top: 8px;
}

.entry h3 {
    font-size: 18.5px;
    font-weight: 700;
    color: var(--ink);
    margin: 18px 0 10px;
}

.entry p {
    margin-bottom: 15px;
    color: var(--ink-soft);
}

.entry ul,
.entry ol {
    margin: 12px 0 18px 24px;
    color: var(--ink-soft);
}

.entry li { margin-bottom: 7px; }

.entry dl { margin: 14px 0 18px; }

.entry dt { font-weight: 700; color: var(--ink); margin-top: 10px; font-family: 'Bitter', Georgia, serif; }
.entry dd { margin-left: 0; color: var(--ink-soft); padding-left: 14px; border-left: 3px solid var(--leaf-wash); }

/* Print-style double-rule divider */
.twin-rule {
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    height: 5px;
    width: 110px;
    margin: 28px auto 28px 0;
}

/* =========================================================
   PANEL (right column) - index-card styling
   ========================================================= */
.panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 14px;
}

.panel-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 15px 16px 13px;
    box-shadow: 0 1px 2px rgba(40,28,15,.06);
}

.panel-card h4 {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--brand-deep);
    margin-bottom: 10px;
    padding-bottom: 7px;
    border-bottom: 2px dashed var(--line);
}

.panel-card ul {
    list-style: none;
    margin: 0;
}

.panel-card li {
    padding: 6px 0;
    font-size: 13.5px;
    border-bottom: 1px dotted var(--line-soft);
}

.panel-card li:last-child { border-bottom: 0; }

.panel-card li a {
    text-decoration: none;
    color: var(--ink-soft);
    display: block;
}

.panel-card li a:hover { color: var(--leaf-deep); text-decoration: underline; }

.panel-card img {
    border: 1px solid var(--line-soft);
    margin-bottom: 10px;
}

.panel-facts {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.6;
}

.panel-facts strong {
    color: var(--brand-deep);
    display: block;
    margin-top: 8px;
    font-family: 'Bitter', Georgia, serif;
}

.panel-facts strong:first-child { margin-top: 0; }

/* Panel search variation - stack widget fields */
.panel-search .search-widget .search-form {
    grid-template-columns: 1fr;
    gap: 8px;
}

.panel-search .search-widget .phone-row {
    grid-template-columns: 1fr;
    gap: 8px;
}

.panel-search .search-widget .search-form-phone .search-input {
    grid-column: auto;
}

.panel-search .spons-note {
    font-size: 11px;
    color: var(--ink-mute);
    text-align: center;
    margin: 6px 0 0;
}

/* =========================================================
   BUREAU CARDS - records-office card grid
   ========================================================= */
.bureau-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 16px;
    margin: 18px 0 24px;
}

.bureau-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-bottom: 3px solid var(--leaf);
    border-radius: 3px;
    padding: 14px 16px;
}

.bureau-card h4 {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--brand-deep);
    margin-bottom: 8px;
    line-height: 1.3;
}

.bureau-card p {
    font-size: 13.5px;
    color: var(--ink-soft);
    margin-bottom: 4px;
    line-height: 1.55;
}

.bureau-card .phone { color: var(--ink); font-weight: 600; }

/* =========================================================
   TABLES - open ruled style (no filled header band)
   ========================================================= */
.ledger-table,
.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0 24px;
    background: var(--card);
    border: 1px solid var(--line);
    font-size: 14.5px;
}

.ledger-table th,
.ledger-table td,
.detail-table th,
.detail-table td {
    padding: 10px 13px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: top;
}

.ledger-table thead th {
    background: var(--card);
    color: var(--leaf-deep);
    font-family: 'Bitter', Georgia, serif;
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: .3px;
    border-bottom: 2px solid var(--brand);
}

.detail-table th {
    background: var(--brand-wash);
    color: var(--ink);
    font-weight: 600;
    width: 36%;
}

.ledger-table tr:last-child td,
.detail-table tr:last-child td,
.detail-table tr:last-child th { border-bottom: 0; }

.ledger-table tbody tr:nth-child(even) td { background: var(--cream); }

/* =========================================================
   ASIDE NOTES (callouts)
   ========================================================= */
.aside-note {
    padding: 13px 16px;
    margin: 18px 0;
    font-size: 14.5px;
    line-height: 1.6;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    color: var(--ink);
}

.aside-note strong { color: var(--brand-deep); font-family: 'Bitter', Georgia, serif; }

.aside-tip  { border-left-color: var(--leaf); background: var(--leaf-wash); }
.aside-key  { border-left-color: var(--brand); background: var(--brand-wash); }
.aside-warn { border-left-color: var(--alert); background: #f7e9e6; }
.aside-warn strong { color: var(--alert); }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
    display: inline-block;
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}

.btn-go { background: var(--leaf); color: #fff; }
.btn-go:hover { background: var(--leaf-deep); color: #fff; }

.btn-plain { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn-plain:hover { background: var(--brand-wash); }

/* =========================================================
   SEARCH WIDGET (markup generated by search.js -
   selector names are fixed, do NOT rename these)
   ========================================================= */
.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(--line);
    border-radius: 3px;
    background: #fff;
}

.search-widget .search-button {
    background: var(--leaf);
    color: #fff;
    font-weight: 600;
    border: none;
    cursor: pointer;
    padding: 12px 14px;
    text-transform: uppercase;
    letter-spacing: .8px;
}

.search-widget .search-button:hover { background: var(--leaf-deep); }

.search-widget .search-input:focus,
.search-widget .search-select:focus {
    outline: none;
    border-color: var(--leaf);
    box-shadow: 0 0 0 2px rgba(46,110,78,.18);
}

/* ---- Phone search form (data-search-type="phone") ---- */
.search-widget .search-form-phone { display: block; }

.search-widget .search-label {
    display: block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--brand-deep);
    margin-bottom: 8px;
    font-size: 13px;
}

.search-widget .phone-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.search-widget .search-form-phone .search-input {
    grid-column: span 3;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 3px;
}

.search-widget .search-form-phone .search-button {
    padding: 12px 14px;
    white-space: nowrap;
}

.search-widget .secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    color: var(--ok);
    font-style: italic;
    font-size: 13.5px;
}

.search-widget .secure-note svg {
    width: 15px;
    height: 15px;
    fill: var(--ok);
    flex-shrink: 0;
}

/* ---- Address search form (data-search-type="address") ---- */
.search-widget .search-form-address { display: block; }

.search-widget .address-row {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr;
    gap: 10px;
    align-items: end;
}

.search-widget .address-row .field { display: flex; flex-direction: column; }

.search-widget .search-form-address .search-input,
.search-widget .search-form-address .search-select {
    width: 100%;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 3px;
}

.search-widget .search-form-address .search-button {
    padding: 12px 14px;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .search-widget .address-row { grid-template-columns: 1fr; }
    .search-widget .search-form-address .search-button { width: 100%; }
}

/* ---- Stacked Name + Phone widget (data-search-type="name-phone") ---- */
.search-widget .np-block .search-label { margin-bottom: 6px; }

.search-widget .np-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    color: var(--ink-mute);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .7px;
}

.search-widget .np-or::before,
.search-widget .np-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line-soft);
}

/* =========================================================
   BASEMENT (footer) - LIGHT, print-style
   ========================================================= */
.basement {
    background: var(--brand-wash);
    border-top: 4px double var(--brand);
    color: var(--ink-soft);
    margin-top: 42px;
    font-size: 14px;
}

.basement-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 30px 0 22px;
}

.basement-grid h5 {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--brand-deep);
    margin-bottom: 11px;
    padding-bottom: 6px;
    border-bottom: 2px dashed var(--line);
}

.basement-grid ul { list-style: none; }
.basement-grid li { margin-bottom: 7px; }
.basement-grid a { color: var(--ink-soft); text-decoration: none; }
.basement-grid a:hover { color: var(--leaf-deep); text-decoration: underline; }

.basement-legal {
    border-top: 1px solid var(--line);
    padding: 15px 0;
    font-size: 12.5px;
    color: var(--ink-mute);
    line-height: 1.6;
}

.basement-legal strong { color: var(--ink-soft); }

.basement-base {
    background: #e6ddcc;
    border-top: 1px solid var(--line);
    padding: 12px 0;
    text-align: center;
    font-size: 12px;
    color: var(--ink-mute);
}

.basement-base a { color: var(--ink-soft); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
    .columns { grid-template-columns: 1fr; }
    .panel { position: static; }
    .basement-grid { grid-template-columns: 1fr 1fr; }
    .title-block h1 { font-size: 27px; }
}

@media (max-width: 700px) {
    .navline a { padding: 9px 10px; font-size: 12px; letter-spacing: .5px; }
    .search-widget .search-form { grid-template-columns: 1fr; }
    .search-widget .phone-row { grid-template-columns: 1fr; }
    .search-widget .search-form-phone .search-input { grid-column: auto; }
    .search-widget .search-button { padding: 14px; }
    .entry h2 { font-size: 21px; }
    .title-block { padding: 22px 0 14px; }
    .title-block h1 { font-size: 23px; }
    .basement-grid { grid-template-columns: 1fr; gap: 22px; }
}


/* =========================================================
   STACKED SEARCH DIVIDER - separates the name-phone widget
   from the address widget when all three are stacked in one
   lookup box (home page). Mirrors the widget's internal np-or.
   ========================================================= */
.lookup-box .stack-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    color: var(--ink-mute);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .7px;
}
.lookup-box .stack-or::before,
.lookup-box .stack-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line-soft);
}

/* Stacked home box: keep a single "secure connection" note (the address form's, at the bottom) */
.lookup-tri .search-form-phone .secure-note { display: none; }

/* Stacked home box: give the address block a "BY ..." header matching the
   name/phone blocks, and hide the now-redundant per-field labels so all three
   blocks read the same (header + fields). */
.lookup-tri .stack-label {
    display: block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--brand-deep);
    margin-bottom: 8px;
    font-size: 13px;
}
.lookup-tri .search-form-address .search-label { display: none; }
