/* Local Lookout - shared app styles. MOBILE-FIRST: base rules target phones,
 * min-width media queries add layout for tablets and desktops.
 * Touch targets are >= 44px and form fields use 16px text so iOS does not zoom. */

:root {
    --ll-navy: #0B2D5B;
    --ll-navy-2: #12427f;
    --ll-teal: #00BAA6;
    --ll-teal-dark: #007c70;     /* teal that passes AA contrast as text on white */
    --ll-ink: #17324d;
    --ll-muted: #4f6676;
    --ll-line: #d9e4e8;
    --ll-bg: #f7fafb;
    --ll-danger: #b42318;
    --ll-danger-bg: #fdecea;
    --ll-warn-bg: #fff6e0;
    --ll-ok-bg: #e6f6ef;
    --ll-radius: .6rem;
}

html { -webkit-text-size-adjust: 100%; }
body { padding-bottom: env(safe-area-inset-bottom, 0); }
a { color: #0b5cad; }

.skip-link {
    position: absolute; left: .5rem; top: -4rem; z-index: 3000; background: #fff; color: var(--ll-navy);
    padding: .7rem 1rem; border-radius: .4rem; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: .5rem; }

/* ---------- header account actions (anchors + sign-out form) ---------- */
.site-account-actions { flex-wrap: wrap; gap: .5rem; }
.site-acct-link, .site-account-actions .site-join-button, .site-signout-form button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem;
    padding: .4rem .9rem; border-radius: .4rem; font-size: .9rem; font-weight: 600; text-decoration: none;
    border: 1px solid #fff; background: transparent; color: #fff; white-space: nowrap; cursor: pointer;
}
.site-account-actions .site-join-button { background: var(--ll-teal); border-color: var(--ll-teal); color: #062c36; }
.site-acct-link:hover, .site-signout-form button:hover { background: rgba(255,255,255,.14); color: #fff; }
.site-account-actions .site-join-button:hover { background: #00d1bb; color: #062c36; }
.site-acct-link.is-current { border-color: var(--ll-teal); color: var(--ll-teal); }
.site-signout-form { margin: 0; }
.site-nav-links a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* ---------- footer (public pages) ---------- */
.site-footer { background: #0a2347; color: #c9dbee; margin-top: 3rem; border-top: 0; }
.site-footer a { color: #e4f0fb; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer a:focus-visible { outline: 3px solid var(--ll-teal); outline-offset: 3px; border-radius: .2rem; }
.site-footer h2 { font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: #8fe3d8; margin: 0 0 .75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }

.footer-cta { background: linear-gradient(120deg, #00897a 0%, #00a392 45%, #0e8fb0 100%); color: #fff; }
.footer-cta-inner { display: grid; gap: 1rem; padding-block: 1.75rem; align-items: center; }
.footer-cta h2 { color: #fff; font-size: clamp(1.25rem, 4vw, 1.7rem); font-weight: 800; letter-spacing: 0; text-transform: none; margin: 0 0 .3rem; }
.footer-cta p { margin: 0; color: #e8fbf8; max-width: 42rem; }
.footer-cta-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.footer-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: .55rem 1.25rem; border-radius: .5rem; font-weight: 800; width: 100%; text-decoration: none !important; }
.site-footer .footer-btn-primary { background: #fff; color: #06444a; }
.site-footer .footer-btn-primary:hover { background: #e8fbf8; color: #06444a; }
.site-footer .footer-btn-ghost { border: 2px solid rgba(255,255,255,.85); color: #fff; }
.site-footer .footer-btn-ghost:hover { background: rgba(255,255,255,.15); color: #fff; }

.footer-main { display: grid; gap: 1.75rem 1.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: 2.25rem 1.5rem; }
.footer-brand { grid-column: 1 / -1; }
.footer-logo { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.25rem; font-weight: 800; color: #fff !important; min-height: 2.75rem; }
.footer-brand p { margin: .6rem 0 0; max-width: 30rem; font-size: .95rem; line-height: 1.55; }
.footer-emergency { color: #ffd9d4; }
.footer-col li a { display: inline-flex; align-items: center; min-height: 2.5rem; font-size: .95rem; }

.footer-areas { border-top: 1px solid rgba(255,255,255,.12); padding-block: 1.25rem; }
.footer-areas ul { display: flex; flex-wrap: wrap; gap: .4rem; }
.footer-areas a { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .25rem .8rem; border: 1px solid rgba(255,255,255,.22); border-radius: 2rem; font-size: .88rem; }
.footer-areas a:hover { background: rgba(255,255,255,.1); text-decoration: none; }

.footer-bottom { background: #071a38; }
.footer-bottom-inner { padding-block: 1.25rem; display: grid; gap: .6rem; font-size: .82rem; line-height: 1.6; color: #a9c1da; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: #cfe3f5; text-decoration: underline; }
.footer-copy { color: #fff; font-weight: 600; }
.footer-note { color: #8fa9c4; }

/* admin screens keep a quiet footer */
.admin-footer { background: #fff; border-top: 1px solid var(--ll-line); padding: 1.1rem 0 1.4rem; }
.admin-footer small { color: var(--ll-muted); }
/* ---------- layout helpers ---------- */
.page { padding-block: 1.25rem 2.5rem; }
.page-narrow { width: 100%; max-width: 30rem; margin-inline: auto; }
.page-title { font-size: clamp(1.6rem, 5vw, 2.25rem); font-weight: 750; margin: 0 0 .4rem; color: var(--ll-navy); }
.page-lead { color: var(--ll-muted); margin: 0 0 1.25rem; }
.breadcrumbs { font-size: .85rem; margin: 0 0 .75rem; color: var(--ll-muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: .5rem; color: #8aa0ae; }
.breadcrumbs a { color: var(--ll-muted); }

.card-ll { background: #fff; border: 1px solid var(--ll-line); border-radius: var(--ll-radius); padding: 1rem; }
.card-ll > h2:first-child, .card-ll > h3:first-child { margin-top: 0; }
.card-title { font-size: 1.1rem; font-weight: 750; margin: 0 0 .6rem; color: var(--ll-navy); }
.stack { display: grid; gap: 1rem; }
.muted { color: var(--ll-muted); }
.small { font-size: .85rem; }

/* ---------- buttons ---------- */
.btn-ll, .btn-ll-outline, .btn-ll-danger {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.9rem;
    padding: .6rem 1.2rem; border-radius: .45rem; font-weight: 700; font-size: 1rem; line-height: 1.2;
    text-decoration: none; cursor: pointer; border: 2px solid transparent; width: 100%;
}
.btn-ll { background: var(--ll-navy); color: #fff; border-color: var(--ll-navy); }
.btn-ll:hover { background: var(--ll-navy-2); border-color: var(--ll-navy-2); color: #fff; }
.btn-ll-outline { background: #fff; color: var(--ll-navy); border-color: var(--ll-navy); }
.btn-ll-outline:hover { background: #eef4fa; color: var(--ll-navy); }
.btn-ll-danger { background: #fff; color: var(--ll-danger); border-color: var(--ll-danger); }
.btn-ll-danger:hover { background: var(--ll-danger-bg); color: var(--ll-danger); }
.btn-ll:focus-visible, .btn-ll-outline:focus-visible, .btn-ll-danger:focus-visible,
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
    outline: 3px solid var(--ll-teal); outline-offset: 2px;
}
.btn-sm { min-height: 2.75rem; padding: .4rem .9rem; font-size: .92rem; width: auto; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn-row > .btn-ll, .btn-row > .btn-ll-outline, .btn-row > .btn-ll-danger { flex: 1 1 100%; }

/* ---------- forms ---------- */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field label, .field .label { font-weight: 700; font-size: .95rem; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="search"],
.field input[type="date"], .field input[type="time"], .field input[type="number"], .field input[type="url"], .field input[type="tel"],
.field input[type="file"], .field select, .field textarea {
    width: 100%; min-height: 2.9rem; padding: .6rem .8rem; font-size: 1rem; color: var(--ll-ink);
    background: #fff; border: 2px solid #b8c9d2; border-radius: .45rem;
}
.field textarea { min-height: 9rem; resize: vertical; line-height: 1.45; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--ll-danger); }
.field-hint { color: var(--ll-muted); font-size: .85rem; margin: 0; }
.field-error { color: var(--ll-danger); font-size: .9rem; font-weight: 600; margin: 0; }
.check { display: grid; grid-template-columns: 1.4rem 1fr; gap: .65rem; align-items: start; font-size: .95rem; }
.check input { width: 1.4rem; height: 1.4rem; margin-top: .1rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.counter { text-align: right; color: var(--ll-muted); font-size: .8rem; }

/* ---------- alerts + badges ---------- */
.alert { border-radius: var(--ll-radius); padding: .85rem 1rem; margin: 0 0 1rem; font-size: .95rem; border: 1px solid; }
.alert-success { background: var(--ll-ok-bg); border-color: #a5dcc3; color: #0b5a3a; }
.alert-error   { background: var(--ll-danger-bg); border-color: #f2b8b2; color: #7a1c14; }
.alert-info    { background: #eaf3fc; border-color: #b6d3ee; color: #0b3a66; }
.badge { display: inline-block; border-radius: 2rem; padding: .15rem .65rem; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-pending  { background: #fff0c9; color: #6b4a00; }
.badge-approved { background: #d7f2e5; color: #0b5a3a; }
.badge-rejected, .badge-removed, .badge-suspended { background: #fde0dd; color: #7a1c14; }
.badge-expired  { background: #e6ebef; color: #46586a; }
.badge-flagged  { background: #f8d7f0; color: #6d155a; }
.badge-role     { background: #e1ecfb; color: #0b3a66; }
.badge-active   { background: #d7f2e5; color: #0b5a3a; }

/* ---------- member control panel ---------- */
.acct-tabs {
    display: flex; gap: .25rem; overflow-x: auto; margin: 0 0 1.25rem; padding: 0 0 .25rem;
    border-bottom: 2px solid var(--ll-line); -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.acct-tabs a {
    flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 2.9rem; padding: .4rem .95rem;
    text-decoration: none; color: var(--ll-muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.acct-tabs a[aria-current="page"] { color: var(--ll-navy); border-bottom-color: var(--ll-teal); }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.stat { background: #fff; border: 1px solid var(--ll-line); border-radius: var(--ll-radius); padding: .85rem; }
.stat-num { display: block; font-size: 1.75rem; font-weight: 800; color: var(--ll-navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--ll-muted); font-size: .85rem; }
.stat.is-alert { border-color: #f0c36d; background: var(--ll-warn-bg); }

.item-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.item { background: #fff; border: 1px solid var(--ll-line); border-radius: var(--ll-radius); padding: .9rem; display: grid; gap: .5rem; }
.item-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.item-title { font-weight: 750; margin: 0; font-size: 1rem; color: var(--ll-navy); overflow-wrap: anywhere; }
.item-meta { color: var(--ll-muted); font-size: .85rem; margin: 0; }
.item-body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.empty { text-align: center; padding: 1.75rem 1rem; color: var(--ll-muted); }

/* ---------- admin panel ---------- */
.admin-bar { background: #0a1f3d; color: #fff; }
.admin-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 3.5rem; }
.admin-brand { color: #fff; font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; }
.admin-brand small { font-weight: 600; color: #8fe3d8; letter-spacing: .04em; text-transform: uppercase; font-size: .7rem; }
.admin-bar a.admin-out, .admin-bar button { color: #fff; font-size: .9rem; min-height: 2.75rem; padding: .3rem .8rem; background: transparent; border: 1px solid rgba(255,255,255,.5); border-radius: .4rem; text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.admin-nav { background: #12305c; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-nav .container { display: flex; gap: .25rem; }
.admin-nav a { color: #cfe3f5; text-decoration: none; padding: .55rem .9rem; display: inline-flex; align-items: center; min-height: 2.9rem; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; }
.admin-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--ll-teal); }
.admin-page { padding-block: 1.25rem 3rem; }
.admin-page h1 { font-size: 1.5rem; font-weight: 750; color: var(--ll-navy); margin: 0 0 1rem; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.filter-tabs a { padding: .45rem .85rem; min-height: 2.5rem; display: inline-flex; align-items: center; gap: .4rem; border: 1px solid #b8c9d2; border-radius: 2rem; text-decoration: none; color: var(--ll-ink); background: #fff; font-size: .9rem; font-weight: 600; }
.filter-tabs a[aria-current="page"] { background: var(--ll-navy); color: #fff; border-color: var(--ll-navy); }
.filter-tabs .count { font-variant-numeric: tabular-nums; opacity: .8; }
.mod-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; border-top: 1px solid var(--ll-line); padding-top: .75rem; margin-top: .25rem; }
.mod-actions form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin: 0; }
.mod-actions input[type="text"] { min-height: 2.75rem; padding: .4rem .7rem; border: 2px solid #b8c9d2; border-radius: .4rem; font-size: .95rem; flex: 1 1 10rem; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-top: 1rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; margin: 0; font-size: .9rem; }
.kv dt { color: var(--ll-muted); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Tables become stacked cards on phones (cells carry data-label), real tables from 768px. */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; }
.data-table thead { position: absolute; left: -9999px; }
.data-table tr { display: block; border: 1px solid var(--ll-line); border-radius: var(--ll-radius); margin-bottom: .75rem; padding: .5rem .8rem; background: #fff; }
.data-table td { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border: 0; text-align: right; overflow-wrap: anywhere; }
.data-table td::before { content: attr(data-label); font-weight: 700; color: var(--ll-muted); text-align: left; flex: 0 0 auto; }
.data-table td.cell-actions { display: block; text-align: left; }
.data-table td.cell-actions::before { display: none; }

/* ---------- SEO landing pages ---------- */
.prose { max-width: 46rem; line-height: 1.65; }
.prose h2 { font-size: 1.3rem; font-weight: 750; margin: 1.75rem 0 .5rem; color: var(--ll-navy); }
.prose p, .prose li { color: #29465c; }
.area-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.area-links a { display: flex; align-items: center; min-height: 2.75rem; padding: .4rem .75rem; background: #fff; border: 1px solid var(--ll-line); border-radius: .45rem; text-decoration: none; font-weight: 600; color: var(--ll-navy); }
.area-links a:hover { border-color: var(--ll-teal); }
.facts { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--ll-line); border-radius: var(--ll-radius); overflow: hidden; }
.facts th, .facts td { padding: .6rem .8rem; border-bottom: 1px solid var(--ll-line); text-align: left; font-size: .95rem; }
.facts th { background: #f1f6f8; }
.facts td:last-child, .facts th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- >= 640px ---------- */
@media (min-width: 640px) {
    .footer-cta-inner { grid-template-columns: 1fr auto; }
    .footer-btn { width: auto; }
    .footer-main { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .footer-bottom-inner { grid-template-columns: 1fr; }
    .btn-ll, .btn-ll-outline, .btn-ll-danger { width: auto; }
    .btn-row > .btn-ll, .btn-row > .btn-ll-outline, .btn-row > .btn-ll-danger { flex: 0 0 auto; }
    .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .area-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-inner { grid-template-columns: 1fr auto; align-items: center; }
    .card-ll { padding: 1.25rem; }
}

/* ---------- >= 768px: real tables ---------- */
@media (min-width: 768px) {
    .data-table thead { position: static; }
    .data-table tr { display: table-row; border: 0; border-radius: 0; margin: 0; padding: 0; }
    .data-table th, .data-table td { display: table-cell; padding: .65rem .75rem; border-bottom: 1px solid var(--ll-line); text-align: left; vertical-align: top; }
    .data-table th { background: #f1f6f8; font-size: .85rem; }
    .data-table td::before { display: none; }
    .data-table td.cell-actions { display: table-cell; }
    .table-wrap { border: 1px solid var(--ll-line); border-radius: var(--ll-radius); }
}

/* ---------- >= 992px ---------- */
@media (min-width: 992px) {
    .footer-main { grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); }
    .footer-brand { grid-column: auto; }
    .page { padding-block: 2rem 3.5rem; }
    .area-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .two-col { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.5rem; align-items: start; }
}

@media (prefers-reduced-motion: no-preference) {
    .btn-ll, .btn-ll-outline, .btn-ll-danger, .acct-tabs a { transition: background-color .15s ease, border-color .15s ease; }
}

/* small event picture in lists (account, admin) */
.ev-mini { width: 7rem; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .45rem; display: block; background: #dfe9ee; }
