/**
 * ARTICLE.CSS - Composants spécifiques aux articles
 *
 * Inclus automatiquement pour les pages avec ogType: article
 */

/* ==========================================================================
   ARTICLE HEADER (Hero Dark)
   Supports both naming conventions: BEM (article-header__*) and legacy (article-*)
   ========================================================================== */

.article-header {
    background: var(--oi-marine);
    color: var(--oi-albatre);
    padding: 120px 24px 60px;
    text-align: center;
}

.article-header-inner,
.article-header__inner {
    max-width: 720px;
    margin: 0 auto;
}

.article-breadcrumb {
    font-family: var(--font-h2);
    font-size: 0.75rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.article-breadcrumb a {
    color: var(--oi-albatre);
    text-decoration: none;
}

.article-breadcrumb a:hover {
    text-decoration: underline;
}

/* Tag row at top of header */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.article-tag {
    font-family: var(--font-h2);
    font-size: 0.65rem;
    text-transform: lowercase;
    letter-spacing: 0.05em;
    background: rgba(214, 247, 78, 0.2);
    color: var(--oi-chartreuse);
    padding: 4px 10px;
    border-radius: 3px;
}

/* Single tag line (BEM style) */
.article-header__tag {
    font-family: var(--font-h2);
    font-size: 0.75rem;
    text-transform: lowercase;
    letter-spacing: 0.1em;
    color: var(--oi-chartreuse);
    margin-bottom: 16px;
}

.article-title,
.article-header__title {
    font-family: var(--font-h1);
    font-size: clamp(2rem, 5vw, 2.75rem);
    line-height: 1.15;
    margin: 0 0 20px 0;
}

.article-excerpt,
.article-header__subtitle {
    font-size: 1.15rem;
    font-weight: 300;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

.article-info,
.article-header__meta {
    font-family: var(--font-h2);
    font-size: 0.7rem;
    opacity: 0.6;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==========================================================================
   TL;DR BOX
   ========================================================================== */

.tldr-box {
    background: linear-gradient(135deg, var(--oi-dragee) 0%, rgba(188, 228, 254, 0.6) 100%);
    border-radius: 12px;
    padding: 28px;
    margin: 32px 0;
    border-left: 4px solid var(--oi-marine);
}

.tldr-box h2 {
    font-family: var(--font-h2);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--oi-marine);
    margin: 0 0 16px 0;
}

.tldr-box p {
    margin-bottom: 16px;
}

.tldr-box p:last-child {
    margin-bottom: 0;
}

.tldr-box table {
    width: 100%;
    margin: 16px 0;
    font-size: 0.9rem;
}

.tldr-box ol, .tldr-box ul {
    margin: 12px 0;
    padding-left: 20px;
}

/* ==========================================================================
   ALERT BOXES (Warning, Danger, Success)
   ========================================================================== */

.warning-box,
.danger-box,
.success-box {
    padding: 20px 24px;
    border-radius: 8px;
    margin: 24px 0;
}

.warning-box {
    background: rgba(214, 247, 78, 0.15);
    border-left: 4px solid var(--oi-chartreuse);
}

.danger-box {
    background: rgba(211, 47, 47, 0.08);
    border-left: 4px solid var(--oi-rouge);
}

.success-box {
    background: rgba(0, 86, 27, 0.08);
    border-left: 4px solid var(--oi-empire);
}

.warning-box p:last-child,
.danger-box p:last-child,
.success-box p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   FAQ ITEMS
   ========================================================================== */

/* FAQ Section - Style original (_SITE) */
.faq-item {
    background: rgba(0, 86, 27, 0.03);
    border: 1px solid rgba(0, 86, 27, 0.1);
    padding: 24px;
    margin-bottom: 16px;
    border-radius: 8px;
}

.faq-question {
    font-family: var(--font-h1);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--oi-marine);
    margin-bottom: 8px;
}

.faq-answer {
    color: var(--oi-marine);
    opacity: 0.85;
    font-size: 0.95rem;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul, .faq-answer ol {
    margin: 12px 0;
    padding-left: 20px;
}

/* ==========================================================================
   CODE BLOCKS & SYNTAX HIGHLIGHTING
   ========================================================================== */

pre {
    background: var(--oi-marine);
    color: var(--oi-albatre);
    padding: 20px 24px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 24px 0;
}

code {
    font-family: 'Space Mono', monospace;
    font-size: 0.85em;
    background: rgba(27, 34, 44, 0.08);
    padding: 2px 6px;
    border-radius: 3px;
}

pre code {
    background: transparent;
    padding: 0;
}

/* Syntax highlighting */
.code-comment {
    color: #6a9955;
    font-style: italic;
}

.code-keyword {
    color: var(--oi-chartreuse);
}

.code-string {
    color: #ce9178;
}

.code-error {
    color: #f14c4c;
}

.code-success {
    color: #4ec9b0;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.95rem;
}

thead {
    background: var(--oi-marine);
    color: var(--oi-albatre);
}

th {
    font-family: var(--font-h2);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 16px;
    text-align: left;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(27, 34, 44, 0.1);
}

tbody tr:hover {
    background: rgba(188, 228, 254, 0.15);
}

/* ==========================================================================
   FIGURES & IMAGES
   ========================================================================== */

.article-figure {
    margin: 32px 0;
    text-align: center;
}

.article-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(27, 34, 44, 0.1);
}

.article-figure figcaption {
    font-family: var(--font-h2);
    font-size: 0.75rem;
    color: var(--oi-marine);
    opacity: 0.7;
    margin-top: 12px;
}

/* ==========================================================================
   CHECKLISTS
   ========================================================================== */

/* Checklist - Style original (_SITE) */
.checklist {
    list-style: none;
    padding: 24px;
    margin: 24px 0;
    background: rgba(0, 86, 27, 0.05);
    border-radius: 8px;
}

.checklist li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(27, 34, 44, 0.05);
}

.checklist li:last-child {
    border-bottom: none;
}

.checklist li::before {
    content: '☐';
    color: var(--oi-empire);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ==========================================================================
   TEMPLATE BOXES
   ========================================================================== */

.template-box {
    background: white;
    border: 1px solid rgba(27, 34, 44, 0.1);
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
}

.template-box h4 {
    font-family: var(--font-h2);
    font-size: 0.85rem;
    color: var(--oi-empire);
    margin: 0 0 16px 0;
}

.template-box pre {
    margin: 16px 0 0 0;
}

/* ==========================================================================
   PERFORMANCE CHARTS
   ========================================================================== */

.perf-chart {
    background: var(--oi-marine);
    color: var(--oi-albatre);
    padding: 24px;
    border-radius: 8px;
    margin: 24px 0;
}

.perf-chart-title {
    font-family: var(--font-h2);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--oi-chartreuse);
    margin-bottom: 20px;
}

.perf-bar {
    margin-bottom: 16px;
}

.perf-label {
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: block;
}

.perf-bar-fill {
    height: 24px;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.perf-bar-pip {
    background: var(--oi-rouge);
    width: 100%;
}

.perf-bar-uv {
    background: var(--oi-chartreuse);
    width: 4.8%; /* 5.3/111 */
}

.perf-result {
    font-family: var(--font-h2);
    font-size: 0.8rem;
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--oi-chartreuse);
}

/* ==========================================================================
   RESOURCES LIST
   ========================================================================== */

.resources-list {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}

.resources-list li {
    margin-bottom: 16px;
}

.resources-list a {
    font-weight: 600;
    color: var(--oi-empire);
    text-decoration: none;
}

.resources-list a:hover {
    text-decoration: underline;
}

.resource-desc {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 4px;
}

/* ==========================================================================
   MERMAID DIAGRAMS
   ========================================================================== */

.mermaid-wrapper {
    margin: 32px 0;
    overflow-x: auto;
}

.mermaid-wrapper pre.mermaid {
    background: transparent;
    padding: 0;
}

/* ==========================================================================
   RELATED ARTICLES
   ========================================================================== */

.related-articles {
    max-width: 720px;
    margin: 48px auto 0;
    padding: 32px 24px 0;
    border-top: 1px solid rgba(27, 34, 44, 0.1);
}

.related-title {
    font-family: var(--font-h2);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--oi-empire);
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    gap: 16px;
}

/* ==========================================================================
   RICH ARTICLE COMPONENTS (Capabilities, Profiles, Spectrum)
   Used in DORA reports and similar rich content articles
   ========================================================================== */

/* Table wrapper for overflow handling */
.table-wrapper {
    overflow-x: auto;
    margin: 24px 0;
}

/* Capabilities grid */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
}

.capability-card {
    background: var(--oi-albatre);
    border-radius: 8px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-icon {
    width: 24px;
    height: 24px;
    margin-top: auto;
    opacity: 0.4;
}

.card-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--oi-empire);
}

.card-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--oi-empire);
    color: var(--oi-chartreuse);
    font-family: var(--font-h2);
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-title {
    font-family: var(--font-h2);
    font-size: 0.6rem;
    text-transform: lowercase;
    color: var(--oi-empire);
    line-height: 1.3;
}

.card-desc {
    font-family: var(--font-body);
    font-size: 0.55rem;
    color: var(--oi-marine);
    opacity: 0.8;
    line-height: 1.4;
}

/* Bottom wrapper (for centered capability cards) */
.bottom-wrapper {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.bottom-wrapper .capability-card {
    flex: 0 1 calc(25% - 8px);
    min-width: 140px;
}

/* Profiles list (team profiles, user personas) */
.profiles-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.profile-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
}

.profile-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-h2);
    font-size: 0.6rem;
    flex-shrink: 0;
}

.profile-badge {
    font-family: var(--font-h2);
    font-size: 0.5rem;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: lowercase;
    flex-shrink: 0;
}

.profile-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-name {
    font-family: var(--font-h2);
    font-size: 0.65rem;
    text-transform: lowercase;
}

.profile-desc {
    font-family: var(--font-body);
    font-size: 0.55rem;
    color: var(--oi-albatre);
    opacity: 0.65;
}

/* Tier variations (top, mid, low) */
.profile-row.top-tier {
    background: rgba(214, 247, 78, 0.15);
    border-left: 3px solid var(--oi-chartreuse);
}

.top-tier .profile-number {
    background: var(--oi-chartreuse);
    color: var(--oi-marine);
}

.top-tier .profile-badge {
    background: var(--oi-chartreuse);
    color: var(--oi-marine);
}

.top-tier .profile-name {
    color: var(--oi-chartreuse);
}

.profile-row.mid-tier {
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.mid-tier .profile-number {
    background: rgba(255, 255, 255, 0.2);
    color: var(--oi-albatre);
}

.mid-tier .profile-badge {
    background: rgba(255, 255, 255, 0.15);
    color: var(--oi-albatre);
}

.mid-tier .profile-name {
    color: var(--oi-albatre);
}

.profile-row.low-tier {
    background: rgba(211, 47, 47, 0.1);
    border-left: 3px solid var(--oi-rouge);
}

.low-tier .profile-number {
    background: var(--oi-rouge);
    color: var(--oi-albatre);
}

.low-tier .profile-badge {
    background: var(--oi-rouge);
    color: var(--oi-albatre);
}

.low-tier .profile-name {
    color: var(--oi-rouge);
}

/* Spectrum bar (visual gradient indicator) */
.spectrum-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.spectrum-label {
    font-family: var(--font-h2);
    font-size: 0.5rem;
    text-transform: lowercase;
    opacity: 0.5;
    color: var(--oi-albatre);
}

/* Architecture diagrams (Traefik, infrastructure) */
.arch-container {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.arch-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.arch-source {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.arch-source-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(214, 247, 78, 0.15);
}

.arch-source-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--oi-chartreuse);
}

.arch-source-label {
    font-family: var(--font-h2);
    font-size: 0.6rem;
    text-transform: lowercase;
    color: var(--oi-albatre);
    opacity: 0.8;
}

.arch-traefik {
    flex: 1;
    padding: 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(214, 247, 78, 0.2);
}

.arch-traefik-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.arch-traefik-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--oi-chartreuse);
    display: flex;
    align-items: center;
    justify-content: center;
}

.arch-traefik-icon svg {
    width: 14px;
    height: 14px;
    stroke: var(--oi-marine);
}

.arch-traefik-label {
    font-family: var(--font-h2);
    font-size: 0.7rem;
    text-transform: lowercase;
    color: var(--oi-chartreuse);
}

.arch-routers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.arch-router {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
}

.arch-router.protected {
    border-left: 3px solid var(--oi-chartreuse);
}

.arch-router.public {
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.arch-router-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arch-router.protected .arch-router-icon {
    background: var(--oi-chartreuse);
}

.arch-router.protected .arch-router-icon svg {
    width: 12px;
    height: 12px;
    stroke: var(--oi-marine);
}

.arch-router.public .arch-router-icon {
    background: rgba(255, 255, 255, 0.15);
}

.arch-router.public .arch-router-icon svg {
    width: 12px;
    height: 12px;
    stroke: var(--oi-albatre);
}

.arch-router-info {
    flex: 1;
}

.arch-router-name {
    font-family: var(--font-h2);
    font-size: 0.65rem;
    color: var(--oi-albatre);
    margin-bottom: 2px;
}

.arch-router-rule {
    font-family: var(--font-body);
    font-size: 0.55rem;
    color: var(--oi-albatre);
    opacity: 0.6;
}

.arch-router-priority {
    font-family: var(--font-h2);
    font-size: 0.5rem;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(214, 247, 78, 0.2);
    color: var(--oi-chartreuse);
}

.arch-router.public .arch-router-priority {
    background: rgba(255, 255, 255, 0.1);
    color: var(--oi-albatre);
    opacity: 0.6;
}

.arch-arrow {
    display: flex;
    align-items: center;
    opacity: 0.4;
}

.arch-arrow svg {
    width: 24px;
    height: 24px;
    stroke: var(--oi-chartreuse);
}

.arch-backend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.arch-backend-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(214, 247, 78, 0.15);
    border: 1px solid rgba(214, 247, 78, 0.3);
}

.arch-backend-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--oi-chartreuse);
}

.arch-backend-label {
    font-family: var(--font-h2);
    font-size: 0.6rem;
    text-transform: lowercase;
    color: var(--oi-albatre);
}

/* Diagram wide variants */
.diagram.diagram-wide {
    max-width: 800px;
}

.diagram-inline--wide {
    max-width: var(--article-wide-width, 900px);
    margin-left: calc((var(--article-max-width, 720px) - var(--article-wide-width, 900px)) / 2);
    margin-right: calc((var(--article-max-width, 720px) - var(--article-wide-width, 900px)) / 2);
}

@media (min-width: 640px) {
    .related-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.related-card {
    display: block;
    padding: 20px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: var(--oi-marine);
    border-left: 3px solid var(--oi-empire);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 34, 44, 0.1);
}

.related-card h4 {
    font-family: var(--font-h2);
    font-size: 0.9rem;
    margin: 0 0 8px 0;
}

.related-card p {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.8;
}

/* ==========================================================================
   ARTICLE SOURCES (Footer)
   ========================================================================== */

.article-sources {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    text-align: center;
}

.article-sources__title {
    font-family: var(--font-h2);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--oi-marine);
    opacity: 0.5;
    margin-bottom: 16px;
}

.article-sources__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-sources__item {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--oi-marine);
    opacity: 0.7;
}

.article-sources__item a {
    color: var(--oi-empire);
    text-decoration: none;
}

.article-sources__item a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 640px) {
    .article-header {
        padding: 100px 20px 40px;
    }

    .article-content {
        padding: 32px 20px 48px;
    }

    .tldr-box,
    .warning-box,
    .danger-box,
    .success-box {
        padding: 20px;
    }

    pre {
        padding: 16px;
        font-size: 0.8rem;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 10px 12px;
    }

    /* Rich components responsive */
    .capabilities-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bottom-wrapper .capability-card {
        flex: 0 1 calc(50% - 5px);
        min-width: 120px;
    }

    .diagram-inline--wide {
        margin-left: -20px;
        margin-right: -20px;
    }
}
