/* ============================================================
   BLOG STYLES — Obsidian Dashboard Gallery
   Uses same CSS variables as style.css
   ============================================================ */

/* ── Blog list page ──────────────────────────────────────── */
.blog-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 24px 80px;
}

.blog-page-header {
    margin-bottom: 48px;
    text-align: center;
}

.blog-page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 600;
    letter-spacing: -1.5px;
    color: var(--text);
    margin-bottom: 12px;
}

.blog-page-desc {
    font-size: 15px;
    color: var(--text-dim);
    max-width: 460px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

/* ── Language badge & tooltip ──────────────────────────────── */
.blog-lang-notice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 100px;
    animation: langNoticeFadeIn 0.6s ease-out 0.3s backwards;
    margin-bottom: 60px;
    position: relative;
    z-index: 200;
}

@keyframes langNoticeFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.blog-lang-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: #10b981;
    letter-spacing: 1.5px;
}

/* pulsing green dot before EN */
.blog-lang-badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: langPulse 2s ease-in-out infinite;
}

@keyframes langPulse {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    60%  { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.blog-lang-sep {
    width: 1px;
    height: 12px;
    background: rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
}

.blog-lang-tooltip-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: #10b981;
    font-size: 12px;
    font-weight: 500;
    transition: opacity 0.2s ease;
    user-select: none;
}

.blog-lang-tooltip-icon:hover,
.blog-lang-tooltip-icon:focus {
    opacity: 0.8;
    outline: none;
}

.blog-lang-tooltip-icon svg {
    flex-shrink: 0;
    stroke: #10b981;
}

.blog-lang-tooltip-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: #10b981;
    white-space: nowrap;
}

.blog-lang-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    padding: 14px 16px;
    /* fully opaque — no bleed-through on any background */
    background: #0a0a0a;
    border: 1px solid #10b981;
    border-radius: 12px;
    font-size: 13px;
    color: #d4d4d8;
    line-height: 1.6;
    box-shadow:
        0 0 0 4px rgba(16, 185, 129, 0.06),
        0 20px 60px rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 200;
    text-align: left;
    white-space: normal;
}

/* little arrow */
.blog-lang-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #0a0a0a;
    border-left: 1px solid #10b981;
    border-top: 1px solid #10b981;
}

.blog-lang-tooltip-icon:hover .blog-lang-tooltip,
.blog-lang-tooltip-icon:focus .blog-lang-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ── Posts list ──────────────────────────────────────────── */
.blog-posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-list-card {
    display: flex;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
    /* force equal height for all cards */
    min-height: 140px;
    height: 140px;
}

.blog-list-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.blog-list-card-img {
    flex: 0 0 220px;
    align-self: stretch;
    overflow: hidden;
    min-height: 160px;
}

.blog-list-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.blog-list-card:hover .blog-list-card-img img {
    transform: scale(1.05);
}

.blog-list-card-body {
    flex: 1;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

.blog-list-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
}

.sep {
    color: var(--border);
}

.blog-list-card h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 19px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.blog-list-card-excerpt {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
    display: block;
    margin-top: 6px;
    opacity: 0.85;
}

/* ── Blog post page ──────────────────────────────────────── */
.blog-post-page {
    max-width: 740px;
    margin: 0 auto;
    padding: 100px 40px 80px;
    overflow-x: hidden;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    margin-bottom: 36px;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.blog-post-full {
    width: 100%;
}

.post-cover {
    width: 100%;
    height: 360px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 40px;
    border: 1px solid var(--border);
}

.post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-header {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.post-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 600;
    letter-spacing: -1.5px;
    color: var(--text);
    line-height: 1.15;
    margin-bottom: 16px;
}

.post-excerpt {
    font-size: 16px;
    color: var(--text-dim);
    line-height: 1.7;
}

/* ── Prose / post body ───────────────────────────────────── */
.post-body {
    font-size: 15px;
    line-height: 1.85;
    color: var(--text-dim);
}

.post-body h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.5px;
    margin: 44px 0 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.post-body h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin: 30px 0 10px;
}

.post-body p {
    margin-bottom: 20px;
}

.post-body a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    padding: 2px 4px;
    margin: 0 -2px;
    border-radius: 4px;
}

.post-body a:hover {
    background: var(--accent);
    color: var(--bg);
    border-radius: 4px;
    border-bottom-color: transparent;
}

.post-body ul,
.post-body ol {
    margin: 0 0 20px 24px;
}

.post-body li {
    margin-bottom: 8px;
}

.post-body strong {
    color: var(--text);
    font-weight: 600;
}

.post-body code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px 7px;
    color: var(--accent);
}

.post-body pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 22px;
    overflow-x: auto;
    margin: 20px 0 24px;
}

.post-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.7;
}

.post-body blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    border-left: 3px solid var(--accent);
    background: var(--surface);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-dim);
}

.post-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 44px 0;
}

.post-body img {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin: 16px 0;
}

/* ── Home page blog section / blog grid ──────────────────── */
.blog-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.blog-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    max-width: 300px;
    flex: 0 0 auto;
}

.blog-card:hover {
    border-color: var(--text-dim);
    transform: translateY(-1px);
}

.blog-card-img {
    height: 70px;
    overflow: hidden;
    border-radius: 3px;
    margin-bottom: 8px;
}

.blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-body {
    padding: 0;
}

.blog-date {
    font-size: 8px;
    color: var(--text-dim);
    margin-bottom: 2px;
    display: block;
}

.blog-card h3 {
    font-size: 11px;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 2px;
    line-height: 1.3;
}

.blog-card p {
    display: none;
}

.blog-link {
    font-size: 9px;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-link:hover {
    color: var(--text);
}

/* ── Coming soon card ──────────────────────────────────── */
.coming-soon-card {
    grid-column: 1 / -1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 40px 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-height: 180px;
    margin-top: 0;
    position: relative;
    z-index: 10;
}

.coming-soon-dots {
    display: flex;
    gap: 8px;
}

.coming-soon-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-dim);
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.coming-soon-dots span:nth-child(1) { animation-delay: 0s; }
.coming-soon-dots span:nth-child(2) { animation-delay: 0.25s; }
.coming-soon-dots span:nth-child(3) { animation-delay: 0.5s; }

.coming-soon-card h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 1px;
}

.coming-soon-card p {
    font-size: 12px;
    color: var(--text-dim);
    max-width: 250px;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Estilo para blog-list cuando no hay posts */
.blog-posts-list .coming-soon-card {
    grid-column: auto;
    min-height: 200px;
    margin-top: 48px;
}



/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .blog-card-img {
        height: 70px;
    }

    .blog-list-card {
        flex-direction: column;
        height: auto;
        min-height: unset;
    }

    .blog-list-card-img {
        flex: none;
        width: 100%;
        height: 160px;
        align-self: auto;
    }

    .blog-list-card-body {
        padding: 16px 20px;
    }

    .blog-page {
        padding: 90px 16px 60px;
    }

    .blog-post-page {
        padding: 90px 20px 60px;
    }

    .post-cover {
        height: 220px;
    }
}

.support-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.support-text {
    font-size: 14px;
    color: var(--text);
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
    padding: 12px 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.post-footer-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.kofi-widget-container {
    display: flex;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.kofi-widget-container:hover {
    transform: scale(1.05);
}

.kofi-widget-container iframe {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.kofi-widget-container:hover iframe {
    transform: scale(1.02);
}

.gh-btn {
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    font-weight: 500;
    transition: transform 0.15s cubic-bezier(.4,0,.2,1);
    user-select: none;
    overflow: hidden;
    white-space: nowrap;
    border: 1px solid transparent;
}
.gh-btn:hover  { transform: scale(1.05); }
.gh-btn:active { transform: scale(0.95); }

.gh-btn {
    line-height: 1;
}

.gh-btn.sm { font-size: 12px; }
.gh-btn.sm .gh-left  { gap: 5px;  padding: 5px 10px; }
.gh-btn.sm .gh-count { padding: 5px 10px; }
.gh-btn.sm .gh-icon  { width: 13px; height: 13px; }

.gh-btn.md { font-size: 13px; }
.gh-btn.md .gh-left  { gap: 6px;  padding: 10px 18px; align-items: center; }
.gh-btn.md .gh-count { padding: 10px 18px; }
.gh-btn.md .gh-icon  { width: 14px; height: 14px; display: block; }

.gh-left    { display: flex; align-items: center; justify-content: center; line-height: 1; }
.gh-left .gh-icon { display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.gh-divider { width: 1px; align-self: stretch; flex-shrink: 0; background: rgba(255,255,255,.25); }
.gh-count   { display: flex; align-items: center; justify-content: center; line-height: 1; }
.gh-count span { line-height: 1; }
.gh-left span { line-height: 1; }
.star-suffix { margin-left: 4px; line-height: 1; vertical-align: middle; }

.gh-btn.v-default {
    background: #24292f;
    border-color: transparent;
    color: #fff;
}

@media (prefers-color-scheme: dark) {
    .gh-btn.v-default {
        background: #24292f;
        border-color: transparent;
        color: #fff;
    }
    .gh-btn.v-default .gh-divider { background: rgba(255,255,255,.25); }
}

.slide-num {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.image-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.image-zoom-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-zoom-overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-zoom-overlay.active img {
    transform: scale(1);
}

.image-zoom-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    transition: background 0.2s ease;
}

.image-zoom-close:hover {
    background: rgba(255, 255, 255, 0.2);
}
.slide-char {
    display: inline-block;
    overflow: hidden;
    height: 1.2em;
    line-height: 1.2em;
}
.slide-char-inner {
    display: flex;
    flex-direction: column;
    will-change: transform;
}
.slide-char-inner span {
    height: 1.2em;
    display: block;
}

@keyframes gh-slide-up {
    from { transform: translateY(0); }
    to   { transform: translateY(-50%); }
}
@keyframes gh-slide-down {
    from { transform: translateY(-50%); }
    to   { transform: translateY(0); }
}
.slide-char-inner.anim-up {
    animation: gh-slide-up 0.3s cubic-bezier(.4,0,.2,1) forwards;
}
.slide-char-inner.anim-down {
    animation: gh-slide-down 0.3s cubic-bezier(.4,0,.2,1) forwards;
}
