
/* =========================================
   1. CSS Reset & Base Styles
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Цветовая палитра */
    --color-primary: #1e3c72; /* Глубокий синий */
    --color-primary-light: #2a5298;
    --color-accent: #00d2ff; /* Яркий голубой для акцентов */
    --color-accent-hover: #3a7bd5;
    
    --color-text-main: #2c3e50;
    --color-text-secondary: #546e7a;
    --color-text-light: #ffffff;
    
    --color-bg-body: #f4f7f6;
    --color-bg-card: #ffffff;
    --color-border: #e0e6ed;
    
    /* Типографика */
    --font-family-base: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --line-height-base: 1.6;
    --transition-base: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Размеры и отступы */
    --container-width: 75rem; /* 1200px */
    --header-height: 4.5rem;
    --border-radius-sm: 0.5rem;
    --border-radius-md: 1rem;
    --border-radius-lg: 1.5rem;
    
    /* Тени */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 32px rgba(30, 60, 114, 0.15);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    line-height: var(--line-height-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-base);
}

ul, ol {
    list-style: none;
}

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

/* =========================================
   2. Layout & Container
   ========================================= */
.wrapper {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

#main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-box {
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 20rem; /* Контент + Сайдбар */
    gap: 2.5rem;
    align-items: start;
}

/* =========================================
   3. Header & Navigation
   ========================================= */
.header {
    background-color: var(--color-bg-card);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.5rem 0;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.header .wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo {
    height: 3rem;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform var(--transition-base);
}

.logo:hover {
    transform: scale(1.05);
}

.main-menu__list {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.main-menu__list_m {
    display: none; /* Скрываем мобильное меню на десктопе */
}

.main-menu__list li a,
.main-menu__list li span {
    font-weight: 500;
    font-size: 1rem;
    color: var(--color-text-main);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-base);
    position: relative;
    cursor: pointer;
}

/* Hover effects for menu */
.main-menu__list li a:hover,
.main-menu__list li.current-menu-item span {
    color: var(--color-primary);
    background-color: rgba(30, 60, 114, 0.05);
}

.main-menu__list li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    transition: width var(--transition-base), left var(--transition-base);
}

.main-menu__list li a:hover::after {
    width: 80%;
    left: 10%;
}

/* Выделение кнопок Вход/Регистрация */
.menu-item-116 a, 
.menu-item-70 a {
    border: 1px solid var(--color-primary);
}

.menu-item-70 a {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: var(--color-text-light) !important;
    border: none;
    box-shadow: 0 4px 10px rgba(30, 60, 114, 0.3);
}

.menu-item-70 a:hover {
    box-shadow: 0 6px 15px rgba(30, 60, 114, 0.4);
    transform: translateY(-2px);
}

/* =========================================
   4. Main Content Area
   ========================================= */
.post.single {
    background: var(--color-bg-card);
    border-radius: var(--border-radius-md);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography in Article */
.single__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--color-text-main);
    line-height: 1.2;
    position: relative;
    padding-bottom: 1rem;
}

.single__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 4rem;
    height: 4px;
    background: var(--color-accent);
    border-radius: 2px;
}

.entry p {
    margin-bottom: 1.5rem;
    font-size: 1.0625rem;
    color: var(--color-text-main);
    text-align: justify;
}

.entry h2 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    margin: 2rem 0 1rem;
    color: var(--color-primary);
    font-weight: 600;
}

.entry ul, .entry ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.entry ul li, .entry ol li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 0.5rem;
}

.entry ul li::before {
    content: '•';
    color: var(--color-accent);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.entry ol {
    list-style-type: decimal;
    color: var(--color-accent);
    font-weight: 600;
}

.entry ol li span, .entry ol li strong {
    color: var(--color-text-main);
    font-weight: normal;
}

/* Images in content */
.entry img {
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    margin: 2rem auto;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.entry img:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-hover);
}

.wp-block-image figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
}

/* =========================================
   5. Sidebar & Widgets
   ========================================= */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section_widget {
    background: var(--color-bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base);
}

.section_widget:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.section_widget .title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.widget_text ol {
    list-style: none;
    padding: 0;
    counter-reset: widget-counter;
}

.widget_text li {
    position: relative;
    padding: 0.75rem 0 0.75rem 2.5rem;
    border-bottom: 1px solid var(--color-border);
    font-weight: 500;
}

.widget_text li::before {
    counter-increment: widget-counter;
    content: counter(widget-counter);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1.8rem;
    height: 1.8rem;
    background-color: var(--color-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* =========================================
   6. Comments Section
   ========================================= */
.comments-block {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.comment-title, .respond__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--color-text-main);
}

.commentlist {
    margin-bottom: 3rem;
}

.comment {
    margin-bottom: 2rem;
    background: #f9fbfd;
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
}

.comment .gravatar img {
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    border: 3px solid var(--color-bg-card);
    box-shadow: var(--shadow-sm);
    float: left;
    margin-right: 1.5rem;
}

.comment_content {
    overflow: hidden;
}

.cauthor .fn {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-primary);
}

.comment_date {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-left: 0.5rem;
}

.ctext p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.reply a {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.reply a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Form Styles */
.respond-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.respond-form__text {
    grid-column: 1 / -1;
}

.respond-form__field,
.respond-form__text {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background-color: #fcfcfc;
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-base);
}

.respond-form__field:focus,
.respond-form__text:focus {
    outline: none;
    border-color: var(--color-accent);
    background-color: var(--color-bg-card);
    box-shadow: 0 0 0 4px rgba(0, 210, 255, 0.1);
}

.respond-form__button {
    grid-column: 1 / -1;
    justify-self: start;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
}

.respond-form__button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(30, 60, 114, 0.4);
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
}

/* =========================================
   7. Footer
   ========================================= */
.footer {
    background-color: var(--color-text-main);
    color: var(--color-text-secondary);
    padding: 3rem 0;
    margin-top: auto;
    font-size: 0.9rem;
    text-align: center;
}

.footer-bottom {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.copy {
    opacity: 0.7;
    line-height: 1.8;
}

/* =========================================
   8. Responsive Design
   ========================================= */

/* Tablet & Mobile (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr; /* Одна колонка */
    }
    
    .sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Сетка виджетов */
        gap: 1.5rem;
    }
    
    .sidebar .widget_media_image img {
        width: 100%;
        height: auto;
    }
}

/* Mobile (max-width: 768px) */
@media screen and (max-width: 768px) {
    :root {
        --header-height: 4rem;
    }

    /* Навигация на мобильном */
    .main-menu__list {
        display: none; /* Скрываем десктопное меню */
    }
    
    .main-menu__list_m {
        display: flex; /* Показываем мобильное */
        overflow-x: auto;
        padding-bottom: 0.5rem;
        width: 100%;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
    }
    
    .main-menu__list_m::-webkit-scrollbar {
        display: none; /* Скрываем скроллбар */
    }
    
    .main-menu__list_m li {
        flex: 0 0 auto; /* Элементы не сжимаются */
    }
    
    .main-menu__list_m li a,
    .main-menu__list_m li span {
        font-size: 0.9rem;
        white-space: nowrap;
        background: #f0f2f5;
        border: 1px solid transparent;
    }
    
    .header .wrapper {
        flex-direction: column;
        height: auto;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .m-nav {
        width: 100%;
        overflow: hidden;
    }

    .post.single {
        padding: 1.5rem;
    }

    .respond-form {
        grid-template-columns: 1fr;
    }
    
    .respond-form__button {
        width: 100%;
    }
    
    .sidebar {
        grid-template-columns: 1fr; /* Одна колонка для виджетов на телефоне */
    }
}
