/*!
 * Knowledge Base Custom Styles
 * Brutal Domains - Knowledge Base Pages
 * Version: 1.0.9
 */

/* Article Summary Section (Ahrefs-style) */
.article-summary-section {
    margin-bottom: 3rem;
}

.article-summary-section .card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.article-summary-section h2 {
    color: #344767;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.article-summary-section .card-body {
    color: #000000;
}

.article-summary-section .card-body p,
.article-summary-section .card-body li,
.article-summary-section .card-body ul,
.article-summary-section .card-body ol {
    color: #000000 !important;
}

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

.summary-list li {
    padding: 1rem 0;
    padding-left: 1.75rem;
    position: relative;
    color: #344767;
    line-height: 1.7;
    font-size: 1rem;
    font-weight: 400;
}

.summary-list li strong {
    color: #344767;
    font-weight: 600;
}

.summary-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #cb0c9f;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.5;
}

.summary-list li:not(:last-child) {
    border-bottom: 1px solid #f1f3f5;
}

/* Article Content Section */
.article-content-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
}

/* Ahrefs-style Breadcrumbs */
.breadcrumb-wrapper {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 768px) {
    .breadcrumb-wrapper {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

.breadcrumb-ahrefs-style {
    text-align: left;
}

.breadcrumb-ahrefs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.breadcrumb-ahrefs li {
    display: inline-flex;
    align-items: center;
}

.breadcrumb-ahrefs a {
    color: #67748e;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.breadcrumb-ahrefs a:hover {
    color: #344767;
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #adb5bd;
    font-size: 0.9rem;
    margin: 0 0.25rem;
}

.breadcrumb-current {
    color: #344767;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Breadcrumb styling - always dark text now since moved below hero */
.breadcrumb-ahrefs a {
    color: #67748e;
}

.breadcrumb-ahrefs a:hover {
    color: #344767;
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #adb5bd;
}

.breadcrumb-current {
    color: #344767;
}

/* Hero Section - Compact Ahrefs-style */
header .page-header {
    padding-top: 8rem !important; /* Space for navigation bar (my-3 + navbar height + margin) */
    padding-bottom: 2rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    color: #344767;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #000000 !important;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    header .page-header {
        padding-top: 5rem !important; /* Less padding on mobile */
        padding-bottom: 1rem !important;
    }
    
    header .page-header .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero-description {
        font-size: 0.95rem;
    }
    
    /* Reduce section padding on mobile */
    section.py-7 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* Aggressively reduce container padding on mobile for article pages */
    main section .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Remove row gutter padding on mobile */
    main section .row {
        margin-left: -0.75rem !important;
        margin-right: -0.75rem !important;
    }
    
    main section .row > * {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Make content column full width on mobile */
    main section .col-lg-9 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    /* Align breadcrumbs with card content on mobile - match card-body p-3 */
    .breadcrumb-wrapper {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Reduce spacing in article content on mobile */
    .article-content-section {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }
    
    /* Reduce article summary section margin */
    .article-summary-section {
        margin-bottom: 1rem;
    }
}

/* Knowledge Base Sidebar */
.knowledge-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.knowledge-sidebar .nav-link {
    color: #67748e;
    padding: 0.5rem 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.knowledge-sidebar .nav-link:hover,
.knowledge-sidebar .nav-link.active {
    color: #344767;
    background-color: #f8f9fa;
    border-left-color: #344767;
}

/* Article Content Styling */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #000000 !important;
}

.article-content p,
.article-content div,
.article-content span:not(.text-primary):not(.text-success):not(.text-danger):not(.text-warning):not(.text-info) {
    color: #000000 !important;
}

.article-content a {
    color: #0d6efd !important; /* Keep links blue */
}

.article-content a.text-primary {
    color: #0d6efd !important; /* Keep primary links blue */
}

.article-content strong,
.article-content b {
    color: #000000 !important;
    font-weight: 600;
}

.article-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: #344767;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #344767;
}

.article-content p {
    margin-bottom: 1.5rem;
    color: #000000 !important;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    color: #000000 !important;
}

.article-content li {
    margin-bottom: 0.75rem;
    color: #000000 !important;
}

/* Ensure card body text is black */
.card-body {
    color: #000000;
}

.card-body .article-content,
.card-body .article-content p,
.card-body .article-content li,
.card-body .article-content ul,
.card-body .article-content ol,
.card-body p:not(.text-muted):not(.text-white),
.card-body div:not(.text-muted):not(.text-white),
.card-body span:not(.text-muted):not(.text-white):not(.text-primary):not(.text-success) {
    color: #000000 !important;
}

/* Table of Contents */
.table-of-contents {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 3rem;
}

.table-of-contents h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #344767;
}

.table-of-contents ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
}

.table-of-contents a {
    color: #67748e;
    text-decoration: none;
    transition: color 0.2s;
}

.table-of-contents a:hover {
    color: #344767;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

.article-content h2,
.article-content h3 {
    scroll-margin-top: 100px;
}

/* Scroll Indicator for Knowledge Base Articles */
header .page-header .scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3;
}

header .page-header .scroll-indicator .mouse {
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    position: relative;
    margin-bottom: 10px;
}

header .page-header[style*="background-image"] .scroll-indicator .mouse {
    border-color: rgba(255, 255, 255, 0.8);
}

header .page-header:not([style*="background-image"]) .scroll-indicator .mouse {
    border-color: rgba(52, 71, 103, 0.6);
}

header .page-header .scroll-indicator .wheel {
    width: 3px;
    height: 8px;
    background: #fff;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: mouseWheel 1.5s infinite;
}

header .page-header[style*="background-image"] .scroll-indicator .wheel {
    background: #fff;
}

header .page-header:not([style*="background-image"]) .scroll-indicator .wheel {
    background: #344767;
}

header .page-header .scroll-indicator .arrow-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 20px;
    animation: arrowBounce 1.5s infinite;
}

header .page-header .scroll-indicator .arrow {
    display: block;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-left: 0;
    border-top: 0;
    transform: rotate(45deg);
}

header .page-header[style*="background-image"] .scroll-indicator .arrow {
    border-color: rgba(255, 255, 255, 0.8);
}

header .page-header:not([style*="background-image"]) .scroll-indicator .arrow {
    border-color: rgba(52, 71, 103, 0.6);
}

@keyframes mouseWheel {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

@keyframes arrowBounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Hide scroll indicator on very short screens */
@media (max-height: 600px) {
    header .page-header .scroll-indicator {
        display: none;
    }
}

@media (max-width: 768px) {
    header .page-header .scroll-indicator {
        bottom: 20px;
    }
    
    header .page-header .scroll-indicator .mouse {
        width: 24px;
        height: 40px;
    }
}

/* Article Cards (Index Page) - Simplified Ahrefs-style */
.article-card-simple {
    height: 100%;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    color: #000000;
}

.article-card-simple .text-muted {
    color: #000000 !important;
}

.article-card-simple:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #dee2e6;
    transform: translateY(-2px);
}

.article-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.article-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card-simple:hover .article-card-image img {
    transform: scale(1.05);
}

.article-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    color: #000000;
}

.article-card-content p,
.article-card-content * {
    color: #000000 !important;
}

.article-card-content .article-card-title {
    color: #344767 !important; /* Keep titles dark blue-grey for contrast */
}

.article-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #344767;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    transition: color 0.2s;
}

.article-card-simple:hover .article-card-title {
    color: #cb0c9f;
}

.article-card-description {
    font-size: 0.95rem;
    color: #000000 !important;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

/* Override text-muted in article cards */
.article-card-simple .text-muted,
.article-card-content .text-muted,
.article-card-description.text-muted {
    color: #000000 !important;
}

/* Fallback for cards without images - handled in template */
.article-card-simple .article-card-content {
    min-height: 120px;
}

@media (max-width: 768px) {
    .article-card-image {
        height: 160px;
    }
    
    .article-card-content {
        padding: 1.25rem;
    }
    
    .article-card-title {
        font-size: 1.1rem;
    }
    
    .article-card-description {
        font-size: 0.9rem;
    }
    
    /* Reduce padding on mobile for article pages */
    .article-summary-section .card-body {
        padding: 1rem !important;
    }
    
    .article-content-section .card-body {
        padding: 1rem !important;
    }
    
    .table-of-contents {
        padding: 1rem !important;
        margin-bottom: 1rem;
    }
    
    .table-of-contents h4 {
        margin-bottom: 0.5rem !important;
        font-size: 0.95rem;
    }
    
    .summary-list li {
        padding: 0.5rem 0;
        padding-left: 1.25rem;
        font-size: 0.95rem;
    }
    
    .article-content h2 {
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        margin-top: 1.25rem;
        margin-bottom: 0.5rem;
        font-size: 1.15rem;
    }
    
    .article-content p {
        margin-bottom: 0.75rem;
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .article-content ul,
    .article-content ol {
        margin-bottom: 0.75rem;
        padding-left: 1.25rem;
    }
    
    .article-content li {
        margin-bottom: 0.4rem;
        font-size: 1rem;
        line-height: 1.6;
    }
    
    /* Reduce card border radius on mobile */
    .card {
        border-radius: 6px !important;
    }
}
