/*
Theme Name: Retired Monterey Police
Description: Retired MPD community and members portal
Version: 1.0.0
Requires PHP: 8.4
*/
:root {
    color-scheme: light;
    --bg: #f0f5fa;
    --surface: #fff;
    --soft: #e7f0f9;
    --line: #c8d8e8;
    --ink: #10243c;
    --muted: #496178;
    --accent: #14568a;
    --on-accent: #fff;
    --hover: #103d65;
    --focus: #0078af;
    --shadow: 0 20px 55px -34px #2e527c69;
    --radius: 22px;
    font-family: "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c1725;
    --surface: #142438;
    --soft: #192f47;
    --line: #304963;
    --ink: #f1f7ff;
    --muted: #b2c5d8;
    --accent: #8ecaff;
    --on-accent: #0b233b;
    --hover: #b6ddff;
    --focus: #74cdff;
    --shadow: 0 20px 55px -34px #02050b;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 1rem; line-height: 1.6; min-height: 100vh; }
body:not(.login) { display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; height: auto; }
figure, h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.14; letter-spacing: -.025em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.skip-link, .screen-reader-text:not(:focus) { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; }
.skip-link:focus { inset: 10px auto auto 10px; clip-path: none; width: auto; height: auto; z-index: 20; background: var(--surface); padding: 10px; }
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.mast-inner { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; line-height: 1.25; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 4px; color: var(--muted); font-size: .83rem; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 44px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); color: var(--accent); font-size: .86rem; font-weight: 800; letter-spacing: .08em; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.button, .theme-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 9px 19px; border-radius: 10px; border: 1px solid transparent;
    font-size: .95rem; font-weight: 700; line-height: 1.3; text-decoration: none;
}
.button { background: var(--accent); color: var(--on-accent); }
.button:hover { background: var(--hover); color: var(--on-accent); }
.button.compact, .theme-toggle { min-height: 40px; padding: 7px 13px; font-size: .875rem; }
.button.subtle, .theme-toggle { background: var(--surface); color: var(--ink); border-color: var(--line); }
.button.subtle:hover, .theme-toggle:hover { background: var(--soft); color: var(--ink); }
.theme-toggle [aria-hidden] { font-size: 1.2rem; line-height: 1; }
.public-main { padding-block: 46px 55px; }
.public-hero {
    min-height: 480px; display: grid; grid-template-columns: 1.13fr 1fr; align-items: center; gap: 36px;
    padding: clamp(32px, 5.5vw, 72px); border-radius: 26px; border: 1px solid var(--line); box-shadow: var(--shadow);
    background: radial-gradient(ellipse at 96% 20%, var(--soft), transparent 65%), var(--surface);
}
.eyebrow { font-size: .82rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .105em; margin-bottom: 10px; }
.hero-copy h1 { font-size: clamp(2.7rem, 5.7vw, 5.1rem); line-height: .99; letter-spacing: -.072em; }
.hero-copy h1 span { color: var(--accent); }
.hero-lead { color: var(--muted); max-width: 36ch; font-size: clamp(1.05rem, 1.5vw, 1.23rem); margin: 22px 0 27px; }
.hero-art { padding: 0; overflow: hidden; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero-art img { display: block; width: 100%; }
.resources { margin-top: 30px; }
.resources h2 { font-size: 1.3rem; margin-bottom: 13px; }
.resource-grid, .dashboard, .field-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.resource { padding: 17px 22px; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); border-radius: 14px; }
.resource span { font-size: .9rem; color: var(--muted); }
.resource:hover { border-color: var(--accent); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { min-height: 74px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; font-size: .875rem; padding-block: 12px; }
.footer-dot { margin-inline: 4px; }
.member-nav { border-top: 1px solid var(--line); }
.member-nav .shell { display: flex; flex-wrap: wrap; gap: 3px 20px; }
.member-nav a { padding: 12px 1px 9px; color: var(--muted); font-weight: 650; text-decoration: none; border-bottom: 3px solid transparent; }
.member-nav a:hover, .member-nav [aria-current="page"] { color: var(--accent); border-color: var(--accent); }
.interior { padding-block: 33px 58px; }
.narrow { max-width: 790px; }
.page-title { font-size: clamp(2rem, 4.5vw, 3.1rem); margin-bottom: 12px; }
.intro { color: var(--muted); margin-bottom: 22px; }
.content-panel, .empty { padding: clamp(18px, 3.4vw, 34px); }
.content-panel p, .empty p { margin-block: 10px; }
.members-hero { display: grid; grid-template-columns: 1fr minmax(155px, 265px); align-items: center; gap: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); padding: clamp(20px, 4vw, 42px); margin-bottom: 22px; }
.members-hero h1 { font-size: clamp(2rem, 4.5vw, 3.6rem); }
.members-hero p:not(.eyebrow) { color: var(--muted); margin: 10px 0 18px; }
.member-badge { width: 100%; height: auto; border-radius: 14px; display: block; }
.directory-hero { grid-template-columns: 1fr minmax(130px, 190px); }
.dashboard { grid-template-columns: 1.35fr 1fr; gap: 22px; align-items: start; }
.dashboard-panel { padding: clamp(15px, 3vw, 28px); }
.dashboard h2 { font-size: clamp(1.3rem, 2.5vw, 1.75rem); }
.calendar-heading { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.calendar-actions { display: flex; gap: 5px; }
.calendar { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: center; }
.calendar th { font-size: .89rem; color: var(--muted); font-weight: 600; padding-block: 5px; }
.calendar abbr { text-decoration: none; }
.calendar td { border: 1px solid var(--line); height: 44px; }
.calendar-day { display: grid; width: max(100%, 34px); max-width: 100%; place-items: center; min-height: 42px; color: var(--ink); }
.calendar-day[aria-current="date"] { outline: 2px solid var(--accent); outline-offset: -3px; font-weight: 800; }
.calendar-day.has-event { background: var(--soft); color: var(--accent); font-weight: 800; }
.events { margin-top: 20px; }
.events h3 { margin-bottom: 6px; font-size: 1.08rem; }
.events > p { color: var(--muted); }
.event-day { display: grid; grid-template-columns: 66px 1fr; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.event-day time { color: var(--accent); font-weight: 750; }
summary { cursor: pointer; }
.event-day summary { font-weight: 650; }
.event-day p { margin: 5px 0; }
.featured figure, .photo-placeholder { margin-block: 16px; }
.featured img { display: block; width: 100%; border-radius: 12px; }
.featured figcaption { color: var(--muted); margin-top: 6px; }
.photo-placeholder { display: grid; place-content: center; text-align: center; min-height: 220px; padding: 18px; background: var(--soft); border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.photo-placeholder span:first-child { font-size: 2rem; color: var(--accent); }
.stack { display: grid; gap: 12px; }
.issue { padding: 18px 23px; }
.issue summary strong { color: var(--ink); display: inline-block; margin-left: 6px; }
.issue time { color: var(--muted); font-size: .89rem; margin-left: 5px; }
.issue-content { padding: 12px 4px 2px; }
.issue-content p + p { margin-top: 10px; }
.gallery-grid, .directory-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery-card { overflow: hidden; }
.gallery-card img { display: block; height: auto; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gallery-card > div { padding: 15px 18px 18px; }
.gallery-card h2, .person h2 { font-size: 1.19rem; }
.gallery-card p { color: var(--muted); margin-top: 7px; }
.directory-search { max-width: 480px; margin-bottom: 20px; }
.search-actions { display: flex; gap: 8px; }
label, legend { font-weight: 650; }
input:not([type="checkbox"],[type="radio"],[type="submit"]), textarea, select {
    width: 100%; min-height: 43px; padding: 9px 11px; color: var(--ink); background: var(--surface);
    border: 1px solid var(--line); border-radius: 8px; box-shadow: none;
}
input[readonly] { background: var(--soft); }
input[type="checkbox"] { accent-color: var(--accent); }
.avatar { width: 56px; height: 56px; flex: 0 0 56px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: var(--soft); color: var(--accent); font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person { display: flex; align-items: center; gap: 12px; padding: 15px; }
.pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pagination:empty { display: none; }
.page-numbers { min-width: 36px; padding: 3px 9px; text-align: center; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.page-numbers.current { color: var(--on-accent); background: var(--accent); }
.profile-form h2 { font-size: 1.4rem; }
.profile-form .field-grid { margin-top: 15px; }
.profile-form input:not([type="checkbox"]) { display: block; margin-top: 4px; }
.photo-field { display: flex; align-items: center; gap: 15px; margin-block: 20px; }
.photo-field small { display: block; margin-top: 4px; font-weight: 400; color: var(--muted); }
.profile-form fieldset { border: 1px solid var(--line); padding: 12px 16px 15px; border-radius: 12px; margin: 18px 0; }
.check { display: flex; gap: 9px; align-items: baseline; margin-bottom: 4px; }
.muted { color: var(--muted); }
.notice { padding: 10px 15px; background: var(--soft); border-radius: 8px; margin-bottom: 12px; }
.setup-steps { padding-left: 22px; margin: 12px 0 20px; }
.setup-steps li { margin-bottom: 8px; }
#bbpress-forums { color: var(--ink); font-size: 1rem; }
#bbpress-forums div.bbp-breadcrumb, #bbpress-forums div.bbp-topic-tags { font-size: .9rem; }
#bbpress-forums ul.bbp-forums, #bbpress-forums ul.bbp-topics, #bbpress-forums ul.bbp-replies, #bbpress-forums fieldset.bbp-form { border-color: var(--line); font-size: .96rem; }
#bbpress-forums li.bbp-header, #bbpress-forums li.bbp-footer,
#bbpress-forums div.bbp-forum-header, #bbpress-forums div.bbp-topic-header, #bbpress-forums div.bbp-reply-header,
#bbpress-forums #bbp-user-wrapper ul.bbp-lead-topic, #bbpress-forums #bbp-user-wrapper ul.bbp-topics { background: var(--soft); border-color: var(--line); color: var(--ink); }
#bbpress-forums div.odd, #bbpress-forums ul.odd, #bbpress-forums div.even, #bbpress-forums ul.even,
#bbpress-forums li.bbp-body ul.forum, #bbpress-forums li.bbp-body ul.topic { background: var(--surface); border-color: var(--line); }
#bbpress-forums .bbp-forum-title, #bbpress-forums .bbp-topic-permalink { font-weight: 750; }
#bbpress-forums div.bbp-forum-content, #bbpress-forums div.bbp-topic-content, #bbpress-forums div.bbp-reply-content { overflow-wrap: anywhere; }
div.bbp-template-notice, div.indicator-hint { background: var(--soft); color: var(--ink); border-color: var(--line); }
#bbpress-forums button, #bbp_search_submit { min-height: 38px; border-radius: 8px; border: 0; padding: 6px 12px; color: var(--on-accent); background: var(--accent); cursor: pointer; }
#bbp-search-form { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; max-width: 460px; }
body.login { display: grid; grid-template-columns: minmax(280px, 510px) minmax(300px, 440px); column-gap: clamp(20px, 7vw, 100px); align-content: center; justify-content: center; align-items: center; padding: 30px; }
body.login::before { content: ""; width: 100%; aspect-ratio: 1; background: #fff var(--flag-badge) center/contain no-repeat; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.login #login { width: 100%; padding: 26px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); margin: 0; }
.login #login h1 a { width: auto; height: auto; background: none; color: var(--ink); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 750; line-height: 1.14; margin: 4px 0 20px; text-indent: 0; text-align: left; }
.login form { background: var(--surface); border: 0; padding: 0; box-shadow: none; color: var(--ink); }
.login form .input, .login input[type="text"], .login input[type="password"] { font-size: 1.03rem; color: var(--ink); background: var(--surface); border-color: var(--line); }
.login .button-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); min-height: 42px; }
.login .button-primary:hover { background: var(--hover); color: var(--on-accent); }
.login #backtoblog a, .login #nav a, .login .privacy-policy-page-link a { color: var(--accent); }
.login #backtoblog, .login #nav { padding: 0; }
.login .notice, .login .message, .login #login_error { background: var(--soft); color: var(--ink); }
.login-theme { position: fixed; bottom: 10px; right: 15px; z-index: 2; }
@media (max-width: 820px) {
    .shell { width: calc(100% - 38px); }
    .public-hero { gap: 24px; min-height: 0; }
    .dashboard { grid-template-columns: minmax(0, 1fr); }
    .directory-grid, .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .shell { width: calc(100% - 28px); }
    .mast-inner { min-height: 74px; flex-wrap: wrap; column-gap: 10px; row-gap: 8px; padding-block: 10px; }
    .brand-mark { width: 39px; height: 36px; font-size: .7rem; }
    .brand { gap: 7px; font-size: .91rem; }
    .brand small { font-size: .75rem; }
    .public-main, .interior { padding-top: 21px; }
    .public-hero { grid-template-columns: minmax(0, 1fr); padding: 23px; }
    .hero-copy h1 { font-size: clamp(2.45rem, 9.3vw, 3.25rem); }
    .hero-art { width: min(100%, 350px); justify-self: center; }
    .resource-grid, .field-grid, .gallery-grid, .directory-grid { grid-template-columns: minmax(0, 1fr); }
    .members-hero, .directory-hero { grid-template-columns: 1fr; gap: 12px; }
    .member-badge { width: min(100%, 225px); }
    .member-nav .shell { gap: 0 16px; }
    .member-nav a { font-size: .91rem; padding-top: 8px; }
    .photo-field { align-items: flex-start; }
}
@media (max-width: 730px) {
    body.login { grid-template-columns: minmax(0, 440px); padding: 18px 18px 65px; gap: 15px; }
    body.login::before { width: 135px; min-height: 0; justify-self: center; }
    .login-theme { position: absolute; }
}
