/*
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: #ffffff;
    --db-color-text: #111827;
    --db-color-muted: #6b7280;
    --db-color-accent: #2563eb;
}

*,
*::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);
    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(2.25rem, 2vw + 2rem, 2.75rem);
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
    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;
}

/* ==========================================================================
   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;
}

.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;
}

.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;
}

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

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

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

.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;
}

/* ==========================================================================
   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-muted);
    font-size: 0.95rem;
}