/*
Theme Name: Tech Tutorial
Theme URI: https://vsesam.org/
Author: Tech Tutorial
Description: Lightweight, responsive WordPress theme for smartphone and Android tutorials.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: tech-tutorial
*/

:root {
    --accent: #1769e0;
    --text: #172033;
    --muted: #667085;
    --border: #e6e9ef;
    --bg: #ECEDEF;
    --soft: #f6f8fb;
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.container {
    width: min(calc(100% - 32px), var(--max));
    margin: auto;
}


/* =========================
   HEADER
   ========================= */

.site-header {
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-brand {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
}

.site-brand:hover {
    text-decoration: none;
}

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

.main-nav {
    margin-left: auto;
}

.main-nav ul {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: var(--text);
    font-weight: 600;
}

.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 18px;
}


/* =========================
   HERO
   ========================= */

.hero {
    padding: 58px 0;
    background: linear-gradient(180deg, #f7f9fc, #fff);
}

.hero h1 {
    width: 100%;
    text-align: center !important;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.1;
    margin: 0 0 14px;
}

.hero p {
    font-size: 19px;
    color: var(--muted);
    max-width: 720px;
    margin: 0 0 26px;
}

.search-form {
    display: flex;
    max-width: 700px;
}

.search-form input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid #cfd5df;
    border-radius: 9px 0 0 9px;
    font-size: 16px;
}

.search-form button {
    border: 0;
    background: var(--accent);
    color: #fff;
    padding: 0 22px;
    border-radius: 0 9px 9px 0;
    font-weight: 700;
}


/* =========================
   SECTIONS
   ========================= */

.section {
    padding: 42px 0;
}

.section-title {
    font-size: 28px;
    margin: 0 0 22px;
}


/* =========================
   GRID
   ========================= */

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.card-body {
    padding: 18px;
}

.card h2,
.card h3 {
    font-size: 20px;
    line-height: 1.3;
    margin: 8px 0;
}

.thumb {
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--soft);
    overflow: hidden;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.meta {
    font-size: 13px;
    color: var(--muted);
}

.excerpt {
    color: #596579;
}


/* =========================
   CATEGORIES
   ========================= */

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.category-box {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--soft);
    font-weight: 700;
    color: var(--text);
}


/* =========================
   ARTICLE
   ========================= */

.content-wrap {
    display: block;
    padding: 42px 0;
}

.article-header {
    margin-bottom: 28px;
}

.breadcrumbs {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 16px;
}

.entry-title {
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.12;
    margin: 0 0 14px;
}

.article-meta {
    color: var(--muted);
    font-size: 14px;
}

.featured {
    margin: 28px 0;
}

.entry-content {
    font-size: 18px;
}

.entry-content h2 {
    font-size: 30px;
    line-height: 1.25;
    margin-top: 42px;
}

.entry-content h3 {
    font-size: 24px;
    margin-top: 32px;
}

.entry-content img {
    border-radius: 10px;
}

.entry-content blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    border-left: 4px solid var(--accent);
    background: var(--soft);
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
}

.entry-content td,
.entry-content th {
    border: 1px solid var(--border);
    padding: 10px;
    text-align: left;
}


/* =========================
   IMAGES
   ========================= */

/*
   Центрирование изображений,
   которым WordPress присвоил aligncenter
*/

.entry-content .aligncenter {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
}


/*
   Обычный текст статьи остаётся слева
*/

.entry-content p {
    text-align: left;
}


/*
   Абзац с центрированной картинкой
*/

.entry-content p:has(.aligncenter) {
    text-align: center !important;
}


/* =========================
   NOTICE
   ========================= */

.notice {
    padding: 16px 18px;
    background: #f1f6ff;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    margin: 24px 0;
}


/* =========================
   SIDEBAR
   ========================= */

.sidebar-box {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
}

.sidebar-box h3 {
    margin-top: 0;
}

.sidebar-box ul {
    padding-left: 20px;
}


/* =========================
   PAGINATION
   ========================= */

.pagination {
    display: flex;
    gap: 8px;
    margin-top: 28px;
}

.pagination a,
.pagination span {
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
}


/* =========================
   FOOTER
   ========================= */

.site-footer {
    border-top: 1px solid var(--border);
    background: #fafbfc;
    margin-top: 40px;
}

.footer-inner {
    padding: 36px 0;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    gap: 16px;
    margin: 0;
    padding: 0;
}


/* =========================
   ACCESSIBILITY
   ========================= */

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* =========================
   TABLET
   ========================= */

@media (max-width: 900px) {

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-wrap {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .main-nav {
        display: none;
    }

    .menu-toggle {
        display: block !important;
        margin-left: auto;
        cursor: pointer;
        position: relative;
        z-index: 1002;
    }

    .header-inner {
        position: relative;
        width: 100%;
    }

    .header-inner.menu-open .main-nav {
        display: block;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border);
        padding: 18px;
        z-index: 1001;
    }

    .header-inner.menu-open .main-nav ul {
        flex-direction: column;
    }

    .container {
        width: min(calc(100% - 24px), var(--max));
    }
}


/* =========================
   MOBILE
   ========================= */

@media (max-width: 600px) {

    .container {
        width: calc(100% - 24px);
        max-width: none;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 40px 0;
    }

    .search-form input {
        width: 100%;
    }

    .search-form button {
        padding: 0 15px;
    }

    .entry-content {
        font-size: 17px;
    }

    .footer-inner {
        flex-direction: column;
    }
}
/* =========================
   CONTENT + SIDEBAR
   ========================= */

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 34px;
    align-items: start;
}

.main-column {
    min-width: 0;
}

.sidebar {
    min-width: 0;
    position: sticky;
    top: 20px;
}

.sidebar-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
}

.sidebar-box h2 {
    font-size: 19px;
    line-height: 1.3;
    margin: 0 0 14px;
}

.sidebar-search .search-form {
    max-width: none;
    width: 100%;
}

.sidebar-search .search-form input {
    min-width: 0;
    width: 100%;
    padding: 11px 12px;
    font-size: 15px;
}

.sidebar-search .search-form button {
    padding: 0 14px;
}

.sidebar-list,
.sidebar-posts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-list li:last-child,
.sidebar-posts li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.sidebar-list a {
    color: var(--text);
    font-weight: 600;
}

.sidebar-list span {
    color: var(--muted);
    font-size: 13px;
    flex: 0 0 auto;
}

.sidebar-posts li {
    padding: 0 0 13px;
    margin-bottom: 13px;
    border-bottom: 1px solid var(--border);
}

.sidebar-posts a {
    display: block;
    color: var(--text);
    font-weight: 650;
    line-height: 1.4;
}

.sidebar-posts a:hover,
.sidebar-list a:hover {
    color: var(--accent);
}

.sidebar-posts time {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 5px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag-cloud a {
    display: inline-block;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--soft);
    color: var(--text);
    font-size: 13px;
}

.tag-cloud a:hover {
    border-color: var(--accent);
    text-decoration: none;
}

@media (min-width: 901px) {
    .content-wrap {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 34px;
        align-items: start;
    }

    .content-wrap > .main-column {
        min-width: 0;
    }
}

@media (max-width: 1100px) and (min-width: 901px) {
    .content-layout,
    .content-wrap {
        grid-template-columns: minmax(0, 1fr) 270px;
        gap: 24px;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .content-layout,
    .content-wrap {
        display: block;
    }

    .sidebar {
        position: static;
        margin-top: 34px;
    }
}
