/**
 * Calendar Events Archive Styles
 * Based on Tabor Water Bureau design example
 */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

/* ============================================
   Base Styles
   ============================================ */
.ct-event-list__title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 40px;
    text-transform: none;
}

/* ============================================
   Filter Form Styles
   ============================================ */
.ct-event-list__filter-wrapper {
    margin-bottom: 35px;
}

.ct-filter-heading {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    padding: 0;
}

.ct-event-list__filter {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 20px;
    align-items: end;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.ct-filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ct-filter-field label {
    font-size: 14px;
    font-weight: 400;
    color: #666;
    margin: 0;
    display: block;
}

.ct-event-list__filter input,
.ct-event-list__filter select {
    box-sizing: border-box;
    padding: 10px 12px;
    line-height: 1.5;
    min-height: 42px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ct-event-list__filter input::placeholder {
    color: #999;
}

.ct-event-list__filter input:focus,
.ct-event-list__filter select:focus {
    outline: none;
    border-color: #4A9BA7;
    box-shadow: 0 0 0 3px rgba(74, 155, 167, 0.1);
}

.ct-event-list__filter select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
    cursor: pointer;
}

.ct-event-list__filter input.ct-datetime-picker {
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 64 64' fill='%23333' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M60,4h-7V3c0-1.657-1.343-3-3-3s-3,1.343-3,3v1H17V3c0-1.657-1.343-3-3-3s-3,1.343-3,3v1H4 C1.789,4,0,5.789,0,8v52c0,2.211,1.789,4,4,4h56c2.211,0,4-1.789,4-4V8C64,5.789,62.211,4,60,4z M62,60c0,1.104-0.896,2-2,2H4c-1.104,0-2-0.896-2-2V17h60V60z M62,15H2V8c0-1.104,0.896-2,2-2h7v4 c0,1.657,1.343,3,3,3s3-1.343,3-3V6h30v4c0,1.657,1.343,3,3,3s3-1.343,3-3V6h7c1.104,0,2,0.896,2,2V15z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

.ct-filter-submit {
    display: flex;
    align-items: flex-end;
}

.ct-event-list__filter button {
    display: inline-block;
    line-height: 1.5;
    padding: 12px 28px;
    border-radius: 6px;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    min-height: 42px;
}

.ct-event-list__filter button:hover {
    background: #333;
}

.ct-event-list__filter button:active {
    transform: translateY(1px);
}

/* ============================================
   Date Block Styles
   ============================================ */
.ct-event-date-block {
    flex: 0 0 90px;
    width: 90px;
    height: 90px;
    background: #4A9BA7; /* Light teal - matches example */
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    margin-right: 25px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(74, 155, 167, 0.2);
}

.ct-event-date-day {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.2;
    margin-bottom: 6px;
    opacity: 0.95;
}

.ct-event-date-number {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -1px;
}

.ct-event-date-month {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.2;
    opacity: 0.95;
}

/* ============================================
   List Layout Styles
   ============================================ */
.ct-events-items.ct-layout-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 40px;
}

.ct-event-list__item {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    padding: 30px 0;
    border-bottom: 1px solid #e8e8e8;
    transition: all 0.2s ease;
}

.ct-event-list__item:hover {
    background-color: #fafafa;
    padding-left: 10px;
    padding-right: 10px;
    margin-left: -10px;
    margin-right: -10px;
    border-radius: 6px;
}

.ct-event-list__item:last-child {
    border-bottom: none;
}

.ct-event-list__content {
    flex: 1;
    min-width: 0;
    padding-right: 20px;
}

.ct-event-list__item-heading {
    margin: 0 0 14px 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    color: #2c3e50;
}

.ct-event-list__item-heading a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ct-event-list__item-heading a:hover {
    color: #4A9BA7;
}

.ct-event-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ct-event-datetime {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ct-event-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4A9BA7;
}

.ct-event-time {
    font-weight: 600;
    color: #333;
}

.ct-event-venue,
.ct-event-organizer,
.ct-event-contact {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ct-event-venue {
    font-weight: 500;
}

/* Image thumbnail for list view */
.ct-event-list__item .ct-events-item__img {
    flex: 0 0 200px;
    width: 200px;
    height: 140px;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ct-event-list__item:hover .ct-events-item__img {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ct-event-list__item .ct-events-item__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ct-events-item__img-label {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Categories list */
.ct-events-item__categories {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ct-events-item__categories li {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f0f0;
    color: #666;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   Grid Layout Styles
   ============================================ */
.ct-events-items.ct-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.ct-event-grid__item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.ct-event-grid__item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #4A9BA7;
}

/* Date block for grid - positioned absolutely at top */
.ct-event-grid__item .ct-event-date-block {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
    width: 70px;
    height: 70px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ct-event-grid__item .ct-event-date-day {
    font-size: 11px;
}

.ct-event-grid__item .ct-event-date-number {
    font-size: 24px;
}

.ct-event-grid__item .ct-event-date-month {
    font-size: 10px;
}

/* Image for grid view */
.ct-event-grid__item .ct-events-item__img {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

.ct-event-grid__item .ct-events-item__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Content area for grid */
.ct-event-grid__content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ct-event-grid__item-heading {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.ct-event-grid__item-heading a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ct-event-grid__item-heading a:hover {
    color: #4A9BA7;
}

.ct-event-grid__content .ct-event-details {
    margin-bottom: 15px;
}

.ct-event-grid__content .ct-event-datetime {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ct-event-grid__content .ct-event-venue,
.ct-event-grid__content .ct-event-organizer,
.ct-event-grid__content .ct-event-contact {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   Pagination Styles
   ============================================ */
.ct-events-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 50px;
    padding: 20px 0;
}

.ct-events-pagination .page-numbers {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.ct-events-pagination .page-numbers li {
    margin: 0;
}

.ct-events-pagination .page-numbers a,
.ct-events-pagination .page-numbers span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.ct-events-pagination .page-numbers a {
    background: #fff;
    color: #4A9BA7;
    border: 1px solid #e0e0e0;
}

.ct-events-pagination .page-numbers a:hover {
    background: #4A9BA7;
    color: #fff;
    border-color: #4A9BA7;
}

.ct-events-pagination .page-numbers .current {
    background: #4A9BA7;
    color: #fff;
    border: 1px solid #4A9BA7;
}

.ct-events-pagination .page-numbers .dots {
    background: transparent;
    border: none;
    color: #999;
    cursor: default;
}

/* ============================================
   Empty State
   ============================================ */
.ct-event-list p {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #999;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 768px) {
    .ct-event-list {
        padding: 20px 15px;
    }

    .ct-event-list__title {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .ct-event-list__filter {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .ct-filter-submit {
        align-items: stretch;
    }

    .ct-event-list__filter button {
        width: 100%;
    }

    .ct-events-items.ct-layout-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ct-event-list__item {
        flex-wrap: wrap;
    }

    .ct-event-date-block {
        flex: 0 0 70px;
        width: 70px;
        height: 70px;
    }

    .ct-event-list__item .ct-events-item__img {
        flex: 1 1 100%;
        width: 100%;
        height: 200px;
        margin-top: 15px;
    }

    .ct-event-list__item-heading,
    .ct-event-grid__item-heading {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .ct-event-list__title {
        font-size: 24px;
    }

    .ct-event-date-block {
        width: 60px;
        height: 60px;
        flex: 0 0 60px;
    }

    .ct-event-date-day {
        font-size: 10px;
    }

    .ct-event-date-number {
        font-size: 22px;
    }

    .ct-event-date-month {
        font-size: 9px;
    }

    .ct-event-list__item-heading,
    .ct-event-grid__item-heading {
        font-size: 16px;
    }
}
