/* SLEY Contacts - etusivun yhteystietoupotus */

.sleycontact-shell {
    font-family: inherit;
    color: #084f3f;
    max-width: 800px;
    margin: 0 auto;
}

.sleycontact-shell--grid-rows {
    max-width: 1200px;
}

.sleycontact-toolbar {
    max-width: 1200px;
    margin: 0 auto 14px;
}

.sleycontact-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.sleycontact-search__label {
    display: block;
    margin-bottom: 6px;
    color: #1f2937;
    font-size: 13px;
    font-weight: 600;
}

.sleycontact-search .sleycontact-search__input[type="text"],
.sleycontact-search .sleycontact-search__input[type="search"] {
    display: block;
    width: 100%;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.3;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.sleycontact-search .sleycontact-search__input::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.sleycontact-search .sleycontact-search__input:focus {
    outline: none;
    border-color: #0b6a55;
    box-shadow: 0 0 0 3px rgba(11, 106, 85, 0.16);
}

.sleycontact-search__status {
    min-height: 18px;
    margin-top: 8px;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.2;
}

.sleycontact-switch {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sleycontact-switch__button,
.sleycontact-near {
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
}

.sleycontact-switch__button[aria-pressed="true"],
.sleycontact-near.is-active {
    background: #084f3f;
    border-color: #084f3f;
    color: #fff;
}

.sleycontact-near {
    background: #0b6a55;
    border-color: #0b6a55;
    color: #fff;
}

.sleycontact-near:disabled {
    opacity: 0.7;
    cursor: wait;
}

.sleycontact-switch__button:focus-visible,
.sleycontact-near:focus-visible,
.sleycontact-card__contact:focus-visible,
.sleycontact-card__action:focus-visible,
.sleycontact-button--more:focus-visible {
    outline: 2px solid #084f3f;
    outline-offset: 2px;
}

.sleycontact-placeholder,
.sleycontact-placeholder--error {
    padding: 18px 20px;
    border-radius: 18px;
    background: #f2f4f0;
    color: #1f2937;
}

.sleycontact-contacts__items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sleycontact-contacts--grid {
    max-width: 1200px;
}

.sleycontact-contacts--grid .sleycontact-contacts__items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 20px;
    align-items: stretch;
}

.sleycontact-contacts--grid.sleycontact-contacts--grid-rows .sleycontact-contacts__items {
    --sleycontact-row-card-width: clamp(260px, 32vw, 340px);
    grid-template-columns: none;
    grid-template-rows: repeat(var(--sleycontact-grid-rows), minmax(0, auto));
    grid-auto-flow: column;
    grid-auto-columns: var(--sleycontact-row-card-width);
    align-items: start;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 8px 16px;
    padding-inline-end: clamp(8px, calc(100% - var(--sleycontact-row-card-width)), 64px);
    margin: -12px -8px 0;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 8px;
    scrollbar-gutter: stable both-edges;
}

.sleycontact-contacts--grid.sleycontact-contacts--grid-rows .sleycontact-card {
    scroll-snap-align: start;
    min-height: 0;
}

.sleycontact-contacts--grid.sleycontact-contacts--grid-rows .sleycontact-card__body {
    min-height: 0;
}

.sleycontact-contacts--grid.sleycontact-contacts--grid-rows .sleycontact-card__footer {
    margin-top: 0;
}

.sleycontact-card[hidden],
.sleycontact-badge[hidden] {
    display: none !important;
}

.sleycontact-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
    transform-origin: center center;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

@media (hover: hover) and (pointer: fine) {
    .sleycontact-card:hover,
    .sleycontact-card:focus-within {
        transform: perspective(1000px) translateY(-2px) scale(1.01) rotateX(0.4deg) rotateY(-0.6deg);
        border-color: #d1d5db;
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sleycontact-card,
    .sleycontact-card__action,
    .sleycontact-button {
        transition: none;
    }

    .sleycontact-card:hover,
    .sleycontact-card:focus-within {
        transform: none;
    }
}

.sleycontact-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100%;
    font-size: 14px;
    line-height: 1.35;
    color: #111827;
}

.sleycontact-card__header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.sleycontact-card__avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    flex: 0 0 56px;
    background: #e8f3ef;
}

.sleycontact-card__heading {
    min-width: 0;
    flex: 1;
}

.sleycontact-card__top {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
}

.sleycontact-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    gap: 5px;
}

.sleycontact-badge--city {
    background: #357b62;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.sleycontact-badge--distance {
    background: #0c7a60;
    color: #fff;
}

.sleycontact-badge__icon--pin {
    display: inline-block;
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s7-5.7 7-12a7 7 0 1 0-14 0c0 6.3 7 12 7 12Z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E");
}

.sleycontact-card__title {
    margin: 6px 0 0;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
    color: #111827;
}

.sleycontact-card__subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: #4b5563;
}

.sleycontact-card__kv {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: baseline;
}

.sleycontact-card__kv span {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
}

.sleycontact-card__kv strong {
    color: #1f2937;
    font-size: 13px;
    font-weight: 600;
}

.sleycontact-card__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sleycontact-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
}

.sleycontact-card__footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
}

.sleycontact-card__contacts {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sleycontact-card__contact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0b6a55;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.sleycontact-contact__icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.sleycontact-contact__icon--phone {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1C7.61 21 0 13.39 0 4c0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1C7.61 21 0 13.39 0 4c0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E");
}

.sleycontact-contact__icon--envelope {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
}

.sleycontact-card__contact:hover {
    color: #084f3f;
    text-decoration: underline;
}

.sleycontact-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sleycontact-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    background: #0b6a55;
    color: #fff;
    transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.sleycontact-card__action--secondary {
    background: #e8f3ef;
    color: #0b6a55;
}

.sleycontact-card__action:hover,
.sleycontact-card__action:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
    background: #095544;
    color: #fff;
}

.sleycontact-card__action--secondary:hover,
.sleycontact-card__action--secondary:focus-visible {
    background: #dcebe6;
    color: #084f3f;
}

.sleycontact-contacts__more {
    text-align: left;
    padding: 16px 0;
}

.sleycontact-button--more {
    display: inline-block;
    padding: 10px 20px;
    background-color: #084f3f;
    color: #fff;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.sleycontact-button--more:hover {
    background-color: #063d31;
    color: #fff;
    text-decoration: none;
}

@media (max-width: 600px) {
    .sleycontact-card {
        padding: 16px;
    }

    .sleycontact-card__title {
        font-size: 16px;
    }

    .sleycontact-contacts--grid .sleycontact-contacts__items {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .sleycontact-contacts--grid.sleycontact-contacts--grid-rows .sleycontact-contacts__items {
        grid-template-columns: none;
    }

    .sleycontact-toolbar__row {
        flex-direction: column;
        align-items: stretch;
    }

    .sleycontact-near {
        width: 100%;
    }
}
