/*
Theme Name: IT World Modern
Theme URI: https://example.com/itworld-modern
Author: OpenAI
Author URI: https://openai.com/
Description: Современный WordPress-шаблон для IT-медиа: новости, категории, подписка и рекламные блоки. Адаптивная верстка с акцентом на технологии, AI, криптовалюту и программирование.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: itworld-modern
*/

/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
    --bg: #f3f7fb;
    --surface: #ffffff;
    --surface-2: #f8fbff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #dbe5f1;
    --primary: #0b57d0;
    --primary-2: #19b5ff;
    --dark: #081223;
    --radius: 24px;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.10);
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
    --container: 1280px;
}

/* ========================================
   Reset & Base
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f7fbff 0%, var(--bg) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

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

button,
input,
textarea {
    font: inherit;
}

/* ========================================
   Utility Classes
   ======================================== */
.container {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
}

.section {
    padding: 34px 0;
}

.section-title {
    font-size: clamp(1.6rem, 2.4vw, 2.5rem);
    line-height: 1.05;
    margin: 0 0 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.section-subtitle {
    color: var(--muted);
    max-width: 720px;
}

/* ========================================
   Header
   ======================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    border-bottom: 1px solid #dbe5f1;
    padding-top: 10px;    /* Отступ сверху */
    padding-bottom: 10px; /* Отступ снизу */
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 62px; /* 82px - 20px = 62px */
}

.site-branding img {
    height: 42px;
    width: auto;
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    justify-content: center;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 14px;
    flex-wrap: wrap;
}

.main-navigation a {
    display: inline-flex;
    padding: 12px 14px;
    border-radius: 999px;
    font-weight: 600;
    color: #24324a;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    background: #eaf4ff;
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon,
.search-toggle {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #f0f6fc;
    border: 1px solid var(--line);
}

.mobile-toggle {
    display: none;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 24px;
    border-radius: 16px;
    font-weight: 800;
    border: 1px solid transparent;
    transition: 0.25s ease;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: 0 16px 35px rgba(11, 87, 208, 0.28);
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: saturate(1.08);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    position: relative;
    padding: 0 0 24px;
}

.hero-wide {
    position: relative;
    overflow: hidden;
    min-height: 520px;
    background: linear-gradient(135deg, #081223 0%, #10213c 58%, #153564 100%);
}

.hero-media img {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    max-width: none;
    max-height: 90%;
    opacity: 0.95;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at 18% 20%, rgba(25, 181, 255, 0.18), transparent 24%),
        radial-gradient(circle at 82% 30%, rgba(11, 87, 208, 0.22), transparent 28%),
        linear-gradient(90deg, rgba(8, 18, 35, 0.88) 0%, rgba(8, 18, 35, 0.74) 34%, rgba(8, 18, 35, 0.38) 62%, rgba(8, 18, 35, 0.16) 100%);
}

.hero-wide .container {
    position: relative;
    z-index: 2;
}

.hero-shell {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 520px;
    align-items: center;
    padding: 72px 0;
}

.hero-copy {
    position: relative;
    z-index: 2;
    max-width: 720px;
}

.hero-kicker {
    display: inline-flex;
    align-self: flex-start;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 700;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.hero-title {
    margin: 0 0 18px;
    font-size: clamp(2.8rem, 6vw, 5.4rem);
    line-height: 0.95;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    text-shadow: 0 12px 38px rgba(0, 0, 0, 0.34);
}

.hero-text {
    width: 80%;
    max-width: 620px;
    margin: 0 0 28px;
    font-size: 1.14rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-features span {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #dbeafe;
    font-weight: 700;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

/* ========================================
   Category Grid
   ======================================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-card,
.news-card,
.sidebar-card,
.archive-card {
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid rgba(219, 229, 241, 0.95);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.category-card:hover,
.news-card:hover,
.archive-card:hover {
    transform: translateY(-4px);
    transition: 0.25s ease;
    box-shadow: var(--shadow);
}

.category-thumb {
    aspect-ratio: 1.35 / 1;
    overflow: hidden;
    background: #eef5fb;
}

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

.category-body {
    padding: 20px;
}

.category-body h3 {
    margin: 0 0 8px;
    font-size: 1.4rem;
}

.category-body p {
    margin: 0;
    color: var(--muted);
}

/* ========================================
   About Block (TheItWorld)
   ======================================== */
.theitworld-hero {
    margin: 10px 16px 0;
    padding: 60px 20px;
    background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
    color: #ffffff;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.theitworld-container {
    max-width: 1100px;
    margin: 0 auto;
}

.theitworld-badge {
    display: inline-block;
    margin-bottom: 18px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #93c5fd;
    background: rgba(147, 197, 253, 0.12);
    border: 1px solid rgba(147, 197, 253, 0.25);
    border-radius: 999px;
}

.theitworld-hero h1,
.theitworld-hero h2 {
    margin: 0 0 22px;
    font-size: 40px;
    line-height: 1.2;
    font-weight: 800;
    color: #ffffff;
}

.theitworld-hero p {
    margin: 0 0 18px;
    font-size: 18px;
    line-height: 1.75;
    color: #d1d5db;
    max-width: 900px;
}

.theitworld-hero strong {
    color: #ffffff;
}

.theitworld-quick-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 36px;
}

.theitworld-card {
    padding: 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

.theitworld-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #ffffff;
}

.theitworld-card p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #cbd5e1;
}

/* ========================================
   Content Grid & News List
   ======================================== */
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}

.news-list {
    display: grid;
    gap: 18px;
}

.news-card {
    display: grid;
    grid-template-columns: 280px 1fr;
}

.news-thumb {
    height: 100%;
    min-height: 220px;
    overflow: hidden;
    background: #edf4fb;
}

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

.news-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.entry-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: var(--muted);
}

.entry-title {
    font-size: 1.7rem;
    line-height: 1.1;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.entry-excerpt {
    color: #4b5563;
    line-height: 1.6;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 110px;
}

.sidebar-card {
    padding: 24px;
}

.sidebar-card h3 {
    margin: 0 0 14px;
    font-size: 1.35rem;
}

.topics-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.topic-pill {
    display: inline-flex;
    padding: 10px 14px;
    border-radius: 999px;
    background: #edf5ff;
    color: var(--primary);
    font-weight: 700;
}

/* ========================================
   Subscribe / Newsletter
   ======================================== */
.newsletter-form {
    display: grid;
    gap: 12px;
}

.newsletter-form input {
    min-height: 52px;
    border-radius: 14px;
    border: 1px solid var(--line);
    padding: 0 16px;
    background: #fff;
}

.newsletter-form button {
    cursor: pointer;
}

.subscribe-box {
    background: #f5f7fa;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    padding: 25px 20px;
    position: sticky;
    top: 20px;
}

.subscribe-box h3 {
    margin: 0 0 10px;
    font-size: 20px;
}

.subscribe-box p {
    margin: 0 0 15px;
    font-size: 14px;
    color: #666;
}

.subscribe-form-wrap {
    margin-top: 30px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* ========================================
   Recent Posts (Single / Sidebar)
   ======================================== */
.recent-posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.recent-post-item {
    display: flex;
    gap: 15px;
    align-items: center;
}

.recent-post-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.recent-post-info h3 {
    margin: 5px 0 0;
    font-size: 16px;
}

.recent-post-info h3 a {
    text-decoration: none;
    color: inherit;
}

.cover-second-line {
    padding: 15px;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    margin-top: 50px;
    background: #081223;
    color: rgba(255, 255, 255, 0.84);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 22px;
    padding: 48px 0;
}

.footer-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 14px;
}

.footer-note {
    color: rgba(255, 255, 255, 0.64);
    line-height: 1.7;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 0;
    color: rgba(255, 255, 255, 0.58);
}

/* ========================================
   Archive Page
   ======================================== */
.archive-hero {
    padding: 34px 0 16px;
}

.archive-shell {
    background: linear-gradient(135deg, #091528, #0f2440);
    border-radius: 30px;
    padding: 34px;
    color: #fff;
    box-shadow: var(--shadow);
}

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

.archive-card .body {
    padding: 20px;
}

.archive-card .thumb {
    aspect-ratio: 1.4 / 1;
}

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

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 26px;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    font-weight: 700;
}

.pagination .current {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    border-color: transparent;
}

/* ========================================
   Single Post
   ======================================== */
.single-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    padding: 34px 0;
}

.single-article {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.single-cover {
    aspect-ratio: 16 / 8;
}

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

.single-body {
    padding: 36px;
}

.single-body p {
    font-size: 1.06rem;
    line-height: 1.8;
    color: #334155;
}

.single-body h2,
.single-body h3 {
    line-height: 1.15;
}

/* ========================================
   Widgets
   ======================================== */
.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.widget li a {
    display: block;
    padding: 10px 0;
    color: #334155;
}

/* ========================================
   Category Page (Extended)
   ======================================== */
.category-page {
    padding: 40px 0 60px;
}

.category-page__header {
    margin-bottom: 32px;
}

.category-page__title {
    margin: 0 0 12px;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.15;
    color: #1f1f1f;
}

.category-page__description {
    max-width: 1200px;
    font-size: 16px;
    line-height: 1.7;
    color: #5f5f5f;
}

.category-page__description p {
    margin: 0 0 12px;
}

.category-page__empty {
    padding: 24px;
    border: 1px solid #ececec;
    border-radius: 16px;
    background: #fafafa;
    color: #5f5f5f;
    text-align: center;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.post-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.1);
}

.post-card__image-link {
    display: block;
}

.post-card__image {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.post-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 20px;
}

.post-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #8a8a8a;
}

.post-card__separator {
    opacity: 0.6;
}

.post-card__title {
    margin: 0 0 12px;
    font-size: 22px;
    line-height: 1.3;
}

.post-card__title a {
    color: #1f1f1f;
    text-decoration: none;
}

.post-card__title a:hover {
    color: #0073aa;
}

.post-card__excerpt {
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.65;
    color: #5f5f5f;
}

.post-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    margin-top: auto;
    padding: 10px 16px;
    border-radius: 10px;
    background: #0073aa;
    color: #ffffff;
    text-decoration: none;
    transition: background 0.2s ease;
}

.post-card__button:hover {
    background: #005f8d;
    color: #ffffff;
}

.pagination__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination .page-numbers:hover {
    background: #0073aa;
    border-color: #0073aa;
    color: #ffffff;
}

.pagination .page-numbers.current {
    background: #0073aa;
    border-color: #0073aa;
    color: #ffffff;
    font-weight: 600;
}

.header-search-form form {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f0f6fc;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.header-search-form input {
    min-height: 46px;
    padding: 0 16px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 180px;
}

.header-search-form button {
    width: 46px;
    height: 46px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: var(--muted);
}

.header-search-form button:hover {
    color: var(--primary);
}

/* ========================================
   Responsive — до 1180px
   ======================================== */
@media (max-width: 1180px) {
    .content-grid,
    .single-wrap,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

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

    .hero-wide,
    .hero-shell {
        min-height: 640px;
    }

    .hero-media img {
        max-height: 78%;
        right: -80px;
    }
}

/* ========================================
   Responsive — до 920px
   ======================================== */
@media (max-width: 920px) {
    .main-navigation {
        display: none;
    }

    .mobile-toggle {
        display: grid;
    }

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

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

    .news-thumb {
        aspect-ratio: 16 / 10;
    }

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

    .hero-wide,
    .hero-shell {
        min-height: 600px;
    }

    .hero-shell {
        padding: 48px 0;
    }

    .hero-title {
        font-size: clamp(2.3rem, 8vw, 3.8rem);
    }

    .hero-text {
        font-size: 1.02rem;
    }

    .hero-media img {
        max-height: 64%;
        right: -140px;
        opacity: 0.72;
    }

    .hero-overlay {
        background:
            radial-gradient(circle at 18% 20%, rgba(25, 181, 255, 0.16), transparent 24%),
            radial-gradient(circle at 82% 30%, rgba(11, 87, 208, 0.18), transparent 28%),
            linear-gradient(90deg, rgba(8, 18, 35, 0.92) 0%, rgba(8, 18, 35, 0.84) 44%, rgba(8, 18, 35, 0.62) 72%, rgba(8, 18, 35, 0.34) 100%);
    }

    .theitworld-hero h1,
    .theitworld-hero h2 {
        font-size: 30px;
    }

    .theitworld-hero p {
        font-size: 17px;
    }

    .theitworld-quick-info {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Responsive — до 768px
   ======================================== */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Responsive — до 640px
   ======================================== */
@media (max-width: 640px) {
    .container {
        width: min(calc(100% - 24px), var(--container));
    }
    .site-header {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .header-inner {
        min-height: 48px;
    }
    .site-branding img {
        height: 34px;
    }

    .hero {
        padding: 0 0 16px;
    }

    .hero-wide,
    .hero-shell {
        min-height: 520px;
    }

    .hero-shell {
        padding: 36px 0 40px;
        align-items: end;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-text {
        font-size: 1rem;
        max-width: 100%;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-media img {
        right: 50%;
        top: 24%;
        transform: translate(50%, -20%);
        max-height: 42%;
        opacity: 0.28;
    }

    .hero-overlay {
        background:
            radial-gradient(circle at 18% 20%, rgba(25, 181, 255, 0.12), transparent 24%),
            radial-gradient(circle at 82% 30%, rgba(11, 87, 208, 0.14), transparent 28%),
            linear-gradient(180deg, rgba(8, 18, 35, 0.28) 0%, rgba(8, 18, 35, 0.82) 46%, rgba(8, 18, 35, 0.96) 100%);
    }

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

    .section {
        padding: 22px 0;
    }

    .single-body {
        padding: 24px;
    }

    .theitworld-hero {
        margin: 10px 12px 0;
        padding: 40px 16px;
        border-radius: 16px;
    }

    .theitworld-hero h1,
    .theitworld-hero h2 {
        font-size: 26px;
    }

    .theitworld-hero p {
        font-size: 16px;
        line-height: 1.7;
    }
}


/* ========================================
   Responsive — до 767px (Category Page)
   ======================================== */
@media (max-width: 767px) {
    .category-page {
        padding: 24px 0 40px;
    }

    .post-card__image {
        height: 200px;
    }

    .post-card__title {
        font-size: 20px;
    }
}