/* ============================================================
   Core base styles — header, dropdown menu, user badge, footer
   Wood-flooring palette: dark walnut header/footer, white text,
   white edge borders.
   ============================================================ */

:root {
    --wood-header:   #3b2a21;   /* dark walnut — header & footer */
    --wood-panel:    #4a3529;   /* menu dropdown background */
    --wood-accent:   #c8a27c;   /* light oak accent */
    --edge:          #ffffff;   /* white borders */
    --text-on-wood:  #ffffff;
    --text-muted:    #e7d9c9;
    --focus-ring:    #ffd8a8;
    --button-background: #8B4B07;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #2b2b2b;
    background: #ffffff;
}

/* ---------- Header ---------- */
.site-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--wood-header);
    color: var(--text-on-wood);
    border-bottom: 3px solid var(--edge);
}

.header-col--left   { justify-self: start; }
.header-col--center { justify-self: center; }
.header-col--right  { justify-self: end; }

/* ---------- Brand wordmark (header centre) ---------- */
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-on-wood);
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
}
.site-brand:hover .site-brand__name {
    text-decoration: underline;
}
.site-brand:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}
.site-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.4rem;
    padding: 3px 6px;
    border: 2px solid var(--wood-accent);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.site-brand__mark img {
    height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
}
.site-brand__name {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.1;
}

/* ---------- Dropdown menu (top-left) ---------- */
.menu { position: relative; }

.menu__button {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid white;
    border-radius: 6px;
    color: var(--text-on-wood);
    background-color: var(--button-background);
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
}
.menu__button::-webkit-details-marker { display: none; }
.menu__button:hover        { background: rgba(255, 255, 255, 0.08); }
.menu[open] .menu__button  { background: rgba(255, 255, 255, 0.14); }

/* hamburger icon */
.menu__bars {
    position: relative;
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
}
.menu__bars::before,
.menu__bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: currentColor;
}
.menu__bars::before { top: -6px; }
.menu__bars::after  { top: 6px; }

.menu__panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 210px;
    display: flex;
    flex-direction: column;
    padding: 0.35rem;
    background: var(--wood-panel);
    border: 1px solid var(--wood-accent);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    z-index: 100;
}

.menu__link {
    padding: 0.6rem 0.75rem;
    border-radius: 5px;
    color: var(--text-on-wood);
    text-decoration: none;
    font-size: 0.95rem;
}
.menu__link:hover { background: rgba(255, 255, 255, 0.10); }

/* "Logout" is a POST form styled to match the other menu links. */
.menu__logout { margin: 0; }
.menu__link--button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    font-family: inherit;
    cursor: pointer;
}

/* ---------- User badge + menu (top-right) ---------- */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}
.user-badge__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--edge);
    flex-shrink: 0;
    object-fit: cover;
    background: var(--wood-accent);
}
.user-badge__name {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Unread-messages pill for admins, next to their name - links to the
   manage-bookings dashboard so it's a one-click "go check" from any page. */
.nav-alert {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    margin-right: 0.4rem;
    border-radius: 999px;
    background: #8a1f1f;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.nav-alert:hover,
.nav-alert:focus-visible {
    background: #6f1818;
}

/* The badge links to the profile page (signed in) or the login page (out). */
.user-badge--link {
    text-decoration: none;
    color: inherit;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}
.user-badge--link:hover,
.user-badge--link:focus-visible {
    background-color: rgba(255, 255, 255, 0.12);
}
.user-badge--link:hover .user-badge__name {
    color: var(--text-on-wood);
    text-decoration: underline;
}

/* ---------- Flash messages ---------- */
.messages {
    list-style: none;
    max-width: 640px;
    margin: 1rem auto 0;
    padding: 0 1rem;
}
.message {
    padding: 0.7rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    text-align: center;
}
.message--success { background: #e3f4e4; color: #1f5b2d; border: 1px solid #b7dcbb; }
.message--error   { background: #fbe6e6; color: #8a1f1f; border: 1px solid #e0b1b1; }
.message--info,
.message--warning { background: #eef1f4; color: #2b2b2b; border: 1px solid #ccd3da; }

/* ---------- Main + footer ---------- */
.site-main { flex: 1 0 auto; }

.site-footer {
    background: var(--wood-header);
    color: var(--text-muted);
    border-top: 3px solid var(--edge);
    padding: 0.7rem 1.25rem;
}
.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}
.site-footer__logo {
    height: 40px;
    width: auto;
    border-radius: 4px;
}
.site-footer__text { margin: 0; font-size: 0.85rem; }

.site-footer__legal {
    display: flex;
    gap: 0.9rem;
    font-size: 0.8rem;
}
.site-footer__legal a {
    color: var(--text-muted);
    text-decoration: underline;
}
.site-footer__legal a:hover,
.site-footer__legal a:focus-visible {
    color: var(--text-on-wood);
}

/* ---------- Focus visibility ---------- */
:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
    .site-header { grid-template-columns: auto 1fr auto; gap: 0.5rem; }
    .menu__label         { display: none; }
    .site-brand__name    { font-size: 1.05rem; white-space: normal; }
    .site-brand__mark    { height: 2rem; padding: 2px 5px; }
    .user-badge__name    { display: none; }
}