/*
Theme Name: dds_easyfrca.com
Author: Илья Рязанцев
Description: Информационная тема о профессиональном медицинском образовании: структура экзаменов, стратегии подготовки, обзоры учебных материалов и международные карьерные пути для врачей. Сдержанный медицинско-академический стиль.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: efrca
*/

/* =========================================================================
   Дизайн-токены
   ====================================================================== */
:root {
    --c-dark: #0A2B3E;
    --c-bg: #F5F7FA;
    --c-accent: #2C7A5E;
    --c-accent-dark: #20684E;
    --c-tertiary: #E8E9ED;
    --c-text: #1B2B34;
    --c-muted: #5A6B74;
    --c-line: #D5DAE0;
    --c-white: #FFFFFF;

    --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

    --radius: 4px;
    --shell: min(92%, 1180px);
    --gap: clamp(24px, 4vw, 44px);
}

/* =========================================================================
   База
   ====================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-base);
    font-size: 17px;
    line-height: 1.7;
    color: var(--c-text);
    background-color: var(--c-bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--c-accent);
    text-decoration: none;
    transition: color .18s ease;
}
a:hover { color: var(--c-accent-dark); text-decoration: underline; }

h1, h2, h3, h4 {
    font-family: var(--font-base);
    color: var(--c-dark);
    line-height: 1.25;
    font-weight: 700;
    margin: 0 0 .6em;
}
h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

code, pre, .exam-code, kbd {
    font-family: var(--font-mono);
    font-size: .92em;
}
code {
    background: var(--c-tertiary);
    padding: .12em .4em;
    border-radius: 3px;
    color: var(--c-dark);
}
pre {
    background: var(--c-dark);
    color: #E6EDF1;
    padding: 16px 18px;
    border-radius: var(--radius);
    overflow-x: auto;
}
pre code { background: none; color: inherit; padding: 0; }

blockquote {
    margin: 1.4em 0;
    padding: .4em 1.2em;
    border-left: 3px solid var(--c-accent);
    background: var(--c-tertiary);
    color: var(--c-text);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid var(--c-line);
}
th, td {
    border: 1px solid var(--c-line);
    padding: 10px 12px;
    text-align: left;
}
th { background: var(--c-tertiary); color: var(--c-dark); }

/* =========================================================================
   Контейнер ширины (единственный источник, см. A12.7)
   ====================================================================== */
.shell {
    width: var(--shell);
    margin-inline: auto;
}

.narrow {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 600px) {
    .narrow { width: 100%; }
}

/* =========================================================================
   Кнопки
   ====================================================================== */
.btn {
    display: inline-block;
    font-family: var(--font-base);
    font-weight: 600;
    font-size: .95rem;
    color: var(--c-white);
    background: var(--c-dark);
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .18s ease;
}
.btn:hover {
    background: var(--c-accent);
    color: var(--c-white);
    text-decoration: none;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--c-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.read-more .arrow { transition: transform .18s ease; }
.read-more:hover { color: var(--c-accent-dark); }
.read-more:hover .arrow { transform: translateX(3px); }

/* =========================================================================
   Шапка (не липкая)
   ====================================================================== */
.site-header {
    background: var(--c-dark);
    color: var(--c-white);
    padding: 20px 0;
}
.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    min-width: 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.brand-logo,
.brand-fallback {
    flex: 0 0 auto;
    display: block;
    width: 54px;
    height: 54px;
}
.brand-text { min-width: 0; }
.brand-text .site-title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--c-white);
    font-weight: 700;
}
.brand-text .site-title a { color: var(--c-white); }
.brand-text .site-title a:hover { color: var(--c-tertiary); text-decoration: none; }
.brand-text .site-desc {
    margin: 6px 0 0;
    font-size: .82rem;
    line-height: 1.5;
    color: #B7C4CC;
}

/* Навигация */
.main-nav { width: 100%; }
.nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--c-white);
    border: 1px solid #34566A;
    border-radius: var(--radius);
    padding: 8px 14px;
    font-family: var(--font-base);
    font-size: .9rem;
    cursor: pointer;
}
.nav-menu {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 22px;
}
.nav-menu a {
    color: #DCE5EA;
    font-weight: 500;
    font-size: .95rem;
    padding: 6px 0;
    display: inline-block;
}
.nav-menu a:hover,
.nav-menu .current-menu-item > a {
    color: var(--c-white);
    text-decoration: none;
    border-bottom: 2px solid var(--c-accent);
}

/* =========================================================================
   Хлебные крошки
   ====================================================================== */
.breadcrumbs {
    font-size: .85rem;
    color: var(--c-muted);
    padding: 16px 0 0;
}
.breadcrumbs a { color: var(--c-accent); }
.breadcrumbs .sep { color: var(--c-line); margin: 0 2px; }
.breadcrumbs span { color: var(--c-muted); }

/* =========================================================================
   Основная область
   ====================================================================== */
.site-main { padding: 30px 0 60px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
    gap: var(--gap);
    align-items: start;
}
.layout-single .content-area { width: 85%; margin-inline: auto; }

.content-area { min-width: 0; }

@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); }
    .layout-single .content-area { width: 100%; }
}

/* Контент записи/страницы */
.entry-header { margin-bottom: 18px; }
.entry-title { margin-bottom: .3em; }
.entry-thumb { margin: 0 0 22px; }
.entry-thumb img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}
.entry-content { font-size: 1.05rem; }
.entry-content img { border-radius: var(--radius); }
.entry-content h2 { margin-top: 1.4em; }

/* =========================================================================
   Карточки записей (см. A8, A10)
   ====================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: var(--gap);
}

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-thumb {
    display: block;
    overflow: hidden;
}
.card-thumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform .3s ease;
}
.card-thumb:hover img { transform: scale(1.04); }
.card-thumb-fallback {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--c-tertiary);
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
    min-width: 0;
}
.card-title {
    font-size: 1.2rem;
    margin: 0 0 .55em;
    line-height: 1.3;
}
.card-title a { color: var(--c-dark); }
.card-title a:hover { color: var(--c-accent); text-decoration: none; }
.card-excerpt {
    color: var(--c-text);
    font-size: .96rem;
    flex: 1;
}
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card .read-more { margin-top: 12px; }

/* =========================================================================
   Тематические секции главной
   ====================================================================== */
.home-section { padding: 46px 0; }
.home-section.alt { background: var(--c-tertiary); }
.home-section .section-head {
    max-width: 760px;
    margin: 0 0 28px;
}
.home-section .section-head h2 { margin-bottom: .35em; }
.home-section .section-head p { color: var(--c-muted); margin: 0; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: var(--gap);
}
.feature {
    min-width: 0;
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 26px 24px;
}
.home-section.alt .feature { background: var(--c-white); }
.feature .feature-icon {
    width: 40px;
    height: 40px;
    color: var(--c-accent);
    margin-bottom: 14px;
}
.feature h3 { font-size: 1.15rem; margin-bottom: .4em; }
.feature p { margin: 0; color: var(--c-text); font-size: .96rem; }
.feature .exam-code {
    display: inline-block;
    margin-top: 12px;
    color: var(--c-accent-dark);
    background: var(--c-tertiary);
    padding: 3px 8px;
    border-radius: 3px;
}

.steps {
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: var(--gap);
}
.step {
    min-width: 0;
    position: relative;
    padding-left: 52px;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0; top: 0;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-dark);
    color: var(--c-white);
    font-family: var(--font-mono);
    font-weight: 500;
    border-radius: var(--radius);
}
.step h3 { font-size: 1.1rem; margin-bottom: .3em; }
.step p { margin: 0; font-size: .95rem; color: var(--c-muted); }

.home-recent { padding: 46px 0; }
.home-recent .section-head { margin-bottom: 28px; }

/* =========================================================================
   Сайдбар (светлый фон → тёмный текст, явный контраст)
   ====================================================================== */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
    color: var(--c-text);
}
.sidebar .widget-title {
    font-size: 1.05rem;
    color: var(--c-dark);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--c-accent);
}
.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar .widget li {
    padding: 7px 0;
    border-bottom: 1px solid var(--c-tertiary);
    color: var(--c-text);
}
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget a { color: var(--c-accent); }
.sidebar .widget a:hover { color: var(--c-accent-dark); }
.sidebar .widget .post-date { color: var(--c-muted); font-size: .82rem; display: block; }

/* =========================================================================
   Форма поиска
   ====================================================================== */
.search-form {
    display: flex;
    gap: 8px;
    min-width: 0;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    font-family: var(--font-base);
    font-size: .95rem;
    color: var(--c-text);
    background: var(--c-white);
}
.search-form .search-submit {
    flex: 0 0 auto;
    background: var(--c-dark);
    color: var(--c-white);
    border: none;
    border-radius: var(--radius);
    padding: 0 18px;
    cursor: pointer;
    font-family: var(--font-base);
    transition: background .18s ease;
}
.search-form .search-submit:hover { background: var(--c-accent); }

/* =========================================================================
   Пагинация
   ====================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 40px;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 9px 12px;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    color: var(--c-dark);
    background: var(--c-white);
    font-weight: 500;
    font-size: .92rem;
}
.pagination a.page-numbers:hover {
    background: var(--c-tertiary);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: var(--c-white);
}
.pagination .page-numbers.dots { border: none; background: none; }

/* =========================================================================
   Комментарии
   ====================================================================== */
.comments-area { margin-top: 48px; padding-top: 30px; border-top: 1px solid var(--c-line); }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 28px; padding: 0; }
.comment-item { margin: 0 0 18px; }
.comment-inner {
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.comment-head {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    align-items: baseline;
    margin-bottom: 8px;
}
.comment-author { font-weight: 600; color: var(--c-dark); }
.comment-date { font-size: .82rem; color: var(--c-muted); }
.comment-reply { margin-top: 8px; font-size: .88rem; }
.comment-form p { margin-bottom: 14px; }
.comment-form label { display: block; font-weight: 500; margin-bottom: 5px; color: var(--c-dark); }
.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 var(--c-line);
    border-radius: var(--radius);
    font-family: var(--font-base);
    font-size: .95rem;
    color: var(--c-text);
    background: var(--c-white);
}

/* =========================================================================
   Подвал (тёмный фон → светлый текст, явный контраст)
   ====================================================================== */
.site-footer {
    background: var(--c-dark);
    color: #C3CED5;
    padding: 50px 0 0;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: var(--gap);
    padding-bottom: 40px;
}
.footer-col { min-width: 0; }
.site-footer .widget { color: #C3CED5; margin-bottom: 0; }
.site-footer .widget-title {
    color: var(--c-white);
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--c-accent);
}
.site-footer .widget p { color: #C3CED5; margin: 0 0 .8em; }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { padding: 6px 0; }
.site-footer .widget a { color: #9FE3C6; }
.site-footer .widget a:hover { color: var(--c-white); }

.footer-bottom {
    border-top: 1px solid #1E465C;
    padding: 20px 0;
}
.footer-bottom .footer-bottom-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}
.footer-copy { font-size: .86rem; color: #9FB0BA; margin: 0; }
.footer-copy a { color: #9FE3C6; }
.footer-mini {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0;
    padding: 0;
}
.footer-mini a { color: #C3CED5; font-size: .86rem; }
.footer-mini a:hover { color: var(--c-white); }

/* =========================================================================
   404
   ====================================================================== */
.error-404 { text-align: center; padding: 50px 0; }
.error-404 .code-404 {
    font-family: var(--font-mono);
    font-size: clamp(3.5rem, 12vw, 6rem);
    color: var(--c-accent);
    line-height: 1;
    margin: 0 0 .2em;
}
.error-404 .search-form { max-width: 460px; margin: 24px auto 0; }

/* =========================================================================
   Cookie-баннер (правило [hidden] ДО основного блока, см. A11)
   ====================================================================== */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--c-dark);
    color: #DCE5EA;
    padding: 16px 0;
    box-shadow: 0 -2px 12px rgba(10, 43, 62, .18);
}
.cookie-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}
.cookie-inner p { margin: 0; font-size: .9rem; flex: 1; min-width: 0; }
.cookie-inner a { color: #9FE3C6; }
.cookie-accept {
    flex: 0 0 auto;
    background: var(--c-accent);
    color: var(--c-white);
    border: none;
    border-radius: var(--radius);
    padding: 10px 22px;
    font-family: var(--font-base);
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease;
}
.cookie-accept:hover { background: var(--c-accent-dark); }

/* =========================================================================
   Адаптив
   ====================================================================== */
@media (max-width: 600px) {
    body { font-size: 16px; }

    .nav-toggle { display: inline-flex; margin-top: 14px; }
    .nav-menu {
        display: none;
        flex-direction: column;
        gap: 0;
        margin-top: 12px;
    }
    .nav-menu.is-open { display: flex; }
    .nav-menu li { border-bottom: 1px solid #1E465C; }
    .nav-menu a { padding: 11px 0; width: 100%; }

    .footer-bottom .footer-bottom-inner { flex-direction: column; align-items: flex-start; }
}
