/* ────────────────────────────────────────────────
   Events section layout
   ──────────────────────────────────────────────── */

.tib-events {
    width: min(1120px, calc(100% - 32px));
    margin: 48px auto;
}

.tib-events__header {
    margin-bottom: 28px;
}

.tib-events__eyebrow {
    margin: 0 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #66725f;
}

.tib-events h2 {
    margin: 0;
}

.tib-events__place {
    margin-top: 36px;
}

.tib-events__place h3 {
    margin: 0 0 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    padding-bottom: 10px;
    font-size: clamp(1.35rem, 2.4vw, 1.8rem);
    line-height: 1.2;
}

.tib-events__empty {
    margin: 0;
}

.tib-events__debug {
    margin-top: 16px;
    overflow: auto;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 8px;
    background: #f7f7f7;
    padding: 14px;
    font-size: 0.86rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

/* ────────────────────────────────────────────────
   Grid
   ──────────────────────────────────────────────── */

.tib-events__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* ────────────────────────────────────────────────
   Preview card — compact version
   ──────────────────────────────────────────────── */

.tib-preview-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: #fff;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    cursor: default;
}

.tib-preview-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Thumbnail */
.tib-preview-card__image-wrap {
    position: relative;
    overflow: hidden;
}

.tib-preview-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #f4f1ea;
    transition: transform 0.35s ease;
}

.tib-preview-card:hover .tib-preview-card__image {
    transform: scale(1.04);
}

/* Body */
.tib-preview-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 16px;
}

.tib-preview-card__date {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #66725f;
}

.tib-preview-card h4 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.3;
}

.tib-preview-card__name {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.18s ease;
}

.tib-preview-card__name:hover {
    color: #4a7c3f;
}

.tib-preview-card__place {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 0.82rem;
    color: #8a8a8a;
}

.tib-preview-card__place svg {
    flex-shrink: 0;
}

/* ────────────────────────────────────────────────
   Detail overlay
   ──────────────────────────────────────────────── */

.tib-detail {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tib-detail--open {
    opacity: 1;
    visibility: visible;
}

/* Panel */
.tib-detail__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(880px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.tib-detail--open .tib-detail__panel {
    transform: translateY(0) scale(1);
}

/* Close button */
.tib-detail__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.tib-detail__close:hover {
    background: #fff;
    transform: scale(1.08);
}


/* Image */
.tib-detail__image-wrap {
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: #f4f1ea;
}

.tib-detail__image {
    display: block;
    width: 100%;
    max-height: 380px;
    object-fit: cover;
}

/* Content */
.tib-detail__content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 28px 28px 32px;
}

.tib-detail__title {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    line-height: 1.2;
}

.tib-detail__date {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background: #f0ece4;
    font-size: 0.88rem;
    font-weight: 700;
    color: #66725f;
    width: fit-content;
}

/* Meta row */
.tib-detail__meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tib-detail__place,
.tib-detail__address {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 0.92rem;
    color: #555;
}

.tib-detail__place svg,
.tib-detail__address svg {
    flex-shrink: 0;
    color: #66725f;
}

.tib-detail__description {
    margin: 0;
    line-height: 1.65;
    color: #333;
    white-space: pre-line;
}

.tib-detail__price {
    margin: 0;
    padding: 6px 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e8f5e4 0%, #d6ecd0 100%);
    font-size: 1rem;
    font-weight: 700;
    color: #3c6b32;
    width: fit-content;
}

/* ────────────────────────────────────────────────
   Responsive
   ──────────────────────────────────────────────── */

@media (max-width: 640px) {
    .tib-events {
        width: min(100% - 24px, 1120px);
        margin: 32px auto;
    }

    .tib-events__grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }

    .tib-preview-card__body {
        padding: 10px 12px 14px;
    }

    .tib-detail__panel {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 24px);
        border-radius: 12px;
    }

    .tib-detail__image {
        max-height: 260px;
    }

    .tib-detail__content {
        padding: 20px 20px 24px;
    }
}

.tib-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.tib-lightbox--active {
    display: flex;
}

.tib-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.tib-detail__image-wrap img {
    cursor: zoom-in;
}