/* =======================
   IMPORT FONTS
======================= */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Share+Tech+Mono&display=swap');

/* =======================
   VARIABLES
======================= */
:root {
    --cyan:        #00f2ff;
    --cyan-dim:    rgba(0, 242, 255, 0.18);
    --cyan-glow:   rgba(0, 242, 255, 0.45);
    --cyan-border: rgba(0, 242, 255, 0.25);
    --teal:        #00cfb4;
    --blue-deep:   #020c18;
    --blue-mid:    #041424;
    --blue-panel:  rgba(4, 20, 40, 0.88);
    --green-dl:    #00ff88;
    --green-ok:    rgba(0, 255, 136, 0.12);
    --red-err:     rgba(255, 60, 80, 0.12);
    --red-border:  rgba(255, 60, 80, 0.4);
    --text-body:   #a8dde9;
    --text-dim:    #4a7a8a;
    --font-hud:    'Share Tech Mono', monospace;
    --font-title:  'Orbitron', sans-serif;
}

/* =======================
   GLOBAL
======================= */
html { font-size: 17px; }

.news-container {
    font-family: var(--font-title);
    color: var(--cyan);
    width: 100%;
    box-sizing: border-box;
}

/* =======================
   BREADCRUMB
======================= */
.rn-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-hud);
    font-size: 0.7em;
    color: var(--text-dim);
    margin-bottom: 1.4rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.rn-breadcrumb a { color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.rn-breadcrumb a:hover { color: var(--cyan); }
.rn-breadcrumb .sep { opacity: 0.4; }
.rn-breadcrumb .current { color: var(--cyan); }

/* =======================
   ARTICLE
======================= */
.rn-article { margin-bottom: 2rem; }

.rn-header {
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    background: var(--blue-panel);
    border: 1px solid var(--cyan-border);
    border-radius: 4px 20px 4px 20px;
    box-shadow:
        0 0 0 1px rgba(0, 242, 255, 0.05),
        0 0 40px rgba(0, 242, 255, 0.06),
        inset 0 0 50px rgba(0, 20, 40, 0.5);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(6px);
}
.rn-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 242, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 255, 0.022) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}
.rn-header::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--teal), transparent);
    z-index: 1;
}
.rn-header > * { position: relative; z-index: 2; }
.rn-header h1 {
    font-family: var(--font-title);
    font-size: 1.15em;
    font-weight: 900;
    color: #e0f8ff;
    text-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
    margin: 0.5rem 0 1rem;
    line-height: 1.4;
    letter-spacing: 0.06em;
}

.rn-cat-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 242, 255, 0.07);
    border: 1px solid rgba(0, 242, 255, 0.28);
    border-radius: 999px;
    padding: 0.2rem 0.85rem;
    color: var(--cyan);
    font-family: var(--font-hud);
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: background 0.2s;
    margin-bottom: 0.75rem;
}
.rn-cat-badge:hover { background: rgba(0, 242, 255, 0.14); color: #fff; text-shadow: none; }

.rn-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
    align-items: center;
    font-family: var(--font-hud);
    font-size: 0.74em;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}
.rn-meta-item { display: flex; align-items: center; gap: 0.35rem; }
.rn-meta-item .val { color: var(--cyan); font-weight: 700; }
.rn-read-time { color: var(--text-dim); }

.rn-share {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 242, 255, 0.1);
    flex-wrap: wrap;
}
.rn-share span {
    font-family: var(--font-hud);
    font-size: 0.7em;
    color: var(--text-dim);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.rn-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 4px 10px 4px 10px;
    background: rgba(0, 10, 22, 0.8);
    border: 1px solid rgba(0, 242, 255, 0.2);
    color: var(--cyan);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.rn-share a:hover {
    background: rgba(0, 242, 255, 0.1);
    border-color: var(--cyan);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
    color: #fff;
    text-shadow: none;
}

.rn-body {
    background: rgba(25, 46, 71, 0.8);
    border: 1px solid rgba(0, 242, 255, 0.12);
    border-left: 3px solid var(--cyan);
    border-radius: 0 12px 12px 0;
    padding: 1.5rem 1.75rem;
    line-height: 1.9;
    font-family: var(--font-hud);
    font-size: 0.9em;
    color: var(--text-body);
}
.rn-body p  { margin: 0 0 1rem; }
.rn-body a  {
    color: var(--cyan);
    border-bottom: 1px solid rgba(0, 242, 255, 0.3);
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}
.rn-body a:hover { color: #fff; border-color: #fff; }
.rn-body img {
    max-width: 100%;
    border-radius: 4px 12px 4px 12px;
    border: 1px solid rgba(0, 242, 255, 0.2);
    margin: 0.75rem 0;
    cursor: zoom-in;
    transition: box-shadow 0.3s;
}
.rn-body img:hover { box-shadow: 0 0 24px rgba(0, 242, 255, 0.25); }
.rn-body h2, .rn-body h3 {
    color: var(--cyan);
    font-family: var(--font-title);
    letter-spacing: 0.08em;
    margin: 1.25rem 0 0.6rem;
}
.rn-body ul, .rn-body ol { margin: 0.5rem 0 1rem 1.5rem; color: var(--text-body); }
.rn-body li { margin-bottom: 0.4rem; }
.rn-body b, .rn-body strong { color: #e0f8ff; }
.rn-body i, .rn-body em { color: #7ecfea; }

.news-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    background: rgba(2, 12, 24, 0.8);
    border: 1px solid var(--cyan-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 14px rgba(0, 242, 255, 0.06);
}
.news-content thead th {
    padding: 10px 14px;
    background: rgba(0, 242, 255, 0.06);
    border-bottom: 1px solid var(--cyan-border);
    color: var(--cyan);
    font-family: var(--font-title);
    font-size: 0.68em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: left;
}
.news-content tbody td {
    padding: 9px 14px;
    border-bottom: 1px solid rgba(0, 242, 255, 0.06);
    color: var(--text-body);
    font-family: var(--font-hud);
    font-size: 0.84em;
}
.news-content tbody tr:hover td { background: rgba(0, 242, 255, 0.03); }
.news-content tbody tr:last-child td { border-bottom: none; }
.news-content tbody a { color: var(--cyan); font-weight: 700; text-decoration: none; }
.news-content tbody a:hover { color: #fff; text-shadow: 0 0 8px var(--cyan); }

/* =======================
   NAV PREV / NEXT
======================= */
.rn-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}
.rn-nav-card {
    background: rgba(2, 14, 28, 0.85);
    border: 1px solid rgba(0, 242, 255, 0.14);
    border-radius: 4px 14px 4px 14px;
    padding: 0.9rem 1.1rem;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    overflow: hidden;
}
.rn-nav-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(0, 242, 255, 0.04));
    opacity: 0;
    transition: opacity 0.2s;
}
.rn-nav-card:hover {
    border-color: rgba(0, 242, 255, 0.35);
    box-shadow: 0 0 18px rgba(0, 242, 255, 0.08);
    transform: translateY(-2px);
    text-shadow: none;
}
.rn-nav-card:hover::before { opacity: 1; }
.rn-nav-card.next { text-align: right; }
.rn-nav-card .dir {
    font-family: var(--font-hud);
    font-size: 0.65em;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.rn-nav-card .ttl {
    font-family: var(--font-hud);
    font-size: 0.8em;
    color: var(--cyan);
    line-height: 1.4;
}

/* =======================
   MESSAGE SUCCÈS
======================= */
.rn-success {
    background: var(--green-ok);
    border: 1px solid rgba(0, 255, 136, 0.35);
    border-left: 3px solid var(--green-dl);
    border-radius: 0 10px 10px 0;
    padding: 0.75rem 1rem;
    color: var(--green-dl);
    font-family: var(--font-hud);
    font-size: 0.84em;
    margin-bottom: 1.25rem;
    letter-spacing: 0.04em;
}

/* =======================
   SECTION COMMENTAIRES
======================= */
.rn-comments-section { margin-top: 1.75rem; }

.rn-section-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-title);
    font-size: 0.8em;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 1.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(0, 242, 255, 0.2);
    width: 100%;
}
.rn-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 242, 255, 0.2), transparent);
    margin-left: 8px;
}

/* =======================
   FORMULAIRE COMMENTAIRE
======================= */
.rn-form-block {
    background: var(--blue-panel);
    border: 1px solid var(--cyan-border);
    border-radius: 4px 16px 4px 16px;
    padding: 1.4rem 1.6rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(6px);
}
.rn-form-block::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 242, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 255, 0.018) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}
.rn-form-block > * { position: relative; z-index: 1; }

.rn-form-block h3 {
    font-family: var(--font-hud);
    font-size: 0.8em;
    color: var(--teal);
    letter-spacing: 0.08em;
    padding: 0 0 0.7rem;
    margin: 0 0 1.1rem;
    border-bottom: 1px solid rgba(0, 242, 255, 0.1);
    border-left: 2px solid var(--teal);
    padding-left: 10px;
}

.rn-field { margin-bottom: 1rem; }
.rn-field label {
    display: block;
    font-family: var(--font-hud);
    font-size: 0.98em;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
}
.rn-field small {
    display: block;
    font-family: var(--font-hud);
    font-size: 0.65em;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

.rn-form-block input[type="text"],
.rn-form-block input[type="email"],
.response-form input[type="text"],
.response-form input[type="email"] {
    width: 100%;
    background: rgba(0, 10, 22, 0.9);
    border: 1px solid rgba(0, 242, 255, 0.28);
    border-radius: 4px 10px 4px 10px;
    padding: 0.55rem 0.85rem;
    color: var(--cyan);
    font-family: var(--font-hud);
    font-size: 0.82em;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.rn-form-block input:focus,
.response-form input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px rgba(0, 242, 255, 0.12);
}

.rn-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.rn-char-counter {
    font-family: var(--font-hud);
    font-size: 0.66em;
    color: var(--text-dim);
    text-align: right;
    margin-top: 0.3rem;
}
.rn-char-counter.warn { color: #f59e0b; }
.rn-char-counter.over { color: #ef4444; }

.rn-submit {
    margin-top: 0.75rem;
    padding: 0.65rem 1.5rem;
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.1), rgba(0, 207, 180, 0.08));
    border: 1px solid var(--cyan-border);
    border-radius: 3px 12px 3px 12px;
    color: var(--cyan);
    font-family: var(--font-hud);
    font-size: 0.9em;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.2s ease;
}
.rn-submit:hover {
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.18), rgba(0, 207, 180, 0.14));
    border-color: var(--cyan);
    box-shadow: 0 0 16px rgba(0, 242, 255, 0.2);
    color: #fff;
}

.rn-errors {
    background: var(--red-err);
    border: 1px solid var(--red-border);
    border-left: 3px solid rgba(255, 60, 80, 0.8);
    border-radius: 0 10px 10px 0;
    padding: 0.65rem 1rem;
    color: #ff6680;
    font-family: var(--font-hud);
    font-size: 0.78em;
    margin-top: 0.75rem;
}
.rn-errors ul { margin: 0; padding-left: 1.2rem; }
.rn-errors li { margin-bottom: 0.25rem; }

/* =======================
   COMMENTAIRES
======================= */
.rn-comment {
    background: rgba(2, 14, 28, 0.8);
    border: 1px solid rgba(0, 242, 255, 0.1);
    border-left: 3px solid rgba(0, 242, 255, 0.3);
    border-radius: 0 12px 12px 0;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    transition: all 0.2s;
    animation: item-appear 0.35s ease both;
}
@keyframes item-appear {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}
.rn-comment:hover {
    border-left-color: var(--teal);
    border-color: rgba(0, 242, 255, 0.22);
    box-shadow: 0 0 16px rgba(0, 242, 255, 0.06);
}

.rn-comment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
    font-family: var(--font-hud);
    font-size: 0.74em;
    color: var(--text-dim);
    border-bottom: 1px solid rgba(0, 242, 255, 0.08);
    padding-bottom: 0.5rem;
}
.rn-comment-meta strong { color: var(--cyan); font-size: 0.9em; }
.rn-comment-meta time   { color: var(--text-dim); }

.rn-comment-body {
    font-family: var(--font-hud);
    font-size: 0.875em;
    line-height: 1.8;
    color: var(--text-body);
    margin-bottom: 0.75rem;
    word-break: break-word;
}
.rn-comment-body b, .rn-comment-body strong { color: #e0f8ff; }
.rn-comment-body i, .rn-comment-body em     { color: #7ecfea; }

.btn-reply {
    background: transparent;
    border: 1px solid rgba(0, 242, 255, 0.18);
    border-radius: 3px 8px 3px 8px;
    color: var(--text-dim);
    font-family: var(--font-hud);
    font-size: 0.68em;
    letter-spacing: 0.06em;
    padding: 0.28rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-reply:hover {
    background: rgba(0, 242, 255, 0.08);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 8px rgba(0, 242, 255, 0.12);
}

.rn-reply {
    background: rgba(2, 10, 20, 0.7);
    border: 1px solid rgba(0, 242, 255, 0.08);
    border-left: 2px solid rgba(0, 207, 180, 0.4);
    border-radius: 0 10px 10px 0;
    padding: 0.75rem 1rem;
    margin: 0.6rem 0 0 1.5rem;
    transition: border-color 0.2s;
}
.rn-reply:hover { border-left-color: var(--teal); }
.rn-reply .rn-comment-meta { font-size: 0.7em; }
.rn-reply .rn-comment-body { font-size: 0.84em; }

.response-form {
    background: rgba(2, 10, 20, 0.75);
    border: 1px solid rgba(0, 242, 255, 0.12);
    border-radius: 4px 12px 4px 12px;
    padding: 1rem 1.1rem;
    margin-top: 0.75rem;
}
.response-form .rn-submit { font-size: 0.74em; padding: 0.45rem 1rem; }

.rn-no-comments {
    text-align: center;
    color: var(--text-dim);
    font-family: var(--font-hud);
    font-size: 0.82em;
    letter-spacing: 0.08em;
    padding: 1.5rem;
    border: 1px dashed rgba(0, 242, 255, 0.12);
    border-radius: 8px;
}

/* =======================
   TOOLBAR WYSIWYG
======================= */
.wysiwyg-toolbar {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 8, 18, 0.9);
    border: 1px solid rgba(0, 242, 255, 0.18);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: 5px 8px;
    flex-wrap: wrap;
    position: relative;
}
.wysiwyg-toolbar button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px 6px 3px 6px;
    color: var(--text-body);
    cursor: pointer;
    font-family: var(--font-hud);
    font-size: 1.2em;
    padding: 3px 8px;
    transition: all 0.15s;
}
.wysiwyg-toolbar button:hover {
    background: rgba(0, 242, 255, 0.08);
    border-color: rgba(0, 242, 255, 0.25);
    color: var(--cyan);
}
.toolbar-sep {
    width: 1px;
    height: 18px;
    background: rgba(0, 242, 255, 0.15);
    margin: 0 4px;
    flex-shrink: 0;
}
.toolbar-color {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding: 3px 6px;
    border-radius: 3px 6px 3px 6px;
    border: 1px solid transparent;
    transition: background 0.15s;
}
.toolbar-color:hover {
    background: rgba(0, 242, 255, 0.08);
    border-color: rgba(0, 242, 255, 0.25);
}
.toolbar-color span {
    font-family: var(--font-hud);
    font-size: 0.82em;
    font-weight: 700;
    color: #eee;
    border-bottom: 3px solid #e8a000;
    line-height: 1.1;
    pointer-events: none;
}
.toolbar-color input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 100%; height: 100%;
    top: 0; left: 0;
    cursor: pointer;
    border: none; padding: 0;
}
.smiley-btn { font-size: 0.95em !important; }

/* Smiley picker : styles gérés en JS (picker global sur body) */

/* Éditeur contenteditable */
.wysiwyg-editor {
    min-height: 100px;
    background: rgba(0, 8, 18, 0.9);
    border: 1px solid rgba(0, 242, 255, 0.25);
    border-radius: 0 0 4px 10px;
    padding: 0.6rem 0.85rem;
    color: var(--text-body);
    font-family: var(--font-hud);
    font-size: 0.85em;
    line-height: 1.75;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.wysiwyg-editor:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px rgba(0, 242, 255, 0.1);
}

/* =======================
   RESPONSIVE
======================= */
@media (max-width: 768px) {
    .rn-header  { padding: 1.1rem 1.2rem; border-radius: 4px 14px 4px 14px; }
    .rn-header h1 { font-size: 0.95em; }
    .rn-body    { padding: 1.1rem 1.2rem; }
    .rn-form-block { padding: 1rem 1.1rem; }
    .rn-form-row { grid-template-columns: 1fr; }
    .rn-nav     { grid-template-columns: 1fr; }
    .rn-reply   { margin-left: 0.75rem; }
    .smiley-picker { width: 300px; }

    .news-content table,
    .news-content thead,
    .news-content tbody,
    .news-content th,
    .news-content td,
    .news-content tr { display: block; }
    .news-content thead { display: none; }
    .news-content tr {
        margin-bottom: 12px;
        border: 1px solid rgba(0, 242, 255, 0.12);
        border-left: 3px solid var(--cyan);
        border-radius: 0 8px 8px 0;
    }
    .news-content td {
        padding: 8px 12px;
        text-align: right;
        position: relative;
        border-bottom: 1px solid rgba(0, 242, 255, 0.06);
    }
    .news-content td::before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        color: var(--cyan);
        font-weight: 700;
        font-family: var(--font-hud);
        font-size: 0.8em;
    }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
