/* Basic styles for VCA Masonry */
.vca-masonry-wrap {
    margin: 0 auto;
}

.vca-grid {
    margin: 0;
    position: relative;
}

.vca-grid-sizer {
    width: 33.333%;
}

.vca-grid-item {
    box-sizing: border-box;
    padding: 6px;
    float: left;
}

.vca-grid-item .vca-thumb {
    position: relative;
    overflow: hidden;
}

.vca-grid-item img {
    width: 100%;
    height: auto;
    display: block;
}

.vca-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Overlay content */
.vca-overlay {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    padding: 24px;
    color: #fff;
    text-align: center;
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .62));
    font-family: inherit;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.vca-cat {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: .95;
    color: #fff;
    font-family: inherit;
}

.vca-cat a {
    color: inherit;
    text-decoration: none;
}

.vca-title {
    margin: 6px 0 4px;
    font-size: 29px;
    line-height: 1.05;
    font-weight: 700;
    color: #fff;
    font-family: inherit;
}

.vca-title a {
    color: inherit;
    text-decoration: none;
}

.vca-title a:hover {
    color: #737373;
    text-decoration: none;
}

.vca-date {
    font-size: 13px;
    opacity: .95;
    color: #fff;
    font-family: inherit;
}

.vca-load-more-wrap {
    text-align: center;
    margin: 16px 0;
}

.vca-load-more {
    padding: 8px 16px;
    cursor: pointer;
}

@media (max-width: 480px) {

    .vca-grid-sizer,
    .vca-grid-item {
        width: 100% !important;
    }
}

/* Pseudo-masonry (CSS Grid) - gapless, repeating pattern for uniform images */
.vca-grid.vca-pseudo {
    display: grid;
    grid-template-columns: repeat(var(--vca-cols, 3), 1fr);
    grid-auto-rows: 220px;
    gap: 0;
    grid-auto-flow: dense;
    align-items: stretch;
}

.vca-grid.vca-pseudo .vca-grid-item {
    float: none;
    padding: 0;
}

.vca-grid.vca-pseudo .vca-thumb {
    height: 100%;
}

/* Composite items (hc case) - display 2 posts side-by-side */
.vca-grid.vca-pseudo .vca-grid-item.vca-composite {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.vca-grid.vca-pseudo .vca-grid-item.vca-composite .vca-thumb {
    height: 100%;
    position: relative;
    overflow: hidden;
    background-color: #000;
}

.vca-grid.vca-pseudo .vca-grid-item.vca-composite .vca-thumb img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1.06);
    transition: transform 420ms cubic-bezier(.2, .8, .2, 1);
    transform-origin: center center;
    will-change: transform;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}

/* Composite items have independent hover per thumb */
.vca-grid.vca-pseudo .vca-grid-item.vca-composite .vca-thumb:hover img,
.vca-grid.vca-pseudo .vca-grid-item.vca-composite .vca-thumb:focus-within img {
    transform: translate(-50%, -50%) scale(1);
}

.vca-grid.vca-pseudo .vca-grid-item.vca-composite .vca-thumb .vca-overlay-inner {
    transition: transform 420ms cubic-bezier(.2, .8, .2, 1);
    will-change: transform;
}

.vca-grid.vca-pseudo .vca-grid-item.vca-composite .vca-thumb:hover .vca-overlay-inner,
.vca-grid.vca-pseudo .vca-grid-item.vca-composite .vca-thumb:focus-within .vca-overlay-inner {
    transform: translateY(-6px);
}

/* Vertical composite: q3 (top small, bottom tall) */
.vca-grid.vca-pseudo .vca-grid-item.vca-composite[data-case="q3"] {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.vca-grid.vca-pseudo .vca-grid-item.vca-composite[data-case="q3"] .vca-thumb {
    height: 100%;
}

/* Ensure q3 occupies three grid rows on desktop/tablet unless explicitly overridden by smaller breakpoints */
.vca-grid.vca-pseudo .vca-grid-item.vca-composite[data-case="q3"] {
    grid-row: span 3 !important;
}

/* Fallback min-height for environments where grid-row span gets collapsed
   (ensures visual height matches 3 auto-rows). Values mirror grid-auto-rows
   declared for the main grid so the fallback matches the intended sizes. */
.vca-grid.vca-pseudo .vca-grid-item.vca-composite[data-case="q3"] {
    min-height: calc(220px * 3) !important;
    /* desktop/tablet default */
}

@media (max-width: 768px) {
    .vca-grid.vca-pseudo .vca-grid-item.vca-composite[data-case="q3"] {
        min-height: calc(160px * 3) !important;
        /* matches grid-auto-rows:160px */
    }
}

@media (max-width: 480px) {
    .vca-grid.vca-pseudo .vca-grid-item.vca-composite[data-case="q3"] {
        min-height: calc(140px * 3) !important;
        /* matches grid-auto-rows:140px */
    }
}

/* On mobile, ensure the vertical composite still spans sensible columns */
@media (max-width: 768px) {
    .vca-grid.vca-pseudo .vca-grid-item.vca-composite[data-case="q3"] {
        grid-column: span 2 !important;
        /* use two columns on mobile for visibility */
    }
}


/* Per-item size classes (generated deterministically by the template) */
.vca-grid.vca-pseudo .vca-grid-item.vca-size-tall {
    grid-row: span 2;
}

.vca-grid.vca-pseudo .vca-grid-item.vca-size-normal {
    grid-row: span 1;
}

/* Responsive adjustment: reduce row height on smaller screens */
/* Tablets: 769px - 1100px */
@media (min-width: 769px) and (max-width: 1100px) {
    /* Force Elementor container to full width */
    .elementor-widget-container {
        width: 100vw !important;
        max-width: 100vw !important;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Keep fullscreen breakout behavior on tablets */
    .vca-masonry-wrap.vca-fullscreen {
        width: 100vw !important;
        max-width: none !important;
        position: relative !important;
        left: 50% !important;
        right: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        box-sizing: border-box !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .vca-grid,
    .vca-grid.vca-pseudo {
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        /* Override CSS custom property */
        --vca-cols: 2 !important;
        grid-auto-rows: 220px !important;
        /* Force flexible columns by overriding the var() calculation */
        grid-template-columns: repeat(2, 1fr) !important;
        grid-auto-flow: dense !important;
        gap: 0 !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Additional override with attribute selector */
    .vca-grid.vca-pseudo[style] {
        grid-template-columns: repeat(2, 1fr) !important;
        width: 100vw !important;
    }
    
    /* Force grid items to fill their grid cells */
    .vca-grid.vca-pseudo .vca-grid-item {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* FORCE all items to 1 column by default, override inline styles */
    .vca-grid.vca-pseudo .vca-grid-item,
    .vca-grid.vca-pseudo .vca-grid-item[data-case="qq"],
    .vca-grid.vca-pseudo .vca-grid-item[data-case="qh"],
    .vca-grid.vca-pseudo .vca-grid-item[data-case="hh"] {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    /* Tall items: 1 column, 2 rows */
    .vca-grid.vca-pseudo .vca-grid-item[data-case="hf"],
    .vca-grid.vca-pseudo .vca-grid-item[data-case="qf"] {
        grid-column: span 1 !important;
        grid-row: span 2 !important;
    }

    /* Wide items AND composites: 2 columns (100% width) */
    .vca-grid.vca-pseudo .vca-grid-item[data-case="fh"],
    .vca-grid.vca-pseudo .vca-grid-item[data-case="ff"],
    .vca-grid.vca-pseudo .vca-grid-item.vca-composite,
    .vca-grid.vca-pseudo .vca-grid-item[data-case="hc"],
    .vca-grid.vca-pseudo .vca-grid-item[data-case="q3"] {
        grid-column: span 2 !important;
    }

    .vca-title {
        font-size: 18px!important;
        margin: 0px!important;
    }

    .vca-cat {
        font-size: 14px;
    }

    .vca-date {
        font-size: 12px;
    }
}

/* Mobile: 481px - 768px */
@media (min-width: 481px) and (max-width: 768px) {
    /* Force Elementor container to full width on mobile */
    .elementor-widget-container {
        width: 100vw !important;
        max-width: 100vw !important;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow: visible !important;
    }
    
    /* Fullscreen breakout for mobile */
    .vca-masonry-wrap.vca-fullscreen {
        width: 100vw !important;
        max-width: none !important;
        position: relative !important;
        left: 50% !important;
        right: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        box-sizing: border-box !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow: visible !important;
    }
    
    .vca-masonry-wrap.vca-fullscreen .vca-grid,
    .vca-masonry-wrap.vca-fullscreen .vca-grid.vca-pseudo {
        width: 100vw !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    .vca-grid.vca-pseudo {
        grid-auto-rows: 180px;
        grid-template-columns: repeat(2, 1fr) !important;
        grid-auto-flow: dense;
    }

    /* Default: all items take 1 column (50% width) */
    .vca-grid.vca-pseudo .vca-grid-item {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    /* Tall items: 1 column (50% width), 2 rows tall */
    .vca-grid.vca-pseudo .vca-grid-item[data-case="hf"],
    .vca-grid.vca-pseudo .vca-grid-item[data-case="qf"] {
        grid-column: span 1 !important;
        grid-row: span 2 !important;
    }

    /* Wide items: 2 columns (100% width), 1 row */
    .vca-grid.vca-pseudo .vca-grid-item[data-case="fh"],
    .vca-grid.vca-pseudo .vca-grid-item[data-case="ff"] {
        grid-column: span 2 !important;
        grid-row: span 1 !important;
    }

    /* Composite items: 2 columns (100% width) */
    .vca-grid.vca-pseudo .vca-grid-item.vca-composite {
        grid-column: span 2 !important;
    }

    /* Fonts */
    .vca-title {
        font-size: 17px!important;
        margin: 0px!important;
    }

    .vca-cat {
        font-size: 13px;
    }

    .vca-date {
        font-size: 11px;
    }
}

/* Extra small mobile phones - single column stacking */
@media (max-width: 480px) {
    /* Force Elementor container to full width on extra small mobile */
    .elementor-widget-container {
        width: 100vw !important;
        max-width: 100vw !important;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow: visible !important;
    }
    
    /* Fullscreen breakout for extra small mobile */
    .vca-masonry-wrap.vca-fullscreen {
        width: 100vw !important;
        max-width: none !important;
        position: relative !important;
        left: 50% !important;
        right: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        box-sizing: border-box !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow: visible !important;
    }
    
    .vca-masonry-wrap.vca-fullscreen .vca-grid,
    .vca-masonry-wrap.vca-fullscreen .vca-grid.vca-pseudo {
        width: 100vw !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    .vca-grid.vca-pseudo {
        grid-auto-rows: 250px;
        grid-template-columns: 1fr !important;
    }
    
    /* Force all items to full width (single column) on phones */
    .vca-grid.vca-pseudo .vca-grid-item,
    .vca-grid.vca-pseudo .vca-grid-item[data-case="qq"],
    .vca-grid.vca-pseudo .vca-grid-item[data-case="qh"],
    .vca-grid.vca-pseudo .vca-grid-item[data-case="hh"],
    .vca-grid.vca-pseudo .vca-grid-item[data-case="hf"],
    .vca-grid.vca-pseudo .vca-grid-item[data-case="qf"],
    .vca-grid.vca-pseudo .vca-grid-item[data-case="fh"],
    .vca-grid.vca-pseudo .vca-grid-item[data-case="ff"],
    .vca-grid.vca-pseudo .vca-grid-item.vca-composite {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }
}

/* Full screen / full-bleed support */
/* Force parent containers to allow overflow for fullscreen breakout */
.vca-masonry-wrap.vca-fullscreen {
    width: 100vw;
    max-width: none;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    box-sizing: border-box;
    padding-left: 20px;
    /* small horizontal padding so content isn't flush with edge */
    padding-right: 20px;
}

/* Ensure parent containers don't constrain the fullscreen breakout */
.vca-masonry-wrap.vca-fullscreen * {
    box-sizing: border-box;
}

.vca-masonry-wrap.vca-fullscreen .vca-grid {
    margin-left: 0;
}

/* Hover animation: subtle zoom-out and overlay lift */
.vca-thumb {
    position: relative;
    overflow: hidden;
    will-change: transform;
    background-color: #000;
}

.vca-thumb img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1.06);
    transition: transform 420ms cubic-bezier(.2, .8, .2, 1);
    transform-origin: center center;
    will-change: transform;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}

.vca-grid-item:hover .vca-thumb img,
.vca-grid-item:focus-within .vca-thumb img {
    transform: translate(-50%, -50%) scale(1);
}

.vca-overlay-inner {
    transition: transform 420ms cubic-bezier(.2, .8, .2, 1);
    will-change: transform;
}

.vca-grid-item:hover .vca-overlay-inner,
.vca-grid-item:focus-within .vca-overlay-inner {
    transform: translateY(-6px);
}

/* --- Custom overrides: title / date / category sizing and hover color ---
   These rules are placed at the end to ensure they override earlier declarations.
*/
.vca-title {
    font-size: 20px;
    font-weight: bold;
    font-family: Century Gothic, CenturyGothic, AppleGothic, sans-serif;
}

.vca-title a:hover {
    color: #737373 !important;
}

.vca-date {
    font-size: 12px;
}

.vca-cat {
    font-size: 14px;
}

/* Reduce vertical spacing between category / title / date */
.vca-overlay-inner {
    /* slightly less padding so the text block is more compact */
    padding: 5px 6px !important;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.vca-cat {
    display: block;
    margin: 0 0 -4px 0;
    /* small gap below category */
}

.vca-title {
    margin: 0 0 -4px 0;
    /* reduce top/bottom gap around title */
    line-height: 1.15;
    /* slightly tighter leading */
}

.vca-date {
    margin: 0;
    /* remove extra spacing below date */
    opacity: .9;
}

/* Debug badges (always available via stylesheet so AJAX-loaded items also show them) */
.vca-masonry-wrap.vca-debug .vca-grid-item[data-case] {
    position: relative;
}

.vca-masonry-wrap.vca-debug .vca-grid-item[data-case]::after {
    content: attr(data-case);
    position: absolute;
    left: 6px;
    top: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 30;
}