/* === Guía pedagógica El Cortafuegos === */

.cfg-wrap {
    --cfg-blue: #0F4F88;
    --cfg-blue-d: #0a3a66;
    --cfg-yellow: #EFAB22;
    --cfg-yellow-d: #c98d10;
    --cfg-purple: #2D1A6E;
    --cfg-cream: #F7F3E8;
    --cfg-text: #1f2937;
    --cfg-muted: #5b6470;
    --cfg-card-bg: #ffffff;
    --cfg-soft: #f1f5f9;
    --cfg-radius: 18px;

    color: var(--cfg-text);
    line-height: 1.6;
    font-size: 16px;
}
.cfg-wrap *,
.cfg-wrap *::before,
.cfg-wrap *::after { box-sizing: border-box; min-width: 0; }
.cfg-wrap img { max-width: 100%; height: auto; }

/* === HERO (transparente sobre el bg full-screen del page) === */
.cfg-hero {
    position: relative;
    padding: 80px 24px 50px;
    color: #fff;
    text-align: center;
    margin-bottom: 28px;
}
.cfg-hero-eyebrow {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(15, 79, 136, .85);
    color: var(--cfg-yellow);
    font-size: 13px; font-weight: 800;
    letter-spacing: 2px; text-transform: uppercase;
    border: 1.5px solid var(--cfg-yellow);
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.cfg-wrap .cfg-hero h1.cfg-hero-title,
.cfg-wrap .cfg-hero-title {
    font-size: clamp(32px, 5vw, 54px);
    font-weight: 900; line-height: 1.1;
    margin: 0 0 18px;
    color: #EFAB22 !important;
    text-shadow: 0 3px 14px rgba(0,0,0,.55), 0 0 2px rgba(0,0,0,.4);
}
.cfg-hero-subtitle {
    font-size: clamp(15px, 1.6vw, 18px);
    max-width: 720px; margin: 0 auto 24px;
    color: #f7f3e8;
    line-height: 1.55;
}
.cfg-hero-meta {
    display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
}
.cfg-hero-meta span {
    background: rgba(15, 79, 136, .85);
    border: 1.5px solid var(--cfg-yellow);
    color: #fff;
    padding: 8px 16px; border-radius: 999px;
    font-size: 14px; font-weight: 700;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* === LAYOUT === */
.cfg-layout {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 36px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px 80px;
}
@media (max-width: 980px) {
    .cfg-layout { grid-template-columns: 1fr; gap: 16px; }
}

/* === TOC === */
.cfg-toc {
    position: sticky;
    top: 110px;
    align-self: start;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--cfg-radius);
    padding: 18px 14px;
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
    border: 1.5px solid rgba(255,255,255,.4);
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}
.cfg-toc-title {
    margin: 0 0 12px;
    font-size: 12px; font-weight: 800;
    letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--cfg-blue);
    padding: 0 8px;
}
.cfg-toc ol {
    list-style: none;
    counter-reset: cfg-toc;
    margin: 0; padding: 0;
}
.cfg-toc li {
    counter-increment: cfg-toc;
    margin: 0;
}
.cfg-toc a,
.cfg-toc a:hover,
.cfg-toc a:focus,
.cfg-toc a:visited {
    display: block;
    padding: 9px 12px 9px 38px;
    color: var(--cfg-text);
    text-decoration: none !important;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.35;
    position: relative;
    transition: all .15s ease;
    font-weight: 500;
    box-shadow: none;
}
.cfg-toc a::before {
    content: counter(cfg-toc, decimal-leading-zero);
    position: absolute;
    left: 10px; top: 9px;
    color: var(--cfg-muted);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
}
.cfg-toc a:hover { background: var(--cfg-soft); color: var(--cfg-blue); }
.cfg-toc a.cfg-active {
    background: var(--cfg-blue);
    color: #fff; font-weight: 700;
}
.cfg-toc a.cfg-active::before { color: var(--cfg-yellow); }

.cfg-toc-toggle {
    display: none !important;
    width: 100%;
    background: var(--cfg-blue);
    color: #fff;
    border: 0;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px; font-weight: 700;
    cursor: pointer;
    text-align: left;
}
@media (max-width: 980px) {
    .cfg-toc {
        position: static;
        padding: 10px;
        max-height: none;
    }
    .cfg-toc-toggle { display: block !important; }
    .cfg-toc-title, .cfg-toc nav { display: none; }
    .cfg-toc.cfg-toc-open .cfg-toc-title,
    .cfg-toc.cfg-toc-open nav { display: block; margin-top: 10px; }
}

/* === SECTIONS === */
.cfg-section {
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--cfg-radius);
    padding: 36px 32px;
    margin-bottom: 28px;
    box-shadow: 0 6px 28px rgba(0,0,0,.18);
    border: 1.5px solid rgba(255,255,255,.4);
    scroll-margin-top: 110px;
}
@media (max-width: 600px) { .cfg-section { padding: 24px 20px; } }
.cfg-section h2 {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 900;
    color: var(--cfg-blue);
    margin: 0 0 6px;
    line-height: 1.2;
}
.cfg-section .cfg-num {
    display: inline-block;
    color: var(--cfg-yellow);
    font-size: 13px; font-weight: 800;
    letter-spacing: 2px; text-transform: uppercase;
    margin-bottom: 8px;
}
.cfg-section h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--cfg-blue);
    margin: 24px 0 10px;
}
.cfg-section p { margin: 0 0 12px; }
.cfg-section a { color: var(--cfg-blue); font-weight: 700; }
.cfg-section ul, .cfg-section ol { padding-left: 22px; margin: 0 0 12px; }
.cfg-section li { margin: 6px 0; }
.cfg-section strong { color: var(--cfg-blue); }

/* Highlight callout */
.cfg-callout {
    margin: 16px 0;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(239,171,34,.10), rgba(239,171,34,.04));
    border-left: 4px solid var(--cfg-yellow);
    border-radius: 10px;
}
.cfg-callout strong { color: var(--cfg-purple); }
.cfg-callout-purple {
    background: linear-gradient(135deg, rgba(45,26,110,.06), rgba(45,26,110,.02));
    border-left-color: var(--cfg-purple);
}

/* === Cards grids === */
.cfg-grid {
    display: grid;
    gap: 16px;
    margin: 16px 0;
}
.cfg-grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cfg-grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cfg-card {
    background: var(--cfg-soft);
    border-radius: 14px;
    padding: 18px 18px 16px;
    border: 1.5px solid #d8e2ee;
}
.cfg-card-icon {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 8px;
    display: block;
}
.cfg-card h4 {
    margin: 0 0 6px;
    color: var(--cfg-blue);
    font-size: 16px;
    font-weight: 800;
}
.cfg-card p {
    margin: 0;
    font-size: 14px;
    color: var(--cfg-muted);
    line-height: 1.5;
}

/* === Calendario === */
.cfg-cal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.cfg-cal-item {
    background: var(--cfg-blue);
    color: #fff;
    border-radius: 14px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}
.cfg-cal-item::before {
    content: ""; position: absolute;
    inset: auto -20px -20px auto;
    width: 80px; height: 80px;
    background: var(--cfg-yellow);
    border-radius: 50%;
    opacity: .25;
}
.cfg-cal-date {
    color: var(--cfg-yellow);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.cfg-cal-text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

/* === Premios === */
.cfg-premios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 16px 0;
}
.cfg-premio {
    background: linear-gradient(135deg, var(--cfg-yellow), #f5c356);
    color: var(--cfg-blue-d);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
}
.cfg-premio-icon { font-size: 36px; margin-bottom: 8px; }
.cfg-premio strong { display: block; font-size: 15px; margin-bottom: 4px; color: var(--cfg-blue-d); }
.cfg-premio span { font-size: 13px; line-height: 1.4; display: block; }

/* === 7 Consejos === */
.cfg-roadmap {
    counter-reset: cfg-step;
    margin: 16px 0;
    display: grid;
    gap: 12px;
}
.cfg-step {
    counter-increment: cfg-step;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 14px 16px;
    background: var(--cfg-soft);
    border-radius: 12px;
    border-left: 4px solid var(--cfg-blue);
}
.cfg-step::before {
    content: counter(cfg-step);
    flex-shrink: 0;
    width: 36px; height: 36px;
    background: var(--cfg-blue);
    color: var(--cfg-yellow);
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 900;
    font-size: 16px;
}
.cfg-step-body { flex: 1; }
.cfg-step-title {
    font-weight: 800;
    color: var(--cfg-blue);
    margin: 0 0 2px;
    font-size: 15px;
}
.cfg-step-time {
    background: var(--cfg-yellow);
    color: var(--cfg-blue-d);
    font-size: 11px; font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
}
.cfg-step-desc {
    margin: 4px 0 0;
    color: var(--cfg-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Tarjetas de cada consejo */
.cfg-tip {
    border-radius: var(--cfg-radius);
    border: 1.5px solid #e3e9f1;
    background: #fff;
    margin: 14px 0;
    overflow: hidden;
    transition: box-shadow .2s;
}
.cfg-tip[open] { box-shadow: 0 6px 24px rgba(15,79,136,.15); }
.cfg-tip-summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: background .15s;
}
.cfg-tip-summary::-webkit-details-marker { display: none; }
.cfg-tip-summary:hover { background: var(--cfg-soft); }
.cfg-tip-thumb {
    flex-shrink: 0;
    width: 64px; height: 64px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--cfg-yellow);
    background-color: var(--cfg-soft);
}
.cfg-tip-info { flex: 1; min-width: 0; }
.cfg-tip-num {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--cfg-yellow);
    text-transform: uppercase;
}
.cfg-tip-name {
    margin: 2px 0 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--cfg-blue);
    line-height: 1.25;
}
.cfg-tip-tagline {
    margin: 4px 0 0;
    font-style: italic;
    color: var(--cfg-muted);
    font-size: 13px;
}
.cfg-tip-arrow {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--cfg-blue);
    color: var(--cfg-yellow);
    display: grid; place-items: center;
    font-size: 18px;
    transition: transform .25s;
}
.cfg-tip[open] .cfg-tip-arrow { transform: rotate(180deg); }
.cfg-tip-body {
    padding: 0 18px 18px 96px;
    border-top: 1px solid #e3e9f1;
}
@media (max-width: 600px) {
    .cfg-tip-body { padding-left: 18px; }
    .cfg-tip-thumb { width: 48px; height: 48px; }
    .cfg-tip-name { font-size: 15px; }
}
.cfg-tip-key {
    background: linear-gradient(135deg, rgba(239,171,34,.14), rgba(239,171,34,.04));
    border-left: 3px solid var(--cfg-yellow);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 14px 0;
    font-size: 14px;
}
.cfg-tip-key strong { color: var(--cfg-purple); }
.cfg-tip-block { margin-top: 14px; }
.cfg-tip-block h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 800;
    color: var(--cfg-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cfg-tip-block ul { padding-left: 18px; margin: 0; }
.cfg-tip-block li { font-size: 14px; margin: 4px 0; }

/* === Tabla ciclos === */
.cfg-table-wrap { overflow-x: auto; margin: 14px 0; }
.cfg-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    min-width: 640px;
}
.cfg-table thead th {
    background: var(--cfg-blue);
    color: #fff;
    padding: 14px 12px;
    text-align: left;
    font-weight: 800;
    border-bottom: 3px solid var(--cfg-yellow);
}
.cfg-table thead th:first-child { border-top-left-radius: 12px; }
.cfg-table thead th:last-child { border-top-right-radius: 12px; }
.cfg-table tbody th {
    background: var(--cfg-soft);
    font-weight: 700;
    color: var(--cfg-blue);
    text-align: left;
    padding: 12px;
    width: 22%;
    vertical-align: top;
}
.cfg-table tbody td {
    padding: 12px;
    vertical-align: top;
    border-bottom: 1px solid #e3e9f1;
    background: #fff;
}
.cfg-table tbody tr:last-child td,
.cfg-table tbody tr:last-child th { border-bottom: 0; }
.cfg-table tbody tr:last-child th:first-child { border-bottom-left-radius: 12px; }
.cfg-table tbody tr:last-child td:last-child { border-bottom-right-radius: 12px; }

/* === Glosario === */
.cfg-glossary-search {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d8e2ee;
    border-radius: 12px;
    font-size: 15px;
    margin-bottom: 14px;
    background: var(--cfg-soft);
    transition: border-color .15s, background .15s;
}
.cfg-glossary-search:focus {
    outline: none;
    border-color: var(--cfg-yellow);
    background: #fff;
}
.cfg-glossary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}
.cfg-term {
    background: var(--cfg-soft);
    padding: 14px 16px;
    border-radius: 12px;
    border: 1.5px solid #d8e2ee;
}
.cfg-term.cfg-hidden { display: none; }
.cfg-term dt {
    font-weight: 800;
    color: var(--cfg-blue);
    margin-bottom: 4px;
    font-size: 15px;
}
.cfg-term dd {
    margin: 0;
    color: var(--cfg-text);
    font-size: 14px;
    line-height: 1.5;
}
.cfg-glossary-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    color: var(--cfg-muted);
    font-style: italic;
}

/* === Sección familias (mismo estilo que las demás) === */
.cfg-section-family {
    border-left: 6px solid var(--cfg-yellow);
}

/* === Recursos === */
.cfg-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 12px 0;
}
.cfg-link-card {
    background: var(--cfg-soft);
    padding: 14px 16px;
    border-radius: 12px;
    border: 1.5px solid #d8e2ee;
    text-decoration: none !important;
    color: var(--cfg-blue) !important;
    font-weight: 700;
    transition: transform .12s, box-shadow .15s;
    display: flex; align-items: center; gap: 10px;
}
.cfg-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15,79,136,.18);
}

/* === LOMLOE chips === */
.cfg-chips {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 10px 0 16px;
}
.cfg-chip {
    background: var(--cfg-soft);
    color: var(--cfg-blue);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px; font-weight: 600;
    border: 1.5px solid #d8e2ee;
}

/* Print friendly hide */
@media print { .cfg-toc, .cfg-toc-toggle { display: none; } }

/* === Mobile overflow fixes === */
@media (max-width: 980px) {
    .cfg-layout { padding: 0 14px 60px; }
    .cfg-hero { padding: 50px 16px 30px; }
    .cfg-section { padding: 22px 18px; }
    .cfg-section h2,
    .cfg-section h3,
    .cfg-section p,
    .cfg-section li,
    .cfg-tip-name,
    .cfg-hero-title,
    .cfg-hero-subtitle {
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
    }
    .cfg-grid-2,
    .cfg-grid-3,
    .cfg-cal,
    .cfg-premios,
    .cfg-glossary,
    .cfg-links { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .cfg-layout { padding: 0 10px 50px; gap: 14px; }
    .cfg-hero { padding: 40px 12px 24px; }
    .cfg-section { padding: 18px 14px; border-radius: 14px; }
    .cfg-toc { padding: 8px; }
    .cfg-tip-summary { padding: 12px 14px; gap: 10px; }
    .cfg-tip-body { padding: 0 14px 14px; }
    .cfg-step { padding: 12px 14px; gap: 12px; }
    .cfg-step::before { width: 30px; height: 30px; font-size: 14px; }
    .cfg-card { padding: 14px; }
    .cfg-cal-item, .cfg-premio { padding: 14px; }
}
