/* 120mAGL Aviation-Themed Markdown Content Styles */

/* Article Layout */
.article-content {
    max-width: 100%;
}

.article-title {
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #0066cc;
    padding-bottom: 1rem;
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #34495e;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Markdown Headers with Aviation Icons */
.article-body .content-h1 {
    color: #2c3e50;
    font-size: 2.2rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #0066cc;
    padding-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.article-body .content-h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.article-body .content-h3 {
    color: #34495e;
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.article-body .content-h4 {
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
}

.article-body .content-h5 {
    color: #5a6c7d;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
}

.article-body .content-h6 {
    color: #6c757d;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
}

/* Paragraphs */
.article-body .content-p {
    margin-bottom: 1.5rem;
    text-align: justify;
    text-indent: 0;
}

/* Text Formatting */
.article-body .content-bold {
    color: #2c3e50;
    font-weight: 600;
}

.article-body .content-italic {
    font-style: italic;
    color: #5a6c7d;
}

.article-body .content-code {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #e83e8c;
}

/* Lists with Aviation Theme */
.article-body .content-ul {
    margin-bottom: 1.5rem;
    padding-left: 0;
}

.article-body .content-ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    counter-reset: aviation-counter;
    list-style: none; /* Prevent default browser numbering */
}

.article-body .content-li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
}

.article-body .content-oli {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    counter-increment: aviation-counter;
    position: relative;
}

.article-body .content-oli::before {
    content: counter(aviation-counter) ".";
    color: #0066cc;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Blockquotes for Regulations */
.article-body .content-blockquote {
    background-color: #f8f9fa;
    border-left: 4px solid #0066cc;
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
    font-style: italic;
    color: #495057;
    border-radius: 0 0.375rem 0.375rem 0;
}

.article-body .content-blockquote::before {
    content: "";
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%230066cc' viewBox='0 0 16 16'%3e%3cpath d='M12 12a1 1 0 0 0 1-1V8.558a1 1 0 0 0-1-1h-1.388c0-.351.021-.703.062-1.054.062-.372.166-.703.31-.992.145-.29.331-.517.559-.683.227-.186.516-.279.868-.279V3c-.579 0-1.085.124-1.52.372a3.322 3.322 0 0 0-1.085.992 4.92 4.92 0 0 0-.62 1.458A7.712 7.712 0 0 0 9 7.558V11a1 1 0 0 0 1 1h2Zm-6 0a1 1 0 0 0 1-1V8.558a1 1 0 0 0-1-1H4.612c0-.351.021-.703.062-1.054.062-.372.166-.703.31-.992.145-.29.331-.517.559-.683.227-.186.516-.279.868-.279V3c-.579 0-1.085.124-1.52.372a3.322 3.322 0 0 0-1.085.992 4.92 4.92 0 0 0-.62 1.458A7.712 7.712 0 0 0 3 7.558V11a1 1 0 0 0 1 1h2Z'/%3e%3c/svg%3e");
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 1rem;
}

/* Horizontal Rules */
.article-body .content-hr {
    border: 0;
    border-top: 2px solid #dee2e6;
    margin: 2rem 0;
    opacity: 1;
}

.article-body .content-hr.my-4 {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Links */
.article-body .content-link {
    color: #0066cc;
    text-decoration: none;
    border-bottom: 1px dotted #0066cc;
    transition: all 0.3s ease;
}

.article-body .content-link:hover {
    color: #004499;
    border-bottom: 1px solid #004499;
    text-decoration: none;
}

/* Article Meta */
.article-meta {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.article-footer {
    border-top: 2px solid #e9ecef;
    padding-top: 2rem;
    margin-top: 3rem;
}

/* Aviation-themed enhancements */
.article-body .content-h1 i,
.article-body .content-h2 i,
.article-body .content-h3 i,
.article-body .content-h4 i,
.article-body .content-h5 i,
.article-body .content-h6 i {
    color: #0066cc;
    margin-right: 0.5rem;
    font-size: 0.8em;
}

/* Table Styles */
.content-table {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    border-collapse: collapse;
    width: 100%;
}

/* Use true dark header with high contrast white text */
.content-table thead {
    background-color: #000000; /* black background */
    color: #ffffff;            /* white text */
}

.content-table thead th {
    padding: 0.75rem 1rem;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid #222; /* subtle separator for dark header */
    white-space: nowrap;
    color: #ffffff; /* ensure white text even if Bootstrap overrides */
}

/* Ensure bold text in header stays white (avoid blue on black) */
.content-table thead strong { color: #ffffff !important; }

/* Make strong text inherit outside header to fix contrast issues */
.content-table strong {
    color: inherit; /* previously forced dark blue - now inherit for better contrast */
    font-weight: 600;
}

.content-table tbody tr {
    transition: background-color 0.2s ease;
}

.content-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.04); /* subtle hover on light background */
}

.content-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
    color: #222; /* ensure good contrast on light rows */
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f6f8fa; /* higher contrast than previous very light blue tint */
}

.content-table em {
    font-style: italic;
    color: #555;
}

.content-table code {
    background-color: #f5f5f5;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.875em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .article-title {
        font-size: 1.8rem;
    }
    
    .article-body .content-h1 {
        font-size: 1.8rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .article-body .content-h2 {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .article-body .content-h3 {
        font-size: 1.3rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .article-body .content-h4 {
        font-size: 1.1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .article-body .content-h5 {
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .article-body .content-h6 {
        font-size: 0.9rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .article-body {
        font-size: 1rem;
    }
    .content-table {
        font-size: 0.875rem;
    }
    .content-table thead th,
    .content-table tbody td {
        padding: 0.5rem 0.75rem;
    }
}

/* Print Styles */
@media print {
    .article-body .content-h1,
    .article-body .content-h2,
    .article-body .content-h3,
    .article-body .content-h4,
    .article-body .content-h5,
    .article-body .content-h6 {
        color: black;
        border-bottom: 1px solid black;
    }
    
    .article-body .content-link {
        color: black;
        border-bottom: none;
    }
    
    .article-body .content-link::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    .table-responsive { overflow: visible; }
    .content-table { page-break-inside: avoid; }
}

/* Hover Effects */
.card:hover {
    transform: translateY(-3px);
    transition: transform 0.3s ease;
    box-shadow: 0 0.5rem 1rem rgba(0, 102, 204, 0.15);
}

/* Badge Styling */
.badge {
    font-size: 0.85em;
}

/* Ensure topic-colored badges always have white text */
.badge[class*="topic-"] {
    color: #ffffff !important;
}

/* Alert Enhancements */
.alert {
    border-radius: 0.5rem;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
}

/* Button Styling */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
}

.btn-outline-primary:hover {
    background-color: #0066cc;
    border-color: #0066cc;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* -------------------------------------------------- */
/* Dark Theme Accessibility Enhancements    */
/* Apply by adding .dark-theme to <body> or wrapper   */
/* -------------------------------------------------- */
.dark-theme {
    background-color: #12181f;
    color: #e2e8f0;
}
.dark-theme .article-body { color: #dce4ec; }
.dark-theme .article-title { color: #f1f5f9; border-color: #0d6efd; }
.dark-theme a { color: #4dabf7; }
.dark-theme a:hover { color: #82cfff; }

/* Cards - Enhanced contrast for dark theme */
.dark-theme .card { background-color: #1e262e; border-color: #2c3a47; color: #e2e8f0; }
.dark-theme .card-header.bg-primary { background-color: #0a4c87 !important; }

/* Ensure ALL card titles have high contrast white text in dark theme */
.dark-theme .card-title,
.dark-theme .card-title a,
.dark-theme .card-body h1,
.dark-theme .card-body h2,
.dark-theme .card-body h3,
.dark-theme .card-body h4,
.dark-theme .card-body h5,
.dark-theme .card-body h6 { 
    color: #f8fafc !important; 
}

/* Ensure card text has good contrast */
.dark-theme .card-text { color: #dce4ec; }
.dark-theme .card-text.small { color: #cbd5e1; }
.dark-theme .card-meta { border-top-color: #2c3a47; }
.dark-theme .hover-card:hover { box-shadow: 0 0.75rem 1.25rem rgba(0,0,0,0.5); }

/* Badges */
.dark-theme .badge.bg-secondary { background-color: #334155 !important; color: #f1f5f9; }
.dark-theme .badge.bg-light { background-color: #2b3640 !important; color: #e2e8f0; border-color: #3b4a56; }
.dark-theme .badge.bg-primary { background-color: #0d6efd !important; color: #ffffff; }

/* Pagination */
.dark-theme .pagination .page-link { background-color: #1e262e; border-color: #2c3a47; color: #4dabf7; }
.dark-theme .pagination .page-link:hover { background-color: #27323c; color: #82cfff; }
.dark-theme .pagination .page-item.active .page-link { background-color: #0066cc; border-color: #0066cc; color: #ffffff; }

/* Breadcrumbs & Meta */
.dark-theme .breadcrumb { background: transparent; }
.dark-theme .breadcrumb-item a { color: #4dabf7; }
.dark-theme .breadcrumb-item.active { color: #94a3b8; }
.dark-theme small.text-muted, .dark-theme .text-muted { color: #94a3b8 !important; }

/* Alerts */
.dark-theme .alert-info { background-color: rgba(13,202,240,0.15); color: #cce9f3; }
.dark-theme .alert-warning { background-color: rgba(255,193,7,0.15); color: #ffe8b3; }
.dark-theme .alert { border-color: #2c3a47; }

/* Table */
.dark-theme .content-table thead { background-color: #0f172a; }
.dark-theme .content-table thead th { border-color: #1e293b; color: #f1f5f9; }
.dark-theme .content-table tbody td { background-color: #1e262e; border-color: #2c3a47; color: #e2e8f0; }
.dark-theme .content-table tbody tr:hover { background-color: #27323c; }
.dark-theme .table-striped tbody tr:nth-of-type(odd) { background-color: #222c35; }
.dark-theme .content-table code { background-color: #27323c; color: #f8fafc; }

/* Markdown headers in dark */
.dark-theme .article-body .content-h1,
.dark-theme .article-body .content-h2,
.dark-theme .article-body .content-h3,
.dark-theme .article-body .content-h4,
.dark-theme .article-body .content-h5,
.dark-theme .article-body .content-h6 { color: #f1f5f9; border-color: #1e293b; }
.dark-theme .article-body .content-h1 i,
.dark-theme .article-body .content-h2 i,
.dark-theme .article-body .content-h3 i,
.dark-theme .article-body .content-h4 i,
.dark-theme .article-body .content-h5 i,
.dark-theme .article-body .content-h6 i { color: #4dabf7; }

/* Links inside article body */
.dark-theme .article-body .content-link { color: #4dabf7; border-bottom-color: #4dabf7; }
.dark-theme .article-body .content-link:hover { color: #82cfff; border-bottom-color: #82cfff; }

/* Blockquote dark */
.dark-theme .article-body .content-blockquote { background-color: #1e262e; color: #cbd5e1; border-left-color: #4dabf7; }

/* Horizontal rules dark */
.dark-theme .article-body .content-hr {
    border-top-color: #2c3a47;
}

/* Code inline dark */
.dark-theme .article-body .content-code { background-color: #222c35; border-color: #2c3a47; color: #ffb4e6; }

/* Buttons */
.dark-theme .btn-outline-primary { color: #4dabf7; border-color: #4dabf7; }
.dark-theme .btn-outline-primary:hover { background-color: #0066cc; color: #ffffff; }
.dark-theme .btn-outline-secondary { color: #94a3b8; border-color: #3b4a56; }
.dark-theme .btn-outline-secondary:hover { background-color: #334155; color: #ffffff; }
.dark-theme .btn-primary { background-color: #0066cc; border-color: #0066cc; }
.dark-theme .btn-primary:hover { background-color: #0a74d1; }

/* Improve focus outline contrast */
.dark-theme a:focus, .dark-theme button:focus, .dark-theme .btn:focus {
    outline: 2px solid #82cfff;
    outline-offset: 2px;
}

/* Accessibility contrast for card title in light theme as well */
.card-title a { color: #1a1f24; }
.card-title a:hover { color: #004499; }



/* -------------------------------------------------- */
/* High Contrast for Card Headers with Dark Backgrounds */
/* Ensures white text on colored card headers          */
/* -------------------------------------------------- */

/* For all card headers with background colors */
.card-header[class*="bg-"],
.card-header[class*="topic-"],
.card-header.bg-primary,
.card-header.bg-secondary,
.card-header.bg-success,
.card-header.bg-danger,
.card-header.bg-warning,
.card-header.bg-info,
.card-header.bg-dark {
    color: #ffffff !important;
}

/* Ensure all text inside colored card headers is white */
.card-header[class*="bg-"] *,
.card-header[class*="topic-"] *,
.card-header.bg-primary *,
.card-header.bg-secondary *,
.card-header.bg-success *,
.card-header.bg-danger *,
.card-header.bg-warning *,
.card-header.bg-info *,
.card-header.bg-dark * {
    color: #ffffff !important;
}

/* Specifically for card titles inside headers with dark backgrounds */
.card-header[class*="bg-"] .card-title,
.card-header[class*="bg-"] .card-title a,
.card-header[class*="topic-"] .card-title,
.card-header[class*="topic-"] .card-title a {
    color: #ffffff !important;
}

/* Card body text when card has colored background */
.card[class*="bg-"] .card-body,
.card.bg-dark .card-body,
.card.bg-primary .card-body,
.card.bg-secondary .card-body {
    color: #ffffff;
}

.card[class*="bg-"] .card-title,
.card.bg-dark .card-title,
.card.bg-primary .card-title,
.card.bg-secondary .card-title {
    color: #ffffff !important;
}

.card[class*="bg-"] .card-text,
.card.bg-dark .card-text,
.card.bg-primary .card-text,
.card.bg-secondary .card-text {
    color: rgba(255, 255, 255, 0.9);
}

/* For cards with dark topic colors */
.card.topic-regulations .card-body,
.card.topic-airspace .card-body,
.card.topic-incident .card-body {
    color: #f8fafc;
}

.card.topic-regulations .card-title,
.card.topic-airspace .card-title,
.card.topic-incident .card-title {
    color: #ffffff !important;
}