/* ═══════════════════════════════════════════════════════
   VV Photo Gallery — Animated Asymmetric Grid
   Colors: Red (#C0211B), Black (#111), Orange (#E67E22)
   ═══════════════════════════════════════════════════════ */

.vv-photo-gallery {
    margin: 3rem 0;
}

/* ── GRID LAYOUT ── */
.vvg-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    grid-template-rows: 240px 240px;
    gap: 10px;
}

/* Hero card: first post spans left column, both rows */
.vvg-hero {
    grid-column: 1;
    grid-row: 1 / 3;
}

/* ── CARD BASE ── */
.vvg-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(18px);
    animation: vvgReveal 0.6s ease forwards;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.4s ease;
}

/* Staggered entrance animation */
.vvg-card:nth-child(1) { animation-delay: 0s; }
.vvg-card:nth-child(2) { animation-delay: 0.1s; }
.vvg-card:nth-child(3) { animation-delay: 0.2s; }
.vvg-card:nth-child(4) { animation-delay: 0.3s; }
.vvg-card:nth-child(5) { animation-delay: 0.4s; }
.vvg-card:nth-child(6) { animation-delay: 0.5s; }
.vvg-card:nth-child(7) { animation-delay: 0.6s; }
.vvg-card:nth-child(8) { animation-delay: 0.7s; }
.vvg-card:nth-child(9) { animation-delay: 0.8s; }
.vvg-card:nth-child(10) { animation-delay: 0.9s; }
.vvg-card:nth-child(11) { animation-delay: 1.0s; }
.vvg-card:nth-child(12) { animation-delay: 1.1s; }

@keyframes vvgReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover lift */
.vvg-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
    z-index: 2;
}

.vvg-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* ── IMAGE — CRITICAL: object-fit:cover handles all image sizes ── */
.vvg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;       /* This is the key — crops any size image to fill the card */
    object-position: center; /* Center the crop point */
    display: block;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.6s ease;
}

.vvg-card:hover .vvg-img {
    transform: scale(1.08);
}

/* Hero card: Ken Burns slow zoom-pan */
.vvg-hero .vvg-img {
    animation: vvgKenBurns 14s ease-in-out infinite alternate;
}

.vvg-hero:hover .vvg-img {
    animation-play-state: paused;
    transform: scale(1.05);
}

@keyframes vvgKenBurns {
    0%   { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.12) translate(-2%, -1%); }
}

/* ── GRADIENT OVERLAY ── */
.vvg-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(0deg,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.08) 55%,
        transparent 100%);
    transition: background 0.4s ease;
}

.vvg-hero .vvg-overlay {
    background: linear-gradient(160deg,
        transparent 25%,
        rgba(0, 0, 0, 0.75) 100%);
}

.vvg-card:hover .vvg-overlay {
    background: linear-gradient(0deg,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        transparent 100%);
}

/* ── PRIMARY TAG BADGE (colored per tag) ── */
.vvg-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--red, #C0211B);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.02em;
}

.vvg-hero .vvg-tag {
    top: 16px;
    left: 16px;
    font-size: 12px;
    padding: 4px 14px;
}

/* Tag-specific colors — match your existing category colors */
.vvg-tag.tag-local-news     { background: var(--orange, #E67E22); }
.vvg-tag.tag-latest-news    { background: var(--red, #C0211B); }
.vvg-tag.tag-around-vaikom  { background: #E74C3C; }
.vvg-tag.tag-tourism        { background: var(--blue, #2980B9); }
.vvg-tag.tag-festival       { background: var(--red, #C0211B); }
.vvg-tag.tag-sports         { background: var(--blue, #2980B9); }
.vvg-tag.tag-politics       { background: var(--magenta, #E84393); }
.vvg-tag.tag-health         { background: var(--teal, #16A085); }
.vvg-tag.tag-kerala-today   { background: var(--green, #27AE60); }
.vvg-tag.tag-culture        { background: var(--purple, #8E44AD); }
.vvg-tag.tag-education      { background: #3498DB; }
.vvg-tag.tag-entertainment  { background: #E84393; }
.vvg-tag.tag-agriculture    { background: #27AE60; }

/* NEWS source badge (appears on posts from #news-gallery tag) */
.vvg-news-badge {
    position: absolute;
    top: 10px;
    left: 90px;
    background: rgba(17, 17, 17, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.08em;
    z-index: 3;
    text-transform: uppercase;
}

/* ── BOTTOM TITLE INFO ── */
.vvg-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 12px;
    z-index: 3;
}

.vvg-hero .vvg-info {
    padding: 26px 20px;
}

.vvg-info h3 {
    color: #fff;
    font-size: 1.1rem; /* Using rem units to match standard fonts on site, typically slightly larger than 12.5px */
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
    font-family: 'Anek Malayalam', sans-serif;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.vvg-hero .vvg-info h3 {
    font-size: 1.4rem;
}

/* ── BOTTOM ROW (cards 8–11) ── */
.vvg-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}


.vvg-bottom-row .vvg-card {
    height: 140px;
}

/* ═══════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════ */

/* Tablet */
@media (max-width: 959px) {
    .vvg-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 220px repeat(2, 175px);
    }
    .vvg-hero {
        grid-column: 1 / -1;
        grid-row: 1;
    }
    .vvg-bottom-row {
        grid-template-columns: 1fr 1fr;
    }
    .vvg-bottom-row .vvg-card {
        height: 130px;
    }
}

/* Mobile */
@media (max-width: 599px) {
    .vvg-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 200px repeat(2, 150px);
        gap: 8px;
    }
    .vvg-hero {
        grid-column: 1 / -1;
        grid-row: 1;
    }
    .vvg-info {
        padding: 10px 8px;
    }
    .vvg-info h3 {
        font-size: 1rem;
    }
    .vvg-hero .vvg-info h3 {
        font-size: 1.2rem;
    }
    .vvg-tag {
        font-size: 9px;
        padding: 3px 8px;
    }
    .vvg-hero .vvg-tag {
        font-size: 10px;
    }
    .vvg-bottom-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 8px;
    }
    .vvg-bottom-row .vvg-card {
        height: 110px;
    }
    .vvg-bottom-row .vvg-info h3 {
        font-size: 0.95rem;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .vvg-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, 180px);
    }
    .vvg-hero {
        grid-column: 1;
    }
    .vvg-bottom-row {
        grid-template-columns: 1fr;
    }
    .vvg-bottom-row .vvg-card {
        height: 160px;
    }
}
