/*
Theme Name: Minimalist Blog
Theme URI: https://example.com/minimalist-blog
Author: Your Name
Author URI: https://example.com
Description: Минималистичная тема для блога. Гибкая настройка шрифтов (в т.ч. Google Fonts), размера, межстрочного интервала и толщины текста и заголовков, цвета текста и фона. Лента постов — от новых к старым, по 10 штук с подгрузкой (lazy load) при прокрутке. Ширина блога — 900px, адаптивный дизайн.
Version: 1.0.0
Requires at least: 5.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: minimalist
*/

/* ==========================================================================
   Reset / base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--mnml-body-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);
    font-size: var(--mnml-body-size, 18px);
    line-height: var(--mnml-body-lh, 1.6);
    font-weight: var(--mnml-body-weight, 400);
    color: var(--mnml-text-color, #1a1a1a);
    background-color: var(--mnml-bg-color, #ffffff);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-color: currentColor; text-underline-offset: 2px; }
a:hover { opacity: 0.7; }

ul, ol { padding-left: 1.2em; }

blockquote {
    margin: 1.5em 0;
    padding: 0.2em 0 0.2em 1.2em;
    border-left: 3px solid currentColor;
    opacity: 0.85;
    font-style: italic;
}

figure { margin: 1.5em 0; }
figcaption { font-size: 0.85em; opacity: 0.6; margin-top: 0.4em; }

hr { border: none; border-top: 1px solid rgba(0,0,0,0.1); margin: 2em 0; }

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--mnml-heading-font, inherit);
    line-height: var(--mnml-heading-lh, 1.3);
    font-weight: var(--mnml-heading-weight, 700);
    margin: 1.3em 0 0.5em;
}
h1 { font-size: var(--mnml-heading-size, 32px); }
h2 { font-size: calc(var(--mnml-heading-size, 32px) * 0.8); }
h3 { font-size: calc(var(--mnml-heading-size, 32px) * 0.65); }
h4 { font-size: calc(var(--mnml-heading-size, 32px) * 0.55); }
h5, h6 { font-size: calc(var(--mnml-heading-size, 32px) * 0.45); }

/* ==========================================================================
   Layout
   ========================================================================== */
.site { display: flex; flex-direction: column; min-height: 100vh; }

.site-header {
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding: 24px 20px;
}
.site-header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.site-title {
    font-size: 22px;
    margin: 0;
    font-family: var(--mnml-heading-font, inherit);
    font-weight: var(--mnml-heading-weight, 700);
    line-height: 1.2;
}
.site-title a { text-decoration: none; }
.site-description { margin: 4px 0 0; opacity: 0.6; font-size: 14px; }

.main-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a { text-decoration: none; font-size: 15px; }

.content-area { flex: 1; padding: 40px 20px 60px; }
.blog-container { max-width: 900px; margin: 0 auto; }

/* ==========================================================================
   Posts list (blog)
   ========================================================================== */
article.post {
    margin-bottom: 56px;
    padding-bottom: 56px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
article.post:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.post-title { margin-top: 0; }
.post-title a { text-decoration: none; }

/* Строка «заголовок + дата»: дата справа, на одном уровне с заголовком,
   прижата к правому краю блога (900px) */
.post-header-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.post-header-row .post-title { margin: 0; }
.post-date {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 14px;
    opacity: 0.55;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-align: right;
}

.post-full-content p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Обложка в стиле Polaroid (карточка 400×550, адаптивная по ширине)
   ========================================================================== */
.post-thumbnail.polaroid {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 400 / 550;
    margin: 0 auto 24px;
    background: #fff;
    padding: 5.5% 5.5% 13%;
    box-sizing: border-box;
    box-shadow: 0 10px 26px rgba(0,0,0,0.16), 0 3px 8px rgba(0,0,0,0.08);
    border-radius: 2px;
    transform: rotate(-1.2deg);
    transition: transform .25s ease, box-shadow .25s ease;
}
.post-thumbnail.polaroid:hover {
    transform: rotate(0deg);
    box-shadow: 0 14px 32px rgba(0,0,0,0.2), 0 4px 10px rgba(0,0,0,0.1);
}
.polaroid-photo { width: 100%; height: 100%; overflow: hidden; background: #eee; }
.polaroid-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.load-more-sentinel { height: 1px; }
.load-more-spinner {
    text-align: center;
    padding: 30px 0;
    opacity: 0.5;
    font-size: 14px;
    display: none;
}
.load-more-spinner.is-active { display: block; }
.no-more-posts { text-align: center; padding: 30px 0 0; opacity: 0.4; font-size: 14px; }

/* ==========================================================================
   Single post / page
   ========================================================================== */
.single .post-title, .page .post-title { font-size: var(--mnml-heading-size, 32px); }

.entry-content { font-size: var(--mnml-body-size, 18px); }
.entry-content > * + * { margin-top: 1.2em; }
.entry-content img { border-radius: 8px; }

/* ==========================================================================
   Comments
   ========================================================================== */
.comments-area { max-width: 900px; margin: 60px auto 0; }
.comments-title { font-size: calc(var(--mnml-heading-size, 32px) * 0.6); }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list .comment { border-top: 1px solid rgba(0,0,0,0.08); padding: 20px 0; }
.comment-list .children { list-style: none; padding-left: 24px; margin: 0; }
.comment-meta { font-size: 13px; opacity: 0.6; margin-bottom: 6px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    margin-bottom: 14px;
    background: transparent;
    color: inherit;
}
.comment-form textarea { min-height: 120px; }
.comment-form .form-submit input {
    padding: 10px 22px;
    border-radius: 6px;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 15px;
}
.comment-form .form-submit input:hover { opacity: 0.7; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    border-top: 1px solid rgba(0,0,0,0.08);
    padding: 30px 20px;
    text-align: center;
    font-size: 13px;
    opacity: 0.55;
}

/* ==========================================================================
   Misc / widgets
   ========================================================================== */
.pagination { max-width: 900px; margin: 20px auto 0; display: flex; gap: 16px; font-size: 14px; }
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
    padding: 8px 12px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-family: inherit;
}
.search-form button {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
    .blog-container, .site-header-inner, .comments-area, .pagination { max-width: 100%; }
}

@media (max-width: 782px) {
    .content-area { padding: 32px 18px 50px; }
}

@media (max-width: 600px) {
    .site-header { padding: 18px 16px; }
    .site-header-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .content-area { padding: 26px 16px 40px; }
    .site-title { font-size: 19px; }
    h1 { font-size: calc(var(--mnml-heading-size, 32px) * 0.72); }
    h2 { font-size: calc(var(--mnml-heading-size, 32px) * 0.6); }
    article.post { margin-bottom: 40px; padding-bottom: 40px; }
    .main-nav ul { gap: 14px; }
}

@media (max-width: 400px) {
    :root { }
    .site-title { font-size: 17px; }
}
