/* Tihase Pesa: additions to existing footer and home */
.site-footer.tp-footer, .site-footer { background:#171717; color:#fff; }
.site-footer a {color:inherit}
.site-footer a:hover {color:#ffd521}
.tp-footer-sales {
    display: grid;
    grid-template-columns: minmax(0,1.1fr) minmax(0,1fr);
    gap: clamp(35px,7vw,110px);
    padding: 75px 0 65px;
    border-bottom: 1px solid #333333;
    margin-bottom: 35px;
}
.tp-footer-sales h2{font-size:clamp(30px,3vw,42px);margin:0 0 30px;color:#fff}
.tp-footer-sales-people{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:25px;align-content:start}
.tp-footer-sales-person h3{font-size:21px;line-height:1.2;margin:0 0 18px;color:#fff}
.tp-footer-sales-person p{margin:0 0 10px;opacity:.75}
.tp-footer-sales-person a{display:block;text-decoration:none;margin-bottom:8px;overflow-wrap:anywhere}
.tp-footer-sales-photo{display:block;width:100%;max-width:180px;aspect-ratio:1/1.1;object-fit:cover;margin-top:28px}
.tp-footer-disclaimer{font-size:13px;line-height:1.6;opacity:.75;margin-top:22px}
.tp-footer-sales-form .wpcf7 input:not([type=submit]):not([type=checkbox]),.tp-footer-sales-form .wpcf7 textarea{width:100%;max-width:100%;background:transparent;border:0;border-bottom:1px solid #777;border-radius:0;color:white;padding:12px 0;box-sizing:border-box}
.tp-footer-sales-form .wpcf7 input::placeholder,.tp-footer-sales-form .wpcf7 textarea::placeholder{color:#aaa}
.tp-footer-sales-form .wpcf7 textarea{height:105px}
.tp-footer-sales-form .wpcf7 input[type=submit]{background:#ffd521;color:#171717;border:0;padding:14px 30px;font-weight:700;cursor:pointer}
.tp-home-gallery{width:100%;background:#fff}
.tp-home-gallery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0}
.tp-home-gallery-item{margin:0;overflow:hidden;aspect-ratio:4/3}
.tp-home-gallery-item img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .4s ease}
.tp-home-gallery-item:hover img{transform:scale(1.035)}
@media(max-width:900px){.tp-footer-sales{grid-template-columns:1fr}.tp-home-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.tp-footer-sales{padding:45px 0}.tp-footer-sales-people{gap:18px}.tp-footer-sales-person h3{font-size:17px}.tp-home-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tp-home-gallery-item{aspect-ratio:1/1}}

/* Sales contacts: stacked rows with portrait on the left and details on the right. */
.tp-footer-sales-people{display:flex;flex-direction:column;gap:28px;align-content:initial;align-items:stretch}
.tp-footer-sales-person{display:flex;flex-direction:row;align-items:center;gap:24px;min-width:0}
.tp-footer-sales-person-media{flex:0 0 120px;width:120px;min-width:0}
.tp-footer-sales-photo{display:block;width:100%;max-width:none;height:auto;aspect-ratio:3/4;object-fit:cover;margin:0;filter:grayscale(100%); border-radius:20px;}
.tp-footer-sales-person-info{flex:1;min-width:0}
.tp-footer-sales-person-info h3{margin:0 0 8px}
.tp-footer-sales-person-info p{margin:0 0 10px}
.tp-footer-sales-person-info a{overflow-wrap:anywhere}
@media(max-width:600px){
 .tp-footer-sales-people{gap:24px}
 .tp-footer-sales-person{gap:16px}
 .tp-footer-sales-person-media{flex-basis:92px;width:92px}
 .tp-footer-sales-person-info h3{font-size:18px}
 .tp-footer-sales-person-info a{font-size:13px}
}

/* Tihase Pesa – mobiiligalerii */

@media (max-width: 767px) {

    .tp-home-gallery-grid:has(> .tp-home-gallery-item:nth-child(3):last-child) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0px;
    }

    /* Esimene pilt täislaiuses */
    .tp-home-gallery-grid:has(> .tp-home-gallery-item:nth-child(3):last-child)
    > .tp-home-gallery-item:first-child {
        grid-column: 1 / -1;
    }

    .tp-home-gallery-grid .tp-home-gallery-item {
        margin: 0;
        min-width: 0;
        overflow: hidden;
    }

    .tp-home-gallery-grid .tp-home-gallery-item img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Esimene pilt horisontaalne */
    .tp-home-gallery-grid:has(> .tp-home-gallery-item:nth-child(3):last-child)
    > .tp-home-gallery-item:first-child {
        aspect-ratio: 16 / 9;
    }

    /* Alumised kaks ruudukujulised */
    .tp-home-gallery-grid:has(> .tp-home-gallery-item:nth-child(3):last-child)
    > .tp-home-gallery-item:nth-child(n+2) {
        aspect-ratio: 1 / 1;
    }
}
