/* Fonts are served from this site (SIL Open Font License; the Source Serif
   licence text is in static/fonts/source-serif-4-OFL.txt): Source Serif 4
   (Adobe's open serif, a sturdy newspaper-style text face) for everything the
   site says, Libre Franklin (a Franklin Gothic revival) for what people type.
   A custom digitization of an early Linotype serif is a long-term goal; see
   docs/FINESS.md. */
@font-face { font-family: 'Source Serif 4'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/source-serif-4-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-weight: 400; font-style: italic; font-display: swap; src: url('../fonts/source-serif-4-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/source-serif-4-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Libre Franklin'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/libre-franklin-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Libre Franklin'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/libre-franklin-latin-600-normal.woff2') format('woff2'); }

:root {
    --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --sans: 'Libre Franklin', 'Franklin Gothic Medium', Arial, Helvetica, sans-serif;
    --ink: #222;
    --ink-soft: #555;
    --rule: #ddd;
    --link: #1b4f8a;
    --field-edge: #8a8f94;
}

/* One step up from the browser's default size, for reading and for typing. */
html { font-size: 112.5%; }

body {
    font-family: var(--serif);
    line-height: 1.55;
    color: var(--ink);
    background: #fff;
    margin: 0;
    padding: 0;
}

h1, h2, h3 { line-height: 1.2; }
a { color: var(--link); }

nav {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #ddd;
}

nav a {
    margin-right: 1.5rem;
    color: #222;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}

main {
    padding: 1.5rem;
    max-width: 960px;
    margin: 0 auto;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.tile {
    display: block;
    padding: 1rem 1.25rem;
    border: 1px solid var(--tile-edge, #ddd);
    border-radius: 6px;
    background: var(--tile-bg, #fff);
    color: #222;
    text-decoration: none;
}

.tile:hover {
    border-color: #222;
    filter: brightness(0.96);
}

/* Very faint tints for the tiles, taken from the hues of Benjamin Moore's
   Mid-Century Modern palette (ochre, terra cotta, gray-blue, tan, peach).
   They are approximations of those hues, not Benjamin Moore's own values.
   Only the background changes: the black text stays as it was. */
.tile-blue  { --tile-bg: #e6edf1; --tile-edge: #cfdbe2; }   /* Wales Gray, Manor Blue */
.tile-sage  { --tile-bg: #eaeee1; --tile-edge: #d6ddc8; }   /* Old Prairie, Balboa Mist */
.tile-ochre { --tile-bg: #f8eed3; --tile-edge: #ebdcb2; }   /* Turmeric, Golden Mist */
.tile-peach { --tile-bg: #f9e8d8; --tile-edge: #eed3b9; }   /* Peach Parfait, Cancun Sand */
.tile-aqua  { --tile-bg: #e1efed; --tile-edge: #c8dedb; }   /* Lucerne, Cloud Cover */
.tile-clay  { --tile-bg: #f6e2d8; --tile-edge: #e8c9ba; }   /* Terra Cotta Tile */
.tile-rose  { --tile-bg: #f6e5e7; --tile-edge: #e7cbd0; }   /* Opulence */
.tile-stone { --tile-bg: #eee8df; --tile-edge: #dcd3c6; }   /* Woodstock Tan, Ashwood */

.tile-title {
    display: block;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.tile-note {
    display: block;
    font-size: 0.9rem;
    color: #555;
}

.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.message {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-left-width: 4px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.message.success { border-left-color: #2e7d32; }
.message.warning { border-left-color: #b26a00; }
.message.error { border-left-color: #b00020; }

form .errorlist {
    color: #b00020;
    list-style: none;
    padding: 0;
    margin: 0.25rem 0;
}

form .helptext {
    display: block;
    font-size: 0.85rem;
    color: #555;
}

table.data {
    border-collapse: collapse;
    width: 100%;
    margin-top: 1rem;
}

table.data th, table.data td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

table.data tr.inactive {
    color: #777;
}

.muted { color: #666; font-size: 0.9rem; }
.flag { color: #b00020; font-size: 0.9rem; }

.rooms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin: 0.75rem 0 1.5rem;
}

.room {
    padding: 0.85rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.room.vacant {
    border-style: dashed;
    background: #fafafa;
}

.room span {
    display: block;
}

.room-name {
    font-weight: bold;
}

.room-status {
    margin: 0.35rem 0 0.15rem;
}

nav form.logout {
    display: inline;
}

nav form.logout button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: #222;
    cursor: pointer;
}

nav form.logout button:hover {
    text-decoration: underline;
}

dialog.notice {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    max-width: 22rem;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

dialog.notice::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

dialog.notice h2 {
    margin-top: 0;
}

dialog.notice button {
    padding: 0.4rem 1.5rem;
    font: inherit;
    cursor: pointer;
}

.request { border-top: 1px solid #ccc; margin-top: 1.5rem; padding-top: 0.5rem; }
.request-photo { max-width: 160px; max-height: 160px; margin: 0.25rem; border: 1px solid #ccc; }

.thread { margin: 0.5rem 0 1rem; }
.post { border-left: 4px solid #999; padding: 0.1rem 0.75rem; margin: 0.6rem 0; background: #fafafa; }
.post.from-staff { border-left-color: #2e5d8f; }
.post.from-resident { border-left-color: #6a8f2e; }
.post-head { margin: 0.3rem 0 0; }
nav { display: flex; flex-wrap: wrap; align-items: center; }
nav .who { margin-left: auto; color: #555; font-size: 0.95em; }

.status-line { margin: 0.4rem 0; font-size: 0.92em; color: #333; border-left: 4px solid #ddd; padding-left: 0.75rem; }
.progress { list-style: none; display: flex; padding: 0; margin: 1rem 0 1.5rem; }
.step { flex: 1; text-align: center; position: relative; font-size: 0.85em; color: #888; padding: 0 0.15rem; }
.step::before { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 3px; background: #ccc; z-index: 0; }
.step:first-child::before { display: none; }
.step .dot { display: block; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid #ccc; margin: 0 auto 0.35rem; position: relative; z-index: 1; box-sizing: border-box; }
.step.done, .step.current { color: #222; }
.step.done::before, .step.current::before { background: #2e7d32; }
.step.done .dot { background: #2e7d32; border-color: #2e7d32; }
.step.current .dot { background: #fff; border-color: #2e7d32; box-shadow: 0 0 0 3px #cfe8d0; }
.step.current .step-label { font-weight: bold; }
.step-label, .step-date { display: block; }
.step-date { font-size: 0.85em; color: #666; min-height: 1.2em; }

/* Monthly Utilities */
.notice-box {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-left: 4px solid #b26a00;
    border-radius: 4px;
}

.utility-form input[type="number"], .utility-form input[type="text"] {
    width: 100%;
    max-width: 12rem;
    box-sizing: border-box;
}

.email-preview {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    background: #fff;
    overflow-x: auto;
}

.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* Rent and Utilities */
.marker { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 3px; font-size: 0.9rem; border: 1px solid #ccc; background: #f4f4f4; }
.marker.green { background: #e6f4e7; border-color: #2e7d32; color: #1b5e20; }
.marker.red { background: #fdecee; border-color: #b00020; color: #8a0019; font-weight: bold; }
.credit { color: #2e7d32; }
.ledger-form input[type="number"], .ledger-form input[type="text"] { max-width: 16rem; }

/* Operations Dashboard */
.chart-figure { margin: 1.5rem 0; padding: 0; }
.chart-figure figcaption { margin-bottom: 0.4rem; }
.chart-actions { margin: 0.25rem 0 0; font-size: 0.9rem; }
.chart svg { display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.25rem; font-family: Arial, Helvetica, sans-serif; font-size: 12px; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.chart-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.chart-description { margin: 0.4rem 0 0.2rem; font-size: 0.92rem; color: #444; max-width: 46rem; }
.signals ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.range-controls { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid #e3e3e3; padding: 0.4rem 0 0.2rem; margin: 0.5rem 0 1rem; font-size: 0.9rem; }
.control-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; margin: 0.15rem 0; }
.control-row button { font-size: 0.85rem; padding: 0.1rem 0.6rem; }
.control-row button.active { background: #333; color: #fff; }
#range-brush svg, .local-range svg { display: block; }
.local-range { margin: 0.3rem 0 0; }
.linklike { background: none; border: 0; padding: 0; color: #00e; text-decoration: underline; cursor: pointer; font: inherit; }
.event-notes ul { margin: 0.1rem 0 0.6rem; padding-left: 1.2rem; }
.event-title { margin: 0.5rem 0 0; }
.chart-figure { scroll-margin-top: 9rem; }
.local-range svg { max-width: 760px; }

/* Phones: wide tables scroll inside themselves, never the page; the signed-in
   line drops to its own row instead of wrapping beside the links. */
@media (max-width: 640px) {
    main table { display: block; max-width: 100%; overflow-x: auto; }
    main select, main textarea, main input { max-width: 100%; box-sizing: border-box; }
    .step { min-width: 0; font-size: 0.62em; padding: 0; overflow-wrap: anywhere; }
}

/* ---- Forms: serif labels, sans entries, slightly larger than usual ---- */
main form p { margin: 0 0 1rem; }
main form label { display: block; margin-bottom: 0.25rem; }
main form input[type="checkbox"] + label, main form label:has(input[type="checkbox"]) { display: inline; }
input, select, textarea, button { font: inherit; }
main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]),
main select, main textarea {
    font-family: var(--sans);
    font-size: 1rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--field-edge);
    border-radius: 4px;
    background: #fff;
    color: var(--ink);
    box-sizing: border-box;
    max-width: 100%;
}
main input:focus, main select:focus, main textarea:focus {
    outline: 2px solid var(--link);
    outline-offset: 1px;
}
main input[type="file"] { font-family: var(--sans); font-size: 0.9rem; }
main form button[type="submit"], main button.button {
    font-family: var(--sans);
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--ink);
    border-radius: 4px;
    background: var(--ink);
    color: #fff;
    cursor: pointer;
}
main form button[type="submit"]:hover { background: #000; }

/* ---- Public pages ---- */
/* ---- Home page ----
   The painting is the centre of the page. On a normal screen it is sized so that the
   navigation bar above it and the footer below it are both visible without scrolling
   (the script on the page reports their heights). The words are stacked in the upper
   left corner of the painting and are about half its height. On a phone the
   words sit above the painting and the page scrolls. */
body:has(.hero) main { padding: 0; max-width: none; }
body:has(.hero) .site-footer { margin-top: 0; }
.hero {
    --nav-h: 3.5rem;
    --foot-h: 5rem;
    --H: max(320px, calc(100vh - var(--nav-h) - var(--foot-h) - 1.5rem));
    --H: max(320px, calc(100svh - var(--nav-h) - var(--foot-h) - 1.5rem));
    --ratio: 0.517;                       /* the painting's width / height */
    height: var(--H);
    margin: 0.75rem 0;
    display: flex;
    justify-content: center;
}
.frame { position: relative; height: 100%; aspect-ratio: 4832 / 9344; }
.art { display: block; width: 100%; height: 100%; }
.words {
    position: absolute;
    right: calc(100% + 1rem);             /* just outside the painting's upper left corner */
    top: 0;
    white-space: nowrap;
    /* all the words together are about half the painting's height, but never wider than the
       paper to the right of the painting (the longest word, Washington, is about 5.4 em wide) */
    font-size: min(calc(var(--H) / 13.8), calc(((100vw - var(--H) * var(--ratio)) / 2 - 2rem) / 5.4));
    line-height: 1.05;
    text-align: left;
}
.words h1 { margin: 0; font-size: 1em; font-weight: 400; letter-spacing: -0.015em; line-height: inherit; }
.w-at { font-size: 0.45em; font-style: italic; letter-spacing: 0; color: var(--ink-soft); }
.w-place { text-align: right; margin: 0.4em 0 0; font-size: 0.4em; font-style: italic; color: var(--ink-soft); }

@media (max-width: 760px) {
    /* phones: the words come first, centred above the painting (except the place line,
       which stays right-justified), and the painting is the width of the screen; the page scrolls */
    .hero { height: auto; display: block; margin: 0; padding: 1rem 0.75rem 1rem; }
    .frame { height: auto; aspect-ratio: auto; width: 100%; margin: 0 auto; }
    .words {
        position: static;
        width: max-content;
        max-width: 100%;
        margin: 0 auto 1rem;
        text-align: center;
        font-size: clamp(2.2rem, 11vw, 3rem);
    }
    .w-place { text-align: right; }
    .art { width: 100%; height: auto; }
}

.site-footer {
    max-width: 960px;
    margin: 3rem auto 0;
    padding: 1rem 1.5rem 2rem;
    border-top: 1px solid var(--rule);
    color: var(--ink-soft);
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    justify-content: space-between;
}
.site-footer a { color: var(--ink-soft); }
.footer-links { display: inline-flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }

/* ---- Facts: bold label, colon, value wrapping inside its own cell ---- */
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 0.75rem; margin: 0.5rem 0 1.5rem; }
dl.facts dt { font-weight: bold; }
dl.facts dt::after { content: ":"; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---- Request cards on the resident list: two light grays in turn ---- */
.request-card { border-radius: 10px; padding: 0.75rem 1.25rem 0.5rem; margin: 1rem 0; background: #f3f3f1; }
.request-card:nth-of-type(even) { background: #e9e9e6; }
.request-card h2 { margin: 0.25rem 0; }

/* ---- Suggestion box: label above, entry below, about a third of the page ---- */
.suggestion-form textarea { width: 30%; min-width: 20rem; }
@media (max-width: 640px) {
    .suggestion-form textarea { width: 100%; min-width: 0; }
}

/* ---- Portal identity: a colored frame around every page of a portal ----
   Red for the landlord portal (property managers share it), blue for the
   residents' portal. The public site has none. */
body.portal {
    --portal: #b3261e;
    margin: 0.6rem;
    border: 4px solid var(--portal);
    border-radius: 14px;
    min-height: calc(100vh - 1.2rem);
    box-sizing: border-box;
    /* No overflow:hidden here: on <body> it would be handed to the window and switch the page scrollbar off. */
}
body.portal-residents { --portal: #1f5fa8; }
body.portal nav { border-bottom-color: var(--portal); }
body.portal .site-footer { border-top-color: var(--portal); }

/* ---- Login panel ---- */
.login-panel {
    max-width: 26rem;
    margin: 2.5rem auto;
    padding: 1.75rem 2rem 1.5rem;
    border: 2px solid var(--portal, var(--ink));
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.10);
    font-size: 1.1rem;
}
.login-panel h1 { font-size: 1.6rem; margin-top: 0; color: var(--portal); }
.login-panel input:not([type="checkbox"]) { width: 100%; font-size: 1.1rem; }
.login-panel button[type="submit"] { background: var(--portal); border-color: var(--portal); width: 100%; font-size: 1.05rem; }
.login-panel p:last-child { margin-bottom: 0; text-align: center; }
@media (max-width: 640px) {
    body.portal { margin: 0.4rem; border-width: 3px; min-height: calc(100vh - 0.8rem); }
    .login-panel { margin: 1.25rem 0.25rem; padding: 1.25rem 1.1rem; }
}

/* ---- Landlord home: tiles in groups divided by a thin line ---- */
.tile-group { border-top: 1px solid var(--rule); margin-top: 1.5rem; padding-top: 0.75rem; }
.tile-group:first-of-type { border-top: 0; margin-top: 0.5rem; }
.tile-group h2 { font-size: 1.1rem; margin: 0; color: var(--ink-soft); font-weight: 400; font-style: italic; }
.tile-group .tiles { margin-top: 0.75rem; }

/* ---- Navigation: links in a row on wide screens; on phones a round burger
   button slides a drawer of large, finger-sized links in from the side.
   Pure CSS (a hidden checkbox), so it works without scripts. ---- */
nav { gap: 0.5rem; }
.nav-links { display: flex; flex: 1; flex-wrap: wrap; align-items: center; }
.nav-brand, .nav-toggle, .burger, .nav-scrim { display: none; }

@media (max-width: 640px) {
    nav { padding: 0.5rem 1rem; justify-content: space-between; min-height: 3.25rem; }
    .nav-brand { display: inline-block; margin: 0; font-weight: bold; }
    .nav-toggle { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; }
    .burger {
        display: flex; align-items: center; justify-content: center;
        width: 2.9rem; height: 2.9rem; border-radius: 50%;
        border: 2px solid var(--portal, var(--ink)); background: #fff;
        cursor: pointer; position: relative; z-index: 40;
    }
    .burger span, .burger span::before, .burger span::after {
        display: block; width: 1.3rem; height: 2px; background: var(--portal, var(--ink)); position: relative;
        transition: transform 0.2s, background 0.2s;
    }
    .burger span::before, .burger span::after { content: ""; position: absolute; left: 0; }
    .burger span::before { top: -0.4rem; }
    .burger span::after { top: 0.4rem; }
    .nav-toggle:checked ~ .burger span { background: transparent; }
    .nav-toggle:checked ~ .burger span::before { transform: translateY(0.4rem) rotate(45deg); }
    .nav-toggle:checked ~ .burger span::after { transform: translateY(-0.4rem) rotate(-45deg); }
    .nav-toggle:focus-visible ~ .burger { outline: 2px solid var(--link); outline-offset: 2px; }
    .nav-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 20; }
    .nav-toggle:checked ~ .nav-scrim { display: block; }
    .nav-links {
        position: fixed; top: 0; right: 0; bottom: 0; z-index: 30;
        width: min(82vw, 20rem); box-sizing: border-box;
        background: #fff; border-left: 4px solid var(--portal, var(--ink));
        flex-direction: column; align-items: stretch; flex-wrap: nowrap; justify-content: flex-start;
        padding: 4.5rem 1.25rem 1.5rem; overflow-y: auto;
        transform: translateX(105%); transition: transform 0.22s ease-out; visibility: hidden;
    }
    .nav-toggle:checked ~ .nav-links { transform: none; visibility: visible; }
    .nav-links a, nav form.logout button {
        display: block; margin: 0; padding: 0.9rem 0.5rem; min-height: 1.5rem;
        font-size: 1.3rem; border-bottom: 1px solid var(--rule); text-align: left; width: 100%; box-sizing: border-box;
    }
    nav form.logout { display: block; }
    nav form.logout button { font-family: var(--serif); }
    .nav-links .who { order: -1; margin: 0 0 0.75rem; font-size: 0.9rem; }
}

.eyebrow { display: block; font-size: 0.5em; font-weight: 400; font-style: italic; color: var(--ink-soft); letter-spacing: 0.02em; }

.request.implemented { color: #8a8a8a; background: #f5f5f4; border-radius: 8px; padding-left: 1rem; padding-right: 1rem; }
.request.implemented .muted { color: #8a8a8a; }

/* Mini progress bar in the landlord request table */
.mini-progress { display: inline-flex; gap: 2px; vertical-align: middle; margin-right: 0.5rem; }
.mini-progress i { display: block; width: 0.9rem; height: 0.55rem; border-radius: 2px; background: #d6d6d3; }
.mini-progress i.on { background: #2e7d32; }
.mini-label { font-size: 0.85rem; color: var(--ink-soft); }

/* ---- "You are logged in" chip and notice: same red/blue as the portal frames ---- */
nav .who { display: inline-flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
    border: 2px solid var(--portal, var(--rule)); border-radius: 8px; padding: 0.2rem 0.4rem 0.2rem 0.75rem;
    background: #fff; color: var(--ink); }
nav .who-text { font-size: 0.9rem; }
nav .who form.logout button { font-family: var(--sans); font-weight: 600; font-size: 0.85rem;
    padding: 0.3rem 0.8rem; border-radius: 5px; background: var(--portal, var(--ink)); color: #fff; border: 0; }
nav .who form.logout button:hover { text-decoration: none; filter: brightness(0.9); }

/* The public site's version of the chip: same colors, in the nav's corner. */
nav .who-landlord { --portal: #b3261e; }
nav .who-residents { --portal: #1f5fa8; }
nav .who a { font-family: var(--sans); font-weight: 600; font-size: 0.85rem; padding: 0.3rem 0.8rem;
    border-radius: 5px; text-decoration: none; margin: 0; }
nav .who a.who-link { border: 1px solid var(--portal); color: var(--portal); background: #fff; }
nav .who a.who-logout { background: var(--portal); color: #fff; border: 1px solid var(--portal); }
nav .who a.who-logout:hover { filter: brightness(0.9); text-decoration: none; }
@media (max-width: 640px) {
    .nav-links .who { order: -1; margin: 0 0 0.75rem; border-radius: 8px; }
    .nav-links .who form.logout { display: block; width: 100%; }
    .nav-links .who a { display: block; width: 100%; text-align: center; box-sizing: border-box; padding: 0.7rem; font-size: 1.1rem; border-bottom-width: 1px; }
    .nav-links .who form.logout button { width: 100%; text-align: center; border-bottom: 0; font-size: 1.1rem; padding: 0.7rem; }
}

/* ---- Emergency notice on the maintenance request page ---- */
.emergency-notice { display: grid; grid-template-rows: 1fr; opacity: 1; margin: 1rem 0;
    transition: grid-template-rows 0.7s ease, opacity 0.7s ease, margin 0.7s ease; }
.emergency-notice.pending { grid-template-rows: 0fr; opacity: 0; margin: 0; }
.emergency-notice.pending .emergency-inner { border-width: 0; }
.emergency-inner { overflow: hidden; min-height: 0; background: #fdecec; border: 2px solid #c0392b;
    border-radius: 10px; padding: 0 1.25rem; transition: border-width 0.7s ease; }
.emergency-notice:not(.pending) .emergency-inner { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.emergency-label { margin: 0 0 0.25rem; font-family: var(--sans); font-weight: 600; font-size: 0.85rem;
    letter-spacing: 0.12em; text-transform: uppercase; color: #a5281b; }
.emergency-inner p { margin: 0; }
.emergency-inner a { color: #a5281b; font-weight: bold; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .emergency-notice { transition: none; } }

/* ---- Landlord's preview of the resident portal: purple ---- */
body.portal-preview { --portal: #6b3fa0; }
.preview-bar { background: #f1eaf9; border-bottom: 2px solid #6b3fa0; color: #46266b; padding: 0.4rem 1.5rem; font-size: 0.9rem; }
.tile-lilac { --tile-bg: #efe8f7; --tile-edge: #d9c9ec; }

/* ---- Home page: the red "Room for Rent - Learn More" link (only while a room is listed) ---- */
nav a.nav-room {
    display: inline-block;
    border: 2px solid #b3261e;
    border-radius: 8px;
    padding: 0.1rem 0.6rem;
    color: #b3261e;
    font-weight: 700;
}
nav a.nav-room:hover { background: #b3261e; color: #fff; text-decoration: none; }
nav a.nav-room.nav-room-bar { display: none; }
@media (max-width: 640px) {
    nav { flex-wrap: wrap; }
    nav .nav-links a.nav-room { display: none; }
    nav a.nav-room.nav-room-bar { display: block; flex-basis: 100%; text-align: center; margin: 0.45rem 0 0.1rem; padding: 0.35rem 0.6rem; }
}

/* ---- The room listing page: Federal Hill type and colours, with a purple-and-gold banner ---- */
.room-page { max-width: 1100px; margin: 0 auto; }
body:has(.room-page) main { max-width: none; padding: 0 1.5rem 3rem; }
.room-banner {
    display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; align-items: baseline; justify-content: center;
    margin: 0 -1.5rem; padding: 0.7rem 1.5rem;
    background: #241773; color: #f0d77a; border-bottom: 3px solid #9e7c0c; font-size: 1.02rem;
}
.room-banner strong { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.9rem; color: #fff; }
.room-intro { text-align: center; padding: 2.5rem 0 1rem; }
.room-intro h1 { font-size: 2.4rem; margin: 0 0 0.5rem; }
.lede { color: var(--ink-soft); font-size: 1.15rem; margin: 0; }

.story { display: grid; gap: 1.5rem 3rem; padding: 2.5rem 0; border-top: 1px solid var(--rule); align-items: start; }
.story h2 { font-size: 1.7rem; margin-top: 0; }
.story-media { margin: 0; }
.story-media img, .step-media img, .room-gallery img { display: block; width: 100%; max-width: 700px; height: auto; border-radius: 6px; }
.story-text { max-width: 36rem; }
.story-text ul { padding-left: 1.2rem; }
.story-text li { margin: 0.3rem 0; }
.pull-quote { margin: 1.5rem 0 0; padding-left: 1rem; border-left: 4px solid #9e7c0c; font-size: 1.3rem; font-style: italic; }
.room-rent { font-size: 1.2rem; }
.room-rent strong { font-size: 1.6rem; color: #241773; }
.room-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; grid-column: 1 / -1; }
.room-gallery figure { margin: 0; }
.room-gallery figcaption { color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.3rem; }

.room-name { margin: -0.6rem 0 0.8rem; color: var(--ink-soft); font-size: 1.1rem; }
.story.scrolly { display: block; }
.scrolly-frame { display: none; }
.scrolly-step { padding: 0 0 2.5rem; }
.step-media { margin: 0 0 1rem; }
@media (min-width: 900px) {
    /* A sticky frame on one side holds the pictures; the steps scroll past on the other. Only with scripts on:
       without them every step keeps its own picture and nothing is hidden. */
    .js .scrolly.has-media { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
    .js .scrolly.has-media .scrolly-frame { display: block; position: sticky; top: 1.5rem; height: min(70vh, 30rem); }
    .js .scrolly.has-media .frame-img {
        position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none;
        border-radius: 6px; opacity: 0;
    }
    .js .scrolly.has-media .frame-img.active { opacity: 1; }
    .js .scrolly.has-media .step-media { display: none; }
    .js .scrolly.has-media .scrolly-step { min-height: 70vh; }
    .js .scrolly.side-right.has-media .scrolly-frame { order: 2; }
}
@media (prefers-reduced-motion: no-preference) {
    .frame-img { transition: opacity 0.6s ease; }
}

/* Words and photos come into focus as their area scrolls into view: each line, bullet and picture rises
   and fades in a moment after the one before. Hidden only when scripting is on (the page adds a "js" class)
   and the visitor has not asked for reduced motion; otherwise everything is plainly visible. The banner and
   the title block at the very top are never hidden. */
@media (prefers-reduced-motion: no-preference) {
    .js .reveal > *:not(ul), .js .reveal li {
        opacity: 0; transform: translateY(1.1rem);
        transition: opacity 0.8s ease, transform 0.8s ease;
        transition-delay: calc(var(--i, 0) * 120ms);
    }
    .js .reveal.in > *:not(ul), .js .reveal.in li { opacity: 1; transform: none; }
    .js .reveal.instant > *:not(ul), .js .reveal.instant li { transition: none; }
}

.inquire-form { max-width: 30rem; }
.inquire-form input[type="text"], .inquire-form input[type="email"], .inquire-form textarea { width: 100%; box-sizing: border-box; font-size: 1.05rem; }
.inquire-form .check label { display: flex; gap: 0.5rem; align-items: center; }
main .inquire-form button[type="submit"] { background: #241773; color: #f0d77a; border: 2px solid #9e7c0c; border-radius: 6px; padding: 0.5rem 1.4rem; font-size: 1.05rem; cursor: pointer; }
main .inquire-form button[type="submit"]:hover { background: #170f4d; }
.inquire-thanks { padding: 0.75rem 1rem; border-left: 4px solid #2e7d32; background: #f1f7f1; }
.flyer-link { margin-top: 2rem; }
/* The honeypot: out of sight and out of the way for people, but present for software. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.room-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.room-card { display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; padding: 0.75rem; }
.room-card:hover { border-color: #241773; }
.room-card img { width: 100%; height: auto; border-radius: 6px; }
.room-card span { display: block; }
.room-card-title { font-weight: 700; font-size: 1.15rem; margin-top: 0.4rem; }
.room-card-rent { color: #241773; font-weight: 700; }
.room-card-when, .room-card-summary { color: var(--ink-soft); }
@media (max-width: 640px) {
    .room-banner { margin: 0 -1.5rem; font-size: 0.95rem; }
    .room-intro h1 { font-size: 1.8rem; }
    body:has(.room-page) main { padding: 0 1rem 2rem; }
    .room-banner { margin: 0 -1rem; }
}


/* ---- The listing page in Baltimore purple ----
   Each section runs the full width of the screen in a deep purple or a more muted purple, alternating, with white
   lettering and a soft gold for accents. The deep purple is Baltimore purple #241773 at 90% over white (about #3a2e81),
   a touch softer than the solid. Contrast: white on it is about 11:1 and on the muted #5e50a6 about 6.6:1; the gold
   (#f0d77a) is about 7.8:1 and 4.6:1. */
.listing { --deep: #241773; --deep-soft: rgba(36, 23, 115, 0.9); --muted: #5e50a6; --gold: #f0d77a; --mist: #e3defa; --pad-x: max(1.5rem, calc((100% - 1100px) / 2)); }
body:has(.listing) main { padding: 0; }
.listing .room-banner { margin: 0; padding: 0.7rem var(--pad-x); }
.listing .room-intro { background: #fff; padding: 2.75rem var(--pad-x) 2.25rem; }
.listing .room-intro h1 { color: var(--deep); }
.listing .story { padding: 3.5rem var(--pad-x); border-top: 0; }
.listing .tone-deep { background: var(--deep-soft); color: #fff; }
.listing .tone-muted { background: var(--muted); color: #fff; }
.listing .story h2, .listing .story strong { color: #fff; }
.listing .story a { color: var(--gold); }
.listing .story li::marker { color: var(--gold); }
.listing .pull-quote { border-left-color: var(--gold); color: #fff; }
.listing .room-rent strong { color: var(--gold); }
.listing .room-name, .listing .room-gallery figcaption { color: var(--mist); }
.listing .story img { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35); }
.listing .flag { color: #ffd0d0; }
.listing .inquire-form label { color: #fff; }
.listing .inquire-form input[type="text"], .listing .inquire-form input[type="email"], .listing .inquire-form textarea {
    background: #fff; color: #222; border: 2px solid transparent; border-radius: 6px; padding: 0.5rem 0.6rem;
}
.listing .inquire-form input:focus, .listing .inquire-form textarea:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
main .listing .inquire-form button[type="submit"] { background: var(--gold); color: var(--deep); border: 2px solid var(--gold); }
main .listing .inquire-form button[type="submit"]:hover { background: #fff; border-color: #fff; }
.listing .inquire-thanks { background: rgba(255, 255, 255, 0.12); border-left: 4px solid var(--gold); color: #fff; }
@media (max-width: 640px) {
    .listing { --pad-x: 1rem; }
    .listing .story { padding: 2.25rem var(--pad-x); }
}
.room-page.listing { max-width: none; margin: 0; }


/* ---- Home page: "About the Art" overlay ----
   Opened by the footer link (which points at #about-art), so it works without scripts: the overlay shows while the
   address ends in #about-art, and anywhere outside the card is a link back home. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.art-overlay { display: none; position: fixed; inset: 0; z-index: 50; align-items: center; justify-content: center; padding: 1rem; box-sizing: border-box; }
.art-overlay:target { display: flex; animation: art-fade 0.6s ease both; }
.art-backdrop { position: absolute; inset: 0; background: rgba(48, 46, 52, 0.62); cursor: default; }
.art-card {
    position: relative;
    width: max(16.7vw, min(88vw, 19rem));       /* about a sixth of a computer screen, wider on a phone so it stays readable */
    box-sizing: border-box;
    padding: 2.6rem 1.75rem 2.5rem;
    background: #fbf8f1;
    border: 1px solid #c9bfa8;
    outline: 1px solid #c9bfa8; outline-offset: -8px;     /* a fine inner rule, like a mat around a painting */
    border-radius: 3px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    text-align: center;
    color: #2b2823;
}
.art-card:focus { outline: 1px solid #c9bfa8; outline-offset: -8px; }
.art-text { margin: 0; font-size: 1.12rem; line-height: 1.65; font-style: normal; hyphens: auto; }
.art-name { font-variant: small-caps; letter-spacing: 0.06em; font-weight: 700; font-size: 1.08em; color: #7a2b22; }
.art-close { position: absolute; top: 0.35rem; right: 0.6rem; text-decoration: none; color: #7c7566; font-size: 1.6rem; line-height: 1; }
.art-close:hover { color: #2b2823; }
@keyframes art-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .art-overlay:target { animation: none; } }
@media (max-width: 640px) { .art-text { font-size: 1.18rem; } }
