/* Publicaciones estilo red social (página principal y páginas /posts/). */
.post {
    --post-bg: #16191e;
    --post-border: rgba(255, 255, 255, 0.1);
    --post-text: #e8eaed;
    --post-soft: rgba(232, 234, 237, 0.62);
    --post-accent: #00f3ff;
    --post-hover: rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    color: var(--post-text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    font-family: 'Inter', system-ui, sans-serif;
    overflow: hidden;
}

html.light .post,
html[data-theme="light"] .post {
    --post-bg: #ffffff;
    --post-border: rgba(15, 23, 42, 0.1);
    --post-text: #050505;
    --post-soft: #65676b;
    --post-accent: #0e7490;
    --post-hover: #f0f2f5;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
}

html.oliver .post,
html[data-theme="oliver"] .post {
    --post-bg: #1c120a;
    --post-border: rgba(255, 176, 102, 0.18);
    --post-text: #fff7ee;
    --post-soft: rgba(255, 237, 220, 0.65);
    --post-accent: #ff8a1f;
    --post-hover: rgba(255, 176, 102, 0.08);
}

.carousel-track > .post { width: min(86%, 360px); }

.post-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; }
.post-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--post-accent); flex-shrink: 0; }
.post-author { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.2; }
.post-meta { display: flex; align-items: center; gap: 5px; margin: 2px 0 0; font-size: 12.5px; color: var(--post-soft); }
.post-meta svg { width: 12px; height: 12px; }
.post-meta a { color: inherit; text-decoration: none; }
.post-meta a:hover { text-decoration: underline; }

.post-text { margin: 0; padding: 4px 16px 12px; font-size: 15px; line-height: 1.5; white-space: pre-line; }
.post--card .post-text { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.post-tag { color: var(--post-accent); font-weight: 600; }

.post-media { display: block; border-top: 1px solid var(--post-border); }
.post-media img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }

.post-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 16px 12px;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--post-text);
    background: var(--post-hover);
    border: 1px solid var(--post-border);
    transition: border-color 0.2s ease;
}

.post-media + .post-link { margin-top: 12px; }
.post-link:hover { border-color: var(--post-accent); }
.post-link-domain { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--post-soft); }
.post-link-label { font-size: 15px; font-weight: 800; }

.post-actions {
    display: flex;
    margin-top: auto;
    padding: 4px 8px;
    border-top: 1px solid var(--post-border);
}

.post-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 8px;
    border-radius: 8px;
    font: 700 14px 'Inter', system-ui, sans-serif;
    color: var(--post-soft);
    background: none;
    border: 0;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.post-action:hover { background: var(--post-hover); color: var(--post-text); }
.post-action svg { width: 18px; height: 18px; }

/* Redes para compartir (páginas de publicaciones) */
.post-networks { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--post-border); }
.post-networks span { width: 100%; font-size: 12px; color: var(--post-soft); }
.post-net { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font: 700 13px 'Inter', system-ui, sans-serif; color: #fff; text-decoration: none; }
.post-net svg { width: 15px; height: 15px; }
.post-net--wa { background: #25D366; color: #04210f; }
.post-net--li { background: #0A66C2; }
.post-net--fb { background: #1877F2; }
.post-net--x { background: #000; border: 1px solid rgba(255, 255, 255, 0.2); }

/* Página con todas las publicaciones */
.posts-feed { display: grid; gap: 18px; max-width: 640px; margin: 0 auto; }
.posts-feed .ad-slot { margin: 0; }
.posts-title { max-width: 640px; margin: 8px auto 18px; }
.posts-title h1 { margin: 0; font-size: clamp(26px, 5vw, 34px); font-weight: 900; }
.posts-title p { margin: 6px 0 0; color: var(--text-soft, rgba(255, 255, 255, 0.65)); }
.post-back { display: inline-block; margin: 18px 0 0; font-weight: 700; text-decoration: none; color: var(--accent, #00f3ff); }

/* Espacio publicitario en las páginas de publicaciones (mismo comportamiento que la principal) */
.ad-slot { padding: 10px 12px 12px; border-radius: 16px; border: 1px dashed rgba(127, 127, 127, 0.4); }
.ad-label { display: block; margin-bottom: 6px; font: 600 10px 'Fira Code', monospace; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; }
.ad-slot--preview ins.adsbygoogle { min-height: 120px; border-radius: 10px; background: repeating-linear-gradient(45deg, rgba(127, 127, 127, 0.08) 0 12px, transparent 12px 24px); }
.ad-slot--preview .ad-label::after { content: ' · vista previa: falta el ID de bloque (data-ad-slot)'; text-transform: none; letter-spacing: 0; }

/* Portada de libro: completa y vertical */
.post-media--cover { display: flex; justify-content: center; padding: 16px; background: var(--post-hover); }
.post-media--cover img { width: auto; max-width: 70%; max-height: 380px; aspect-ratio: 2 / 3; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.carousel-track .post-media--cover img { max-height: 220px; }

/* Filtros de la página de publicaciones */
.posts-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.posts-chip {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(127, 127, 127, 0.35);
    background: none;
    color: inherit;
    font: 700 13px 'Inter', system-ui, sans-serif;
    cursor: pointer;
}
.posts-chip[aria-pressed="true"] { background: var(--accent, #00f3ff); border-color: transparent; color: #04121a; }

.post[hidden] { display: none; }
