/* ================================================================
   Forms page blocks (Pieteikumu formas)
   .fm-apply  — online application cards with "who applies" options
   .fm-files  — downloadable forms: bilingual rows with file chips
   Section head reuses .pub-section / .pub-section__head
   from publications-block.css
   ================================================================ */

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

/* ================= online applications ================= */

.fm-apply {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fm-card {
    display: flex;
    flex-direction: column;
    padding: 30px 28px 28px;
    border: 1px solid var(--pub-line);
    border-radius: 22px;
    background-color: #fff;
    box-shadow: var(--pub-shadow-s);
    transition: box-shadow .25s ease, transform .25s ease;
}

.fm-card:hover {
    box-shadow: var(--pub-shadow-m);
    transform: translateY(-2px);
}

.fm-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 22px;
}

.fm-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background-color: var(--pub-card);
    color: var(--pub-bordo);
}

.fm-card__icon svg {
    width: 26px;
    height: 26px;
}

.fm-card__num {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    color: #ead9de;
}

.fm-card__title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--pub-bordo);
}

.fm-card__text {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--pub-muted);
}

.fm-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: auto 0 0;
    padding: 0;
    list-style: none;
}

.fm-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 14px 14px 18px;
    border: 1px solid var(--pub-line);
    border-radius: 16px;
    background-color: var(--pub-rose);
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.fm-option__body {
    flex: 1 1 auto;
    min-width: 0;
}

.fm-option__label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--pub-ink);
}

.fm-option__hint {
    display: block;
    margin: 3px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--pub-muted);
}

.fm-option__go {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background-color: #fff;
    font-size: 13px;
    font-weight: 500;
    color: var(--pub-bordo);
    white-space: nowrap;
    transition: background-color .2s ease, color .2s ease;
}

.fm-option__go svg {
    width: 16px;
    height: 16px;
    transition: transform .2s ease;
}

.fm-option:hover {
    border-color: var(--pub-bordo-soft);
    background-color: #fff;
    box-shadow: 0 8px 20px rgba(88, 20, 40, .08);
}

.fm-option:hover .fm-option__go {
    background-color: var(--pub-bordo);
    color: #fff;
}

.fm-option:hover .fm-option__go svg {
    transform: translateX(3px);
}

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

/* single option without a label: a full width button */

.fm-option--solo {
    justify-content: center;
    padding: 0;
    border-color: var(--pub-bordo);
    background-color: var(--pub-bordo);
}

.fm-option--solo .fm-option__go {
    justify-content: center;
    width: 100%;
    padding: 16px 20px;
    background-color: transparent;
    font-size: 15px;
    color: #fff;
}

.fm-option--solo:hover {
    border-color: var(--pub-red);
    background-color: var(--pub-red);
}

.fm-option--solo:hover .fm-option__go {
    background-color: transparent;
}

/* ================= downloads ================= */

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

.fm-files__group {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 18px 30px;
    border-bottom: 1px solid var(--pub-line);
    background-color: var(--pub-rose);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--pub-bordo-soft);
}

.fm-files__group::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--pub-line);
}

.fm-file {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 22px 30px;
    border-bottom: 1px solid var(--pub-line);
    transition: background-color .2s ease;
}

.fm-file:last-child {
    border-bottom: 0;
}

.fm-file:hover {
    background-color: #fffbfc;
}

.fm-file__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background-color: var(--pub-card);
    color: var(--pub-bordo);
}

.fm-file__icon svg {
    width: 22px;
    height: 22px;
}

.fm-file__title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--pub-ink);
}

.fm-file__en {
    margin: 5px 0 0;
    font-size: 14px;
    font-style: italic;
    line-height: 1.45;
    color: var(--pub-muted);
}

.fm-file__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: 300px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fm-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 10px;
    border: 1px solid var(--pub-line);
    border-radius: 999px;
    background-color: #fff;
    font-size: 13px;
    font-weight: 500;
    color: var(--pub-ink);
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.fm-chip__lang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background-color: var(--pub-card);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--pub-bordo);
    transition: background-color .2s ease, color .2s ease;
}

.fm-chip svg {
    width: 15px;
    height: 15px;
    color: var(--pub-bordo-soft);
}

.fm-chip:hover {
    border-color: var(--pub-bordo);
    background-color: var(--pub-bordo);
    color: #fff;
}

.fm-chip:hover .fm-chip__lang {
    background-color: rgba(255, 255, 255, .18);
    color: #fff;
}

.fm-chip:hover svg {
    color: #fff;
}

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

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

@media (max-width: 1200px) {
    .fm-apply {
        gap: 20px;
    }

    .fm-card {
        padding: 26px 22px 22px;
    }
}

@media (max-width: 1024px) {
    .fm-apply {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fm-apply > li:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .fm-file {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .fm-file__links {
        grid-column: 2;
        justify-content: flex-start;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .fm-apply {
        grid-template-columns: minmax(0, 1fr);
    }

    .fm-apply > li:last-child:nth-child(odd) {
        grid-column: auto;
    }

    .fm-files {
        border-radius: 18px;
    }

    .fm-files__group {
        padding: 16px 20px;
    }

    .fm-file {
        gap: 14px 16px;
        padding: 20px;
    }
}

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

    .fm-option {
        flex-wrap: wrap;
    }

    .fm-option__go {
        width: 100%;
        justify-content: center;
    }

    .fm-option--solo .fm-option__go {
        width: 100%;
    }

    .fm-file {
        grid-template-columns: minmax(0, 1fr);
    }

    .fm-file__icon {
        display: none;
    }

    .fm-file__links {
        grid-column: auto;
    }

    .fm-file__title {
        font-size: 15px;
    }
}

/* labelled options: a round arrow button, the text stays for screen readers */

@media (min-width: 577px) {
    .fm-option:not(.fm-option--solo) .fm-option__go {
        justify-content: center;
        width: 38px;
        height: 38px;
        padding: 0;
        border-radius: 50%;
    }

    .fm-option:not(.fm-option--solo) .fm-option__go-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}