/* ================================================================
   Counterfeit cases block (Juvelierizstrādājumu viltojumi)
   .cf-case      — photo with thumbnails + "claimed / actually" compare
   .cf-case--wide — wide photo on top, text in two columns below
   .cf-lightbox  — native <dialog> photo viewer
   Section head reuses .pub-section / .pub-section__head
   from publications-block.css
   ================================================================ */

.cf-block * {
    box-sizing: border-box;
}

.cf-cases {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ================= case card ================= */

.cf-case {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--pub-line);
    border-radius: 24px;
    background-color: #fff;
    box-shadow: var(--pub-shadow-s);
}

.cf-case:nth-child(even):not(.cf-case--wide) .cf-case__media {
    order: 2;
}

.cf-case__media {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: #f7f3f2;
}

.cf-case__photo {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    padding: 0;
    border: 0;
    background-color: #fff;
    cursor: zoom-in;
}

.cf-case__photo img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 480px;
    object-fit: contain;
    transition: transform .4s ease;
}

.cf-case__photo:hover img {
    transform: scale(1.03);
}

.cf-case__photo:focus-visible {
    outline: 2px solid var(--pub-red);
    outline-offset: -4px;
}

.cf-case__zoom {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(107, 12, 38, .88);
    color: #fff;
    box-shadow: 0 6px 16px rgba(88, 20, 40, .25);
    transition: background-color .2s ease, transform .2s ease;
}

.cf-case__zoom svg {
    width: 20px;
    height: 20px;
}

.cf-case__photo:hover .cf-case__zoom {
    background-color: var(--pub-red);
    transform: scale(1.06);
}

.cf-case__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-top: 1px solid var(--pub-line);
    background-color: var(--pub-rose);
}

.cf-case__caption {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--pub-muted);
}

.cf-thumbs {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cf-thumb {
    display: block;
    width: 52px;
    height: 52px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 12px;
    background-color: #fff;
    cursor: pointer;
    opacity: .6;
    transition: border-color .2s ease, opacity .2s ease;
}

.cf-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cf-thumb:hover,
.cf-thumb.is-active {
    opacity: 1;
}

.cf-thumb.is-active {
    border-color: var(--pub-bordo);
}

.cf-thumb:focus-visible {
    outline: 2px solid var(--pub-red);
    outline-offset: 2px;
}

/* ================= text side ================= */

.cf-case__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 36px 38px 34px;
}

.cf-case__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 14px;
}

.cf-case__tag {
    display: inline-flex;
    padding: 6px 14px;
    border-radius: 999px;
    background-color: var(--pub-card);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--pub-bordo);
}

.cf-case__num {
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    color: #ead9de;
}

.cf-case__title {
    margin: 0 0 22px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--pub-bordo);
}

.cf-compare {
    display: grid;
    gap: 10px;
    margin: 0 0 22px;
}

.cf-compare__row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 16px;
}

.cf-compare__row dt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.cf-compare__row dt svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

.cf-compare__row dd {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
}

.cf-compare__row--claimed {
    border: 1px dashed #d9c9a3;
    background-color: #fcf8ee;
}

.cf-compare__row--claimed dt {
    color: #9a7a2e;
}

.cf-compare__row--claimed dd {
    color: #6d5a2c;
    text-decoration: line-through;
    text-decoration-color: rgba(163, 22, 42, .55);
    text-decoration-thickness: 1.5px;
}

.cf-compare__row--actual {
    background-color: #fdecee;
}

.cf-compare__row--actual dt {
    color: #a3162a;
}

.cf-compare__row--actual dd {
    color: var(--pub-ink);
}

.cf-case__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.65;
    color: var(--pub-muted);
}

.cf-case__text p {
    margin: 0 0 10px;
}

.cf-case__text p:last-child {
    margin-bottom: 0;
}

.cf-case__source {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 18px 0 0;
    padding: 14px 0 0;
    border-top: 1px dashed var(--pub-line);
    font-size: 13px;
    font-style: italic;
    line-height: 1.5;
    color: var(--pub-muted);
}

.cf-case__source svg {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-top: 1px;
    color: var(--pub-bordo-soft);
}

/* wide photo: full width on top, text below in two columns */

.cf-case--wide {
    grid-template-columns: minmax(0, 1fr);
}

.cf-case--wide .cf-case__photo {
    min-height: 0;
    padding: 20px 24px;
}

.cf-case--wide .cf-case__photo img {
    max-height: 340px;
}

.cf-case--wide .cf-case__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 40px;
}

.cf-case--wide .cf-case__top,
.cf-case--wide .cf-case__title {
    grid-column: 1 / -1;
}

.cf-case--wide .cf-compare {
    margin-bottom: 0;
}

.cf-case--wide .cf-case__text,
.cf-case--wide .cf-case__source {
    grid-column: 2;
}

.cf-case--wide .cf-compare {
    grid-row: span 2;
}

/* ================= lightbox ================= */

.cf-lightbox {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
}

.cf-lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 24px;
}

.cf-lightbox::backdrop {
    background-color: rgba(30, 10, 16, .88);
}

.cf-lightbox__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(1200px, 100%);
    max-height: 100%;
    margin: 0;
}

.cf-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 170px);
    border-radius: 14px;
    background-color: #fff;
    object-fit: contain;
}

.cf-lightbox__caption {
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    color: rgba(255, 255, 255, .85);
}

.cf-lightbox__close,
.cf-lightbox__nav {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    background-color: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    transition: background-color .2s ease;
}

.cf-lightbox__close svg,
.cf-lightbox__nav svg {
    width: 22px;
    height: 22px;
}

.cf-lightbox__close:hover,
.cf-lightbox__nav:hover {
    background-color: rgba(255, 255, 255, .2);
}

.cf-lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
}

.cf-lightbox__nav[hidden] {
    display: none;
}

/* ================= responsive ================= */

@media (max-width: 1200px) {
    .cf-case__body {
        padding: 30px 30px 28px;
    }

    .cf-case__title {
        font-size: 24px;
    }
}

@media (max-width: 1024px) {
    .cf-case {
        grid-template-columns: minmax(0, 1fr);
    }

    .cf-case:nth-child(even):not(.cf-case--wide) .cf-case__media {
        order: 0;
    }

    .cf-case__photo {
        min-height: 0;
        aspect-ratio: 16 / 10;
    }

    .cf-case--wide .cf-case__photo {
        aspect-ratio: auto;
    }

    .cf-case__photo img {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .cf-cases {
        gap: 22px;
    }

    .cf-case {
        border-radius: 20px;
    }

    .cf-case--wide .cf-case__body {
        display: flex;
    }

    .cf-case--wide .cf-compare {
        margin-bottom: 20px;
    }

    .cf-case__photo {
        aspect-ratio: 4 / 3;
    }

    .cf-case--wide .cf-case__photo {
        padding: 12px;
    }

    .cf-lightbox[open] {
        padding: 70px 12px 90px;
    }

    .cf-lightbox__nav {
        position: absolute;
        bottom: 20px;
    }

    .cf-lightbox__nav--prev {
        left: calc(50% - 60px);
    }

    .cf-lightbox__nav--next {
        right: calc(50% - 60px);
    }
}

@media (max-width: 576px) {
    .cf-case {
        border-radius: 18px;
    }

    .cf-case__body {
        padding: 22px 18px 20px;
    }

    .cf-case__title {
        margin-bottom: 18px;
        font-size: 21px;
    }

    .cf-case__num {
        font-size: 28px;
    }

    .cf-compare__row {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
        padding: 12px 14px;
    }

    .cf-case__bar {
        flex-wrap: wrap;
        padding: 12px 14px;
    }

    .cf-thumb {
        width: 46px;
        height: 46px;
    }

    .cf-case__zoom {
        right: 10px;
        bottom: 10px;
        width: 38px;
        height: 38px;
    }
}

/* case without photos: text only */

.cf-case--text {
    grid-template-columns: minmax(0, 1fr);
}