:root {
    --bg-soft: #f6f8fb;
    --surface: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --accent-soft: #dbeafe;
    --border-soft: #e5e7eb;
    --shadow-soft: 0 10px 30px rgba(17, 24, 39, 0.06);
    /* Area del editor (TinyMCE / RTE): referencia para futuros ajustes de layout */
    --rte-editor-max-height: min(58vh, 32rem);
}

body {
    background: var(--bg-soft);
    color: var(--text-main);
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
}

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

.brand-wrap h1 {
    letter-spacing: 0.2px;
}

.menu-section-btn {
    width: 100%;
    border: 0;
    background: #f8fafc;
    border-radius: 12px;
    color: var(--text-main);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 600;
    transition: all 0.22s ease;
    /* Bootstrap reboot centra texto en button; con titulos largos en varias lineas debe quedar a la izquierda */
    text-align: left;
}

/* Titulo del acordeon: ocupa el ancho disponible y alinea el texto a la izquierda al hacer wrap */
.menu-section-btn > span:first-child {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.menu-section-btn:hover {
    background: var(--accent-soft);
    color: #1e3a8a;
}

.menu-section-btn[aria-expanded="true"] .chevron {
    transform: rotate(45deg);
}

.menu-section-btn .chevron {
    flex-shrink: 0;
    font-size: 1.2rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.submenu-wrap {
    margin: 8px 0 0;
    padding-left: 8px;
}

.submenu-item {
    display: block;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 10px;
    padding: 9px 10px;
    margin: 2px 0;
    transition: all 0.2s ease;
}

.submenu-item:hover {
    color: var(--accent);
    background: #eff6ff;
    transform: translateX(3px);
}

.main-wrap {
    background: transparent;
    /* Permite que el panel principal crezca y haga scroll con la pagina (evita recortes en layouts flex) */
    min-width: 0;
}

.content-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 1.25rem;
}

.content-body {
    color: #374151;
    line-height: 1.65;
}

/* Imágenes desde TinyMCE suelen traer width/height fijos; limitar al ancho del contenedor en móvil */
.content-body img,
.content-body video {
    max-width: 100%;
    height: auto;
}

/* YouTube y otros embeds (TinyMCE media) */
.content-body iframe {
    max-width: 100%;
    border: 0;
}

.content-body iframe[src*="youtube.com"],
.content-body iframe[src*="youtube-nocookie.com"] {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

.content-body figure {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Contenedor del textarea antes de que TinyMCE lo sustituya; el iframe hereda height del init */
.tinymce-target {
    display: block;
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
}

/* Boton Guardar siempre accesible al hacer scroll (portal y formularios largos) */
.rte-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 1030;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.75rem 0;
    background: linear-gradient(to top, var(--surface) 55%, rgba(255, 255, 255, 0));
    border-top: 1px solid var(--border-soft);
}

.fade-in {
    animation: fadeIn 220ms ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Barra superior móvil + icono hamburguesa (portal) */
.portal-mobile-topbar {
    padding: 0.35rem 0;
}

.portal-menu-toggle {
    line-height: 1;
}

.portal-menu-bars,
.portal-menu-bars::before,
.portal-menu-bars::after {
    display: block;
    width: 1.25rem;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    position: relative;
}

.portal-menu-bars::before,
.portal-menu-bars::after {
    content: "";
    position: absolute;
    left: 0;
}

.portal-menu-bars::before {
    top: -7px;
}

.portal-menu-bars::after {
    top: 7px;
}

@media (max-width: 991.98px) {
    .sidebar.offcanvas-lg {
        border-right: 0;
    }
}

@media (min-width: 992px) {
    /* .offcanvas-lg pasa a flujo normal en lg+; altura con la fila */
    .sidebar.offcanvas-lg {
        min-height: min(100vh, 100%);
    }
}


