/* ==================================================
   Events Archive + Single Event Styling
   Theme: screenr-child
================================================== */


/* ==================================================
   Screenr Page Header / Cover Image
================================================== */

.post-type-archive-events #page-header-cover,
.single-events #page-header-cover {
    display: block !important;
    position: relative !important;
    min-height: 340px !important;
    padding: 0 !important;
    margin: 0 0 3rem !important;
    overflow: hidden !important;
    background-color: #10233f !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

/* Soft overlay ONLY for Events archive banner */
.post-type-archive-events #page-header-cover::before,
.post-type-archive-events #page-header-cover:before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block !important;
    background: linear-gradient(
        90deg,
        rgba(0, 39, 76, 0.18) 0%,
        rgba(0, 39, 76, 0.12) 50%,
        rgba(0, 39, 76, 0.08) 100%
    ) !important;
    pointer-events: none;
}

/* Make sure no second overlay layer stacks on top */
.post-type-archive-events #page-header-cover::after,
.post-type-archive-events #page-header-cover:after {
    content: none !important;
    display: none !important;
    background: none !important;
    opacity: 0 !important;
}
/* Remove Screenr slide overlay ONLY on Events archive banner */
.post-type-archive-events #page-header-cover .overlay,
.post-type-archive-events #page-header-cover .swiper-slide .overlay,
.post-type-archive-events #page-header-cover .swiper-slide::before,
.post-type-archive-events #page-header-cover .swiper-slide:before,
.post-type-archive-events #page-header-cover .swiper-slide::after,
.post-type-archive-events #page-header-cover .swiper-slide:after {
    content: none !important;
    display: none !important;
    background: none !important;
    opacity: 0 !important;
    box-shadow: none !important;
}

/* Softer overlay for single event pages only */
.single-events #page-header-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        90deg,
        rgba(0, 39, 76, 0.48) 0%,
        rgba(0, 39, 76, 0.32) 50%,
        rgba(0, 39, 76, 0.15) 100%
    );
    pointer-events: none;
}

/* Keep page header content above image/overlay */
.post-type-archive-events #page-header-cover .container,
.single-events #page-header-cover .container,
.post-type-archive-events #page-header-cover .page-header,
.single-events #page-header-cover .page-header,
.post-type-archive-events #page-header-cover .page-header-content,
.single-events #page-header-cover .page-header-content,
.post-type-archive-events #page-header-cover .entry-header,
.single-events #page-header-cover .entry-header,
.post-type-archive-events #page-header-cover .swiper-slide-intro,
.single-events #page-header-cover .swiper-slide-intro,
.post-type-archive-events #page-header-cover .swiper-intro-inner,
.single-events #page-header-cover .swiper-intro-inner {
    position: relative;
    z-index: 2;
}

/* Banner headings */
.post-type-archive-events #page-header-cover h1,
.single-events #page-header-cover h1,
.post-type-archive-events #page-header-cover h2,
.single-events #page-header-cover h2,
.post-type-archive-events #page-header-cover .page-title,
.single-events #page-header-cover .page-title,
.post-type-archive-events #page-header-cover .entry-title,
.single-events #page-header-cover .entry-title,
.post-type-archive-events #page-header-cover .swiper-slide-heading,
.single-events #page-header-cover .swiper-slide-heading {
    color: #ffffff !important;
    font-size: clamp(2.25rem, 4vw, 4rem) !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    letter-spacing: -0.04em !important;
    text-transform: none !important;
    text-shadow: 0 3px 16px rgba(0, 0, 0, 0.35);
}

/* Header subtitle / breadcrumbs if Screenr outputs them */
.post-type-archive-events #page-header-cover p,
.single-events #page-header-cover p,
.post-type-archive-events #page-header-cover .page-subtitle,
.single-events #page-header-cover .page-subtitle {
    max-width: 760px;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1.1rem !important;
    line-height: 1.65 !important;
}

/* Make images inside the cover behave like a real cover */
.post-type-archive-events #page-header-cover img,
.single-events #page-header-cover img {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
}

/* Hide extra banner helper text if theme inserts unwanted blog labels */
.single-events #page-header-cover .page-header-subtitle,
.single-events #page-header-cover .taxonomy-description,
.single-events #page-header-cover .archive-description,
.post-type-archive-events #page-header-cover .page-header-subtitle,
.post-type-archive-events #page-header-cover .taxonomy-description,
.post-type-archive-events #page-header-cover .archive-description {
    display: none !important;
}


/* ==================================================
   Events page structure
================================================== */

.post-type-archive-events #content,
.single-events #content {
    background: #ffffff;
}

.post-type-archive-events .site-content .container,
.single-events .site-content .container {
    max-width: 1120px;
}

.post-type-archive-events #primary,
.post-type-archive-events .content-area.full-width,
.single-events #primary,
.single-events .content-area.full-width {
    width: 100%;
    max-width: 100%;
}


/* ==================================================
   Breadcrumbs
================================================== */

.post-type-archive-events .events-breadcrumbs,
.single-events .events-breadcrumbs {
    font-size: 0.95rem;
    padding: 0.85rem 0 0.85rem !important;
    margin-bottom: 1.45rem !important;
    border-bottom: 1px solid #e5eaf0;
    color: #6b7280;
}

.post-type-archive-events .events-breadcrumbs a,
.single-events .events-breadcrumbs a {
    color: #334155;
    font-weight: 600;
    text-decoration: none;
}

.post-type-archive-events .events-breadcrumbs a:hover,
.single-events .events-breadcrumbs a:hover {
    color: #005ea8;
    text-decoration: underline;
}

.post-type-archive-events .events-breadcrumbs span,
.single-events .events-breadcrumbs span {
    margin: 0 8px;
}


/* ==================================================
   Archive header
================================================== */

.post-type-archive-events .events-archive-header,
.post-type-archive-events .archive-header {
    margin-top: 0 !important;
    margin-bottom: 1.15rem !important;
}

.post-type-archive-events .archive-title {
    position: relative;
    display: inline-block;
    margin: 0 0 0.75rem !important;
    padding-bottom: 0.65rem;
    color: #002f5f;
    font-size: clamp(2rem, 3vw, 2.65rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.post-type-archive-events .archive-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 72px;
    height: 4px;
    background: linear-gradient(90deg, #005ea8, #00a6d6);
    border-radius: 999px;
}

.post-type-archive-events .events-archive-intro {
    max-width: 820px;
    margin: 0 0 1.25rem !important;
    color: #4e5d6c;
    font-size: 1.08rem;
    line-height: 1.7;
}


/* ==================================================
   Search
================================================== */

.post-type-archive-events .events-search {
    float: none !important;
    clear: both !important;
    position: relative;
    display: block !important;
    width: 100% !important;
    max-width: 700px !important;
    margin: 0 0 1.5rem !important;
}

.post-type-archive-events .events-search::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 50%;
    z-index: 2;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    opacity: 0.55;
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M9%2016C12.866%2016%2016%2012.866%2016%209C16%205.134%2012.866%202%209%202C5.134%202%202%205.134%202%209C2%2012.866%205.134%2016%209%2016Z%22%20stroke%3D%22%23005EA8%22%20stroke-width%3D%222%22/%3E%3Cpath%20d%3D%22M14.5%2014.5L18%2018%22%20stroke%3D%22%23005EA8%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E");
}

.post-type-archive-events .events-search-input,
.post-type-archive-events .events-search input {
    float: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 700px !important;
    min-width: 0 !important;
    height: 54px !important;
    padding: 0 1rem 0 3rem !important;
    color: #1f2937;
    font-size: 1rem !important;
    line-height: 54px;
    border: 1px solid #cfd6de !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

.post-type-archive-events .events-search-input:focus,
.post-type-archive-events .events-search input:focus {
    border-color: #005ea8 !important;
    box-shadow: 0 0 0 3px rgba(0, 94, 168, 0.12) !important;
    outline: none !important;
}


/* ==================================================
   Events archive list
================================================== */

.post-type-archive-events #events-results,
.post-type-archive-events .events-archive-list {
    float: none !important;
    clear: both !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.post-type-archive-events .events-archive-item,
.post-type-archive-events .events-archive-list > li {
    float: none !important;
    clear: both !important;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 1.25rem 0 1.6rem !important;
    border: 0 !important;
    border-bottom: 1px solid #d9d9d9 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}


/* ==================================================
   Event row layout
================================================== */

.post-type-archive-events .event-row {
    display: flex !important;
    align-items: flex-start !important;
    gap: 1.5rem !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.post-type-archive-events .event-row-image {
    flex: 0 0 240px !important;
    width: 240px !important;
    max-width: 240px !important;
}

.post-type-archive-events .event-row-image a {
    display: block !important;
    text-decoration: none !important;
}

.post-type-archive-events .event-row-image img {
    display: block !important;
    width: 240px !important;
    height: 160px !important;
    object-fit: cover !important;
    border-radius: 0 !important;
}

.post-type-archive-events .event-placeholder-image {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 240px !important;
    height: 160px !important;
    color: #ffffff;
    font-weight: 700;
    background: linear-gradient(135deg, #005ea8, #003e73);
}

.post-type-archive-events .event-row-content {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding-top: 0 !important;
}


/* ==================================================
   Event row typography
================================================== */

.post-type-archive-events .event-row-date {
    margin: 0 0 0.45rem !important;
    color: #111111 !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

.post-type-archive-events .event-row-title {
    margin: 0 0 0.2rem !important;
    padding: 0 !important;
    color: #0066cc;
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
}

.post-type-archive-events .event-row-title a {
    color: #0066cc !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

.post-type-archive-events .event-row-title a:hover {
    color: #004b93 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.post-type-archive-events .event-row-type {
    margin: 0 0 0.55rem !important;
    color: #111111 !important;
    font-size: 0.98rem !important;
    font-style: italic !important;
    line-height: 1.4 !important;
}

.post-type-archive-events .event-row-location {
    margin: 0 0 0.55rem !important;
    color: #444444 !important;
    font-size: 0.98rem !important;
    font-weight: 600 !important;
}

/* Hide organizer only on archive cards */
.post-type-archive-events .event-row-organizer {
    display: none !important;
}

.post-type-archive-events .event-row-excerpt {
    max-width: 900px;
    color: #111111 !important;
    font-size: 1rem !important;
    line-height: 1.55 !important;
}

.post-type-archive-events .event-row-excerpt p {
    margin: 0 !important;
}


/* ==================================================
   Single Event
================================================== */

.single-events .single-event-title {
    margin-top: 0 !important;
    margin-bottom: 1.35rem !important;
    color: #333333;
    font-size: 2.15rem;
    font-weight: 800;
    line-height: 1.2;
}

/* Safety: if any featured image still appears in content, hide it */
.single-events .single-event-featured-image {
    display: none !important;
}

.single-events .single-event-meta {
    margin: 0 0 1.5rem !important;
    padding: 1.25rem 1.35rem;
    background: #f8f9fa;
    border-left: 5px solid #005ea8;
    border-radius: 8px;
}

.single-events .single-event-meta div {
    margin-bottom: 0.65rem;
    color: #5f6f82;
    font-size: 1rem;
    line-height: 1.5;
}

.single-events .single-event-meta div:last-child {
    margin-bottom: 0;
}

.single-events .single-event-meta strong {
    color: #555555;
    font-weight: 700;
}

.single-events .single-event-meta a {
    color: #224f9c;
    text-decoration: none;
}

.single-events .single-event-meta a:hover {
    text-decoration: underline;
}

.single-events .entry-content.single-event-content,
.single-events .single-event-content {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    color: #5f6f82;
    font-size: 1.05rem;
    line-height: 1.75;
    box-sizing: border-box !important;
}

.single-events .entry-content.single-event-content p,
.single-events .entry-content.single-event-content ul,
.single-events .entry-content.single-event-content ol,
.single-events .entry-content.single-event-content h2,
.single-events .entry-content.single-event-content h3,
.single-events .entry-content.single-event-content h4 {
    max-width: 100% !important;
}

.single-events .entry-content.single-event-content img,
.single-events .single-event-content img {
    max-width: 100% !important;
    height: auto !important;
}

.single-events .entry-content.single-event-content table,
.single-events .single-event-content table {
    width: 100% !important;
}

.single-events .single-event-categories {
    margin-top: 2rem;
    font-size: 0.95rem;
    color: #666666;
}


/* ==================================================
   Pagination
================================================== */

.post-type-archive-events .events-pagination,
.post-type-archive-events .pagination-wrapper {
    clear: both;
    margin-top: 2.5rem;
}


/* ==================================================
   Tighten Single Event spacing below banner
================================================== */

.single-events #page-header-cover {
    margin-bottom: 1.25rem !important;
}

.single-events #page-header-cover .swiper-intro-inner {
    padding-top: 8% !important;
    padding-bottom: 8% !important;
}

.single-events #content.single-event-page,
.single-events .single-event-page {
    padding-top: 0 !important;
}

.single-events .events-breadcrumbs {
    padding: 0.85rem 0 0.85rem !important;
    margin-bottom: 2rem !important;
}

.single-events #primary,
.single-events .content-area.full-width,
.single-events #main {
    padding-top: 0 !important;
}


/* ==================================================
   Events Archive: banner and tighter spacing
================================================== */

.post-type-archive-events #page-header-cover {
    margin-bottom: 1.1rem !important;
}

.post-type-archive-events #page-header-cover .swiper-intro-inner {
    padding-top: 8% !important;
    padding-bottom: 8% !important;
}

.post-type-archive-events #content.events-archive-page,
.post-type-archive-events .events-archive-page {
    padding-top: 0 !important;
}

.post-type-archive-events #primary,
.post-type-archive-events .content-area.full-width,
.post-type-archive-events #main {
    padding-top: 0 !important;
}


/* ==================================================
   Responsive
================================================== */

@media (max-width: 900px) {
    .post-type-archive-events #page-header-cover,
    .single-events #page-header-cover {
        min-height: 280px !important;
    }

    .post-type-archive-events .event-row {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .post-type-archive-events .event-row-image,
    .post-type-archive-events .event-row-image img,
    .post-type-archive-events .event-placeholder-image {
        width: 100% !important;
        max-width: 100% !important;
    }

    .post-type-archive-events .event-row-image {
        flex: 0 0 auto !important;
    }

    .post-type-archive-events .event-row-image img,
    .post-type-archive-events .event-placeholder-image {
        height: auto !important;
        min-height: 220px;
        max-height: 280px;
        object-fit: cover !important;
    }

    .post-type-archive-events .event-row-title {
        font-size: 1.45rem !important;
    }
}

@media (max-width: 700px) {
    .post-type-archive-events #page-header-cover {
        margin-bottom: 0.85rem !important;
    }

    .post-type-archive-events #page-header-cover .swiper-intro-inner {
        padding-top: 10% !important;
        padding-bottom: 10% !important;
    }

    .post-type-archive-events .events-breadcrumbs {
        margin-bottom: 1.1rem !important;
    }

    .post-type-archive-events .events-archive-header,
    .post-type-archive-events .archive-header {
        margin-bottom: 1rem !important;
    }
}

@media (max-width: 600px) {
    .post-type-archive-events #page-header-cover,
    .single-events #page-header-cover {
        min-height: 240px !important;
        margin-bottom: 2rem !important;
    }

    .post-type-archive-events .events-breadcrumbs,
    .single-events .events-breadcrumbs {
        margin-bottom: 2rem;
    }

    .post-type-archive-events .archive-title {
        font-size: 2rem !important;
    }

    .post-type-archive-events .events-archive-intro {
        font-size: 1rem;
    }

    .post-type-archive-events .events-search {
        max-width: 100% !important;
    }

    .post-type-archive-events .events-search-input,
    .post-type-archive-events .events-search input {
        max-width: 100% !important;
        height: 50px !important;
        line-height: 50px;
    }

    .post-type-archive-events .event-row-title {
        font-size: 1.3rem !important;
    }

    .post-type-archive-events .event-row-date,
    .post-type-archive-events .event-row-type,
    .post-type-archive-events .event-row-excerpt {
        font-size: 0.96rem !important;
    }

    .single-events .single-event-title {
        font-size: 1.75rem;
    }

    .single-events .single-event-meta {
        padding: 1rem;
    }
}

/* ==================================================
   Events Archive Filters
================================================== */

.post-type-archive-events .events-filter-form {
    margin: 1.5rem 0 2rem;
}

.post-type-archive-events .events-filter-top {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 1rem;
    align-items: stretch;
}

.post-type-archive-events .events-filter-search {
    max-width: none !important;
    margin: 0 !important;
}

.post-type-archive-events .events-filter-submit,
.post-type-archive-events .events-view-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 1.75rem;
    border: 2px solid #0066cc;
    background: #0066cc;
    color: #ffffff !important;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
}

.post-type-archive-events .events-view-toggle {
    background: #ffffff;
    color: #0066cc !important;
}

.post-type-archive-events .events-filter-submit:hover {
    background: #004b93;
    border-color: #004b93;
}

.post-type-archive-events .events-view-toggle:hover {
    background: #eef6ff;
}

.post-type-archive-events .events-filter-divider {
    height: 1px;
    margin: 1.5rem 0 1rem;
    background: #d9d9d9;
}

.post-type-archive-events .events-filter-label {
    margin-bottom: 0.75rem;
    color: #111111;
    font-weight: 700;
}

.post-type-archive-events .events-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.post-type-archive-events .events-filter-select,
.post-type-archive-events .events-sort-select {
    width: 100%;
    min-height: 48px;
    padding: 0 1rem;
    color: #111111;
    font-size: 1rem;
    border: 1px solid #333333;
    border-radius: 0;
    background: #ffffff;
}

.post-type-archive-events .events-sort-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

.post-type-archive-events .events-sort-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-type-archive-events .events-sort-control label {
    margin: 0;
    color: #111111;
    font-weight: 700;
}

.post-type-archive-events .events-sort-select {
    min-width: 230px;
}

.post-type-archive-events .events-results-count {
    color: #111111;
    font-weight: 700;
}

@media (max-width: 800px) {
    .post-type-archive-events .events-filter-top,
    .post-type-archive-events .events-filter-grid {
        grid-template-columns: 1fr;
    }

    .post-type-archive-events .events-sort-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .post-type-archive-events .events-sort-control {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
    }

    .post-type-archive-events .events-sort-select {
        width: 100%;
        min-width: 0;
    }
}

/* ==================================================
   Events Archive Sort Row
================================================== */

.post-type-archive-events .events-sort-control {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 0.75rem !important;
    white-space: nowrap !important;
}

.post-type-archive-events .events-sort-control label {
    margin: 0 !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
}

.post-type-archive-events .events-sort-select {
    width: auto !important;
    min-width: 240px !important;
    max-width: 280px !important;
}

/* ==================================================
   Active Events Filter Chips
================================================== */

.post-type-archive-events .events-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.post-type-archive-events .events-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 38px;
    padding: 0.35rem 0.75rem;
    color: #ffffff !important;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    background: #0066cc;
    border: 1px solid #0066cc;
    border-radius: 4px;
}

.post-type-archive-events .events-filter-chip:hover {
    background: #004b93;
    border-color: #004b93;
}

.post-type-archive-events .events-filter-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    color: #0066cc;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    background: #ffffff;
    border-radius: 999px;
}

.post-type-archive-events .events-reset-filters {
    color: #0066cc !important;
    font-weight: 700;
    text-decoration: none !important;
}

.post-type-archive-events .events-reset-filters:hover {
    text-decoration: underline !important;
}

/* ==================================================
   Hide page header cover on Events archive only
================================================== */

.post-type-archive-events #page-header-cover {
    display: none !important;
}