/* =============================================================
   NIRJA VIKAS VARDHINI — events.css
   Page-specific styles for events.html only.

   Shared:  style.css  → header, footer, cursor, buttons, chips
   Reused:  about.css  → .nvv-page-header + breadcrumb
   This file: period cards, timeline, event grid, search,
              year filter, list view, animations
   ============================================================= */

/* ============================================================
   EVENTS PAGE WRAPPER
   ============================================================ */
.nvv-events-page {
    padding: 80px 0 100px;
    background: var(--bg);
}

/* ============================================================
   INTRO / PERIOD SELECTION
   ============================================================ */
.nvv-events-intro {}

.nvv-events-intro__head {
    margin-bottom: 48px;
}

/* ── Timeline strip ── */
.nvv-events-timeline {
    position: relative;
    height: 48px;
    margin: 0 auto 52px;
    max-width: 720px;
}

.nvv-events-timeline__line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green), var(--orange), var(--gold));
    border-radius: 3px;
    transform: translateY(-50%);
}

.nvv-events-timeline__dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--green);
    box-shadow: 0 0 0 4px rgba(45, 122, 82, 0.15);
    z-index: 1;
}

.nvv-events-timeline__dot span {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}

.nvv-events-timeline__dot--orange {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(232, 100, 10, 0.15);
}

/* ── Period Cards Grid ── */
.nvv-period-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* ── Period Card ── */
.nvv-period-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    position: relative;
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease,
        border-color 0.3s ease;
    /* stagger set via nth-child below */
    opacity: 0;
    transform: translateY(32px);
}

.nvv-period-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.nvv-period-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: rgba(232, 100, 10, 0.35);
}

/* Orange bottom bar on hover */
.nvv-period-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--orange), var(--gold));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.nvv-period-card:hover::after {
    transform: scaleX(1);
}

/* Card image */
.nvv-period-card__img {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.nvv-period-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.nvv-period-card:hover .nvv-period-card__img img {
    transform: scale(1.07);
}

.nvv-period-card__img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(14, 32, 64, 0.55) 100%);
}

/* Floating year badge */
.nvv-period-card__badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(14, 32, 64, 0.82);
    backdrop-filter: blur(6px);
    border-radius: 10px;
    padding: 8px 14px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.nvv-period-card__years {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.nvv-period-card__years em {
    color: var(--orange);
    font-style: normal;
}

.nvv-period-card__count {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 3px;
}

/* Card body */
.nvv-period-card__body {
    padding: 20px 22px 22px;
}

.nvv-period-card__body h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
}

.nvv-period-card__body p {
    font-size: 0.8rem;
    line-height: 1.68;
    color: var(--muted);
    margin-bottom: 16px;
}

.nvv-period-card__cta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    transition: gap 0.2s;
}

.nvv-period-card:hover .nvv-period-card__cta {
    gap: 12px;
}

.nvv-period-card__cta i {
    font-size: 0.8rem;
}

/* Stagger delays */
.nvv-period-card:nth-child(1) {
    transition-delay: 0.05s;
}

.nvv-period-card:nth-child(2) {
    transition-delay: 0.15s;
}

.nvv-period-card:nth-child(3) {
    transition-delay: 0.25s;
}

.nvv-period-card:nth-child(4) {
    transition-delay: 0.35s;
}

/* ============================================================
   DETAIL VIEW — header
   ============================================================ */
.nvv-events-detail__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
    animation: fadeInUp 0.45s ease both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nvv-events-detail__head-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Back button */
.nvv-events-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1.5px solid var(--line);
    color: var(--muted);
    padding: 10px 18px;
    border-radius: 10px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.22s;
    white-space: nowrap;
}

.nvv-events-back:hover {
    background: var(--orange-lt);
    border-color: var(--orange);
    color: var(--orange);
    transform: translateX(-3px);
}

.nvv-events-back i {
    transition: transform 0.2s;
}

.nvv-events-back:hover i {
    transform: translateX(-3px);
}

/* Controls row */
.nvv-events-detail__controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Search */
.nvv-events-search {
    position: relative;
    display: flex;
    align-items: center;
}

.nvv-events-search>i {
    position: absolute;
    left: 14px;
    color: var(--muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.nvv-events-search input {
    background: white;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: 10px 36px 10px 36px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    color: var(--text);
    outline: none;
    width: 220px;
    transition: border-color 0.22s, width 0.3s ease;
}

.nvv-events-search input:focus {
    border-color: var(--orange);
    width: 260px;
}

.nvv-events-search__clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.nvv-events-search__clear.visible {
    opacity: 1;
    pointer-events: all;
}

.nvv-events-search__clear:hover {
    color: var(--orange);
}

/* Year filter buttons */
.nvv-events-year-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nvv-year-btn {
    padding: 7px 14px;
    border-radius: 24px;
    border: 1.5px solid var(--line);
    background: white;
    font-family: 'Nunito', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
    transition: all 0.2s;
}

.nvv-year-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.nvv-year-btn.active {
    background: var(--orange);
    color: white;
    border-color: var(--orange);
    box-shadow: 0 4px 12px rgba(232, 100, 10, .3);
}

/* View toggle */
.nvv-events-view-toggle {
    display: flex;
    gap: 4px;
}

.nvv-view-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid var(--line);
    background: white;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.nvv-view-btn:hover,
.nvv-view-btn.active {
    background: var(--orange);
    color: white;
    border-color: var(--orange);
}

/* Results bar */
.nvv-events-results-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    font-size: 0.8rem;
    color: var(--muted);
}

#resultsCount {
    font-weight: 700;
    color: var(--navy);
}

#activeYearLabel {
    background: var(--orange-lt);
    color: var(--orange);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    display: none;
}

#activeYearLabel.visible {
    display: inline-block;
}

/* ============================================================
   EVENTS GRID (GRID VIEW)
   ============================================================ */
.nvv-events-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* LIST VIEW override */
.nvv-events-grid.list-view {
    grid-template-columns: 1fr;
    gap: 16px;
}

/* ── Event Card ── */
.nvv-event-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    position: relative;
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    transition: opacity 0.5s ease, transform 0.5s ease,
        box-shadow 0.3s ease, border-color 0.3s ease;
}

.nvv-event-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.nvv-event-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(232, 100, 10, 0.28);
}

/* Left orange border on hover */
.nvv-event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--orange), var(--gold));
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.35s ease;
}

.nvv-event-card:hover::before {
    transform: scaleY(1);
}

/* Image */
.nvv-event-card__img {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--bg);
}

.nvv-event-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.nvv-event-card:hover .nvv-event-card__img img {
    transform: scale(1.06);
}

/* Year badge on image */
.nvv-event-card__year {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--orange);
    color: white;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(232, 100, 10, .4);
    line-height: 1.3;
    text-align: center;
}

/* Card body */
.nvv-event-card__body {
    padding: 20px 22px 22px;
}

.nvv-event-card__title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 10px;
    line-height: 1.3;
    /* Clamp to 2 lines in grid view */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nvv-event-card__details {
    font-size: 0.82rem;
    line-height: 1.72;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── LIST VIEW card overrides ── */
.nvv-events-grid.list-view .nvv-event-card {
    display: grid;
    grid-template-columns: 240px 1fr;
    border-radius: var(--radius);
}

.nvv-events-grid.list-view .nvv-event-card__img {
    height: 100%;
    min-height: 140px;
    border-radius: var(--radius) 0 0 var(--radius);
}

.nvv-events-grid.list-view .nvv-event-card__title {
    -webkit-line-clamp: 3;
}

.nvv-events-grid.list-view .nvv-event-card__details {
    -webkit-line-clamp: 4;
}

/* ── Search highlight ── */
.nvv-event-card__title mark,
.nvv-event-card__details mark {
    background: rgba(232, 100, 10, 0.2);
    color: var(--orange);
    border-radius: 3px;
    padding: 0 2px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.nvv-events-empty {
    text-align: center;
    padding: 80px 24px;
}

.nvv-events-empty__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.6rem;
    color: var(--muted);
}

.nvv-events-empty h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    color: var(--navy);
    margin-bottom: 8px;
}

.nvv-events-empty p {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 24px;
}

/* ============================================================
   STAGGER ANIMATION DELAYS (grid view)
   ============================================================ */
.nvv-event-card:nth-child(1) {
    transition-delay: 0.04s;
}

.nvv-event-card:nth-child(2) {
    transition-delay: 0.09s;
}

.nvv-event-card:nth-child(3) {
    transition-delay: 0.14s;
}

.nvv-event-card:nth-child(4) {
    transition-delay: 0.06s;
}

.nvv-event-card:nth-child(5) {
    transition-delay: 0.11s;
}

.nvv-event-card:nth-child(6) {
    transition-delay: 0.16s;
}

.nvv-event-card:nth-child(7) {
    transition-delay: 0.05s;
}

.nvv-event-card:nth-child(8) {
    transition-delay: 0.10s;
}

.nvv-event-card:nth-child(9) {
    transition-delay: 0.15s;
}

.nvv-event-card:nth-child(n+10) {
    transition-delay: 0.08s;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .nvv-period-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nvv-events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .nvv-events-page {
        padding: 60px 0 72px;
    }

    .nvv-events-detail__head {
        flex-direction: column;
        gap: 16px;
    }

    .nvv-events-detail__controls {
        width: 100%;
    }

    .nvv-events-search input {
        width: 100%;
    }

    .nvv-events-search input:focus {
        width: 100%;
    }

    .nvv-events-search {
        flex: 1;
    }

    .nvv-events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .nvv-events-grid.list-view .nvv-event-card {
        grid-template-columns: 160px 1fr;
    }

    .nvv-events-timeline {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .nvv-period-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .nvv-period-card__img {
        height: 150px;
    }

    .nvv-events-grid,
    .nvv-events-grid.list-view {
        grid-template-columns: 1fr;
    }

    .nvv-events-grid.list-view .nvv-event-card {
        grid-template-columns: 1fr;
    }

    .nvv-events-grid.list-view .nvv-event-card__img {
        height: 180px;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .nvv-events-detail__head-left {
        flex-direction: column;
        align-items: flex-start;
    }

    .nvv-events-timeline {
        display: none;
    }
}