/*
Theme Name: Clean Minimal Theme
Description: Чистая минимальная тема
Version: 1.0
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Универсальное правило для всех медиа-элементов */
img,
video,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Специфические правила для разных типов медиа */
.wp-video-shortcode,
video.wp-video-shortcode,
.wp-audio-shortcode,
.wp-block-embed iframe,
.mejs-container {
    width: 100% !important;
    max-width: 100%;
    display: block;
}

/* Для сохранения пропорций iframe */
iframe {
    aspect-ratio: 16/9;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: #f8f9fa;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow-x: hidden;
}

/* Центрирование всей темы */
body > * {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Шапка */
header {
    background: #2d3748;
    color: white;
    padding: 1rem 2rem;
}

header > div {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 2rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

header h1 a {
    color: white;
    text-decoration: none;
}

/* Навигация */
nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    justify-content: flex-end;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

nav a:hover {
    background: rgba(255,255,255,0.1);
}

/* Главная страница БЕЗ сайдбаров */
.home-page main {
    padding: 2rem;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Круглые миниатюры на главной */
.home-page .post-thumbnail {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #4299e1;
    transition: all 0.3s ease;
}

.home-page .post-thumbnail:hover {
    transform: scale(1.05);
    border-color: #3182ce;
}

.home-page .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

article {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s ease;
}

article:hover {
    transform: translateY(-3px);
}

article h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

article h2 a {
    color: inherit;
    text-decoration: none;
}

article h2 a:hover {
    color: #4299e1;
}

/* Текст */
.entry-content,
article p {
    text-align: left;
    line-height: 1.7;
    word-wrap: break-word;
}

/* Страницы и записи С сайдбарами */
.inner-page main {
    padding: 2rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.content-grid > :first-child {
    grid-column: 2;
}

/* Сайдбары */
aside {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

aside:first-of-type {
    grid-column: 1;
    grid-row: 1;
}

aside:last-of-type {
    grid-column: 3;
    grid-row: 1;
}

/* Подвал */
footer {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    color: white;
    padding: 2rem;
    margin-top: 3rem;
}

footer > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-widget {
    padding: 1.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.footer-widget:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.15);
}

/* Виджеты */
.widget {
    margin-bottom: 1.5rem;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #4299e1;
}

/* Утилиты */
.entry-meta {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Заголовки */
.content-grid h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Списки */
.entry-content ul,
.entry-content ol,
article ul,
article ol {
    text-align: left;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.entry-content li,
article li {
    margin-bottom: 0.5rem;
}

/* Убираем все подчёркивания */
a {
    text-decoration: none;
}

/* Контейнер для слайдера */
.slider-container {
    width: 100%;
    margin: 2rem 0;
    padding: 0 1rem;
}

/* Слайдер */
.home-slider {
    position: relative;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    background: #2d3748;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.8s ease-in-out;
    visibility: hidden;
}

.slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(45, 55, 72, 0.8), rgba(74, 85, 104, 0.6));
    z-index: 2;
}

.slide-content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    color: white;
}

.slide h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.slide h2 a {
    color: white;
}

.slide-excerpt {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    max-width: 500px;
}

.slide-read-more {
    display: inline-block;
    background: #4299e1;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.slide-read-more:hover {
    background: #3182ce;
}

/* Навигация слайдера */
.slider-nav {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.8rem;
    z-index: 4;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.slider-dot.active {
    background: white;
}

.slider-prev,
.slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4;
    transition: all 0.3s ease;
    border: none;
}

.slider-prev:hover,
.slider-next:hover {
    background: rgba(255,255,255,0.3);
}

.slider-prev {
    left: 1rem;
}

.slider-next {
    right: 1rem;
}

/* Галерея */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    width: 100%;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
	
}

/* Адаптивность */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 250px 1fr;
    }
    
    aside:last-of-type {
        grid-column: 1;
        grid-row: 2;
    }
    
    .home-slider {
        height: 350px;
    }
}

@media (max-width: 768px) {
    body > * {
        padding: 1rem;
    }
    
    header > div {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }
    
    .home-grid,
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .content-grid > :first-child {
        grid-column: 1;
    }
    
    aside {
        grid-column: 1 !important;
    }
    
    footer > div {
        grid-template-columns: 1fr;
    }
    
    .home-slider {
        height: 300px;
    }
    
    .slide-content {
        padding: 1.5rem;
    }
    
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    body > * {
        padding: 0.5rem;
    }
    
    .home-slider {
        height: 250px;
    }
    
    .gallery {
        grid-template-columns: 1fr;
    }
}
/* Галерея */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    width: 100%;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1 / 1; /* Сохраняем квадратные пропорции */
}

.gallery-item img {
    width: 100%;
    height: 100%; /* Занимает всю высоту контейнера */
    object-fit: cover; /* Обрезает и заполняет контейнер */
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Для WordPress галерей */
.wp-block-gallery {
    width: 100% !important;
    max-width: 100% !important;
    margin: 2rem 0 !important;
}

.wp-block-gallery .blocks-gallery-grid {
    width: 100% !important;
    margin: 0 !important;
}

.wp-block-gallery .blocks-gallery-item {
    width: 100% !important;
    margin: 0 !important;
}

.wp-block-gallery img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Для классических галерей WordPress */
.gallery-columns-1 .gallery-item {
    width: 100% !important;
}

.gallery-columns-2 .gallery-item {
    width: 48% !important;
    margin: 1% !important;
    float: left !important;
}

.gallery-columns-3 .gallery-item {
    width: 31.33% !important;
    margin: 1% !important;
    float: left !important;
}

.gallery-columns-4 .gallery-item {
    width: 23% !important;
    margin: 1% !important;
    float: left !important;
}

.gallery-columns-5 .gallery-item {
    width: 18% !important;
    margin: 1% !important;
    float: left !important;
}

/* Очистка float */
.gallery:after {
    content: "";
    display: table;
    clear: both;
}

/* Адаптивность для галерей */
@media (max-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .gallery-columns-4 .gallery-item,
    .gallery-columns-5 .gallery-item,
    .gallery-columns-6 .gallery-item {
        width: 31.33% !important;
        margin: 1% !important;
    }
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.8rem;
    }
    
    .gallery-columns-2 .gallery-item,
    .gallery-columns-3 .gallery-item,
    .gallery-columns-4 .gallery-item,
    .gallery-columns-5 .gallery-item {
        width: 48% !important;
        margin: 1% !important;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    
    .gallery-columns-2 .gallery-item,
    .gallery-columns-3 .gallery-item,
    .gallery-columns-4 .gallery-item,
    .gallery-columns-5 .gallery-item {
        width: 100% !important;
        margin: 0 0 0.5rem 0 !important;
        float: none !important;
    }
}

/* Для постов с галереями */
.entry-content .gallery,
.entry-content .wp-block-gallery {
    width: 100% !important;
    max-width: 100% !important;
}

.entry-content .gallery-item,
.entry-content .blocks-gallery-item {
    aspect-ratio: 1 / 1;
}

.entry-content .gallery-item img,
.entry-content .blocks-gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Горизонтальные изображения */
.gallery-item.horizontal {
    aspect-ratio: 16 / 9;
}

/* Вертикальные изображения */
.gallery-item.vertical {
    aspect-ratio: 9 / 16;
}

/* Широкие изображения */
.gallery-item.wide {
    aspect-ratio: 21 / 9;
}