/* Estilos del sistema: cuentas, paneles y publicaciones.
   Se apoya en las variables y componentes de site.css. */

/* TOP BAR ACCOUNT LINKS */
.account-links {
    display: inline-flex;
    gap: 14px;
    margin-left: 10px;
    padding-left: 14px;
    border-left: 1px solid rgba(166, 25, 46, 0.35);
}

.account-links a {
    color: var(--gold-light);
    text-decoration: none;
    font-weight: 700;
}

.account-links a:hover {
    color: var(--gold-bright);
}

a.btn-gold, a.btn-outline {
    text-decoration: none;
}

/* ALERTS */
.alert {
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 0.92rem;
    font-weight: 600;
    border: 1px solid;
}

.alert-success { background: #ecfdf3; border-color: #86d9a5; color: #14532d; }
.alert-error   { background: #fdecee; border-color: var(--border-red); color: #8a0410; }
.alert-info    { background: #fff7e0; border-color: #c8a24a; color: #6b4e00; }

/* AUTH PAGES */
.auth-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 40px 34px;
    backdrop-filter: blur(12px);
}

.auth-card h1 {
    font-family: var(--font-display);
    color: var(--gold-accent);
    font-size: 1.7rem;
    text-align: center;
    margin-bottom: 6px;
}

.auth-card .auth-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 26px;
}

.auth-alt {
    text-align: center;
    margin-top: 22px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-alt a, .text-link {
    color: var(--gold-bright);
    font-weight: 700;
}

/* FORMS */
.field {
    margin-bottom: 18px;
}

.field label, .field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold-accent);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field .hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 5px;
}

.field .hint.over {
    color: var(--red-text);
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-small {
    padding: 8px 16px !important;
    font-size: 0.82rem !important;
}

.btn-danger {
    background: transparent;
    border: 1.5px solid var(--red);
    color: var(--red-text);
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

.inline-form {
    display: inline;
}

/* PANELS (USER & ADMIN) */
.panel-section {
    padding-top: 50px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.panel-head h1 {
    font-family: var(--font-display);
    color: var(--gold-accent);
    font-size: 1.9rem;
    line-height: 1.2;
}

.panel-head p {
    color: var(--text-muted);
}

.panel-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 26px;
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 12px;
}

.panel-tabs a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 20px;
}

.panel-tabs a.active, .panel-tabs a:hover {
    background: rgba(166, 25, 46, 0.14);
    color: var(--gold-bright);
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 22px;
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 20px;
    padding: 28px;
}

.panel-card h2 {
    font-family: var(--font-display);
    color: var(--gold-light);
    font-size: 1.3rem;
    margin-bottom: 18px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}

.stat {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 18px;
    padding: 20px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold-bright);
    line-height: 1.1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.meta-list {
    list-style: none;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.meta-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(166, 25, 46, 0.1);
}

.meta-list strong {
    color: var(--text-main);
}

/* TABLES */
.table-wrap {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 18px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th, .data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(166, 25, 46, 0.12);
    vertical-align: middle;
}

.data-table th {
    color: var(--gold-accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.data-table .thumb {
    width: 72px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-card);
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-published { background: #e8f7ee; color: #15803d; }
.badge-draft     { background: #f1eeee; color: #555052; }
.badge-scheduled               { background: #fff4d6; color: #8a6100; }

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
}

/* POST EDITOR */
.editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: start;
}

@media (max-width: 960px) {
    .editor-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.banner-preview {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-card);
    margin-bottom: 10px;
    background: var(--soft);
}

.button-row {
    display: grid;
    grid-template-columns: 1fr 1.6fr 120px auto auto;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-card);
    align-items: center;
}

@media (max-width: 700px) {
    .button-row {
        grid-template-columns: 1fr auto auto;
    }
    .button-row > input {
        grid-column: 1 / -1;
    }
}

.serp-preview {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    font-family: Arial, sans-serif;
    line-height: 1.4;
}

.serp-url   { color: #202124; font-size: 12px; overflow-wrap: anywhere; }
.serp-title { color: #1a0dab; font-size: 18px; margin: 3px 0; overflow-wrap: anywhere; }
.serp-desc  { color: #4d5156; font-size: 13px; overflow-wrap: anywhere; }

.checkbox-row {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* POST CARDS */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 26px;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 22px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.post-card-media img {
    display: block;
    width: 100%;
    aspect-ratio: 1.91 / 1;
    object-fit: cover;
}

.post-card-body {
    padding: 22px 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.post-card-body time {
    color: var(--gold-accent);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.post-card-body h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    line-height: 1.3;
}

.post-card-body h3 a {
    color: var(--text-main);
    text-decoration: none;
}

.post-card-body p {
    color: var(--text-muted);
    font-size: 0.92rem;
    flex: 1;
}

.post-card-more {
    color: var(--gold-bright);
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
}

/* SINGLE POST */
.post-single {
    max-width: 860px;
}

.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--gold-accent);
    text-decoration: none;
}

.post-banner {
    width: 100%;
    border-radius: 22px;
    border: 1px solid var(--border-card);
    margin-bottom: 30px;
    display: block;
}

.post-single h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    color: var(--gold-light);
    line-height: 1.2;
    margin-bottom: 12px;
}

.post-meta {
    color: var(--gold-accent);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 26px;
}

.post-content {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.85;
}

.post-content p {
    margin-bottom: 1.1em;
}

.post-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

@media (max-width: 640px) {
    .account-links {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
    }

    .auth-card, .panel-card {
        padding: 26px 20px;
    }
}

/* RICH TEXT (EDITOR TIPO WORD) */
.post-content h2, .post-content h3, .post-content h4 {
    font-family: var(--font-display);
    color: var(--gold-light);
    line-height: 1.3;
    margin: 1.4em 0 0.6em;
}

.post-content h2 { font-size: 1.7rem; }
.post-content h3 { font-size: 1.4rem; }
.post-content h4 { font-size: 1.15rem; }

.post-content strong, .post-content b {
    color: var(--text-main);
}

.post-content a {
    color: var(--gold-bright);
}

.post-content ul, .post-content ol {
    margin: 0 0 1.1em 1.6em;
}

.post-content li {
    margin-bottom: 0.35em;
}

.post-content blockquote {
    border-left: 4px solid var(--gold-accent);
    background: rgba(166, 25, 46, 0.07);
    padding: 14px 20px;
    margin: 1.4em 0;
    border-radius: 0 12px 12px 0;
    font-family: var(--font-display);
    font-style: italic;
    color: var(--gold-light);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    margin: 0.6em 0;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border-card);
    margin: 2em 0;
}

.post-content table {
    border-collapse: collapse;
    max-width: 100%;
    margin-top: 1.2em;
    margin-bottom: 1.2em;
}

/* Tablas a un lado: el texto las rodea; el contenido se "cierra" al final */
.post-content table[style*="float"] {
    margin-top: 0.3em;
}

.post-content::after {
    content: '';
    display: block;
    clear: both;
}

@media (max-width: 640px) {
    .post-content table {
        float: none !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

.post-content th, .post-content td {
    border: 1px solid var(--border-card);
    padding: 10px 12px;
    text-align: left;
}

.post-content th {
    color: var(--gold-accent);
    background: rgba(166, 25, 46, 0.08);
}

/* TinyMCE dentro del panel */
.tox.tox-tinymce {
    border-radius: 14px !important;
    border-color: var(--border-card) !important;
}

/* La barra de navegación queda fija arriba al hacer scroll */
body > .page-wrapper > header {
    position: sticky;
    top: 0;
    z-index: 200;
}

/* PORTADA: TARJETAS "EXPLORA" */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
    gap: 22px;
}

.explore-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 28px 26px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 22px;
    text-decoration: none;
    color: inherit;
}

.explore-icon {
    font-size: 2rem;
}

.explore-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold-light);
}

.explore-text {
    color: var(--text-muted);
    font-size: 0.92rem;
    flex: 1;
}

.explore-more {
    color: var(--gold-bright);
    font-weight: 700;
    font-size: 0.85rem;
}

/* Páginas de contenido: el título es <h1> y la sección arranca más arriba */
.page-main > section:first-child {
    padding-top: 50px;
}


/* ==========================================================================
   LECTOR DE PDF (LIBRO)
   ========================================================================== */
.post-single:has(.pdf-reader) {
    max-width: 1180px;
}

.post-single:has(.pdf-reader) .post-content,
.post-single:has(.pdf-reader) .post-buttons {
    max-width: 860px;
}

.pdf-reader {
    margin: 0 0 36px;
    background: var(--band-dark);
    border-radius: 22px;
    padding: 16px 16px 14px;
    color: #fff;
    box-shadow: 0 18px 40px rgba(43, 26, 28, 0.25);
}

.pdf-reader-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 2px 4px 14px;
}

.pdf-reader-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    min-width: 0;
}

.pdf-reader-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-reader-title .icon {
    color: var(--yellow);
}

.pdf-reader-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pdf-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pdf-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.16);
}

.pdf-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.pdf-counter {
    min-width: 132px;
    text-align: center;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.85);
    font-variant-numeric: tabular-nums;
}

.pdf-jump.styled-select {
    width: auto;
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.pdf-jump option {
    color: var(--text);
    background: var(--card);
}

.pdf-download.btn-gold {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--on-light);
}

.pdf-stage {
    /* Dos páginas abiertas caben en la altura de la ventana (barra y márgenes incluidos) */
    max-width: min(1120px, calc((100vh - 190px) / var(--ratio) * 2));
    margin: 0 auto;
}

.pdf-page {
    background: #fff;
    overflow: hidden;
}

.pdf-page img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.pdf-page-num {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.72rem;
    color: #8b8587;
    background: rgba(255, 255, 255, 0.85);
    padding: 1px 7px;
    border-radius: 8px;
}

/* Antes de que cargue el lector (o sin JavaScript): páginas una debajo de otra */
.pdf-reader:not(.pdf-ready) .pdf-page {
    max-width: 560px;
    margin: 0 auto 12px;
    position: relative;
}

.pdf-hint {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 10px;
}

/* Pantalla completa: el libro cabe entero en la altura disponible */
.pdf-reader.is-fullscreen {
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px 24px;
}

.pdf-reader.is-fullscreen .pdf-stage {
    width: 100%;
    max-width: min(100%, calc((100vh - 130px) / var(--ratio) * 2));
}

@media (max-width: 640px) {
    .pdf-reader {
        margin-left: -6px;
        margin-right: -6px;
        padding: 12px 10px;
        border-radius: 16px;
    }

    .pdf-reader-tools {
        width: 100%;
        justify-content: space-between;
    }

    .pdf-jump.styled-select {
        display: none;
    }

    .pdf-download.btn-gold {
        width: 100%;
    }

    .pdf-reader.is-fullscreen .pdf-stage {
        max-width: min(100%, calc((100vh - 170px) / var(--ratio)));
    }
}

.post-card-media {
    position: relative;
    display: block;
}

.post-card-pdf {
    position: absolute;
    left: 14px;
    bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--band-dark);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
}

.post-card-pdf .icon {
    color: var(--yellow);
}

/* LECTOR · ESTILO PRESENTACIÓN (una página a la vez, para PDF horizontales) */
.pdf-style-slides .pdf-stage {
    /* Una página entera cabe en la altura de la ventana */
    max-width: min(1120px, calc((100vh - 290px) / var(--ratio)));
}

.pdf-slides {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    aspect-ratio: 1 / var(--ratio);
}

.pdf-track {
    display: flex;
    height: 100%;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.pdf-track .pdf-page {
    flex: 0 0 100%;
    height: 100%;
}

.pdf-side {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: rgba(43, 26, 28, 0.55);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.pdf-side-prev { left: 12px; }
.pdf-side-next { right: 12px; }

.pdf-slides:hover .pdf-side:not(:disabled),
.pdf-side:focus-visible {
    opacity: 1;
}

.pdf-side:hover {
    background: rgba(43, 26, 28, 0.8);
}

.pdf-side:disabled {
    opacity: 0 !important;
    pointer-events: none;
}

.pdf-progress {
    height: 4px;
    margin-top: 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.pdf-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--yellow);
    transition: width 0.35s ease;
}

.pdf-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 12px 2px 4px;
    scrollbar-width: thin;
    max-width: 1120px;
    margin: 0 auto;
}

.pdf-thumb {
    position: relative;
    flex: 0 0 auto;
    width: 112px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.pdf-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / var(--ratio);
    object-fit: contain;
}

.pdf-thumb span {
    position: absolute;
    left: 6px;
    bottom: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    background: rgba(43, 26, 28, 0.75);
    padding: 0 6px;
    border-radius: 6px;
}

.pdf-thumb:hover {
    opacity: 0.85;
}

.pdf-thumb.active {
    opacity: 1;
    border-color: var(--yellow);
}

/* Sin JavaScript: las páginas de la presentación, una debajo de otra */
.pdf-style-slides:not(.pdf-ready) .pdf-slides {
    aspect-ratio: auto;
}

.pdf-style-slides:not(.pdf-ready) .pdf-track {
    flex-direction: column;
    gap: 8px;
}

.pdf-style-slides.is-fullscreen .pdf-stage {
    max-width: min(100%, calc((100vh - 230px) / var(--ratio)));
}

@media (max-width: 640px) {
    .pdf-side {
        opacity: 1;
        width: 36px;
        height: 36px;
    }

    .pdf-thumb {
        width: 84px;
    }
}

/* Cinta "Destacada" en las tarjetas */
.post-card-featured {
    position: absolute;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gold);
    color: var(--on-light);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 20px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.post-card-featured .icon {
    fill: currentColor;
    width: 14px;
    height: 14px;
}

/* Toda la tarjeta abre la publicación: el enlace del título se extiende sobre la tarjeta */
.post-card {
    position: relative;
    cursor: pointer;
}

.post-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.post-card-link:focus-visible {
    outline: none;
}

.post-card:has(.post-card-link:focus-visible) {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.post-card:hover .post-card-more {
    text-decoration: underline;
}


/* Botones de publicaciones con color elegido (--btn, --btn-text los pone el servidor o el editor) */
.btn-gold.btn-custom {
    background: var(--btn);
    border-color: var(--btn);
    color: var(--btn-text);
}

.btn-gold.btn-custom:hover {
    background: var(--btn);
    border-color: var(--btn);
    filter: brightness(0.9);
}

.btn-outline.btn-custom {
    border-color: var(--btn);
    color: var(--btn);
}

.btn-outline.btn-custom:hover {
    background: var(--btn);
    color: var(--btn-text);
}

/* Paleta de colores del editor de botones */
.button-preview {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.button-preview a {
    padding: 8px 20px !important;
    font-size: 0.85rem !important;
    pointer-events: none;
}

.color-pick {
    position: relative;
}

.color-pick summary {
    list-style: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border-card);
    border-radius: 12px;
    cursor: pointer;
}

.color-pick summary::-webkit-details-marker {
    display: none;
}

.color-pick[open] summary,
.color-pick summary:hover {
    border-color: var(--gold);
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.color-dot.is-default {
    background: conic-gradient(var(--red) 0 50%, var(--text) 50% 100%);
}

.color-pop {
    position: absolute;
    right: 0;
    top: 52px;
    z-index: 30;
    width: 236px;
    padding: 12px;
    background: var(--soft);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-default {
    background: transparent;
    border: 1.5px solid var(--border-card);
    color: var(--text);
    border-radius: 10px;
    padding: 7px 10px;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.color-default:hover {
    border-color: var(--gold);
}

.color-swatches {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.color-swatch {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    padding: 0;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.is-selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--gold);
}

.color-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.color-custom input {
    width: 44px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}

/* ==========================================================================
   FOTO DE PERFIL (avatar)
   ========================================================================== */
.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.navbar-account {
    overflow: hidden;
}

.avatar-form {
    margin-bottom: 14px;
}

.account-avatar.avatar-upload {
    position: relative;
    width: 104px;
    height: 104px;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 2.8rem;
    transition: box-shadow 0.2s ease;
}

.account-avatar.avatar-upload:hover,
.account-avatar.avatar-upload:focus-within {
    box-shadow: 0 0 0 5px var(--gold);
}

.avatar-upload input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

.avatar-upload-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--on-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 3px solid var(--paper);
    pointer-events: none;
}

.avatar-actions {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--gold-bright);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.menu-avatar {
    display: inline-block;
    width: 26px;
    height: 26px;
    vertical-align: middle;
    margin-right: 4px;
}

/* Autor de la publicación: foto y rol */
.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.post-author {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.post-author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--soft);
    border: 1px solid var(--line);
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.post-meta-sep {
    color: var(--text-dim);
}


/* ==========================================================================
   INSIGNIAS DE ROL: gradiente suave del color del rol (--c) hacia el granate, con brillo
   ========================================================================== */
.badge-role {
    --c: #d8c3b4;
    display: inline-flex;
    align-items: center;
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: none;
    line-height: 1.25;
    white-space: nowrap;
    color: #fff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--c) 55%, #3c1d20), color-mix(in srgb, var(--c) 22%, #3c1d20) 70%);
    border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 2px 10px color-mix(in srgb, var(--c) 25%, transparent);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.badge-role.badge-lg {
    padding: 8px 18px;
    font-size: 0.95rem;
}

/* ===== Lector PDF: visor de zoom ===== */
html.pdf-zoom-lock, html.pdf-zoom-lock body { overflow: hidden; }
.pdf-zoom {
    position: fixed; inset: 0; z-index: 3000;
    display: flex; flex-direction: column;
    background: rgba(18, 8, 9, 0.96);
    opacity: 0; transition: opacity .2s ease;
}
.pdf-zoom.is-open { opacity: 1; }
.pdf-zoom-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
    color: #fff;
}
.pdf-zoom-count { font-size: 0.9rem; color: var(--text-muted); }
.pdf-zoom-tools { display: flex; gap: 8px; }
.pdf-zoom-close { background: rgba(240, 180, 69, 0.18); border-color: var(--gold); }
.pdf-zoom-area {
    position: relative; flex: 1; overflow: hidden;
    touch-action: none; user-select: none; -webkit-user-select: none;
    cursor: zoom-in;
}
.pdf-zoom.is-zoomed .pdf-zoom-area { cursor: grab; }
.pdf-zoom.is-zoomed .pdf-zoom-area:active { cursor: grabbing; }
.pdf-zoom-area img {
    position: absolute; left: 0; top: 0; max-width: none;
    transform-origin: 0 0; will-change: transform;
    border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
    -webkit-user-drag: none; pointer-events: none;
}
.pdf-zoom-nav {
    position: absolute; top: 50%; z-index: 2;
    width: 46px; height: 46px; margin-top: -23px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
    color: #fff; background: rgba(44, 20, 22, 0.75); border: 1px solid rgba(255, 255, 255, 0.25);
    transition: opacity .2s;
}
.pdf-zoom-prev { left: 10px; }
.pdf-zoom-next { right: 10px; }
.pdf-zoom-nav:disabled { opacity: 0; pointer-events: none; }
.pdf-zoom.is-zoomed .pdf-zoom-nav { opacity: 0.35; }
.pdf-zoom-hint {
    text-align: center; font-size: 0.8rem; color: var(--text-dim);
    padding: 8px 14px max(12px, env(safe-area-inset-bottom));
    margin: 0;
}
@media (prefers-reduced-motion: reduce) { .pdf-zoom, .pdf-zoom-area img { transition: none !important; } }
.pdf-zoom[hidden] { display: none; }

/* Recuperar contraseña / confirmar correo */
.field .hint.forgot-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--gold-bright);
    font-weight: 600;
}
.field .hint.forgot-link:hover { text-decoration: underline; }
.auth-card p.hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 16px;
    line-height: 1.5;
}

/* Estado del correo en Mi cuenta */
.email-status {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}
.email-status .icon { width: 16px; height: 16px; }
.email-status.is-verified { color: var(--gold-bright); }
.email-status.is-pending { color: var(--text-muted); }
.email-status .link-button { font-size: inherit; }
