html, body {
    margin: 0;
    padding: 0;
    background: #f4f4f2;
    height: 100%;
}

body, p, td, div, span, input, textarea, label, li, button {
    font-family: arial, verdana, sans-serif;
    font-size: 14px;
}

h1 { margin: 0; }

h2 {
    font-size: 16px;
    color: #8b2100;
    margin: 1.4em 0 0.5em;
}

h3 {
    font-size: 14px;
    color: #8b2100;
    margin: 1.2em 0 0.4em;
}

p { margin: 0.6em 0; }

a {
    color: #8b2100;
    text-decoration: none;
}

a:hover { text-decoration: underline; }

ul, li {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.green { color: green; }
.red   { color: #8b2100; }
.black { color: black; }
.muted { color: #888; }

/* ---- Layout (matches old site) ---- */

#lv0 {
    background: white url(/images/background.png);
    min-height: 100%;
    width: 711px;
    margin: 0 auto;
    padding: 0 24px 0 25px;
}

body.wide #lv0 {
    width: auto;
    max-width: 1200px;
}

body.wide #header {
    background-size: cover;
}

#header {
    background: url(/images/header.jpg) no-repeat center top;
    height: 216px;
    border-bottom: 8px solid #8b2100;
    margin-bottom: 40px;
    position: relative;
}

#header h1 a {
    position: absolute;
    left: 0;
    bottom: 12px;
    color: white;
    font-size: 28px;
    font-weight: normal;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

#lv1 { overflow: hidden; }

#navigation {
    padding: 0 0 25px 25px;
    width: 175px;
    border-right: 1px solid #999999;
    float: left;
}

#navigation a {
    font-size: 16px;
    color: black;
    text-decoration: none;
}

#navigation li { margin-bottom: 30px; }

#main {
    margin-left: 220px;
    padding: 0 0 40px 0;
    position: relative;
}

#main :first-child { margin-top: 0; }

#lv1 #nav { padding-top: 30px; }

#footer { height: 20px; }

/* ---- Forms ---- */

input[type=text], input[type=password], input[type=email], input[type=date] {
    border: 1px solid #666;
    line-height: 25px;
    height: 27px;
    width: 240px;
    margin-bottom: 8px;
    padding: 0 10px;
    font: inherit;
    box-sizing: border-box;
}

textarea {
    border: 1px solid #666;
    width: 100%;
    padding: 10px;
    height: 50px;
    margin: 10px 0 5px;
    font: inherit;
    box-sizing: border-box;
}

label { display: block; margin: 0.5em 0; }

button {
    border: none;
    background: none;
    margin: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

button span {
    display: inline-block;
    height: 25px;
    line-height: 25px;
    background: url(/images/button.png) 100% 0;
    padding-right: 15px;
}

button span span {
    padding: 0 0 0 15px;
    background-position: 0 0;
    color: white;
    font-size: 12px;
}

button:disabled { opacity: 0.5; cursor: default; }

/* ---- Calendar page ---- */

#calendar-app { padding-right: 20px; }

.calendar-header {
    position: relative;
}

.calendar-header h2 {
    margin-top: 0;
}

.calendar-date-wrap {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.calendar-date-label {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.calendar-date-label:hover {
    color: #5a1500;
}

.calendar-date-wrap input[type=date] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.calendar-date-wrap input[type=date]::-webkit-clear-button {
    display: none;
}

.slots {
    margin: 2em 0 0;
}

.slots li {
    margin: 0;
    padding: 10px 2px;
    color: #666;
    border-bottom: 1px solid #ddd;
}

.slots li > * {
    font-size: 14px;
}

.slots li:last-child { border-bottom: none; }

.slots .time {
    display: block;
    font-weight: bold;
    color: #333;
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
}

.slots a { font-style: italic; }

.slots p { margin: 8px 0 12px; }

.slot-comment {
    font-style: italic;
    color: black;
    padding: 8px 0 0;
    margin: 0;
}

/* ---- Booking form inline on calendar ---- */

.booking-form {
    padding: 8px 6px 12px;
    background: #fafafa;
    border-top: 1px dashed #ccc;
    margin-top: 6px;
}

.booking-form label { color: black; }

.booking-form label input[type=checkbox] {
    margin-right: 6px;
    vertical-align: middle;
}

.booking-form button { margin-right: 6px; }

/* ---- Messages ---- */

.notice {
    background: #fff5d6;
    border: 1px solid #e8c86a;
    padding: 6px 10px;
    margin: 0 0 1em;
    color: #554400;
}

.error {
    background: #ffe5e5;
    border: 1px solid #e8a0a0;
    color: #7a2020;
    padding: 6px 10px;
    margin: 0 0 1em;
}

/* ---- Prose pages (rules, about) ---- */

.prose p { max-width: 60ch; }

/* ---- Login form ---- */

form.login h3 { color: #8b2100; margin-top: 1.5em; }

form.login label span {
    display: block;
    color: #888;
    font-size: 12px;
    margin-bottom: 2px;
}

/* ---- Users admin ---- */

table.users {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

table.users th, table.users td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid #ccc;
}

table.users th {
    background: #f4f4f2;
    font-weight: bold;
}

table.users td:last-child {
    white-space: nowrap;
    width: 1%;
}

/* ---- User form ---- */

.user-form h3 {
    margin: 0 0 1.2em;
}

.user-form .grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 10px 14px;
    align-items: center;
}

.user-form .grid > label {
    margin: 0;
    color: #666;
    font-size: 12px;
    text-align: right;
}

.user-form .grid > input[type=text],
.user-form .grid > input[type=email],
.user-form .grid > input[type=password] {
    width: 100%;
    margin: 0;
    background: #f4f4f2;
    border: 1px solid #ccc;
}

.user-form .grid > input:focus {
    background: #fff;
    border-color: #8b2100;
    outline: none;
}

.user-form .grid label.inline {
    text-align: left;
    color: black;
    font-size: 14px;
}

.user-form .actions {
    margin-top: 1.4em;
    text-align: right;
}

.user-form .actions button { margin-left: 6px; }

/* ---- Modal ---- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4em 1em 1em;
    z-index: 100;
}

.modal {
    background: #fff;
    border: 1px solid #8b2100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 1em 1.5em 1.5em;
    max-width: 480px;
    width: 100%;
}

.modal h3 {
    color: #8b2100;
    margin-top: 0.5em;
}

/* ---- Hamburger (hidden on desktop) ---- */

.hamburger {
    display: none;
}

/* ---- Responsive (<= 720px) ---- */

@media (max-width: 720px) {
    #lv0 {
        width: auto;
        background-image: none;
        background-color: white;
        padding: 0;
    }

    #header {
        height: auto;
        aspect-ratio: 760 / 216;
        background-size: cover;
        margin-bottom: 0;
    }

    #lv1 {
        overflow: visible;
    }

    #navigation {
        float: none;
        width: auto;
        border-right: none;
        padding: 0;
        position: relative;
    }

    .hamburger {
        display: block;
        position: absolute;
        top: -114px;
        right: 12px;
        z-index: 50;
        width: 36px;
        height: 36px;
        background: rgba(255,255,255,0.85);
        border: 1px solid #ccc;
        border-radius: 4px;
        padding: 7px 6px;
        cursor: pointer;
    }

    .hamburger span {
        display: block;
        height: 3px;
        background: #8b2100;
        margin: 4px 0;
        border-radius: 1px;
        padding: 0;
    }

    .hamburger span:first-child { margin-top: 0; }

    #nav {
        display: none;
        background: white;
        border-bottom: 2px solid #8b2100;
        padding: 10px 20px 16px;
    }

    #nav.open {
        display: block;
    }

    #nav li {
        margin-bottom: 14px;
    }

    #main {
        margin-left: 0;
        padding: 20px;
    }

    #calendar-app {
        padding-right: 0;
    }

    #footer { height: 10px; }
}
