/* ========================================
   Events calendar (FullCalendar skin) + event details
   Design rules: zero border-radius, Poppins, theme.json tokens.
   ======================================== */

.hvcc-calendar {
    --fc-border-color: var(--wp--preset--color--off-white);
    --fc-today-bg-color: var(--wp--preset--color--primary-light);
    --fc-page-bg-color: var(--wp--preset--color--white);
    --fc-neutral-bg-color: var(--wp--preset--color--off-white);
    --fc-list-event-hover-bg-color: var(--wp--preset--color--primary-light);
    --fc-event-border-color: var(--wp--preset--color--primary);
    --fc-now-indicator-color: var(--wp--preset--color--accent);
    font-family: var(--wp--preset--font-family--body);
    color: var(--wp--preset--color--text);
    min-height: 320px;
}

.hvcc-calendar[data-error]::before {
    content: attr(data-error);
    display: block;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--wp--preset--color--primary-light);
    border-left: 4px solid var(--wp--preset--color--primary);
    color: var(--wp--preset--color--dark);
}

/* Square everything. */
.hvcc-calendar .fc-button,
.hvcc-calendar .fc-event,
.hvcc-calendar .fc-popover,
.hvcc-calendar .fc-more-link,
.hvcc-calendar .fc-list-event-dot {
    border-radius: 0;
}

/* Toolbar */
.hvcc-calendar .fc-toolbar-title {
    font-family: var(--wp--preset--font-family--heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--wp--preset--color--dark);
}

.hvcc-calendar .fc-button {
    font-family: var(--wp--preset--font-family--body);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: none;
    padding: 0.55em 1em;
    background: transparent;
    border: 1px solid var(--wp--preset--color--primary);
    color: var(--wp--preset--color--primary);
    box-shadow: none !important;
}

.hvcc-calendar .fc-button:hover,
.hvcc-calendar .fc-button-primary:not(:disabled):hover {
    background: var(--wp--preset--color--primary-dark);
    border-color: var(--wp--preset--color--primary-dark);
    color: var(--wp--preset--color--white);
}

.hvcc-calendar .fc-button-primary:not(:disabled).fc-button-active,
.hvcc-calendar .fc-button-primary:not(:disabled):active {
    background: var(--wp--preset--color--primary);
    border-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
}

.hvcc-calendar .fc-button:disabled {
    opacity: 0.45;
}

.hvcc-calendar .fc-button:focus-visible,
.hvcc-calendar .fc-event:focus-visible {
    outline: 2px solid var(--wp--preset--color--dark);
    outline-offset: 2px;
}

/* Column headers */
.hvcc-calendar .fc-col-header-cell-cushion {
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wp--preset--color--dark);
    padding: 10px 4px;
}

.hvcc-calendar .fc-col-header-cell-cushion,
.hvcc-calendar .fc-daygrid-day-number,
.hvcc-calendar .fc-list-day-text,
.hvcc-calendar .fc-list-day-side-text {
    text-decoration: none;
}

.hvcc-calendar .fc-daygrid-day-number {
    color: var(--wp--preset--color--text);
    font-size: 0.875rem;
}

/* Month cells are narrow: let titles wrap, drop the redundant dot (left bar shows type). */
.hvcc-calendar .fc-daygrid-event-dot {
    display: none;
}

.hvcc-calendar .fc-daygrid-dot-event {
    display: block;
    padding: 2px 4px;
}

.hvcc-calendar .fc-daygrid-dot-event .fc-event-time,
.hvcc-calendar .fc-daygrid-dot-event .fc-event-title {
    display: inline;
    white-space: normal;
    overflow: visible;
}

.hvcc-calendar .fc-daygrid-event {
    white-space: normal;
}

/* Events: tinted block, colored left bar, dark text (readable contrast). */
.hvcc-calendar .fc-event {
    --hvcc-ev-color: var(--wp--preset--color--primary);
    --hvcc-ev-bg: var(--wp--preset--color--primary-light);
    background: var(--hvcc-ev-bg);
    border: 0;
    border-left: 4px solid var(--hvcc-ev-color);
    color: var(--wp--preset--color--dark);
    cursor: pointer;
    font-size: 0.8125rem;
    padding: 1px 4px;
}

.hvcc-calendar .fc-event .fc-event-main,
.hvcc-calendar .fc-event .fc-event-title,
.hvcc-calendar .fc-event .fc-event-time {
    color: var(--wp--preset--color--dark);
}

.hvcc-calendar .fc-event .fc-event-time {
    font-weight: 600;
}

.hvcc-calendar .fc-daygrid-dot-event .fc-event-title {
    font-weight: 500;
}

.hvcc-calendar .fc-event:hover {
    filter: brightness(0.97);
}

.hvcc-calendar .hvcc-ev--meeting {
    --hvcc-ev-color: var(--wp--preset--color--accent);
    --hvcc-ev-bg: #e8f5e9;
}

.hvcc-calendar .hvcc-ev--fundraiser {
    --hvcc-ev-color: var(--wp--preset--color--dark);
    --hvcc-ev-bg: var(--wp--preset--color--off-white);
}

.hvcc-calendar .hvcc-ev--community {
    --hvcc-ev-color: var(--wp--preset--color--primary-dark);
    --hvcc-ev-bg: #fbe9d0;
}

.hvcc-calendar .hvcc-ev--cancelled {
    opacity: 0.6;
}

.hvcc-calendar .hvcc-ev--cancelled .fc-event-title {
    text-decoration: line-through;
}

/* List view */
.hvcc-calendar .fc-list-day-cushion {
    font-family: var(--wp--preset--font-family--heading);
    font-weight: 600;
    color: var(--wp--preset--color--dark);
}

.hvcc-calendar .fc-list-event {
    cursor: pointer;
}

.hvcc-calendar .fc-list-event-title a {
    color: var(--wp--preset--color--dark);
    font-weight: 600;
    text-decoration: none;
}

.hvcc-calendar .fc-list-event.hvcc-ev--cancelled .fc-list-event-title a {
    text-decoration: line-through;
}

.hvcc-calendar .fc-list-event-dot {
    border-color: var(--wp--preset--color--primary);
}

.hvcc-calendar .fc-list-empty {
    background: var(--wp--preset--color--off-white);
    color: var(--wp--preset--color--text-light);
}

/* Toolbar stacks on small screens */
@media (max-width: 720px) {
    .hvcc-calendar .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .hvcc-calendar .fc-toolbar-title {
        font-size: 1.25rem;
    }
}

/* ========================================
   Event dialog
   ======================================== */

.hvcc-dialog {
    border: 0;
    border-radius: 0;
    padding: 0;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    font-family: var(--wp--preset--font-family--body);
    color: var(--wp--preset--color--text);
    border-top: 6px solid var(--wp--preset--color--primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hvcc-dialog::backdrop {
    background: rgba(34, 34, 34, 0.6);
}

.hvcc-dialog > * {
    margin-left: 28px;
    margin-right: 28px;
}

.hvcc-dialog__close {
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0 !important;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--wp--preset--color--dark);
    cursor: pointer;
}

.hvcc-dialog__close:hover,
.hvcc-dialog__close:focus-visible {
    color: var(--wp--preset--color--primary);
}

.hvcc-dialog__type {
    margin-top: 24px;
    margin-bottom: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wp--preset--color--primary);
}

.hvcc-dialog__title {
    margin-top: 4px;
    margin-bottom: 12px;
    padding-right: 32px;
    font-family: var(--wp--preset--font-family--heading);
    font-size: 1.5rem;
    color: var(--wp--preset--color--dark);
}

.hvcc-dialog__cancelled,
.hvcc-event-details__cancelled {
    padding: 8px 12px;
    background: #fdecea;
    border-left: 4px solid #b3261e;
    color: #b3261e;
    font-weight: 600;
}

.hvcc-dialog__label,
.hvcc-event-details__label {
    margin-top: 14px;
    margin-bottom: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wp--preset--color--text-light);
}

.hvcc-dialog__value,
.hvcc-event-details__value {
    margin-top: 2px;
    margin-bottom: 0;
}

.hvcc-dialog__value a,
.hvcc-event-details__value a {
    color: var(--wp--preset--color--primary-dark);
}

.hvcc-dialog__excerpt {
    margin-top: 16px;
    margin-bottom: 0;
}

.hvcc-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    margin-bottom: 12px;
}

.hvcc-dialog__actions .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 1.5rem;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    font-weight: 600;
    text-decoration: none;
    border-radius: 0;
}

.hvcc-dialog__actions .wp-block-button__link:hover {
    background: var(--wp--preset--color--primary-dark);
}

.hvcc-dialog__more {
    font-weight: 600;
    color: var(--wp--preset--color--primary-dark);
}

/* ========================================
   Single event: details card
   ======================================== */

.hvcc-event-details .wp-block-buttons {
    margin-top: 20px;
}

@media (prefers-reduced-motion: reduce) {
    .hvcc-calendar .fc-event,
    .hvcc-dialog {
        transition: none;
    }
}

/* ========================================
   Add to calendar, subscribe link
   ======================================== */

.hvcc-dialog__cal {
    margin-top: 0;
    margin-bottom: 28px;
    font-size: 0.875rem;
    color: var(--wp--preset--color--text-light);
}

.hvcc-dialog__cal a,
.hvcc-calendar__subscribe a {
    color: var(--wp--preset--color--primary-dark);
}

.hvcc-calendar__subscribe {
    margin-top: 16px;
    font-size: 0.875rem;
    text-align: right;
    color: var(--wp--preset--color--text-light);
}

/* ========================================
   Optional RSVP form
   ======================================== */

.hvcc-dialog__rsvp {
    margin-top: 20px;
}

.hvcc-rsvp__inner {
    display: grid;
    gap: 12px;
}

.hvcc-rsvp__toggle,
.hvcc-rsvp__form button[type="submit"] {
    justify-self: start;
    min-height: 48px;
    padding: 0 1.5rem;
    border: 0;
    border-radius: 0;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    font-family: var(--wp--preset--font-family--body);
    font-weight: 600;
    cursor: pointer;
}

.hvcc-rsvp__toggle:hover,
.hvcc-rsvp__form button[type="submit"]:hover:not(:disabled) {
    background: var(--wp--preset--color--primary-dark);
}

.hvcc-rsvp__form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: wait;
}

.hvcc-rsvp__form {
    display: grid;
    gap: 12px;
    padding: 16px;
    background: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--off-white);
}

.hvcc-rsvp__form[hidden] {
    display: none;
}

.hvcc-rsvp__field {
    display: grid;
    gap: 4px;
}

.hvcc-rsvp__field label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wp--preset--color--text-light);
}

.hvcc-rsvp__field input,
.hvcc-rsvp__field select,
.hvcc-rsvp__field textarea {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #c9c9c9;
    border-radius: 0;
    font: inherit;
    color: var(--wp--preset--color--dark);
    background: var(--wp--preset--color--white);
}

.hvcc-rsvp__field input:focus-visible,
.hvcc-rsvp__field select:focus-visible,
.hvcc-rsvp__field textarea:focus-visible {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 1px;
}

.hvcc-rsvp__date,
.hvcc-rsvp__privacy,
.hvcc-rsvp__full {
    margin: 0;
    font-size: 0.875rem;
    color: var(--wp--preset--color--text);
}

.hvcc-rsvp__privacy {
    font-size: 0.8125rem;
    color: var(--wp--preset--color--text-light);
}

.hvcc-rsvp__full {
    font-weight: 600;
}

.hvcc-rsvp__status:empty {
    display: none;
}

.hvcc-rsvp__status {
    margin: 0;
    padding: 8px 12px;
}

.hvcc-rsvp__status.is-error {
    background: #fdecea;
    border-left: 4px solid #b3261e;
    color: #b3261e;
}

.hvcc-rsvp__success {
    margin: 0;
    padding: 12px 16px;
    background: #e8f5e9;
    border-left: 4px solid var(--wp--preset--color--accent);
    color: var(--wp--preset--color--accent-dark);
    font-weight: 600;
}

/* Honeypot: off-screen, not display:none (bots skip display:none less often). */
.hvcc-rsvp__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.hvcc-event-details .hvcc-rsvp {
    margin-top: 20px;
}

.hvcc-rsvp__toggle[hidden] {
    display: none;
}
