/*
    App-level overrides layered on top of MudBlazor.
*/

/*
    Never let a width constraint reach a date/time picker's calendar.

    MudPicker appends its Style parameter to the *popover paper's* inline style, not to the input.
    So `Style="max-width:180px"`, written to size the field, instead capped the calendar — which needs
    about 310px — and silently cut the last three day columns off the right-hand side. Measured on the
    live page: paper 180px, calendar 310px.

    This has now been fixed twice by editing the pages that happened to be reported (Front Desk and the
    report pages in June, the waitlist dialog in August), and it came back both times because the next
    picker someone writes repeats the same reasonable-looking mistake. The rule below makes the whole
    class of bug impossible, so the page-level fixes are tidiness rather than the only line of defence.

    !important is needed because the offending value arrives inline. Sizing the *input* is still done
    the normal way — a wrapper element around the picker, which the teleported overlay cannot inherit.
*/
.mud-picker-inline-paper,
.mud-picker-inline-paper > .mud-picker-paper {
    max-width: none !important;
}

/*
    Public marketing site (build plan §13.1).

    These pages are anonymous and statically rendered, so everything here has to work without a
    circuit. Colours come from MudBlazor's CSS custom properties, which the campground's own palette
    already drives — that way a campground with a different theme restyles the public site too,
    with no per-campground CSS.
*/
.ddpros-hero {
    background: linear-gradient(135deg,
        var(--mud-palette-primary) 0%,
        var(--mud-palette-tertiary, var(--mud-palette-secondary)) 100%);
    color: var(--mud-palette-primary-text);
    padding: 6rem 0 5rem;
}

/*
    With a photograph behind it. The gradient above stays underneath as the fallback, so a slow
    or failed image load shows the palette rather than unreadable text on white.

    Text sits at the BOTTOM, not vertically centred. Buckhorn's hero is a neon entrance sign
    against a sunset, and the sign is centre frame - exactly where a centred heading lands. The
    title then ran straight through the medallion, which is both unreadable and redundant, since
    the sign already spells the resort's name. Dropping the text onto the smooth sunset band below
    leaves the arch and the sign clear above it and gives the words a quiet surface to sit on.

    The scrim is weighted to match: light at the top so the sign keeps its colour, heavy at the
    bottom where the words are. It is not decoration - white text on that sunset is illegible
    without it.

    Tried and rejected: shifting background-position to slide the sign out from behind the text.
    The photo is 2.4:1 and so is this band at a desktop width, so there is no overflow to pan -
    the sign stays centre however the position is set.
*/
.ddpros-hero-photo {
    background-image:
        linear-gradient(to bottom,
            rgba(0, 0, 0, .15) 0%,
            rgba(0, 0, 0, .25) 45%,
            rgba(0, 0, 0, .78) 100%),
        var(--ddpros-hero-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    min-height: 500px;
    display: flex;
    align-items: flex-end;
    padding: 0 0 2.5rem;
}

/* Belt and braces over a photograph: the scrim does the work, this covers the bright patches. */
.ddpros-hero-photo .ddpros-hero-title,
.ddpros-hero-photo .ddpros-hero-sub {
    text-shadow: 0 1px 12px rgba(0, 0, 0, .55);
}

.ddpros-hero-photo .ddpros-hero-sub {
    opacity: 1;
}

.ddpros-hero-title {
    font-weight: 600;
}

.ddpros-hero-sub {
    opacity: 0.85;
    font-weight: 400;
}

/* Hero text scales down on phones; §13.1 UAT checks 375px explicitly. */
@media (max-width: 600px) {
    .ddpros-hero {
        padding: 3.5rem 0 3rem;
    }

    .ddpros-hero-title {
        font-size: 2.25rem;
    }

    .ddpros-hero-photo {
        /* Enough height for the sign to read above the text once the 2.4:1 photo is cropped to a
           phone's width, which keeps only its middle - and its middle is the sign. */
        min-height: 400px;
        padding: 0 0 2rem;
        background-image:
            linear-gradient(to bottom,
                rgba(0, 0, 0, .20) 0%,
                rgba(0, 0, 0, .35) 40%,
                rgba(0, 0, 0, .82) 100%),
            var(--ddpros-hero-image);
    }
}

.ddpros-public-nav {
    display: flex;
    align-items: center;
}

/* Below 800px the inline links give way to the disclosure menu below, rather than simply being
   dropped. Leaving a guest the campground name and Sign in meant every page but the landing one
   was reachable from the footer alone - which is to say not at all, on the phone most of them
   arrive on. */
@media (max-width: 800px) {
    .ddpros-public-nav .mud-button-text {
        display: none;
    }
}

/* The phone menu. A native <details> disclosure rather than MudMenu or MudDrawer: this layout is
   deliberately static (BP-6) and has no circuit to drive a component with. The browser opens and
   closes it by itself, with no JavaScript, no WebSocket and nothing added to the first paint. */
.ddpros-public-menu {
    position: relative;
    display: none;
    margin-right: 4px;
}

@media (max-width: 800px) {
    .ddpros-public-menu {
        display: block;
    }
}

.ddpros-public-menu > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    list-style: none; /* the disclosure triangle, in the engines that draw one */
}

.ddpros-public-menu > summary::-webkit-details-marker {
    display: none; /* and in the ones that draw it as a pseudo-element instead */
}

.ddpros-public-menu > summary:hover,
.ddpros-public-menu[open] > summary {
    background: rgba(255, 255, 255, .16);
}

/* Anchored to the toolbar, which MudBlazor already positions relative. The panel then sits under
   the bar at whatever height the bar is - 56px portrait, 48px landscape - without this needing to
   know which, or being told again when MudBlazor changes it. */
.ddpros-public-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: -8px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-width: 208px;
    padding: 8px 0;
    border-radius: var(--mud-default-borderradius, 4px);
    background: var(--mud-palette-surface);
    box-shadow: 0 5px 5px -3px rgba(0, 0, 0, .2), 0 8px 10px 1px rgba(0, 0, 0, .14),
        0 3px 14px 2px rgba(0, 0, 0, .12);
}

.ddpros-public-menu-panel a {
    padding: 12px 20px; /* 44px of row: a thumb target rather than a mouse one */
    color: var(--mud-palette-text-primary);
    font-size: .95rem;
    text-decoration: none;
}

.ddpros-public-menu-panel a:hover,
.ddpros-public-menu-panel a:focus-visible {
    background: var(--mud-palette-action-default-hover, rgba(0, 0, 0, .06));
}

/* A long campground name, a menu button and a Sign in button do not all fit across a narrow
   phone. The name is what gives way: the guest is standing on the site and knows whose it is. */
@media (max-width: 800px) {
    .ddpros-public-title {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
}

.ddpros-public-footer {
    border-top: 1px solid var(--mud-palette-divider);
    padding: 2rem 0;
    margin-top: 3rem;
}

.ddpros-public-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

/* Money and counts read as columns, not prose. */
.ddpros-num {
    text-align: right;
    white-space: nowrap;
}

/* The rate table has five columns and must not push the page sideways on a phone; it scrolls
   inside its own box instead (§13.1 UAT checks 375px). */
.ddpros-rate-table {
    overflow-x: auto;
}

/* FAQ as a definition list: correct semantics, and it needs no interactivity to read. */
.ddpros-faq dt {
    font-weight: 600;
    margin-top: 1.75rem;
}

.ddpros-faq dd {
    margin: 0.5rem 0 0;
    color: var(--mud-palette-text-secondary);
}

.ddpros-contact-address {
    font-style: normal;
}

/* Event cards: a calendar-tear date block reads faster than a date string in a list. */
.ddpros-event-date {
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    text-align: center;
    min-width: 64px;
    flex-shrink: 0;
}

.ddpros-event-month {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    line-height: 1.2;
}

.ddpros-event-day {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}

.ddpros-amenity-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
}

.ddpros-amenity-list li {
    padding: 0.15rem 0;
    font-size: 0.875rem;
}
