.page-block-c {
    padding-top: 5vh;
    position: relative;
}

.page-block-c-gallery-container {
    max-width: 1200px;
    width: 100%;
}

.page-block-c-tile-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(180px, auto);
    margin-bottom: 20px;
}

.page-block-c-tile {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background: #e0e0e0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    aspect-ratio: 1 / 1;
}

.page-block-c-tile:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-block-c-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
    pointer-events: none;
}

@media (max-width: 768px) {
    .page-block-c-tile-grid {
        gap: 12px;
        grid-auto-rows: minmax(150px, auto);
    }
}

@media (max-width: 480px) {
    .page-block-c-tile-grid {
        gap: 8px;
    }
    .page-block-c-tile {
        border-radius: 16px;
    }
}

.page-block-c-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10001;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.page-block-c-lightbox.active {
    display: flex;
    opacity: 1;
}

.page-block-c-lightbox__content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-block-c-lightbox__img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: #111;
    user-select: none;
}

.page-block-c-lightbox__close {
    position: absolute;
    top: 0px;
    right: 0;
    background: rgba(30, 30, 30, 0.8);
    color: white;
    border: none;
    font-size: 36px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: background 0.2s;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.page-block-c-lightbox__close:hover {
    background: rgba(255, 70, 70, 0.9);
}

.page-block-c-lightbox__close:active {
    transform: scale(0.95);
}

.page-block-c-lightbox-caption {
    color: #ccc;
    margin-top: 16px;
    font-size: 16px;
    max-width: 80%;
    text-align: center;
    background: rgba(0,0,0,0.4);
    padding: 6px 20px;
    border-radius: 40px;
    backdrop-filter: blur(2px);
}

@media (hover: hover) {
    .page-block-c-tile:hover {
        transform: scale(1.02);
        box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
    }
}

.page-block-c-tile::after {
    content: "⤢";
    position: absolute;
    bottom: 8px;
    right: 10px;
    background: rgba(0,0,0,0.4);
    color: white;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 30px;
    backdrop-filter: blur(2px);
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.2s;
}

.page-block-c-tile--portrait::after {
    content: "↕️";
}
.page-block-c-tile--landscape::after {
    content: "↔️";
}

@media (max-width: 480px) {
    .page-block-c-tile::after {
        font-size: 12px;
        padding: 2px 6px;
        bottom: 4px;
        right: 5px;
    }
}

@media (max-width: 600px) {
    .page-block-c-lightbox__close {
        top: 10px;
        right: 10px;
        background: rgba(0,0,0,0.7);
        width: 44px;
        height: 44px;
        font-size: 32px;
    }
    
    .page-block-c-lightbox-caption {
        font-size: 14px;
        margin-top: 10px;
    }
}