/**
 * DefoSert.ru - Modern Stylesheet v2.0
 * Brand Palette:
 *   Primary Orange: #ff7000
 *   Dark Orange:    #e65c00
 *   Accent Orange:  #fc4e04
 *   Dark Slate:     #1e293b / #2c3e50
 *   Neutral BG:     #f8fafc / #f1f5f9
 *   Border:         #e2e8f0
 */

/* ==========================================================================
   1. Typography & Global Enhancements
   ========================================================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    color: #334155;
    background-color: #ffffff;
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Link Styling */
a {
    color: #ff7000;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover, a:focus {
    color: #e65c00;
    text-decoration: underline;
}

/* Responsive Image Scaling */
img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   2. Responsive Layout Overrides (Breaking the 1249px bottleneck)
   ========================================================================== */
#container {
    width: 100% !important;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
    background-color: #ffffff;
}

#main {
    width: 100% !important;
    float: none !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    box-sizing: border-box;
}

#left {
    width: 68% !important;
    float: none !important;
    box-sizing: border-box;
    min-width: 0; /* Prevents flex children from overflowing */
}

#right {
    width: 29% !important;
    float: none !important;
    box-sizing: border-box;
    min-width: 0;
}

#sidebar {
    width: 100% !important;
    float: none !important;
}

.algnLog {
    padding: 15px 0 10px;
}

.algnLog img {
    max-height: 80px;
    width: auto;
}

/* Header Top Menu */
#menu-top_menu-new {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
    padding: 0;
    list-style: none;
}

#menu-top_menu-new li {
    list-style: none;
}

.orange-button,
.top-orange-button {
    display: inline-block;
    background: linear-gradient(180deg, #ff8c21 0%, #ff7000 100%);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 13px;
    padding: 7px 14px;
    border-radius: 4px;
    text-decoration: none !important;
    box-shadow: 0 2px 4px rgba(255, 112, 0, 0.25);
    transition: all 0.2s ease;
}

.orange-button:hover,
.top-orange-button:hover {
    background: linear-gradient(180deg, #ff7000 0%, #e65c00 100%);
    box-shadow: 0 3px 6px rgba(255, 112, 0, 0.35);
    transform: translateY(-1px);
}

/* Mobile Nav Toggle Button */
.defosert-mobile-nav-bar {
    display: none;
    margin: 10px 0;
}

.defosert-nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #ff7000;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    justify-content: center;
}

.defosert-hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.defosert-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
}

/* Main Navigation Bar */
#nav {
    border-radius: 6px;
    background-color: #ff7000 !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    margin: 10px 0 24px 0 !important;
}

#left #nav ul {
    display: flex;
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
}

#left #nav li {
    flex: 1;
    display: block;
    text-align: center;
    margin: 0;
    padding: 0;
}

#nav li a {
    display: block;
    padding: 13px 12px;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-decoration: none !important;
    transition: background-color 0.2s ease;
}

#nav li:hover,
#nav .current-menu-item,
#nav .current-post-ancestor {
    background-color: #e65c00 !important;
}

/* Sidebar Contact Block */
.sidebar_block {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.sidebar_block .side {
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 500;
}

.sidebar_block .side:first-child {
    font-weight: 700;
    color: #1e293b;
    font-size: 16px;
}

.sidebar_block .side a {
    color: #ff7000;
    font-weight: 600;
}

/* ==========================================================================
   3. Breadcrumbs
   ========================================================================== */
.defosert-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    margin: 10px 0 20px 0;
    padding: 8px 12px;
    background-color: #f8fafc;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
}

.defosert-breadcrumbs a {
    color: #64748b;
    text-decoration: none;
}

.defosert-breadcrumbs a:hover {
    color: #ff7000;
    text-decoration: underline;
}

.defosert-crumb-sep {
    color: #cbd5e1;
    user-select: none;
}

.defosert-crumb-current {
    color: #334155;
    font-weight: 600;
}

/* ==========================================================================
   4. Single Post & Article Styling
   ========================================================================== */
.defosert-single-article {
    margin-bottom: 30px;
}

.defosert-article-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.defosert-article-title {
    font-size: 28px;
    line-height: 1.35;
    color: #1e293b;
    font-weight: 700;
    margin: 0 0 14px 0;
}

.defosert-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #64748b;
}

.defosert-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.defosert-meta-item svg {
    color: #ff7000;
    flex-shrink: 0;
}

.defosert-meta-category a {
    color: #ff7000;
    font-weight: 600;
}

/* Table of Contents (TOC) */
.defosert-toc {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #ff7000;
    border-radius: 8px;
    padding: 18px 22px;
    margin: 24px 0 30px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.defosert-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.defosert-toc-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.defosert-toc-toggle-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.defosert-toc-toggle-btn:hover {
    color: #1e293b;
    border-color: #94a3b8;
}

.defosert-toc-list {
    margin: 0;
    padding-left: 20px;
    list-style: decimal;
}

.defosert-toc-list li {
    margin-bottom: 8px;
    list-style-type: decimal;
    font-size: 14px;
    line-height: 1.5;
}

.defosert-toc-list a {
    color: #334155;
    text-decoration: none;
    transition: color 0.15s ease;
}

.defosert-toc-list a:hover {
    color: #ff7000;
    text-decoration: underline;
}

.defosert-toc.is-collapsed .defosert-toc-list {
    display: none;
}

/* Content Typography */
.defosert-article-content {
    color: #334155;
    font-size: 15px;
    line-height: 1.75;
}

.defosert-article-content p {
    margin-bottom: 16px;
}

.defosert-article-content h2 {
    font-size: 22px;
    line-height: 1.35;
    color: #1e293b;
    font-weight: 700;
    margin: 32px 0 16px 0;
    padding-left: 12px;
    border-left: 4px solid #ff7000;
}

.defosert-article-content h3 {
    font-size: 19px;
    line-height: 1.4;
    color: #1e293b;
    font-weight: 600;
    margin: 24px 0 12px 0;
}

.defosert-article-content h4 {
    font-size: 16px;
    line-height: 1.4;
    color: #1e293b;
    font-weight: 600;
    margin: 20px 0 10px 0;
}

.defosert-article-content ul,
.defosert-article-content ol {
    margin: 16px 0 20px 24px;
    padding: 0;
}

.defosert-article-content ul li {
    list-style-type: disc;
    margin-bottom: 8px;
}

.defosert-article-content ol li {
    list-style-type: decimal;
    margin-bottom: 8px;
}

.defosert-article-content blockquote {
    background-color: #f8fafc;
    border-left: 4px solid #ff7000;
    margin: 20px 0;
    padding: 16px 20px;
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: #475569;
}

/* Responsive Table Wrapper */
.defosert-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 24px 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.defosert-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
    background-color: #ffffff;
}

.defosert-table-wrap th,
.defosert-table-wrap td {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.defosert-table-wrap th {
    background-color: #f1f5f9;
    color: #1e293b;
    font-weight: 700;
}

.defosert-table-wrap tr:nth-child(even) td {
    background-color: #f8fafc;
}

.defosert-edit-link {
    margin: 20px 0;
    font-size: 13px;
}

.defosert-edit-link a {
    color: #94a3b8;
}

/* ==========================================================================
   5. Expert Consultation Card
   ========================================================================== */
.defosert-expert-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #fff9f5 0%, #ffffff 100%);
    border: 1px solid #fed7aa;
    border-left: 5px solid #ff7000;
    border-radius: 8px;
    padding: 22px 24px;
    margin: 36px 0;
    box-shadow: 0 4px 12px rgba(255, 112, 0, 0.06);
}

.defosert-expert-avatar {
    flex-shrink: 0;
}

.defosert-expert-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #ffedd5;
    color: #ff7000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.defosert-expert-info {
    flex: 1;
    min-width: 0;
}

.defosert-expert-name {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
}

.defosert-expert-desc {
    font-size: 13.5px;
    color: #475569;
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.defosert-expert-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.defosert-expert-phone,
.defosert-expert-email {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #ff7000;
    text-decoration: none;
}

.defosert-expert-phone:hover,
.defosert-expert-email:hover {
    color: #e65c00;
    text-decoration: underline;
}

.defosert-expert-action {
    flex-shrink: 0;
}

.defosert-expert-btn {
    display: inline-block;
    background: linear-gradient(180deg, #ff8c21 0%, #ff7000 100%);
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    padding: 11px 20px;
    border-radius: 6px;
    text-decoration: none !important;
    box-shadow: 0 3px 8px rgba(255, 112, 0, 0.3);
    white-space: nowrap;
    transition: all 0.2s ease;
}

.defosert-expert-btn:hover {
    background: linear-gradient(180deg, #ff7000 0%, #e65c00 100%);
    box-shadow: 0 4px 12px rgba(255, 112, 0, 0.4);
    transform: translateY(-1px);
}

/* ==========================================================================
   6. Post Navigation (Prev / Next)
   ========================================================================== */
.defosert-post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 32px 0;
    padding: 16px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.defosert-post-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.defosert-post-nav-next {
    text-align: right;
}

.defosert-post-nav-label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.defosert-post-nav-item a {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.defosert-post-nav-item a:hover {
    color: #ff7000;
}

/* ==========================================================================
   7. Related Posts Grid
   ========================================================================== */
.defosert-related-posts {
    margin: 40px 0 20px 0;
}

.defosert-related-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 18px;
    position: relative;
    padding-bottom: 8px;
    border-bottom: 2px solid #ff7000;
    display: inline-block;
}

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

.defosert-related-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.defosert-related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.defosert-card-date {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    display: block;
}

.defosert-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.defosert-card-title a {
    color: #1e293b;
    text-decoration: none;
}

.defosert-card-title a:hover {
    color: #ff7000;
}

.defosert-card-excerpt {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 12px 0;
    flex: 1;
}

.defosert-card-link {
    font-size: 13px;
    font-weight: 600;
    color: #ff7000;
}

/* ==========================================================================
   8. Archive / Category Page Styling
   ========================================================================== */
.defosert-archive-wrapper {
    margin-bottom: 30px;
}

.defosert-archive-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #ff7000;
}

.defosert-archive-title {
    font-size: 26px;
    color: #1e293b;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.defosert-archive-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
}

.defosert-archive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.defosert-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.defosert-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.defosert-card-meta {
    display: flex;
    gap: 14px;
    font-size: 12.5px;
    color: #94a3b8;
    margin-bottom: 10px;
}

.defosert-card-date,
.defosert-card-reading {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.defosert-card-heading {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 10px 0;
}

.defosert-card-heading a {
    color: #1e293b;
    text-decoration: none;
}

.defosert-card-heading a:hover {
    color: #ff7000;
}

.defosert-card-summary {
    font-size: 14.5px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 14px;
}

.defosert-card-footer {
    display: flex;
    justify-content: flex-start;
}

.defosert-card-btn {
    display: inline-block;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #ff7000;
    font-size: 13.5px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 4px;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.defosert-card-btn:hover {
    background-color: #ff7000;
    border-color: #ff7000;
    color: #ffffff !important;
}

.defosert-pagination {
    margin: 30px 0;
    text-align: center;
}

.defosert-pagination .nav-links {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.defosert-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.defosert-pagination .page-numbers.current {
    background-color: #ff7000;
    border-color: #ff7000;
    color: #ffffff;
}

.defosert-pagination .page-numbers:hover:not(.current) {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #ff7000;
}

/* ==========================================================================
   9. Modern 4-Column Branded Footer
   ========================================================================== */
.defosert-footer {
    background-color: #1e293b;
    color: #94a3b8;
    margin-top: 50px;
    padding-top: 45px;
    font-size: 14px;
    line-height: 1.6;
    clear: both;
}

.defosert-footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px 36px 16px;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
    gap: 32px;
    box-sizing: border-box;
}

.defosert-footer-col {
    min-width: 0;
}

.defosert-footer-logo strong {
    font-size: 22px;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.defosert-footer-logo strong:hover {
    color: #ff7000;
}

.defosert-footer-desc {
    margin: 12px 0 16px 0;
    font-size: 13.5px;
    color: #94a3b8;
    line-height: 1.6;
}

.defosert-footer-copy {
    font-size: 12.5px;
    color: #64748b;
}

.defosert-footer-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 18px 0;
    position: relative;
    padding-bottom: 8px;
}

.defosert-footer-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 2px;
    background-color: #ff7000;
}

.defosert-footer-menu {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.defosert-footer-menu li {
    list-style: none !important;
    margin-bottom: 9px;
    padding: 0;
}

.defosert-footer-menu a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13.5px;
    transition: color 0.15s ease, padding-left 0.15s ease;
}

.defosert-footer-menu a:hover {
    color: #ff7000;
    text-decoration: none;
    padding-left: 3px;
}

.defosert-footer-contact-item {
    margin-bottom: 12px;
}

.defosert-contact-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.defosert-footer-phone {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff !important;
    text-decoration: none !important;
}

.defosert-footer-phone:hover {
    color: #ff7000 !important;
}

.defosert-footer-email {
    font-size: 14.5px;
    color: #ff7000;
    font-weight: 600;
    text-decoration: none;
}

.defosert-footer-email:hover {
    text-decoration: underline;
}

.defosert-footer-hours {
    font-size: 13.5px;
    color: #cbd5e1;
}

.defosert-footer-btn-wrap {
    margin-top: 16px;
}

.defosert-footer-cta-btn {
    display: inline-block;
    background: linear-gradient(180deg, #ff8c21 0%, #ff7000 100%);
    color: #ffffff !important;
    font-size: 13.5px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 4px;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(255, 112, 0, 0.3);
    transition: all 0.2s ease;
}

.defosert-footer-cta-btn:hover {
    background: linear-gradient(180deg, #ff7000 0%, #e65c00 100%);
    box-shadow: 0 3px 8px rgba(255, 112, 0, 0.4);
    transform: translateY(-1px);
}

.defosert-subfooter {
    background-color: #0f172a;
    border-top: 1px solid #334155;
    padding: 16px 0;
    font-size: 12px;
    color: #64748b;
}

.defosert-subfooter-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
    text-align: center;
}

.defosert-subfooter-inner p {
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   10. Media Queries / Mobile Responsiveness
   ========================================================================== */
@media (max-width: 1024px) {
    .defosert-footer-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }

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

@media (max-width: 860px) {
    #container {
        padding: 0 12px;
    }

    #main {
        flex-direction: column;
    }

    #left {
        width: 100% !important;
        float: none !important;
        order: 1; /* Main content displays first! */
    }

    #right {
        width: 100% !important;
        float: none !important;
        order: 2; /* Sidebar follows below content */
        margin-top: 30px;
    }

    .defosert-mobile-nav-bar {
        display: block;
    }

    #nav {
        display: none; /* Toggled via JS */
    }

    #nav.is-open {
        display: block;
    }

    #left #nav ul {
        flex-direction: column;
    }

    #left #nav li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }

    #left #nav li:last-child {
        border-bottom: none;
    }

    #nav li a {
        padding: 12px 16px;
        text-align: left;
    }

    .defosert-expert-box {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .defosert-expert-contacts {
        justify-content: center;
    }

    .defosert-expert-btn {
        width: 100%;
        box-sizing: border-box;
    }

    .defosert-article-title {
        font-size: 23px;
    }

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

    .defosert-post-nav {
        flex-direction: column;
        gap: 12px;
    }

    .defosert-post-nav-next {
        text-align: left;
    }
}

@media (max-width: 580px) {
    .defosert-footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .defosert-meta-bar {
        gap: 10px;
        font-size: 12px;
    }

    .defosert-article-title {
        font-size: 21px;
    }

    .defosert-article-content h2 {
        font-size: 19px;
    }
}
