/*
 * Gravity Forms 3.x date picker
 *
 * Gravity Forms 3.0 replaced the jQuery UI datepicker (styled by the .ui-datepicker rules in
 * style.css) with its own accessible calendar. This site doesn't load Gravity Forms' CSS, so
 * without these rules the calendar renders inline and unstyled, and its open button shows up
 * as a small red dash under the field.
 *
 * Kept out of style.css on purpose: style.css is served with a one-year browser cache and a
 * fixed ?ver, so changes there don't reach returning visitors. This file is enqueued with its
 * modified time as the version (see functions.php).
 */

.ginput_container_date {
    position: relative;
}

/* The theme drew the calendar icon as a background image on the input, which wasn't clickable.
   The icon now sits on Gravity Forms' own toggle button, in the same spot. */
.step-form .ginput_container_date input {
    background-image: none;
    cursor: text;
}

.gform_wrapper .ginput_container_date .gform-datepicker-toggle {
    position: absolute;
    top: 0;
    right: 16px;
    width: 55px;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent url('../images/calendar-icon.png') no-repeat center / 31px auto;
    cursor: pointer;
}

.gform_wrapper .ginput_container_date .gform-datepicker-toggle:hover {
    background-color: transparent;
    opacity: 0.8;
}

.gform_wrapper .ginput_container_date .gform-datepicker-toggle:focus-visible {
    outline: 2px solid #028635;
    outline-offset: -2px;
}

/* Dashicons isn't loaded on the front end, so the button's built-in icon is blank. */
.gform_wrapper .ginput_container_date .gform-datepicker-toggle-icon {
    display: none;
}

/* Calendar popup (matches the old jQuery UI datepicker look) */
.gform-datepicker-calendar {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1000;
    width: 310px;
    max-width: calc(100vw - 32px);
    padding: 15px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    box-shadow: 0 0 50px 0 rgba(0, 0, 0, 0.08);
    font-size: 14px;
    line-height: 1.2;
}

.gform-datepicker-calendar table.calendar {
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    box-shadow: none;
    table-layout: fixed;
    font-size: 14px;
}

.gform-datepicker-calendar tr {
    border: 0;
}

.gform-datepicker-calendar th,
.gform-datepicker-calendar td {
    padding: 3px;
    border: 0;
    background: transparent;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
    line-height: 1.2;
}

/* Previous / next year and month arrows */
.gform-datepicker-calendar td.nav {
    width: 34px;
    height: 34px;
    border-radius: 3px;
    color: #000000;
    font-size: 18px;
    cursor: pointer;
}

.gform-datepicker-calendar td.nav:hover,
.gform-datepicker-calendar td.nav:focus {
    background-color: #efefef;
    outline: none;
}

.gform-datepicker-calendar select.nav.current {
    width: 100%;
    height: auto;
    padding: 5px 10px;
    border: 1px solid #cccccc;
    border-radius: 5px !important;
    background-color: #ffffff;
    font-family: 'Caveat Brush', cursive;
    font-size: 16px;
    line-height: 1.2;
}

.gform-datepicker-calendar th.week {
    height: 35px;
    padding: 0;
    font-family: 'Caveat Brush', cursive;
    font-size: 14px;
    font-weight: 400;
}

.gform-datepicker-calendar td.day {
    height: 34px;
    padding: 0;
    border-radius: 4px;
    color: #000000;
    font-weight: 600;
    cursor: pointer;
}

.gform-datepicker-calendar td.day:hover {
    background-color: #028635;
    color: #ffffff;
}

.gform-datepicker-calendar td.dayToday {
    color: #028635;
    box-shadow: inset 0 0 0 1px #028635;
}

/* "selected" is the day with keyboard focus / the chosen date */
.gform-datepicker-calendar td.day.selected,
.gform-datepicker-calendar td.day:focus {
    background-color: #1c4721;
    color: #ffffff;
    box-shadow: none;
    outline: none;
}

.gform-datepicker-calendar td.day.disabled,
.gform-datepicker-calendar td.day[aria-disabled="true"] {
    background: none;
    color: #908f8f;
    font-weight: 400;
    cursor: not-allowed;
}

.gform-datepicker-calendar td.empty {
    cursor: default;
}

/* "Press F1 for help" */
.gform-datepicker-calendar .monthMessage {
    margin-top: 8px;
    color: #6b7280;
    font-size: 12px;
    text-align: center;
}

.gform-datepicker-calendar .monthMessage p {
    margin: 0;
    font-size: 12px;
}
