/* ================================================================
   EU assay authorities page blocks (ES iestāžu saraksts)
   Sections: authorities register grouped by country,
             hallmark tables gallery with a lightbox
   Section head, search bar and count reuse .pub-section
   (publications-block.css) and .cv-bar (convention-block.css)
   ================================================================ */

.au-list *,
.au-marks *,
.au-box * {
    box-sizing: border-box;
}

.au-list [hidden],
.au-marks [hidden] {
    display: none !important;
}

/* ================= register ================= */

.au-register {
    overflow: hidden;
    border: 1px solid var(--pub-line);
    border-radius: 20px;
    background-color: #fff;
    box-shadow: var(--pub-shadow-s);
}

.au-register__head {
    display: grid;
    grid-template-columns: 250px 56px minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 24px;
    padding: 16px 28px;
    background: linear-gradient(135deg, var(--pub-bordo), var(--pub-red));
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .86);
}

.au-register__head span:nth-child(2) {
    text-align: center;
}

.au-country {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 0 24px;
    padding: 22px 28px;
    border-top: 1px solid var(--pub-line);
    transition: background-color .2s ease;
}

.au-country:first-of-type {
    border-top: 0;
}

.au-country:hover {
    background-color: var(--pub-rose);
}

.au-country__side {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.au-country__flag {
    flex: none;
    width: 40px;
    height: 30px;
    border-radius: 5px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}

.au-country__names {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.au-country__name {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--pub-bordo);
}

.au-country__en {
    margin: 3px 0 0;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--pub-muted);
}

.au-country__marks {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    padding: 5px 12px 5px 10px;
    border: 1px solid var(--pub-line);
    border-radius: 999px;
    background-color: #fff;
    font-size: 13px;
    font-weight: 500;
    color: var(--pub-red);
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.au-country__marks svg {
    width: 15px;
    height: 15px;
}

.au-country__marks:hover,
.au-country__marks:focus-visible {
    border-color: var(--pub-red);
    background-color: var(--pub-red);
    color: #fff;
}

.au-country__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.au-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 24px;
    align-items: start;
    padding: 12px 0;
    border-top: 1px dashed var(--pub-line);
}

.au-item:first-child {
    padding-top: 2px;
    border-top: 0;
}

.au-item:last-child {
    padding-bottom: 0;
}

.au-item__num {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border-radius: 50%;
    background-color: var(--pub-card);
    font-size: 15px;
    font-weight: 700;
    color: var(--pub-bordo);
}

.au-item__name {
    margin: 0;
    padding-top: 6px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--pub-ink);
}

.au-item__note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: #f3eceb;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    color: #8a5a3c;
}

.au-item__note::before {
    content: '';
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

.au-item__orig {
    margin: 0;
    padding-top: 6px;
    font-size: 15px;
    font-style: italic;
    line-height: 1.45;
    color: var(--pub-muted);
}

.au-item__label {
    display: none;
}

/* ================= hallmark tables gallery ================= */

.au-gallery {
    columns: 3;
    column-gap: 22px;
}

.au-mark {
    display: inline-block;
    width: 100%;
    margin: 0 0 22px;
    break-inside: avoid;
    scroll-margin-top: 90px;
}

.au-mark__card {
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--pub-line);
    border-radius: 16px;
    background-color: #fff;
    box-shadow: var(--pub-shadow-s);
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: zoom-in;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.au-mark__card:hover,
.au-mark__card:focus-visible {
    transform: translateY(-3px);
    border-color: #dcc9ce;
    box-shadow: var(--pub-shadow-m);
    outline: none;
}

.au-mark__card:focus-visible {
    box-shadow: 0 0 0 3px rgba(155, 74, 97, .35), var(--pub-shadow-m);
}

.au-mark--flash .au-mark__card {
    animation: au-flash 1.6s ease;
}

@keyframes au-flash {
    0%, 100% { box-shadow: var(--pub-shadow-s); }
    25%, 60% { box-shadow: 0 0 0 3px var(--pub-red), var(--pub-shadow-m); }
}

.au-mark__media {
    display: block;
    padding: 10px 10px 0;
    background-color: #fff;
}

.au-mark__img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.au-mark__caption {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.au-mark__flag {
    flex: none;
    width: 28px;
    height: 21px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}

.au-mark__title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--pub-bordo);
}

.au-mark__zoom {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--pub-card);
    color: var(--pub-red);
    transition: background-color .2s ease, color .2s ease;
}

.au-mark__zoom svg {
    width: 17px;
    height: 17px;
}

.au-mark__card:hover .au-mark__zoom {
    background-color: var(--pub-red);
    color: #fff;
}

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

.au-box {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 90px;
    background-color: rgba(38, 8, 18, .88);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.au-box.is-open {
    opacity: 1;
    visibility: visible;
}

.au-box__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    margin: 0;
}

.au-box__img {
    display: block;
    max-width: min(760px, 100%);
    max-height: calc(100vh - 130px);
    width: auto;
    height: auto;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
}

.au-box__caption {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 16px 0 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.au-box__count {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .65);
}

.au-box__btn {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    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, border-color .2s ease;
}

.au-box__btn:hover,
.au-box__btn:focus-visible {
    border-color: #fff;
    background-color: rgba(255, 255, 255, .18);
    outline: none;
}

.au-box__btn svg {
    width: 22px;
    height: 22px;
}

.au-box__btn--close {
    top: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
}

.au-box__btn--prev {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

.au-box__btn--next {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

.au-box__btn[hidden] {
    display: none;
}

body.au-box-open {
    overflow: hidden;
}

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

@media (max-width: 1200px) {
    .au-register__head,
    .au-country {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .au-register__head {
        grid-template-columns: 220px 46px minmax(0, 1fr) minmax(0, 1fr);
        gap: 0 18px;
    }

    .au-item {
        grid-template-columns: 46px minmax(0, 1fr) minmax(0, 1fr);
        gap: 0 18px;
    }
}

@media (max-width: 1024px) {
    .au-register__head {
        display: none;
    }

    .au-country {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 22px 24px;
    }

    .au-country__side {
        align-items: center;
    }

    .au-country__names {
        display: grid;
        flex: 1;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 12px;
    }

    .au-country__en {
        grid-column: 1;
    }

    .au-country__marks {
        grid-column: 2;
        grid-row: 1 / span 2;
        margin: 0;
    }

    .au-item {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 0 16px;
    }

    .au-item__orig {
        grid-column: 2;
        padding-top: 4px;
    }

    .au-item__label {
        display: inline;
        margin-right: 6px;
        font-size: 11px;
        font-style: normal;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: #a8979c;
    }

    .au-gallery {
        columns: 2;
    }

    .au-box {
        padding: 70px 24px 90px;
    }

    .au-box__btn--prev,
    .au-box__btn--next {
        top: auto;
        bottom: 22px;
        transform: none;
    }

    .au-box__btn--prev {
        left: calc(50% - 64px);
    }

    .au-box__btn--next {
        right: calc(50% - 64px);
    }

    .au-box__img {
        max-height: calc(100vh - 220px);
    }
}

@media (max-width: 768px) {
    .au-register {
        border-radius: 16px;
    }

    .au-country {
        padding: 20px 18px;
    }

    .au-country__name {
        font-size: 19px;
    }

    .au-gallery {
        column-gap: 16px;
    }

    .au-mark {
        margin-bottom: 16px;
    }
}

@media (max-width: 576px) {
    .au-item {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 0 12px;
    }

    .au-item__num {
        min-width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .au-item__name {
        padding-top: 4px;
        font-size: 15px;
    }

    .au-item__orig {
        font-size: 14px;
    }

    .au-gallery {
        columns: 1;
    }

    .au-box {
        padding: 64px 12px 90px;
    }

    .au-box__caption {
        font-size: 16px;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .au-country,
    .au-mark__card,
    .au-box {
        transition: none;
    }

    .au-mark--flash .au-mark__card {
        animation: none;
    }
}