/* ─── Project gallery grid ──────────────────────────────── */
.project-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 60px;
}

/* Каждый 5-й элемент — на всю ширину */
.project-gallery-item:nth-child(5n) {
    grid-column: span 2;
}

.project-gallery-item {
    display: block;
    overflow: hidden;
    border-radius: 2px;
    line-height: 0;
}

.project-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
    cursor: zoom-in;
}

.project-gallery-item:hover img {
    transform: scale(1.03);
}

/* Fallback masonry (оставляем для project-masonry-gallery) */
.project-masonry-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 60px;
}

.project-masonry-gallery a {
    display: block;
    overflow: hidden;
    border-radius: 2px;
    line-height: 0;
}

.project-masonry-gallery img {
    width: 100%;
    display: block;
    transition: transform 0.6s ease;
    cursor: zoom-in;
}

.project-masonry-gallery a:hover img {
    transform: scale(1.03);
}

@media (max-width: 768px) {
    .project-gallery-grid,
    .project-masonry-gallery {
        grid-template-columns: 1fr;
        padding: 0 24px;
    }
    .project-gallery-item:nth-child(5n) {
        grid-column: span 1;
    }
}

/* ─── A2 Lightbox ───────────────────────────────────────── */
@keyframes a2lb-backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes a2lb-img-in {
    0%   { opacity: 0; transform: scale(0.82); }
    60%  { opacity: 1; transform: scale(1.03); }
    80%  { transform: scale(0.98); }
    100% { transform: scale(1); }
}

@keyframes a2lb-img-change {
    0%   { opacity: 0; transform: scale(0.92) translateY(6px); }
    100% { opacity: 1; transform: scale(1)    translateY(0); }
}

#a2-lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    align-items: center;
    justify-content: center;
}

#a2-lightbox.is-open {
    display: flex;
    animation: a2lb-backdrop-in 0.3s ease forwards;
}

.a2-lb-img-wrap {
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.a2-lb-img-wrap img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    display: block;
    user-select: none;
    will-change: transform, opacity;
}

.a2-lb-img-wrap img.anim-open {
    animation: a2lb-img-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.a2-lb-img-wrap img.anim-change {
    animation: a2lb-img-change 0.25s ease forwards;
}

.a2-lb-close {
    position: fixed;
    top: 28px;
    right: 36px;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 2;
    padding: 8px;
}

.a2-lb-close:hover { opacity: 1; }

.a2-lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 20px 24px;
    z-index: 2;
}

.a2-lb-nav:hover { opacity: 1; }
.a2-lb-prev { left: 20px; }
.a2-lb-next { right: 20px; }

.a2-lb-counter {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 0.08em;
    z-index: 2;
}

/* ─── Project meta responsive ───────────────────────────── */
@media (max-width: 768px) {
    .project-meta {
        padding: 0 !important;
    }
}

/* ─── Footer legal links ────────────────────────────────── */
.clapat-footer-center {
    flex-direction: column !important;
    gap: 4px;
    height: auto !important;
    min-height: 80px;
}
.footer-legal {
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #555;
    white-space: nowrap;
    pointer-events: initial;
}
.footer-legal a {
    color: #555;
    text-decoration: none;
    transition: color 0.2s;
    pointer-events: initial;
}
.footer-legal a:hover {
    color: #fa821d;
}
.footer-legal__sep {
    margin: 0 6px;
    color: #333;
}

/* Blog content styles */

.blog-content h2,
.blog-content h3,
.blog-content h4 {
    font-weight: 600;
    line-height: 1.3;
    margin: 2em 0 0.75em;
    color: #1a1a1a;
}

.blog-content h2 { font-size: clamp(20px, 2.5vw, 28px); }
.blog-content h3 { font-size: clamp(17px, 2vw, 22px); }
.blog-content h4 { font-size: clamp(15px, 1.8vw, 18px); }

.blog-content p {
    margin: 0 0 1.4em;
}

.blog-content ul,
.blog-content ol {
    margin: 0 0 1.4em 1.5em;
    padding: 0;
}

.blog-content li {
    margin-bottom: 0.5em;
}

.blog-content a {
    color: #fa821d;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-content a:hover {
    text-decoration: none;
}

.blog-content blockquote {
    margin: 2em 0;
    padding: 20px 28px;
    border-left: 3px solid #fa821d;
    background: #f9f9f9;
    font-style: italic;
    color: #555;
    border-radius: 0 4px 4px 0;
}

.blog-content blockquote p:last-child {
    margin-bottom: 0;
}

.blog-content pre,
.blog-content code {
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    background: #1a1a1a;
    color: #e0e0e0;
    border-radius: 4px;
}

.blog-content pre {
    padding: 20px 24px;
    overflow-x: auto;
    margin: 0 0 1.4em;
}

.blog-content code {
    padding: 2px 6px;
    font-size: 13px;
}

.blog-content pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1.5em 0;
}

.blog-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 2.5em 0;
}

/* Blog card hover effect */
.blog-card__media:hover img {
    transform: scale(1.04);
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr !important;
        padding: 0 24px 40px !important;
    }

    .blog-content {
        font-size: 15px !important;
    }

    #main-page-content .one_full[style*="padding: 0 60px"] {
        padding: 0 24px !important;
    }
}
