/* ================================================================
   Year marks page block (Gada atšķirības zīmes)
   Finder by letter or year + timeline grouped by legal basis
   Section head reuses .pub-section / .pub-section__head
   from publications-block.css
   ================================================================ */

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

.ym-block [hidden] {
    display: none !important;
}

/* ================= finder ================= */

.ym-finder {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    overflow: hidden;
    margin: 0 0 64px;
    border: 1px solid var(--pub-line);
    border-radius: 22px;
    background-color: #fff;
    box-shadow: var(--pub-shadow-m);
    scroll-margin-top: 90px;
}

.ym-finder__form {
    padding: 40px 44px;
}

.ym-finder__title {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--pub-bordo);
}

.ym-finder__text {
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--pub-muted);
}

.ym-finder__field {
    position: relative;
    display: block;
}

.ym-finder__icon {
    position: absolute;
    top: 50%;
    left: 20px;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    color: var(--pub-bordo-soft);
    pointer-events: none;
}

.ym-finder__input {
    width: 100%;
    height: 60px;
    padding: 0 20px 0 54px;
    border: 1px solid var(--pub-line);
    border-radius: 16px;
    background-color: var(--pub-rose);
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    color: var(--pub-ink);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.ym-finder__input::placeholder {
    color: #a8979c;
}

.ym-finder__input:focus {
    border-color: var(--pub-bordo-soft);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(155, 74, 97, .12);
}

.ym-finder__hint {
    display: flex;
    gap: 10px;
    margin: 18px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--pub-muted);
}

.ym-finder__hint svg {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--pub-bordo-soft);
}

.ym-finder__quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.ym-finder__quick button {
    padding: 7px 14px;
    border: 1px solid var(--pub-line);
    border-radius: 999px;
    background-color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: var(--pub-ink);
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease;
}

.ym-finder__quick button:hover,
.ym-finder__quick button:focus-visible {
    border-color: var(--pub-red);
    color: var(--pub-red);
    outline: none;
}

/* result */

.ym-result {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 36px;
    background: linear-gradient(145deg, var(--pub-bordo), var(--pub-red));
    text-align: center;
    color: #fff;
    overflow: hidden;
}

.ym-result::before {
    content: '';
    position: absolute;
    top: -90px;
    right: -90px;
    width: 260px;
    height: 260px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    box-shadow: 0 0 0 40px rgba(255, 255, 255, .03);
}

.ym-result__found,
.ym-result__none {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.ym-result__mark {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
}

.ym-result__case {
    display: inline-block;
    margin: 18px 0 0;
    padding: 4px 12px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, .14);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
}

.ym-result__stamp {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, .18), 0 18px 40px rgba(0, 0, 0, .25);
    color: var(--pub-bordo);
}

.ym-result__stamp::after {
    content: '';
    position: absolute;
    inset: 9px;
    border: 2px solid var(--pub-red);
    border-radius: 50%;
    opacity: .35;
}

.ym-result__letter {
    font-size: 70px;
    font-weight: 700;
    line-height: 1;
}

.ym-result__year {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .12em;
}

.ym-result__label {
    margin: 26px 0 4px;
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
}

.ym-result__doc {
    max-width: 360px;
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
}

.ym-result__doc-text {
    max-width: 360px;
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .82);
}

.ym-result__twin {
    margin: 18px 0 0;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    font-size: 13px;
    color: rgba(255, 255, 255, .9);
}

.ym-result__twin b {
    font-size: 15px;
}

.ym-result__empty {
    max-width: 280px;
    margin: 0;
    font-size: 16px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .9);
}

.ym-result__empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin: 0 0 18px;
    border: 2px dashed rgba(255, 255, 255, .45);
    border-radius: 50%;
    font-size: 34px;
    font-weight: 700;
}

/* ================= timeline ================= */

.ym-timeline__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 28px;
    scroll-margin-top: 90px;
}

.ym-timeline__title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: var(--pub-bordo);
}

.ym-timeline__note {
    margin: 0;
    font-size: 14px;
    color: var(--pub-muted);
}

.ym-timeline {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ym-timeline::before {
    content: '';
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 171px;
    width: 2px;
    background: linear-gradient(var(--pub-line), #e3cfd5 40%, var(--pub-line));
}

.ym-period {
    position: relative;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 0 50px;
    padding: 0 0 22px;
}

.ym-period:last-child {
    padding-bottom: 0;
}

.ym-period::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 165px;
    width: 14px;
    height: 14px;
    border: 3px solid #fff;
    border-radius: 50%;
    background-color: var(--pub-red);
    box-shadow: 0 0 0 1px var(--pub-line);
}

.ym-period__range {
    padding-top: 14px;
    text-align: right;
}

.ym-period__years {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--pub-bordo);
}

.ym-period__count {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--pub-muted);
}

.ym-period__card {
    padding: 22px 26px 24px;
    border: 1px solid var(--pub-line);
    border-radius: 18px;
    background-color: #fff;
    box-shadow: var(--pub-shadow-s);
    transition: box-shadow .25s ease, border-color .25s ease;
}

.ym-period:hover .ym-period__card {
    border-color: #dcc9ce;
    box-shadow: var(--pub-shadow-m);
}

.ym-period__doc {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0 0 18px;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--pub-line);
}

.ym-period__doc-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background-color: var(--pub-card);
    color: var(--pub-red);
}

.ym-period__doc-icon svg {
    width: 20px;
    height: 20px;
}

.ym-period__doc-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--pub-ink);
}

.ym-period__doc-text {
    margin: 3px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--pub-muted);
}

.ym-period__doc-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(141, 11, 44, .3);
    text-underline-offset: 3px;
}

.ym-period__doc-link:hover {
    color: var(--pub-red);
}

.ym-period__card--row {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 18px 26px;
}

.ym-period__card--row .ym-period__doc {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    border-bottom: 0;
}

.ym-period__card--row .ym-marks {
    flex: none;
}

.ym-period__card--row .ym-period__doc + .ym-marks {
    margin-left: auto;
}

/* letter stamps */

.ym-marks {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ym-mark {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 72px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.ym-mark__circle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: 2px solid var(--pub-red);
    border-radius: 50%;
    background-color: #fff;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--pub-bordo);
    transition: transform .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.ym-mark__circle::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(141, 11, 44, .25);
    border-radius: 50%;
}

.ym-mark__year {
    font-size: 13px;
    font-weight: 500;
    color: var(--pub-muted);
    transition: color .2s ease;
}

.ym-mark:hover .ym-mark__circle,
.ym-mark:focus-visible .ym-mark__circle {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(88, 20, 40, .14);
}

.ym-mark:focus-visible {
    outline: none;
}

.ym-mark:focus-visible .ym-mark__circle {
    box-shadow: 0 0 0 4px rgba(155, 74, 97, .25);
}

.ym-mark.is-active .ym-mark__circle {
    background-color: var(--pub-red);
    color: #fff;
}

.ym-mark.is-active .ym-mark__circle::after {
    border-color: rgba(255, 255, 255, .45);
}

.ym-mark.is-active .ym-mark__year {
    color: var(--pub-red);
}

.ym-mark__now {
    position: absolute;
    top: -8px;
    left: 50%;
    z-index: 1;
    padding: 2px 7px;
    border-radius: 999px;
    background-color: #c9a227;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: #fff;
    transform: translateX(-50%);
}

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

@media (max-width: 1200px) {
    .ym-finder__form {
        padding: 34px 36px;
    }
}

@media (max-width: 1024px) {
    .ym-finder {
        grid-template-columns: 1fr;
        margin-bottom: 52px;
    }

    .ym-result {
        padding: 30px 36px;
    }

    .ym-result__found {
        flex-direction: row;
        align-items: center;
        gap: 28px;
        text-align: left;
    }

    .ym-result__case {
        margin-top: 14px;
    }

    .ym-result__stamp {
        width: 120px;
        height: 120px;
    }

    .ym-result__letter {
        font-size: 56px;
    }

    .ym-result__info {
        flex: 1;
        min-width: 220px;
    }

    .ym-result__label {
        margin-top: 0;
    }

    .ym-result__twin {
        display: inline-block;
    }

    .ym-timeline::before {
        left: 131px;
    }

    .ym-period {
        grid-template-columns: 110px minmax(0, 1fr);
        gap: 0 42px;
    }

    .ym-period::before {
        left: 125px;
    }

    .ym-period__years {
        font-size: 21px;
    }
}

@media (max-width: 768px) {
    .ym-finder {
        border-radius: 18px;
    }

    .ym-finder__form {
        padding: 28px 24px;
    }

    .ym-finder__title,
    .ym-timeline__title {
        font-size: 22px;
    }

    .ym-result {
        padding: 26px 24px;
    }

    .ym-timeline__head {
        flex-direction: column;
        gap: 6px;
    }

    .ym-timeline::before {
        left: 7px;
    }

    .ym-period {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 0 22px 32px;
    }

    .ym-period::before {
        top: 5px;
        left: 1px;
    }

    .ym-period__range {
        display: flex;
        align-items: baseline;
        gap: 12px;
        padding-top: 0;
        text-align: left;
    }

    .ym-period__count {
        margin: 0;
    }

    .ym-period__card {
        padding: 18px 18px 20px;
        border-radius: 16px;
    }

    .ym-period__card--row {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .ym-period__card--row .ym-period__doc {
        padding: 0 0 16px;
        border-bottom: 1px solid var(--pub-line);
    }

    .ym-period__card--row .ym-period__doc + .ym-marks {
        margin-left: 0;
    }
}

@media (max-width: 576px) {
    .ym-finder__input {
        height: 54px;
        font-size: 16px;
    }

    .ym-result__found {
        flex-direction: column;
        gap: 0;
        text-align: center;
    }

    .ym-result__case {
        margin-top: 16px;
    }

    .ym-result__info {
        min-width: 0;
    }

    .ym-result__label {
        margin-top: 12px;
    }

    .ym-marks {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px 6px;
    }

    .ym-mark {
        width: auto;
    }

    .ym-mark__circle {
        width: 54px;
        height: 54px;
        font-size: 25px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ym-mark__circle,
    .ym-period__card {
        transition: none;
    }
}