/*
Theme Name: Gribov Media
Theme URI: https://gribov.media
Author: Gribov Media
Author URI: https://gribov.media
Description: Профессиональная тема новостного портала для городского блога. Полная настройка через Customizer, тёмная/светлая тема, адаптивный дизайн, SEO-оптимизация, совместимость с плагинами кеширования и SEO.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gribov-media
Tags: news, blog, custom-colors, custom-logo, custom-menu, featured-images, translation-ready, two-columns, three-columns, right-sidebar, left-sidebar, grid-layout, block-styles, wide-blocks
*/

/* ============================================
   BASE RESET & FOUNDATIONS
   ============================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* ---- Typography ---- */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: 1.25em;
    color: var(--color-text-secondary);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-accent-hover);
}

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

ul, ol {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ---- Accessibility ---- */

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--color-surface);
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: var(--color-text);
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ---- WordPress Core Alignments ---- */

.alignleft {
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1em;
}

.alignright {
    float: right;
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1em;
}

.alignwide {
    margin-left: calc(-1 * var(--content-padding));
    margin-right: calc(-1 * var(--content-padding));
    max-width: calc(100% + 2 * var(--content-padding));
}

.alignfull {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    width: 100vw;
}

/* ---- WordPress Block Editor Compat ---- */

.wp-block-image figcaption,
.wp-block-embed figcaption {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 0.5em;
}

.wp-block-quote {
    border-left: 4px solid var(--color-accent);
    padding: 1em 1.5em;
    margin: 1.5em 0;
    background: var(--color-surface-hover);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.wp-block-quote p {
    font-style: italic;
    font-size: var(--text-lg);
    color: var(--color-text);
}

.wp-block-quote cite {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-style: normal;
}

/* ---- WordPress Gallery ---- */

.wp-block-gallery {
    display: grid;
    gap: 0.5rem;
}

.wp-block-gallery.columns-2 { grid-template-columns: repeat(2, 1fr); }
.wp-block-gallery.columns-3 { grid-template-columns: repeat(3, 1fr); }
.wp-block-gallery.columns-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- WordPress Captions ---- */

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    padding: 0.5em 0;
}
