/*
Theme Name: Lite
Theme URI: https://example.com/
Author: Олег
Author URI: https://google.com
Description: Лёгкая и быстрая тема с двухколоночной сеткой для блога. Version: 1.1
Requires at least: 5.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: two-columns, right-sidebar, custom-menu, post-formats, featured-images, translation-ready
Text Domain: lite
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# Reset & Basics
# Typography & Fonts
# Layout & Structure
    - Site Wrapper & Container
    - Header & Branding
    - Sidebar
    - Main Content
# Navigation & Menus
# Blog Grid & Posts
    - Post Grid Layout
    - Post Meta (Author/Date)
    - Featured Image & Placeholder
# Single Post
# Comments
# Widgets
# Footer
# Pagination
# Media Queries (Responsive)
--------------------------------------------------------------*/

/* # Reset & Basics
--------------------------------------------------------------*/
html {
    font-family: Merriweather, serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.6;
    margin-top: 0 !important;
}

body {
    color: #555;
    background-color: #F3EEEB;
    margin: 0;
}

*, *:before, *:after {
    box-sizing: border-box;
}

a {
    color: #333;
    text-decoration: none;
    background-image: linear-gradient(to bottom, #F26E3F 0%, #F26E3F 100%);
    background-repeat: no-repeat;
    background-size: 0 1px;
    background-position: 0 1.1em;
    transition: background-size .2s ease-in-out;
}

a:hover {
    color: #F26E3F;
    background-size: 100% 1px;
}

img {
    max-width: 100%;
    height: auto;
    border: none !important;
    box-shadow: none !important;
}

/* # Typography & Fonts
--------------------------------------------------------------*/
h1, h2, h3, h4, h5, h6 {
    font-family: Merriweather, serif;
    font-weight: 400;
    margin: 0.5em 0;
}
h1 { font-size: 2.76em; }
h2 { font-size: 2.4em; }
h3 { font-size: 2.04em; }

.entry-title {
    font-family: Merriweather, serif;
    color: #333;
    font-size: 130%;
    font-weight: 500;
    margin-bottom: 0.5em;
}

.entry-title a {
    background-image: linear-gradient(to bottom, #333 0%, #333 100%);
}

#site-title {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 200%;
    font-weight: 500;
    margin: 0;
}

#site-description {
    font-family: Lato, sans-serif;
    font-size: 110%;
    font-weight: 300;
    color: #AEAEAE;
}

/* # Layout & Structure
--------------------------------------------------------------*/
#site-wrapper {
    max-width: 1440px;
    margin: 0 auto;
}

#content {
    padding: 0 20px;
}

#container {
    display: flex;
    flex-wrap: wrap;
}

.main {
    width: calc(97% - 350px);
    margin-top: 20px;
}

/* ## Header & Branding */
#header {
    background: #fff;
    padding: 2em;
    border-bottom: 1px solid #eeeeee;
}

#branding {
    text-align: center;
}

/* ## Sidebar */
#sidebar {
    width: 350px;
    background-color: #fff;
    padding: 20px;
    margin-left: 3%;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

/* # Navigation & Menus
--------------------------------------------------------------*/
#access {
    margin-top: 2em;
}

#access ul {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
}

#access ul li {
    margin: 0.5em 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
}

#access ul li a {
    font-family: Merriweather, serif;
    font-size: 100%;
    font-weight: 400;
    color: #555;
    background-image: none;
}

#access a:hover {
    color: #F26E3F;
}

/* # Blog Grid & Posts
--------------------------------------------------------------*/
#content-masonry {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

article.hentry {
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);

    /* фиксация структуры: превью сверху, текст снизу */
    display: flex;
    flex-direction: column;
}

/* --- FIX: стабильный контейнер превью + плейсхолдер --- */
.post-thumbnail-container {
    position: relative;
    margin-bottom: 1em;

    /* резервируем место под изображение */
    aspect-ratio: 16 / 9;
    height: auto;
    overflow: hidden;
    background-color: #f2f2f2;

    /* фон-плейсхолдер */
    background-image:
        radial-gradient(circle at 30% 30%, rgba(0,0,0,.04) 0 40%, transparent 41%),
        linear-gradient(135deg, #ececec 0%, #e6e6e6 100%);
    background-size: cover;
    background-position: center;
}

/* картинка заполняет контейнер */
.post-thumbnail-container img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .2s ease-in;
}
.post-thumbnail-container img[src]:not([src=""]) {
    opacity: 1;
}

/* скрываем битые/пустые картинки */
.post-thumbnail-container img[src=""],
.post-thumbnail-container img[src^=" "],
.post-thumbnail-container img[src="#"],
.post-thumbnail-container img:not([src]) {
    display: none !important;
}

/* ссылка-плейсхолдер всегда занимает всё место */
.post-featured-image-link {
    display: block;
    position: absolute;
    inset: 0;
}

.entry-meta-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 10px 15px;
    font-size: 90%;
    font-family: Lato, sans-serif;
    pointer-events: none;
}

.entry-meta-overlay .author a,
.entry-meta-overlay .onDate {
    color: #fff;
    background-image: none;
}

.entry-meta-overlay a:hover {
    text-decoration: underline;
}

.entry-meta-overlay span:not(:last-child):after {
    content: '|';
    margin: 0 0.5em;
}

/* # Single Post
--------------------------------------------------------------*/
.main.single-post .hentry {
    padding: 2.5em;
}
.main.single-post .entry-title {
    font-size: 1.5em;
}
.main.single-post h1,
.main.single-post h2,
.main.single-post h3,
.main.single-post h4,
.main.single-post h5,
.main.single-post h6 {
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
    padding-bottom: 5px;
    border-bottom: 1px solid #333;
    margin-top: 1.5em;
}
.entry-content p {
    margin-bottom: 1.5em;
}
.entry-content a {
    background-position: 0 100%;
}
.entry-content img,
.entry-content iframe,
.entry-content video,
.entry-content object,
.entry-content table,
.entry-content figure {
    max-width: 100%;
    height: auto;
}

/* # Comments
--------------------------------------------------------------*/
.comments-area {
    margin-top: 2em;
    padding: 2em;
    background: #fff;
}

.comments-title {
    font-size: 1.5em;
    margin-bottom: 1em;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment-list li {
    padding: 1em 0;
    border-bottom: 1px solid #eee;
}

.comment-author img.avatar {
    float: left;
    margin-right: 1em;
    border-radius: 50%;
}

.comment-metadata {
    font-size: 0.8em;
    color: #888;
}

.comment-content {
    margin-top: 0.5em;
    clear: both;
}

.comment-form p {
    margin-bottom: 1em;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
}

.comment-form input[type="submit"] {
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    transition: background .2s;
    background-image: none;
}

.comment-form input[type="submit"]:hover {
    background: #F26E3F;
}

/* # Widgets
--------------------------------------------------------------*/
.widget-container {
    font-family: Merriweather, serif;
    font-size: 100%;
    font-weight: 400;
    margin-bottom: 2em;
}

.widget-title {
    font-family: Lato, sans-serif;
    font-size: 90%;
    font-weight: 400;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 0.5em;
    margin-bottom: 1em;
}

.widget-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-container ul li {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
}

/* # Footer
--------------------------------------------------------------*/
#footer {
    text-align: center;
    padding: 2em 0;
    margin-top: 2em;
    border-top: 1px solid #eeeeee;
}

/* # Pagination
--------------------------------------------------------------*/
.navigation.pagination {
    margin: 2em 0;
    text-align: center;
    width: 100%;
}

.nav-links {
    display: inline-flex;
    gap: 8px;
}

.page-numbers {
    display: inline-block;
    padding: 8px 15px;
    border: 1px solid #ddd;
    color: #555;
    background-color: #fff;
    font-size: 16px;
    line-height: 1.5;
    background-image: none;
    border-radius: 4px;
    text-align: center;
}

.page-numbers:hover {
    background-color: #f26e3f;
    border-color: #f26e3f;
    color: #fff;
}

.page-numbers.current {
    background-color: #333;
    border-color: #333;
    color: #fff;
}

.page-numbers.dots {
    border: none;
    background: none;
    padding: 8px 0;
}

/* # Related Posts
--------------------------------------------------------------*/
.related-post-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #fff;
}

/* # Media Queries (Responsive)
--------------------------------------------------------------*/
@media (max-width: 1024px) {
    .main {
        width: 100%;
    }
    #sidebar {
        width: 100%;
        margin-left: 0;
        margin-top: 20px;
        position: static;
    }
}

@media (max-width: 768px) {
    #content-masonry {
        grid-template-columns: 1fr;
    }
    html {
        font-size: 18px;
    }
    .main.single-post .hentry {
        padding: 1.5em;
    }
}
