/* =========================================================
   Waterford Township Tax Lookup — Stylesheet
   ========================================================= */

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

/* ---- Accessibility utilities ---- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: .5rem 1rem;
    z-index: 1000;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #ffbf00;
    outline-offset: 0;
}

/* Baseline visible focus for keyboard users on anything focusable */
:focus-visible {
    outline: 3px solid #ffbf00;
    outline-offset: 2px;
}

main:focus { outline: none; }

:root {
    --navy:      #1a3a5c;
    --blue:      #1d6fa4;
    --blue-light:#e8f2fa;
    --green:     #2e7d32;
    --gray-dark: #333;
    --gray:      #666;
    --gray-light:#f4f6f8;
    --border:    #d0d7de;
    --white:     #fff;
    --radius:    6px;
    --shadow:    0 1px 4px rgba(0,0,0,.10);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--gray-dark);
    background: var(--gray-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* ---- Header ---- */
header {
    background: var(--navy);
    color: var(--white);
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    color: inherit;
    text-decoration: none;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 56px;
    width: auto;
    flex-shrink: 0;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: .01em;
}

header p {
    font-size: .9rem;
    opacity: .85;
    margin-top: .15rem;
}

/* ---- Main content ---- */
main {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ---- Cards / sections ---- */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

/* ---- Notices ---- */
.notice {
    background: var(--blue-light);
    border-left: 4px solid var(--blue);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: .92rem;
    color: var(--gray-dark);
}

.notice strong { color: var(--navy); }
.notice a,
.pay-online-bar span a { text-decoration: underline; }

/* ---- Search form ---- */
.search-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: .25rem;
}

.search-subtitle {
    color: var(--gray);
    margin-bottom: 1.25rem;
}

.search-type-toggle {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
}

.toggle-btn {
    padding: .4rem 1rem;
    border: 2px solid var(--blue);
    border-radius: 20px;
    background: var(--white);
    color: var(--blue);
    font-size: .9rem;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.toggle-btn.active {
    background: var(--blue);
    color: var(--white);
}

.search-row {
    display: flex;
    gap: .5rem;
}

.search-input {
    flex: 1;
    padding: .65rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color .15s;
}

.search-input:focus {
    border-color: var(--blue);
}

/* Blue border shift is a compliant focus indicator on its own; suppress the
   global amber ring so autofocus doesn't look alarming on page load. */
.search-input:focus-visible {
    outline: none;
}

.btn-primary {
    display: inline-block;
    padding: .65rem 1.4rem;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary:hover { text-decoration: none; }

.search-instructions { margin-bottom: .75rem; }
.owner-secondary     { font-size: .88rem; color: var(--gray); }
.results-empty       { color: var(--gray); padding: .5rem 0; }
.card-tight          { padding: 1rem 1.5rem; }
.empty-message       { color: var(--gray); font-size: .92rem; }

.btn-primary:hover { background: var(--navy); }

/* Prior years */
.prior-years {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.prior-years-label {
    font-size: .88rem;
    color: var(--gray);
    margin-bottom: .6rem;
}

.year-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.year-pill {
    padding: .3rem .85rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: .88rem;
    font-family: inherit;
    line-height: inherit;
    color: var(--gray-dark);
    background: var(--white);
    cursor: pointer;
    text-decoration: none;
    transition: border-color .15s, color .15s;
}

.year-pill:hover {
    border-color: var(--blue);
    color: var(--blue);
    text-decoration: none;
}

.year-pill.active {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
    font-weight: 600;
    text-decoration: none;
}

/* Current year — larger, more prominent */
.year-pill-current {
    padding: .55rem 1.4rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-width: 2px;
    border-color: var(--blue);
    color: var(--blue);
}

.year-pill-current.active {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
    box-shadow: 0 1px 3px rgba(29,111,164,.25);
}

/* Prior years — smaller, muted */
.year-pill-prior {
    padding: .2rem .65rem;
    font-size: .8rem;
    color: var(--gray);
}

.year-pill-prior.active {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
}

.prior-years-label-sub {
    margin-top: .85rem;
}

/* ---- Results list ---- */
.results-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.results-count {
    font-size: .9rem;
    color: var(--gray);
}

.result-table {
    width: 100%;
    border-collapse: collapse;
}

.result-table th {
    text-align: left;
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .5rem .75rem;
    border-bottom: 2px solid var(--border);
}

.result-table td {
    padding: .7rem .75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.result-table tr:last-child td { border-bottom: none; }
.result-table tr:hover td { background: var(--blue-light); }

.result-address { font-weight: 600; }
.result-owner   { font-size: .88rem; color: var(--gray); }

.season-links { display: flex; gap: .5rem; flex-wrap: wrap; }

.season-link {
    font-size: .85rem;
    padding: .2rem .6rem;
    border: 1px solid var(--blue);
    border-radius: 4px;
    color: var(--blue);
}

.season-link:hover {
    background: var(--blue);
    color: var(--white);
    text-decoration: none;
}

/* ---- Detail page ---- */
.detail-parcel-id {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 1rem;
}

.address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.address-block h3 {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray);
    margin-bottom: .4rem;
}

.address-block p {
    line-height: 1.6;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem 2rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: .35rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .95rem;
}

.summary-row:last-child { border-bottom: none; }
.summary-label { color: var(--gray); }
.summary-value { font-weight: 600; }
.summary-value.highlight { color: var(--navy); font-size: 1.05rem; }

/* ---- Data tables (millage, special assessments) ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}

.data-table th {
    text-align: left;
    font-size: .8rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .5rem .75rem;
    border-bottom: 2px solid var(--border);
}

.data-table th.right,
.data-table td.right { text-align: right; }

.data-table td {
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
}

.data-table tr:nth-child(even) td { background: var(--gray-light); }
.data-table tr:last-child td { border-bottom: none; }

.data-table tfoot td {
    font-weight: 700;
    border-top: 2px solid var(--border);
    border-bottom: none;
    background: var(--white);
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: .75rem;
}

/* ---- Switcher (season / year nav) ---- */
.switcher {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}

.switcher-label {
    font-size: .85rem;
    color: var(--gray);
}

.switcher-link {
    font-size: .85rem;
    padding: .25rem .7rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--gray-dark);
}

.switcher-link.active {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

.switcher-link:hover:not(.active) {
    border-color: var(--blue);
    color: var(--blue);
    text-decoration: none;
}

/* ---- Pay online CTA ---- */
.pay-online-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: linear-gradient(135deg, var(--gray-light), var(--blue-light));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.5rem;
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-dark);
}

.btn-pay {
    display: inline-block;
    padding: .55rem 1.2rem;
    background: var(--blue);
    color: var(--white);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .92rem;
    text-decoration: none;
    transition: background .15s;
    white-space: nowrap;
}

.btn-pay:hover {
    background: var(--navy);
    text-decoration: none;
}

/* ---- Back link ---- */
.back-link {
    display: inline-block;
    font-size: .9rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

.back-link:hover { color: var(--blue); }

/* ---- Error pages ---- */
.error-box {
    text-align: center;
    padding: 3rem 1rem;
}

.error-box h2 {
    font-size: 2rem;
    color: var(--navy);
    margin-bottom: .5rem;
}

.error-box p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

/* ---- Footer ---- */
footer {
    background: var(--navy);
    color: rgba(255,255,255,.92);
    text-align: center;
    font-size: .95rem;
    font-weight: 500;
    padding: 1rem;
    margin-top: auto;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .address-grid  { grid-template-columns: 1fr; }
    .summary-grid  { grid-template-columns: 1fr; }
    .search-row    { flex-direction: column; }
    .btn-primary   { width: 100%; }
    .pay-online-bar { flex-direction: column; gap: .75rem; text-align: center; }
    .btn-pay       { width: 100%; text-align: center; }
    header h1      { font-size: 1.1rem; }
}
