/* ╔════════════════════════════════════════════════════════════════════════════╗
   ║  _____                        __  __              ____ _            _     ║
   ║ |_   _| __ ___  _   ___   __ |  \/  | ___  _ __  / ___| | __ ___  _(_) ___ ║
   ║   | || '__/ _ \| | | \ \ / / | |\/| |/ _ \| '_ \| |   | |/ _` \ \/ / |/ _ \║
   ║   | || | | (_) | |_| |\ V /  | |  | | (_) | | | | |___| | (_| |>  <| |  __/║
   ║   |_||_|  \___/ \__,_| \_/   |_|  |_|\___/|_| |_|\____|_|\__,_/_/\_\_|\___|║
   ║                         ~ FindMyKeyboard.com ~                             ║
   ╚════════════════════════════════════════════════════════════════════════════╝

   @file      article.css
   @brief     Stylesheet for SEO article pages
   @version   1.6.0
   @created   1st March, 2026
   @updated   3rd March, 2026
*/

/* === Article pages — Variables de couleurs (identiques au site principal) === */
:root[data-theme="light"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #555555;
    --btn-primary-bg: #2563eb;
    --btn-primary-hover: #1d4ed8;
    --btn-primary-text: #ffffff;
    --btn-secondary-text: #1a1a2e;
    --btn-secondary-hover: rgba(255, 255, 255, 0.55);
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --option-hover: rgba(255, 255, 255, 0.55);
    --hint-color: #6b7280;
    --code-bg: #f1f5f9;
    --link-color: #2563eb;
    --link-hover: #1d4ed8;
    --table-stripe: #f8fafc;
    --table-border: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.3);
    --glass-border: rgba(255, 255, 255, 0.7);
    --glass-blur: 24px;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

:root[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --btn-primary-bg: #3b82f6;
    --btn-primary-hover: #2563eb;
    --btn-primary-text: #ffffff;
    --btn-secondary-text: #e2e8f0;
    --btn-secondary-hover: rgba(255, 255, 255, 0.14);
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: #1e293b;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --option-hover: rgba(255, 255, 255, 0.12);
    --hint-color: #94a3b8;
    --code-bg: #0f172a;
    --link-color: #60a5fa;
    --link-hover: #93bbfd;
    --table-stripe: #1e293b;
    --table-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-blur: 24px;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* === Reset & base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-y: auto;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* === Header article (glass-morphism) === */
.article-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.8);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.8);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.article-back {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.article-back:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.header-controls {
    display: flex;
    gap: 0.5rem;
}

.header-controls button {
    background: var(--glass-bg);
    color: var(--btn-secondary-text);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    box-shadow: var(--glass-shadow);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.header-controls button:hover {
    background: var(--btn-secondary-hover);
}

/* Language dropdown */
.lang-dropdown {
    position: relative;
}

.lang-toggle {
    background: var(--glass-bg);
    color: var(--btn-secondary-text);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    box-shadow: var(--glass-shadow);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.lang-toggle:hover {
    background: var(--btn-secondary-hover);
}

.lang-arrow {
    font-size: 0.65rem;
    opacity: 0.7;
}

.lang-flag {
    width: 18px;
    height: 13px;
    border-radius: 2px;
    flex-shrink: 0;
    display: block;
}

.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    z-index: 100;
    min-width: 100%;
}

.lang-menu.open {
    display: flex;
    flex-direction: column;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.lang-option:hover {
    background: var(--option-hover);
}

.lang-option.active {
    color: var(--btn-primary-bg);
}

/* Theme toggle icons (article) */
#theme-toggle-article .icon-dark {
    display: none;
}

:root[data-theme="dark"] #theme-toggle-article .icon-light {
    display: none;
}

:root[data-theme="dark"] #theme-toggle-article .icon-dark {
    display: inline;
}

/* === Contenu article === */
.article-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.article-content h1 {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.article-meta {
    color: var(--hint-color);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.article-content h2 {
    font-size: 1.45rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.article-content h3 {
    font-size: 1.15rem;
    margin-top: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.article-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.article-content ul,
.article-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.article-content li {
    margin-bottom: 0.4rem;
}

.article-content strong {
    color: var(--text-primary);
}

.article-content a {
    color: var(--link-color);
    text-decoration: none;
}

.article-content a:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

/* === Encadrés / info boxes === */
.info-box {
    background: var(--code-bg);
    border-left: 4px solid var(--btn-primary-bg);
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
    color: var(--text-secondary);
}

.info-box strong {
    color: var(--text-primary);
}

/* === Tableaux === */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.article-content th,
.article-content td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--table-border);
}

.article-content th {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-weight: 600;
}

.article-content tr:nth-child(even) {
    background: var(--table-stripe);
}

/* === Étapes (guides HowTo) === */
.step {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 1.25rem 0;
    box-shadow: var(--card-shadow);
}

.step-number {
    display: inline-block;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    text-align: center;
    line-height: 2rem;
    font-weight: 700;
    font-size: 0.95rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.step h3 {
    display: inline;
    margin: 0;
    vertical-align: middle;
}

.step p {
    margin-top: 0.6rem;
}

/* === Code inline === */
.article-content code {
    background: var(--code-bg);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
}

/* === Raccourci clavier === */
kbd {
    display: inline-block;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.1rem 0.5rem;
    font-size: 0.85em;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

/* === CTA === */
.cta-box {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    text-align: center;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    margin: 3rem 0 2rem;
}

.cta-box h2 {
    color: var(--btn-primary-text);
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.cta-box p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.25rem;
}

.cta-btn {
    display: inline-block;
    background: #ffffff;
    color: var(--btn-primary-bg);
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    color: var(--btn-primary-hover);
}

/* === Footer article === */
.article-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--hint-color);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

.article-footer a {
    color: var(--link-color);
    text-decoration: none;
}

.article-footer a:hover {
    text-decoration: underline;
}

/* === Articles liés === */
.related-articles {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.related-articles h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.related-articles ul {
    list-style: none;
    padding: 0;
}

.related-articles li {
    margin-bottom: 0.5rem;
}

.related-articles a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
}

.related-articles a:hover {
    text-decoration: underline;
}

/* === Cookie banner === */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
}

.cookie-banner p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 600px;
}

.cookie-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cookie-btn {
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}

.cookie-btn:hover {
    opacity: 0.85;
}

.cookie-accept {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.cookie-reject {
    background: var(--border-color);
    color: var(--text-primary);
}

/* === Responsive === */
@media (max-width: 600px) {
    .article-content {
        padding: 1.5rem 1rem 3rem;
    }

    .article-content h1 {
        font-size: 1.6rem;
    }

    .article-content h2 {
        font-size: 1.25rem;
    }

    .article-header {
        padding: 0.5rem 0.75rem;
    }

    .article-back {
        font-size: 0.85rem;
    }

    .cta-box {
        padding: 1.5rem 1rem;
    }

    .article-content table {
        font-size: 0.85rem;
    }

    .article-content th,
    .article-content td {
        padding: 0.5rem 0.6rem;
    }

    .cookie-banner {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .cookie-banner p {
        text-align: center;
        font-size: 0.8rem;
    }
}
