/*
 Theme Name:   Houses&Flats
 Theme URI:    http://example.com/mytheme-child/
 Description:  Дочерняя тема для 2021
 Author:       Kirill
 Author URI:   http://example.com
 Template:     twentytwentyone
 Version:      1.0.0
*/


.wp-block-button__link:active {
    background-color: transparent;
}

.wp-block-button__link:select {
    background-color: transparent;
}

/* Отключить стандартное выделение фокуса */
:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

:focus-visible {
    outline: 2px solid blue;
    outline-offset: 2px;
}


/* Убрать выделение у блоков в редакторе */
.block-editor-block-list__block:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Убрать у блоков на фронтенде */
.wp-block:focus {
    outline: none !important;
}

/* Убираем черное выделение при клике на мобильных устройствах */
* {
    -webkit-tap-highlight-color: transparent;
}


button:active {
    background-color: #000;
}

/* Также можно убрать фоновые цвета при активном состоянии */
a:active,
button:active,
input:active,
select:active,
textarea:active {
    background-color: transparent;
}

css
:root {
    --wp--style--color--link: #0073aa;
}

:focus {
    outline-color: var(--wp--style--color--link);
}


/* Контейнер сетки */
.posts-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin: 30px 0;
}

/* Элемент поста */
.grid-post-item {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.grid-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Ссылка */
.post-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Контейнер изображения */
.post-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* Соотношение 4:3 */
    overflow: hidden;
}

.post-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.grid-post-item:hover .post-thumbnail {
    transform: scale(1.05);
}

/* Заглушка для поста без картинки */
.no-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-thumbnail .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #ddd;
}

/* Контент поста */
.post-content {
    padding: 15px;
}

.post-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Ограничение в 2 строки */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .posts-grid-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .posts-grid-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .post-content {
        padding: 12px;
    }
    
    .post-title {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .posts-grid-container {
        grid-template-columns: 2fr;
        gap: 15px;
    }
    
    .post-image-wrapper {
        padding-top: 56.25%; /* 16:9 для мобильных */
    }
}