/*
 * Start page (common/home.html).
 * .page-intro (title section) and .hero (first area, fills the window below the navbar) are in layout.css.
 */

/* --- first area --- */

/*
 * the first area is exactly as high as the window below the navbar (see .hero in layout.css);
 * title and buttons keep their size, the illustration takes the height that is left.
 * so the buttons are always visible, on any window height
 */
.hero {
    height: calc(100vh - var(--cf-header-height) - 3rem);
    height: calc(100dvh - var(--cf-header-height) - 3rem);
}

/* shrinks first when the window is low; on very low windows it gives way completely, the buttons matter more */
.welcome-illustration {
    display: block;
    flex: 0 1 auto;
    width: auto;
    max-width: min(480px, 100%);
    max-height: 45vh;
    min-height: 0;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

/* desktop: illustration 20 % larger, the buttons stay as they are */
/* (title and subtitle sizes are set for all pages in layout.css) */
@media (min-width: 1024px) and (min-height: 901px) {
    .welcome-illustration {
        max-width: min(576px, 100%);
        max-height: 54vh;
    }
}

/* log in / register pair (common/components/account_buttons.html) */
.account-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-block: 3rem;
    /* the main call to action of the start page: pico's larger buttons instead of the page's compact spacing */
    --pico-form-element-spacing-vertical: 0.75rem;
    --pico-form-element-spacing-horizontal: 1rem;
}

/* equal widths, so the pair looks balanced on desktop; also for form buttons, which pico stretches to full width */
.account-buttons :is([role="button"], button) {
    width: auto;
    min-width: 10rem;
    margin: 0;
}

/* the notice replaces the button pair, so it needs the same breathing room */
.hero .page-notice {
    margin-block: 3rem;
}

/* inside the notice the box itself provides the spacing */
.page-notice .account-buttons {
    margin-block: 1.5rem 0;
}

/* --- second area: filters and calendar --- */

/* starts below the first one */
.upcoming {
    padding-top: 3rem;
}

/* the calendar is wide, so all filter elements fit in one row above it */
.upcoming .filters form {
    max-width: none;
}

/*
 * the dropdowns and the checkbox from the left edge of the calendar, reset at its right edge,
 * like the week title and the week buttons below; narrow windows wrap them into further rows
 */
.calendar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

/* the selects 12 to 16rem wide, so they share a row where there is room and fill it on phones */
.calendar-filters select {
    flex: 1 1 12rem;
    max-width: 16rem;
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .calendar-filters select {
        max-width: none;
    }
}

.calendar-filters label {
    margin-bottom: 0;
    white-space: nowrap;
}

/* the free space goes before the button, so it sits at the right edge */
.calendar-filters [role="button"] {
    margin: 0 0 0 auto;
}