/* Blog-specific styling - inherits base from main styles.css */

:root {
    --blog-text-secondary: #666;
    --blog-background-secondary: #f5f3ee;
    --blog-accent-color: #4a7c59;
    --blog-accent-hover: #3a6349;
    --blog-accent-light: rgba(74, 124, 89, 0.1);
    --blog-border-color: rgba(26, 26, 26, 0.1);
}

.channel-header {
    position: sticky;
    top: 10px;
    right: 0px;
    z-index: 200;
}

.channel-header h1 {
    margin: 0 0 2rem 0;
    font-size: 24px;
}

#channel-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.channel-content a {
    text-decoration: none;
    color: inherit;
    border-bottom: none;
}

.block {
    background-color: var(--blog-background-secondary);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--blog-border-color);
}

.block h3 {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.block img {
    max-width: 100%;
    height: auto;
}

/* Load more button inherits from main stylesheet */

/* Block type specific styles */
.block-text {
    background-color: var(--blog-background-secondary);
}

.block-text .text-content {
    line-height: 1.6;
    margin-top: 0.5rem;
}

.block-text .text-content p {
    margin: 0.5rem 0;
}

.block-link .description {
    font-size: 0.9rem;
    color: var(--blog-text-secondary);
    margin: 0.5rem 0;
    line-height: 1.4;
}

.block-link .provider {
    font-size: 0.8rem;
    color: var(--blog-accent-color);
    background-color: var(--blog-accent-light);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    display: inline-block;
    margin-top: 0.5rem;
}

.block-media .embed-container {
    margin: 0.5rem 0;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.block-media .embed-container iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 4px;
}

.block-media .view-original {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--blog-accent-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
}

.block-media .view-original:hover {
    background-color: var(--blog-accent-hover);
}

.block-media .provider {
    font-size: 0.8rem;
    color: var(--blog-accent-color);
    background-color: var(--blog-accent-light);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    display: inline-block;
    margin-top: 0.5rem;
}

.block-attachment .file-size {
    font-size: 0.8rem;
    color: var(--blog-text-secondary);
    background-color: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    display: inline-block;
    margin-top: 0.5rem;
}

.block-attachment img {
    opacity: 0.8;
}

/* Error blocks */
.block-error {
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: var(--text-secondary);
}

.block-error h3 {
    color: #ff6b6b;
    margin-top: 0;
}

/* Cloud View Styles */
#cloud-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 100;
    overflow: hidden;
}

.cloud-background-title {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    color: var(--text-color);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    z-index: 1;
}

.cloud-node {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background-color: var(--blog-background-secondary);
    border: 1px solid var(--blog-border-color);
    z-index: 2;
}

.cloud-node:hover {
    margin-top: -5px;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.cloud-node img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cloud-node-text {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--blog-accent-light);
    border: 2px solid var(--blog-accent-color);
}

.cloud-node-text-preview {
    padding: 0.75rem;
    font-size: 0.7rem;
    line-height: 1.3;
    color: var(--text-color);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
}

.cloud-node-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: rgba(26, 26, 26, 0.9);
    color: white;
    font-size: 0.7rem;
    line-height: 1.2;
    opacity: 0;
    transition: opacity 0.3s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cloud-node:hover .cloud-node-title {
    opacity: 1;
}

/* Node Lightbox */
.node-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(245 243 238 / 80%);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.node-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.node-lightbox-close {
    position: fixed;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    font-size: 36px;
    color: var(--text-color);
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: opacity 0.2s;
}

.node-lightbox-close:hover {
    opacity: 0.7;
}

.node-lightbox-content {
    max-width: 800px;
    max-height: 90vh;
    background-color: var(--blog-background-secondary);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--blog-border-color);
}

.node-lightbox-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: 90vh;
}

.node-lightbox-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1.5rem;
    border-radius: 4px;
}



.node-lightbox-body .lightbox-description {
    margin: 1rem 0;
    line-height: 1.6;
    color: var(--blog-text-secondary);
}

.node-lightbox-body .lightbox-content {
    margin: 1rem 0;
    line-height: 1.6;
}

.node-lightbox-body .lightbox-link {
}

.node-lightbox-body .lightbox-provider {
    display: inline-block;
    margin-right: 0.5rem;
}

.node-lightbox-body .embed-container iframe {
    width: 100%;
    min-height: 400px;
    border: none;
    border-radius: 4px;
}

.view-toggle button {
    background-color: var(--blog-background-secondary);
    border: 1px solid var(--blog-border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.view-toggle button.active {
    background-color: var(--blog-accent-color);
    color: white;
}

.view-toggle button:hover {
    background-color: var(--blog-accent-hover);
}

/* Responsive design */
@media (max-width: 768px) {
    .block-media .embed-container iframe {
        min-height: 150px;
    }

    /* Hide cloud view toggle on mobile - not optimal for touch */
    .view-toggle button[data-view="cloud"] {
        display: none;
    }

    .node-lightbox-content {
        max-width: 90vw;
        margin: 0 1rem;
    }

    .node-lightbox-body {
        padding: 1.5rem;
    }

    .node-lightbox-close {
        top: 16px;
        right: 16px;
        font-size: 32px;
    }

    .cloud-background-title {
        font-size: 4rem;
    }
}

@media (max-width: 480px) {
    .cloud-background-title {
        font-size: 2.5rem;
        letter-spacing: 0.05em;
    }
}
