/* =========================================================
   CETCAM - Estilos del ítem único de Tainacan
   Ajusta las variables de color/tipografía según tu marca.
   ========================================================= */

:root {
    --cetcam-green: #1e9e6b;
    --cetcam-green-dark: #167a53;
    --cetcam-text-dark: #1a1a1a;
    --cetcam-text-gray: #6b6b6b;
    --cetcam-border: #e6e6e6;
    --cetcam-bg-light: #f7f7f7;
    --cetcam-pill-bg: #f0f0f0;
}


/* ---------- dflip incluyes  ---------- */


.cetcam-item-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--cetcam-text-dark);
    max-width: 100%;
}

.cetcam-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ---------- Header ---------- */
.cetcam-item-header {
    margin-bottom: 32px;
}

.cetcam-eyebrow {
    display: block;
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--cetcam-text-gray);
    margin-bottom: 12px;
    font-weight: 600;
}

.cetcam-item-title {
    font-size: 34px;
    line-height: 1.25;
    font-weight: 700;
    margin: 0 0 16px;
    max-width: 780px;
}

.cetcam-item-meta {
    font-size: 14px;
    color: var(--cetcam-text-gray);
    margin: 0 0 16px;
}

.cetcam-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cetcam-tag-pill {
    background: var(--cetcam-pill-bg);
    color: var(--cetcam-text-dark);
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 20px;
}

/* ---------- Cuerpo: visor + sidebar ---------- */
.cetcam-item-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 900px) {
    .cetcam-item-body {
        grid-template-columns: 1fr;
    }
}

/* Visor PDF */
.cetcam-pdf-viewer {
    border: 1px solid var(--cetcam-border);
    border-radius: 8px;
    background: #fff;
    padding: 16px;
    min-height: 380px;
}

/*
 * Wrapper con scroll propio y altura máxima fija. Así, si el zoom hace que
 * el libro no quepa, aparecen scrollbars DENTRO de esta caja — nunca se
 * "derrama" visualmente sobre los controles de abajo (que están fuera de
 * esta caja, en el DOM normal).
 */
.cetcam-flipbook-scroll {
    width: 100%;
    max-height: 640px;
    overflow: auto;
    display: flex;
    justify-content: center;
}

.cetcam-flipbook {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    flex-shrink: 0; /* evita que el flex la comprima al activar scroll horizontal */
}

.cetcam-flipbook .page {
    background-size: cover;
    background-position: center;
}

.cetcam-flipbook-loading {
    font-size: 14px;
    color: var(--cetcam-text-gray);
    text-align: center;
    margin: 0;
}

.cetcam-flipbook-error {
    color: #c00;
}

.cetcam-pdf-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.cetcam-pdf-nav-group,
.cetcam-pdf-tools-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cetcam-nav-btn,
.cetcam-tool-btn {
    background: #fff;
    border: 1px solid var(--cetcam-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.cetcam-nav-btn:hover,
.cetcam-tool-btn:hover {
    background: var(--cetcam-bg-light);
}

.cetcam-nav-btn:disabled,
.cetcam-tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cetcam-tool-btn.is-active {
    background: var(--cetcam-green);
    color: #fff;
    border-color: var(--cetcam-green);
}

.cetcam-page-indicator {
    font-size: 14px;
    color: var(--cetcam-text-gray);
    min-width: 50px;
    text-align: center;
}

.cetcam-download-link {
    color: var(--cetcam-green);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.cetcam-download-link:hover {
    text-decoration: underline;
}

/* Modo pantalla completa: centrar el viewer y darle todo el alto disponible */
.cetcam-pdf-viewer:fullscreen,
.cetcam-pdf-viewer:-webkit-full-screen {
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    height: 100vh;
    width: 100vw;
}

.cetcam-pdf-viewer:fullscreen .cetcam-flipbook-scroll,
.cetcam-pdf-viewer:-webkit-full-screen .cetcam-flipbook-scroll {
    max-height: 85vh;
}

/* Sidebar */
.cetcam-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    margin: 4px 0 16px;
}

.cetcam-sidebar-text p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--cetcam-text-dark);
    margin: 0 0 16px;
}

.cetcam-btn-download {
    display: inline-block;
    background: var(--cetcam-green);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 8px;
    transition: background 0.15s ease;
}

.cetcam-btn-download:hover {
    background: var(--cetcam-green-dark);
    color: #fff;
}

/* ---------- Publicaciones relacionadas ---------- */
.cetcam-related-section {
    border-top: 1px solid var(--cetcam-border);
    margin-top: 40px;
    padding-top: 8px;
}

.cetcam-related-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
}

.cetcam-related-eyebrow {
    display: block;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--cetcam-text-gray);
    font-weight: 600;
    margin-bottom: 6px;
}

.cetcam-related-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.cetcam-see-all {
    color: var(--cetcam-green);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.cetcam-see-all:hover {
    text-decoration: underline;
}

.cetcam-related-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

@media (max-width: 1100px) {
    .cetcam-related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .cetcam-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cetcam-related-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.cetcam-related-thumb {
    background: var(--cetcam-bg-light);
    border-radius: 6px;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    margin-bottom: 10px;
}

.cetcam-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cetcam-related-kicker {
    font-size: 12px;
    color: var(--cetcam-text-gray);
    margin: 0 0 6px;
}

.cetcam-related-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--cetcam-green);
    background: rgba(30, 158, 107, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.cetcam-related-card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    color: var(--cetcam-text-dark);
}
