/* -----------------------------------------------------------
   Remote Village – Events (Row layout)
   ----------------------------------------------------------- */

/* Base icon behaviour – used by rv-event-meta and feed */
.rv-ico {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.2em;
    flex-shrink: 0;
}

/* MAIN LIST WRAPPER */
.rv-events-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent !important;
}

/* Remove last-card gap */
.rv-events-list .rv-event-row:last-child {
    margin-bottom: 0 !important;
}

/* HEADING */
.rv-events-heading {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

/* -----------------------------------------------------------
   EVENT ROW — image left, content right
   ----------------------------------------------------------- */
.rv-event-row {
    display: flex;
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    background: #fff;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    margin: 0;
}

/* IMAGE COLUMN */
.rv-event-img {
    flex: 0 0 260px;
    max-width: 260px;
    min-height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 16px 0 0 16px;
}

/* CONTENT */
.rv-event-body {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #000000;
}

.rv-event-body h4 {
    margin: 0 0 6px 0;
    font-size: 1.25rem;
    font-weight: 600;
    
}

.rv-event-date {
    opacity: 0.8;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* IMAGE SIZE: MEDIUM — image takes 50% of row width */
.rv-event-row--img-medium .rv-event-img {
    flex: 0 0 50%;
    max-width: 50%;
    min-height: 0;
    aspect-ratio: 16 / 9;
}

/* IMAGE SIZE: LARGE — full-width image stacked above content */
.rv-event-row--img-large {
    flex-direction: column;
}

.rv-event-row--img-large .rv-event-img {
    flex: none;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-radius: 16px 16px 0 0;
}

.rv-event-row--img-large .rv-event-body {
    justify-content: flex-start;
}

/* -----------------------------------------------------------
   MOBILE STACK
   ----------------------------------------------------------- */
@media (max-width: 680px) {

    .rv-event-row {
        flex-direction: column;
        align-items: flex-start;
        border-radius: 16px;
    }

    .rv-event-img {
        width: 100%;
        max-width: 100%;
        min-height: 180px;
        aspect-ratio: 16 / 9;
        border-radius: 16px 16px 0 0;
    }

    .rv-event-body {
        width: 100%;
        padding: 24px;
        justify-content: flex-start;
    }

    /* Reset --img-medium modifier so it stacks full-width on mobile */
    .rv-event-row--img-medium .rv-event-img {
        flex: none;
        width: 100%;
        max-width: 100%;
    }
}

/* -----------------------------------------------------------
   ARCHIVE PAGE FIXES
   ----------------------------------------------------------- */
.post-type-archive-event .wp-block-post,
.post-type-archive-event .wp-block-query,
.post-type-archive-event .wp-block-post-template {
    all: unset;
    display: block !important;
}

.post-type-archive-event .wp-block-post > * {
    display: block !important;
}

/* Suppress wpautop/block-editor <p> wrapper artifacts.
   <a rv-event-row> contains <div> children, which the browser treats as invalid inside <p>.
   It splits each card into an empty <a> (the ghost thin line) + the real card after the <p>.
   display:contents makes the <p> invisible to the flex layout; :empty hides the ghost anchors. */
.rv-events-list p {
    display: contents !important;
    margin: 0 !important;
    padding: 0 !important;
}
.rv-event-row:empty { display: none; }

/* -----------------------------------------------------------
   GRID LAYOUT — columns parameter on [rv-events]
   ----------------------------------------------------------- */
.rv-events-grid {
    display: grid;
    gap: 16px;
    width: 100%;
}

.rv-events-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.rv-events-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.rv-events-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.rv-events-grid--cols-5 { grid-template-columns: repeat(5, 1fr); }
.rv-events-grid--cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Grid cards: force vertical (image-on-top) layout */
.rv-events-grid .rv-event-row {
    flex-direction: column;
    height: 100%;
}

.rv-events-grid .rv-event-img {
    flex: none;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-radius: 16px 16px 0 0;
}

.rv-events-grid .rv-event-body {
    justify-content: flex-start;
}

/* Tablet (≤900px): 3+ cols collapse to 2 */
@media (max-width: 900px) {
    .rv-events-grid--cols-3,
    .rv-events-grid--cols-4,
    .rv-events-grid--cols-5,
    .rv-events-grid--cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (≤540px): always single column */
@media (max-width: 540px) {
    .rv-events-grid--cols-2,
    .rv-events-grid--cols-3,
    .rv-events-grid--cols-4,
    .rv-events-grid--cols-5,
    .rv-events-grid--cols-6 {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------------------------------------
   FEATURED EVENTS CARD (vertical layout: image on top)
   ----------------------------------------------------------- */

/* Featured card container */
.rv-featured-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    margin: 0;
    max-width: 100%;
}

/* Featured card image */
.rv-featured-card-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 45vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Featured card body (reuses rv-event-body styling) */
.rv-featured-card-body {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    color: #000000;
}

.rv-featured-card-body h4 {
    margin: 0 0 6px 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 680px) {
    .rv-featured-card {
        flex-direction: column;
        border-radius: 16px;
    }

    .rv-featured-card-img {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 16 / 9;
    }

    .rv-featured-card-body {
        padding: 24px;
    }
}

/* -----------------------------------------------------------
   LEGACY - FEATURED EVENTS CAROUSEL (deprecated)
   ----------------------------------------------------------- */

/* Single featured image */
.rv-featured-hero {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
}

.rv-featured-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

/* Carousel wrapper */
.rv-featured-carousel {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
}

/* Track (sliding container) */
.rv-featured-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
    width: 100%;
}

/* Individual slide */
.rv-featured-slide {
    display: block;
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    pointer-events: auto;
}

/* Carousel navigation buttons */
.rv-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 12px 16px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s ease;
    width: auto;
    height: auto;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.rv-carousel-prev {
    left: 12px;
}

.rv-carousel-next {
    right: 12px;
}

/* Carousel indicators (dots) */
.rv-carousel-indicators {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.rv-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    padding: 0;
    pointer-events: auto;
}

.rv-carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.rv-carousel-dot.active {
    background: rgba(255, 255, 255, 1);
}
