/* =========================================================
   Pihlakodu Teised Majad - slider
   Matchib avalehe "Kodud" sektsiooni stiili
   ========================================================= */

.pihlakodu-tm {
    width: 100%;
    padding: 60px 0;
    background: transparent;
}

.pihlakodu-tm__inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 30px;
}

.pihlakodu-tm__title {
    font-family: "DM Serif Display", Georgia, "Times New Roman", serif;
    font-size: 2.5rem;
    font-weight: 400;
    color: #333333;
    text-align: center;
    margin: 0 0 50px;
    line-height: 1.2;
}

/* ---------- Slider ---------- */
.pihlakodu-tm__slider {
    position: relative;
    display: flex;
    align-items: center;
}

.pihlakodu-tm__viewport {
    overflow: hidden;
    width: 100%;
    margin: 0 auto;
    touch-action: pan-y pinch-zoom;
    -webkit-user-select: none;
    user-select: none;
}

.pihlakodu-tm__track {
    display: flex;
    gap: 30px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    -webkit-user-drag: none;
}

/* ---------- Cards ---------- */
.pihlakodu-tm__card {
    flex: 0 0 calc((100% - 60px) / 3); /* 3 kaarti, 2 vahet x 30px */
    min-width: 0;
}

.pihlakodu-tm__card-link {
    display: block;
    text-decoration: none !important;
    color: inherit !important;
    transition: transform 0.25s ease;
}

.pihlakodu-tm__card-link:hover {
    text-decoration: none !important;
    transform: translateY(-4px);
}

.pihlakodu-tm__image {
    width: 100%;
    aspect-ratio: 16 / 10;
    background-size: cover;
    background-position: center;
    background-color: #e8e8e8;
    margin-bottom: 24px;
    pointer-events: none;
}

.pihlakodu-tm__image--placeholder {
    background-image: linear-gradient(135deg, #f0f0f0 0%, #d8d8d8 100%);
}

.pihlakodu-tm__card-title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin: 0 0 20px;
    text-align: center;
}

.pihlakodu-tm__card-title-img {
    /* Vaikimisi kõrgus, kui inline style pole määratud */
    height: 30px;
    width: auto;
    max-width: 90%;
    object-fit: contain;
    display: block;
}

.pihlakodu-tm__card-title {
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 700;
    color: #c8451f;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
    margin: 0;
    line-height: 1.1;
}

.pihlakodu-tm__cta {
    display: inline-block;
    margin: 0 auto;
    background: #ebe9e6;
    color: #2b2b2b;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 12px 28px;
    border-radius: 999px;
    transition: all 0.2s ease;
    text-align: center;
}

/* Center the CTA */
.pihlakodu-tm__card-link {
    text-align: center;
}

.pihlakodu-tm__card-link:hover .pihlakodu-tm__cta {
    background: #c8451f;
    color: #fff;
}

/* ---------- Nav buttons ---------- */
.pihlakodu-tm__nav {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e2e2e2;
    color: #2b2b2b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 2;
}

.pihlakodu-tm__nav:hover:not(:disabled) {
    background: #c8451f;
    border-color: #c8451f;
    color: #fff;
    box-shadow: 0 4px 12px rgba(200, 69, 31, 0.25);
}

.pihlakodu-tm__nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pihlakodu-tm__nav:focus {
    outline: 2px solid #c8451f;
    outline-offset: 2px;
}

.pihlakodu-tm__nav--prev {
    margin-right: 16px;
}

.pihlakodu-tm__nav--next {
    margin-left: 16px;
}

/* ---------- Responsive ---------- */
/* Tahvel - 2 kaarti */
@media (max-width: 980px) {
    .pihlakodu-tm__card {
        flex: 0 0 calc((100% - 30px) / 2);
    }
    .pihlakodu-tm__title {
        font-size: 2rem;
    }
}

/* Mobiil - 1 kaart */
@media (max-width: 640px) {
    .pihlakodu-tm {
        padding: 40px 0;
    }
    .pihlakodu-tm__inner {
        padding: 0 16px;
    }
    .pihlakodu-tm__track {
        gap: 16px;
    }
    .pihlakodu-tm__card {
        flex: 0 0 100%;
    }
    .pihlakodu-tm__title {
        font-size: 1.75rem;
        margin-bottom: 28px;
    }
    .pihlakodu-tm__card-title {
        font-size: 1.25rem;
    }
    .pihlakodu-tm__card-title-wrap {
        min-height: 34px;
        margin-bottom: 16px;
    }
    .pihlakodu-tm__nav {
        width: 40px;
        height: 40px;
    }
    .pihlakodu-tm__nav--prev {
        margin-right: 8px;
    }
    .pihlakodu-tm__nav--next {
        margin-left: 8px;
    }
}
