/* ============================================================
   CIBERAULA — Artículos divulgativos de Linux
   Hoja de estilos compartida para /articulo/
   Archivo: articulo/assets/css/estilos_articulo.css
   Versión: 1.0 — 26 febrero 2026, 18:00 CET
   Derivado de: estilos_linux.css (curso)
   Metodología: BEM (Block__Element--Modifier)
   ============================================================ */

:root {
    --color-primary: #1B5E20;
    --color-primary-light: #388E3C;
    --color-primary-dark: #0D3B12;
    --color-accent: #FF6D00;
    --color-accent-hover: #FF8F00;
    --bg-page: #ECEEF1;
    --bg-content: #FFFFFF;
    --bg-sidebar: #0F172A;
    --bg-sidebar-hover: #1E293B;
    --bg-code: #0F172A;
    --bg-banner: linear-gradient(135deg, #0D3B12 0%, #1B5E20 50%, #2E7D32 100%);
    --text-primary: #1A1A2E;
    --text-secondary: #4A5568;
    --text-muted: #718096;
    --text-sidebar: #CBD5E1;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
    --sidebar-width: 300px;
    --content-max: 1160px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --note-info-bg: #EBF5FB; --note-info-border: #2980B9;
    --note-tip-bg: #E8F8F5; --note-tip-border: #27AE60;
    --note-warn-bg: #FEF9E7; --note-warn-border: #F39C12;
}
[data-theme="dark"] {
    --bg-page: #0B0F1A;
    --bg-content: #151B2B;
    --text-primary: #E2E8F0;
    --text-secondary: #A0AEC0;
    --text-muted: #718096;
    --note-info-bg: #1A2744; --note-tip-bg: #1A3328; --note-warn-bg: #2D2A1A;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: 15.5px;
    line-height: 1.55;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-light); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* === TOP BANNER FUNDAE === */
.top-banner { background: var(--bg-banner); color: white; padding: 8px 24px; max-width: var(--content-max); margin: 0 auto; }
.top-banner__content { display: flex; align-items: center; gap: 12px; justify-content: center; flex-wrap: wrap; font-size: 13px; }
.top-banner__tag { background: rgba(255,255,255,0.2); padding: 2px 10px; border-radius: 12px; font-weight: 700; font-size: 11px; letter-spacing: 0.5px; }
.top-banner__text { font-weight: 500; }
.top-banner__link { color: #FFD54F; font-weight: 700; }
.top-banner__link:hover { color: white; text-decoration: underline; }

/* === LAYOUT PRINCIPAL === */
.page-wrapper {
    max-width: var(--content-max);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    min-height: 100vh;
    background: var(--bg-content);
    box-shadow: 0 0 40px rgba(0,0,0,0.06);
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width); min-width: var(--sidebar-width);
    background: var(--bg-sidebar); color: var(--text-sidebar);
    position: sticky; top: 0; height: 100vh; overflow: hidden;
    display: flex; flex-direction: column;
}
.sidebar__logo-block { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar__logo-img {
    width: 100%; max-width: 268px; height: auto; border-radius: 10px;
    background: white; padding: 10px 16px; margin: 0 auto; display: block;
}
.sidebar__course-info { padding: 14px 20px 10px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar__course-title { font-size: 20px; font-weight: 800; color: white; line-height: 1.2; }
.sidebar__course-title span { display: block; font-size: 11px; font-weight: 500; color: var(--text-sidebar); margin-top: 4px; letter-spacing: 1px; text-transform: uppercase; }
.sidebar__nav { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 0; }
.sidebar__module { border-bottom: 1px solid rgba(255,255,255,0.04); }
.sidebar__module-header {
    display: flex; align-items: center; gap: 10px; padding: 10px 20px;
    cursor: pointer; transition: background 0.15s; font-size: 13px; font-weight: 600;
    color: var(--text-sidebar); user-select: none; background: none; border: none; width: 100%; text-align: left;
}
.sidebar__module-header:hover { background: var(--bg-sidebar-hover); }
.sidebar__module-icon { width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.sidebar__module-chevron { margin-left: auto; font-size: 10px; transition: transform 0.2s; color: var(--text-muted); }
.sidebar__module.is-open .sidebar__module-chevron { transform: rotate(90deg); }
.sidebar__lesson-list { display: none; padding: 0 0 6px; }
.sidebar__module.is-open .sidebar__lesson-list { display: block; }
.sidebar__lesson { display: block; padding: 5px 20px 5px 56px; font-size: 12.5px; color: var(--text-sidebar); transition: all 0.15s; line-height: 1.35; }
.sidebar__lesson:hover { background: var(--bg-sidebar-hover); color: white; text-decoration: none; }
.sidebar__lesson.is-active { color: white; font-weight: 600; background: rgba(74, 222, 128, 0.1); border-left: 3px solid #4ADE80; padding-left: 53px; }
.sidebar__exercises { margin: 10px 16px; padding: 14px; background: linear-gradient(135deg, #065F46, #047857); border-radius: var(--radius); text-align: center; }
.sidebar__exercises-icon { font-size: 24px; margin-bottom: 4px; }
.sidebar__exercises-title { color: white; font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.sidebar__exercises-desc { color: rgba(255,255,255,0.75); font-size: 11.5px; }
.sidebar__separator { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 6px 20px; }
.sidebar__links { padding: 6px 20px 16px; }
.sidebar__links-heading { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.sidebar__link { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; color: var(--text-sidebar); transition: color 0.15s; }
.sidebar__link:hover { color: white; text-decoration: none; }


/* Sidebar section links (navegación interna del artículo) */
.sidebar__section-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    font-size: 13.5px; font-weight: 500;
    color: var(--text-sidebar);
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.sidebar__section-link:hover {
    background: var(--bg-sidebar-hover);
    color: white;
    text-decoration: none;
    border-left-color: rgba(74, 222, 128, 0.4);
}
.sidebar__section-link.is-active {
    color: white;
    font-weight: 700;
    background: rgba(74, 222, 128, 0.08);
    border-left-color: #4ADE80;
}
.sidebar__section-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    color: white;
}

/* === CONTENIDO === */
.content { flex: 1; min-width: 0; }
.breadcrumb { background: linear-gradient(135deg, #1B5E20, #2E7D32); padding: 12px 36px; font-size: 13px; color: rgba(255,255,255,0.7); }
.breadcrumb a { color: rgba(255,255,255,0.85); }
.breadcrumb a:hover { color: white; }
.breadcrumb__sep { margin: 0 8px; color: rgba(255,255,255,0.4); }
.content-header { background: linear-gradient(135deg, #E8F5E9, #C8E6C9); padding: 28px 36px 24px; border-bottom: 1px solid #A5D6A7; }
[data-theme="dark"] .content-header { background: linear-gradient(135deg, #1A3328, #0D3B12); border-bottom-color: #2E7D32; }
.content-header__title { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--color-primary-dark); line-height: 1.2; margin-bottom: 12px; }
[data-theme="dark"] .content-header__title { color: #A5D6A7; }
.content-header__meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-secondary); align-items: center; }
.content-header__meta-item { display: flex; align-items: center; gap: 4px; }
.content-header__stars { color: #F59E0B; letter-spacing: 1px; }

/* TOC */
.toc { background: var(--bg-content); border: 1px solid #E2E8F0; border-radius: var(--radius-lg); margin: 24px 36px; padding: 20px 24px; box-shadow: var(--shadow); }
[data-theme="dark"] .toc { background: #1E293B; border-color: #334155; }
.toc__title { font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.toc__list { list-style: none; counter-reset: toc; }
.toc__item { counter-increment: toc; }
.toc__item a {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 0; font-size: 13.5px; color: var(--text-secondary); transition: color 0.15s;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}
.toc__item a:hover { color: var(--color-primary); text-decoration: none; }
.toc__item a::before {
    content: counter(toc, decimal-leading-zero); font-size: 11px; font-weight: 700;
    color: var(--color-primary); background: #E8F5E9;
    width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
[data-theme="dark"] .toc__item a::before { background: #1A3328; }

/* Artículo */
.article { padding: 0 36px 36px; }
.article h2 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; color: var(--color-primary-dark); margin: 32px 0 14px; padding-top: 18px; border-top: 1px solid #E2E8F0; line-height: 1.3; }
[data-theme="dark"] .article h2 { color: #81C784; border-top-color: #334155; }
.article h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 20px 0 10px; }
.article p { margin-bottom: 12px; color: var(--text-secondary); line-height: 1.5; }
.intro-text { font-size: 1.02rem; line-height: 1.6; color: var(--text-primary); }

/* Notas */
.note { padding: 14px 18px; border-radius: var(--radius); margin: 18px 0; border-left: 4px solid; font-size: 13.5px; line-height: 1.45; }
.note--info { background: var(--note-info-bg); border-color: var(--note-info-border); }
.note--tip { background: var(--note-tip-bg); border-color: var(--note-tip-border); }
.note--warn { background: var(--note-warn-bg); border-color: var(--note-warn-border); }
.note__title { font-weight: 700; margin-bottom: 4px; }

/* Tablas */
.table-responsive { overflow-x: auto; }
.info-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 13.5px; }
.info-table thead th { background: #F1F5F9; padding: 9px 12px; text-align: left; font-weight: 600; border-bottom: 2px solid #E2E8F0; color: var(--text-primary); }
[data-theme="dark"] .info-table thead th { background: #1E293B; border-bottom-color: #334155; }
.info-table tbody td { padding: 8px 12px; border-bottom: 1px solid #F1F5F9; color: var(--text-secondary); }
.info-table tbody tr:hover { background: #F8FAFC; }
[data-theme="dark"] .info-table tbody tr:hover { background: #1E293B; }

/* Figuras */
.article-figure { margin: 24px 0; text-align: center; }
.article-figure__img { max-width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0,0,0,0.10); }
.article-figure__caption { margin-top: 8px; font-size: 12.5px; color: var(--text-muted); font-style: italic; }
.article-figure--small .article-figure__img { max-width: 480px; }
.article-figure--medium .article-figure__img { max-width: 680px; }

/* === FICHAS DE MASCOTAS (específico de /articulo/) === */
.fauna-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 24px 0;
}
.fauna-card {
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--bg-content);
}
.fauna-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .fauna-card { border-color: #334155; }

/* Placeholder for cards without downloaded image */
.fauna-card__emoji-placeholder {
    font-size: 56px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.fauna-card__img-wrap {
    background: #FFFFFF;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}
[data-theme="dark"] .fauna-card__emoji-placeholder {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
[data-theme="dark"] .fauna-card__img-wrap { background: #1E293B; }
.fauna-card__img {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}
.fauna-card__body { padding: 14px 16px; }
.fauna-card__name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.fauna-card__project {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 6px;
}
.fauna-card__desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.fauna-card__meta {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.fauna-card__tag {
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #E8F5E9;
    color: #1B5E20;
    font-weight: 600;
}
[data-theme="dark"] .fauna-card__tag { background: #1A3328; color: #81C784; }
.fauna-card__tag--year { background: #EBF5FB; color: #2471A3; }
[data-theme="dark"] .fauna-card__tag--year { background: #1A2744; color: #85C1E9; }

/* Valoración bloque (footer del artículo) */
.valoracion-bloque {
    text-align: center;
    padding: 28px 36px;
    border-top: 1px solid #E2E8F0;
    margin-top: 24px;
}
[data-theme="dark"] .valoracion-bloque { border-top-color: #334155; }
.valoracion-bloque__titulo { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; color: var(--text-primary); }
.valoracion-bloque__estrellas { display: flex; justify-content: center; gap: 6px; }
.valoracion-estrella { font-size: 32px; cursor: pointer; color: #D1D5DB; transition: color 0.15s, transform 0.1s; }
.valoracion-estrella:hover { color: #F59E0B; transform: scale(1.15); }
.valoracion-bloque__msg { margin-top: 8px; font-size: 14px; color: #4ADE80; font-weight: 600; }

/* CTA Final */
.cta-final { background: linear-gradient(135deg, #0D3B12, #1B5E20); padding: 32px 36px; text-align: center; color: white; }
.cta-final__title { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.cta-final__text { font-size: 13.5px; color: rgba(255,255,255,0.8); margin-bottom: 16px; }
.cta-final__btn { display: inline-block; background: var(--color-accent); color: white; padding: 11px 30px; border-radius: 30px; font-weight: 700; font-size: 14px; transition: background 0.2s, transform 0.2s; }
.cta-final__btn:hover { background: var(--color-accent-hover); transform: translateY(-1px); text-decoration: none; color: white; }

/* Footer */
.site-footer { background: #0B0F1A; color: #64748B; padding: 18px 36px; display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.site-footer a { color: #94A3B8; }
.site-footer a:hover { color: white; }

/* Theme toggle */
.theme-toggle { position: fixed; bottom: 24px; right: 24px; width: 42px; height: 42px; border-radius: 50%; background: var(--bg-sidebar); color: white; border: none; font-size: 18px; cursor: pointer; box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center; z-index: 999; transition: background 0.2s; }
.theme-toggle:hover { background: var(--color-primary); }

/* Barra social */
.social-bar { position: fixed; left: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 99; }
.social-bar__btn { width: 34px; height: 34px; border-radius: 50%; background: white; border: 1px solid #E2E8F0; display: flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow); color: var(--text-secondary); }
.social-bar__btn:hover { background: var(--color-primary); color: white; border-color: var(--color-primary); }

/* Responsive */
@media (max-width: 991px) {
    .sidebar { display: none; }
    .page-wrapper { display: block; }
    .social-bar { display: none; }
    .article { padding: 0 18px 18px; }
    .toc { margin: 14px 18px; }
    .breadcrumb { padding: 10px 18px; }
    .content-header { padding: 20px 18px; }
    .cta-final { padding: 24px 18px; }
    .site-footer { padding: 14px 18px; flex-direction: column; gap: 6px; text-align: center; }
    .fauna-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
    .valoracion-bloque { padding: 20px 18px; }
}
@media (max-width: 575px) {
    .content-header__title { font-size: 1.4rem; }
    .article h2 { font-size: 1.15rem; }
    .fauna-grid { grid-template-columns: 1fr; }
}
