/*
Theme Name: Flavor Theme
Theme URI: https://dev01.molostov.ru
Description: Базовая минималистичная тема на Bootstrap 5. Интеграция: my-site-info, acf-chart-output, blean-wp, custom-wpcf7-handler.
Version: 1.0.0
Author: Developer
Author URI: https://dev01.molostov.ru
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flavor
Requires PHP: 7.4
*/

/* =========================================================
   BASE
   ========================================================= */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

a {
    color: #0d6efd;
    text-decoration: none;
}

a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.site-header .contact-info {
    font-size: 14px;
    color: #555;
    padding: 4px 0 8px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 6px;
}

.site-header .contact-info a {
    color: #333;
}

.site-header .contact-info a:hover {
    color: #0d6efd;
    text-decoration: none;
}

.navbar-brand {
    font-weight: 700;
    font-size: 20px;
    color: #111 !important;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */

.content-wrapper {
    padding: 30px 0 40px;
    min-height: 60vh;
}

/* =========================================================
   POST CARDS (index, archive, search)
   ========================================================= */

.post-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}

.post-card .card-thumb {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #eee;
}

.post-card .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card .card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card .card-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.post-card .card-title a {
    color: #111;
}

.post-card .card-title a:hover {
    color: #0d6efd;
    text-decoration: none;
}

.post-card .card-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.post-card .card-excerpt {
    font-size: 14px;
    color: #555;
    flex: 1;
    margin-bottom: 12px;
}

.sticky-badge {
    display: inline-block;
    background: #ffc107;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}

/* =========================================================
   SINGLE POST
   ========================================================= */

.single-post h1.post-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.post-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
}

.post-meta a {
    color: #666;
}

.post-thumbnail {
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
}

/* =========================================================
   POST CONTENT — blean-wp убирает Gutenberg-стили,
   поэтому обеспечиваем базовую типографику сами
   ========================================================= */

.post-content {
    font-size: 16px;
    line-height: 1.75;
    color: #333;
}

.post-content h2 { font-size: 22px; font-weight: 700; margin: 28px 0 12px; }
.post-content h3 { font-size: 19px; font-weight: 600; margin: 24px 0 10px; }
.post-content h4 { font-size: 17px; font-weight: 600; margin: 20px 0 8px; }

.post-content p { margin-bottom: 16px; }

.post-content ul,
.post-content ol {
    margin-bottom: 16px;
    padding-left: 28px;
}

.post-content li { margin-bottom: 6px; }

.post-content blockquote {
    border-left: 4px solid #0d6efd;
    margin: 24px 0;
    padding: 12px 20px;
    background: #f0f5ff;
    border-radius: 0 6px 6px 0;
    color: #444;
    font-style: italic;
}

.post-content code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    color: #c7254e;
}

.post-content pre {
    background: #f1f3f5;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: #333;
}

/* Таблицы — blean-wp не трогает таблицы, но Gutenberg-стилей нет */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.post-content table tr:first-child {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
}

.post-content table tr:first-child td,
.post-content table tr:first-child th {
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px 16px;
    border: none;
}

.post-content table td {
    padding: 10px 16px;
    border-bottom: 1px solid #e9ecef;
}

.post-content table tr:nth-child(even) {
    background: #f8f9fa;
}

/* =========================================================
   CONTACT FORM 7 — custom-wpcf7-handler убирает стандартные
   стили CF7, стилизуем через Bootstrap + кастом
   ========================================================= */

.wpcf7 form {
    max-width: 600px;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 select,
.wpcf7 textarea {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 16px;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    margin-bottom: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
    outline: 0;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,0.25);
}

.wpcf7 textarea { min-height: 120px; resize: vertical; }

.wpcf7 input[type="submit"] {
    display: inline-block;
    padding: 10px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background-color: #0d6efd;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.wpcf7 input[type="submit"]:hover {
    background-color: #0a58ca;
}

.wpcf7-response-output {
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-size: 14px;
}

.wpcf7 .wpcf7-mail-sent-ok { background: #d1e7dd; border-color: #a3cfbb; color: #0f5132; }
.wpcf7 .wpcf7-validation-errors { background: #fff3cd; border-color: #ffecb5; color: #664d03; }
.wpcf7 .wpcf7-spam-blocked { background: #f8d7da; border-color: #f5c2c7; color: #842029; }

/* =========================================================
   PAGINATION
   ========================================================= */

.pagination-wrapper {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.pagination-info {
    font-size: 14px;
    color: #888;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-links a,
.pagination-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    color: #0d6efd;
    background: #fff;
    transition: background 0.15s, color 0.15s;
}

.pagination-links a:hover {
    background: #e9ecef;
    text-decoration: none;
}

.pagination-links span.current {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    font-weight: 700;
}

.pagination-links span.disabled {
    color: #adb5bd;
    background: #f8f9fa;
}

.pagination-links span.dots {
    border: none;
    background: none;
    min-width: auto;
    color: #888;
}

/* =========================================================
   POST NAVIGATION (single)
   ========================================================= */

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    font-size: 14px;
}

.post-navigation a {
    color: #0d6efd;
    max-width: 45%;
}

/* =========================================================
   POST TAGS
   ========================================================= */

.post-tags {
    margin-top: 20px;
    font-size: 14px;
}

.post-tags a {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 3px 10px;
    border-radius: 20px;
    margin: 0 4px 4px 0;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.15s;
}

.post-tags a:hover {
    background: #0d6efd;
    color: #fff;
    text-decoration: none;
}

/* =========================================================
   404 PAGE
   ========================================================= */

.error-404 {
    padding: 60px 0;
}

.error-404 .error-code {
    font-size: 120px;
    font-weight: 900;
    line-height: 1;
    color: #dee2e6;
    margin-bottom: 16px;
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    background: #212529;
    color: #adb5bd;
    padding: 40px 0 20px;
    margin-top: 40px;
    font-size: 14px;
}

.site-footer h5 {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.site-footer a {
    color: #adb5bd;
    text-decoration: none;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: none;
}

.site-footer .social-links a {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    margin: 0 6px 6px 0;
    font-size: 13px;
    transition: border-color 0.15s, color 0.15s;
}

.site-footer .social-links a:hover {
    border-color: #fff;
    color: #fff;
}

.site-footer .footer-copy {
    font-size: 13px;
    color: #6c757d;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 24px;
}

/* =========================================================
   MAP BLOCK (перед footer, из my-site-info)
   ========================================================= */

.map-wrapper {
    margin: 0 0 0 0;
    background: #e9ecef;
}

.map-wrapper iframe {
    display: block;
    width: 100%;
    border: none;
}

/* =========================================================
   SEARCH FORM
   ========================================================= */

.search-form .input-group {
    max-width: 500px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 767px) {
    .site-header .contact-info { display: none; } /* убираем на мобиле, экономим место */
    .single-post h1.post-title { font-size: 22px; }
    .error-404 .error-code { font-size: 72px; }
    .post-navigation { flex-direction: column; }
    .post-navigation a { max-width: 100%; }
}
