/*
Theme Name: DevBrothers Theme
Theme URI: https://local.testplugins/devbrothers-theme
Author: DevBrothers
Author URI: https://devbrothers.ru
Description: Чистая тема-песочница DevBrothers для тестирования и разработки плагинов.
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.6
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: devbrothers-theme
*/


:root {
    --db-font-base: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --db-color-bg: #eef2f6;
    --db-color-text: #111827;
    --db-color-muted: #6b7280;
    --db-color-accent: #2563eb;
    /* Мягкий «воздушный» фон страницы */
    --db-body-gradient:
        radial-gradient(1000px 520px at 10% -6%, rgba(37, 99, 235, 0.14), transparent 52%),
        radial-gradient(760px 440px at 92% 12%, rgba(99, 102, 241, 0.11), transparent 48%),
        radial-gradient(600px 360px at 50% 100%, rgba(14, 165, 233, 0.06), transparent 55%),
        linear-gradient(168deg, #f1f5f9 0%, #eef2f7 42%, #e2e8f0 100%);
}

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

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

body {
    margin: 0;
    padding: 0;
    font-family: var(--db-font-base);
    background-color: var(--db-color-bg);
    background-image: var(--db-body-gradient);
    background-attachment: fixed;
    color: var(--db-color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

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

a:hover,
a:focus-visible {
    text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 0.5em;
    font-family: var(--db-font-base);
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: clamp(1.3rem, 0.65vw + 1.08rem, 1.425rem);
}

h2 {
    font-size: 1.2rem;
}

h3 {
    font-size: 1.125rem;
}

h4 {
    font-size: 1.0625rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.9375rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

p {
    margin: 0 0 1em;
    color: var(--db-color-text);
}

small {
    font-size: 0.875rem;
    color: var(--db-color-muted);
}

ul,
ol {
    margin: 0 0 1em 1.25em;
    padding: 0;
}

blockquote {
    margin: 0 0 1.25em;
    padding-left: 1em;
    border-left: 3px solid var(--db-color-accent);
    color: var(--db-color-muted);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    width: 100%;
    margin: 0 auto;
}

/* Shared container for header/main/footer alignment */
.db-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* ==========================================================================
   Site header wrapper
   ========================================================================== */

.db-site-header {
    flex: 0 0 auto;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer--default {
    margin-top: auto;
    padding: 1.75rem 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(226, 232, 240, 0.95);
    color: var(--db-color-muted);
    font-size: 0.875rem;
    text-align: center;
}

.db-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.db-footer-copy {
    margin: 0 0 0.35em;
    font-weight: 600;
    color: var(--db-color-text);
}

.db-footer-note {
    margin: 0;
    font-size: 0.8125rem;
}

.site-footer--custom {
    margin-top: auto;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

/* ==========================================================================
   Primary Navigation
   ========================================================================== */

.db-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 4px 20px rgba(15, 23, 42, 0.04);
    position: relative;
    z-index: 100;
}

.db-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
}

.db-nav-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    margin-right: auto;
    flex: 0 0 auto;
}

.db-nav-home {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
}

.db-nav-site-name {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.custom-logo-link,
.custom-logo {
    display: inline-flex;
    align-items: center;
}

.custom-logo {
    max-height: 38px;
    width: auto;
}

.db-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 0.75rem 0;
    cursor: pointer;
}

.db-nav-toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--db-color-text);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.db-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    gap: 0;
    flex: 0 1 auto;
}

.db-nav-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0.5rem;
}

/* Keep auth button aligned with theme nav */
.db-auth-btn.dba-auth-btn {
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: var(--db-color-text);
    font-weight: 600;
    line-height: 1.1;
}

.db-auth-btn.dba-auth-btn:hover {
    background: #f3f4f6;
    text-decoration: none;
}

.db-nav-menu li {
    position: relative;
    border-bottom: none;
    padding: 0;
}

.db-nav-menu > li > a {
    display: flex;
    align-items: center;
    padding: 20px 20px;
    color: var(--db-color-text);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.db-nav-menu > li > a:hover,
.db-nav-menu > li > a:focus-visible,
.db-nav-menu > li.current-menu-item > a,
.db-nav-menu > li.current-menu-ancestor > a {
    color: var(--db-color-accent);
    background: #f0f5ff;
    text-decoration: none;
}

.db-nav-menu > li.current-menu-item > a,
.db-nav-menu > li.current-menu-ancestor > a {
    box-shadow: inset 0 -3px 0 var(--db-color-accent);
}

/* Fallback: автосписок страниц (wp_list_pages) */
.db-nav-menu .page_item > a {
    display: flex;
    align-items: center;
    padding: 20px 20px;
    color: var(--db-color-text);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.db-nav-menu .page_item > a:hover,
.db-nav-menu .page_item > a:focus-visible,
.db-nav-menu .page_item.current_page_item > a {
    color: var(--db-color-accent);
    background: #f0f5ff;
    text-decoration: none;
}

.db-nav-menu .page_item.current_page_item > a {
    box-shadow: inset 0 -3px 0 var(--db-color-accent);
}

/* Dropdown arrow for parent items */
.db-nav-menu > li.menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

/* Submenu (one level deep) */
.db-nav-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 110;
}

.db-nav-menu li:hover > .sub-menu,
.db-nav-menu li:focus-within > .sub-menu,
.db-nav-menu li.db-sub-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.db-nav-menu .sub-menu li {
    padding: 0;
}

.db-nav-menu .sub-menu a {
    display: block;
    padding: 0.625rem 1.25rem;
    color: var(--db-color-text);
    font-size: 0.875rem;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.db-nav-menu .sub-menu a:hover,
.db-nav-menu .sub-menu a:focus-visible,
.db-nav-menu .sub-menu .current-menu-item > a {
    background: #f0f5ff;
    color: var(--db-color-accent);
    text-decoration: none;
}

/* Mobile navigation */
@media (max-width: 768px) {
    .db-nav-inner {
        flex-wrap: wrap;
    }

    .db-nav-toggle {
        display: flex;
    }

    .db-nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 0.5rem 0 1rem;
        border-top: 1px solid #e5e7eb;
    }

    .db-nav-actions {
        padding: 0.5rem 0;
    }

    .db-nav-menu.db-nav-menu--open {
        display: flex;
    }

    .db-nav-menu > li > a {
        padding: 0.75rem 0;
    }

    .db-nav-menu > li.current-menu-item > a,
    .db-nav-menu > li.current-menu-ancestor > a {
        box-shadow: none;
    }

    .db-nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        display: none;
    }

    .db-nav-menu li.db-sub-open > .sub-menu {
        display: block;
    }

    .db-nav-menu .sub-menu a {
        padding-left: 1.5rem;
    }

    .db-nav-menu > li.menu-item-has-children > a::after {
        margin-left: auto;
        transform: rotate(45deg);
        transition: transform 0.2s ease;
    }

    .db-nav-menu > li.db-sub-open > a::after {
        transform: rotate(225deg);
    }
}

/* ==========================================================================
   Screen Reader Text (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: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
   Entry (Posts & Pages)
   ========================================================================== */

article {
    margin-bottom: 3rem;
}

.entry-header {
    margin-bottom: 1.5rem;
}

.entry-title {
    margin-bottom: 0.5rem;
}

.entry-title a {
    color: inherit;
    text-decoration: none;
}

.entry-title a:hover {
    color: var(--db-color-accent);
}

.entry-meta {
    font-size: 0.875rem;
    color: var(--db-color-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.entry-thumbnail {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
}

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

.entry-content {
    margin-bottom: 1.5rem;
}

.entry-footer {
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: var(--db-color-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Single post meta (categories/tags) */
.single .entry-footer.entry-footer-meta {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
}

.single .entry-taxonomy {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.single .entry-meta-label {
    font-weight: 600;
    margin-right: 0.35rem;
}

.single .entry-meta-values a {
    display: inline-block;
    margin-right: 0.35rem;
    margin-bottom: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: var(--db-color-text);
    font-size: 0.8rem;
    text-decoration: none;
}

.single .entry-meta-values a:hover {
    background: #e5edff;
    color: var(--db-color-accent);
}

.read-more {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--db-color-accent);
    color: #fff;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s ease;
}

.read-more:hover {
    background: #1d4ed8;
    text-decoration: none;
    color: #fff;
}

/* ==========================================================================
   Archive & Search
   ========================================================================== */

.archive-header,
.search-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.archive-title,
.search-title {
    margin-bottom: 0.5rem;
}

.archive-description {
    color: var(--db-color-muted);
}

.posts-list,
.search-results {
    display: grid;
    gap: 2rem;
}

/* ==========================================================================
   404 Page
   ========================================================================== */

.error-404 {
    text-align: center;
    padding: 4rem 1rem;
}

.error-404 .page-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-404 .page-content {
    max-width: 500px;
    margin: 0 auto;
}

/* ==========================================================================
   Search Form
   ========================================================================== */

.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
}

.search-field {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 1rem;
}

.search-field:focus {
    outline: none;
    border-color: var(--db-color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-submit {
    padding: 0.75rem 1.25rem;
    background: var(--db-color-accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.search-submit:hover {
    background: #1d4ed8;
}

/* ==========================================================================
   Comments
   ========================================================================== */

.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.comments-title {
    margin-bottom: 1.5rem;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list .comment {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.comment-list .comment:last-child {
    border-bottom: none;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-author img {
    border-radius: 50%;
}

.comment-author .fn {
    font-weight: 600;
}

.comment-metadata {
    font-size: 0.875rem;
    color: var(--db-color-muted);
    margin-bottom: 0.75rem;
}

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

.comment-reply-link {
    font-size: 0.875rem;
    font-weight: 500;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--db-color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comment-form .submit {
    padding: 0.75rem 1.5rem;
    background: var(--db-color-accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.comment-form .submit:hover {
    background: #1d4ed8;
}

/* ==========================================================================
   Pagination & Navigation
   ========================================================================== */

.pagination,
.post-navigation,
.comments-pagination {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-links .page-numbers {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: var(--db-color-text);
    text-decoration: none;
}

.nav-links .page-numbers:hover {
    background: #f3f4f6;
    text-decoration: none;
}

.nav-links .page-numbers.current {
    background: var(--db-color-accent);
    border-color: var(--db-color-accent);
    color: #fff;
}

.post-navigation .nav-links {
    justify-content: space-between;
}

.single .post-navigation {
    margin-top: 2.5rem;
    padding: 1.5rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.single .post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1.25rem;
}

.single .post-navigation .entry-nav-item {
    max-width: 48%;
}

.nav-subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--db-color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-title {
    font-weight: 500;
}

.single .post-navigation .entry-nav-prev .nav-subtitle::before {
    content: '← ';
}

.single .post-navigation .entry-nav-next .nav-subtitle::after {
    content: ' →';
}

/* ==========================================================================
   Sidebar & Widgets
   ========================================================================== */

.widget-area {
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
}

.widget {
    margin-bottom: 2rem;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--db-color-accent);
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.widget li:last-child {
    border-bottom: none;
}

/* ==========================================================================
   Alignments (Gutenberg)
   ========================================================================== */

.alignwide {
    margin-left: -2rem;
    margin-right: -2rem;
    max-width: calc(100% + 4rem);
}

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

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

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

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

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .alignwide {
        margin-left: -1rem;
        margin-right: -1rem;
        max-width: calc(100% + 2rem);
    }

    .search-form {
        flex-direction: column;
    }

    .nav-links {
        flex-direction: column;
    }
}

/* ==========================================================================
   Details / Accordion
   ========================================================================== */

details {
    margin: 0 0 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    padding: 0.75rem 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

details[open] {
    background: #f3f4ff;
    border-color: var(--db-color-accent);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

details summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--db-color-text);
}

/* убираем стандартный маркер */
details summary::-webkit-details-marker {
    display: none;
}

/* иконка-стрелка */
details summary::before {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--db-color-accent);
    border-bottom: 2px solid var(--db-color-accent);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

details[open] summary::before {
    transform: rotate(225deg);
}

/* фокус по Tab */
details summary:focus-visible {
    outline: 2px solid var(--db-color-accent);
    outline-offset: 3px;
}

/* контент внутри details */
details > *:not(summary) {
    margin-top: 0.75rem;
    color: var(--db-color-text);
    font-size: 0.95rem;
}