/* =========================================================================
   Blog Styles
   Extends the main Metrotown design system (styles.css)
   ========================================================================= */

/* Ensure footer stays at bottom of short pages */
.blog-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.blog-page footer {
    margin-top: auto;
}

/* =========================================================================
   Blog Listing Page
   ========================================================================= */

.blog-hero {
    padding: 120px 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.blog-hero h1 {
    color: var(--clr-action);
    margin-bottom: 1.5rem;
    font-size: clamp(1.875rem, 3.75vw, 3rem);
}

.blog-hero p {
    font-size: 1.125rem;
    margin: 0;
}

/* Post List (Vertical Layout) */
.post-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 80px;
    max-width: 900px;
    margin: 0 auto;
}

.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 1rem;
}

.post-card {
    background: rgba(11, 17, 32, 0.95);
    border: 1px solid rgba(248, 250, 252, 0.06);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: row;
    height: 220px;
}

.post-card:hover {
    transform: translateY(-4px);
    border-color: rgba(250, 204, 21, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.post-card-image-wrapper {
    width: 380px;
    height: 100%;
    flex-shrink: 0;
    overflow: hidden;
}

.post-card-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-card-thumbnail {
    transform: scale(1.05);
}

.post-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-date {
    font-size: 0.8rem;
    color: var(--clr-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.post-card-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--clr-text);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.post-card-excerpt {
    font-size: 0.95rem;
    color: var(--clr-text-muted);
    line-height: 1.6;
    margin-bottom: 0;
    flex: 1;
}

/* Empty State */
.blog-empty {
    text-align: center;
    padding: 80px 0;
    color: var(--clr-text-muted);
    font-size: 1.125rem;
}

/* =========================================================================
   Blog Post Detail Page
   ========================================================================= */

.post-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
}

.post-header h1 {
    color: var(--clr-text);
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-header-date {
    color: var(--clr-accent);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Post Content Article */
.post-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem 40px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h2 {
    color: var(--clr-action);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.post-content h3 {
    color: var(--clr-text);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.35rem;
}

.post-content p {
    color: var(--clr-text-muted);
    margin-bottom: 1.5rem;
}

.post-content a {
    color: var(--clr-action);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content a:hover {
    color: #EAB308;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.post-content li {
    color: var(--clr-text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.post-content strong {
    color: var(--clr-text);
}

/* Post Images */
.post-image {
    margin: 2rem 0;
}

.post-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.post-image figcaption {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--clr-text-muted);
    font-style: italic;
}

/* Post Meta (inside post content) */
.post-meta {
    color: var(--clr-accent) !important;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive Video Embed */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Back to Blog Link */
.back-link-container {
    padding-top: 120px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link-container.bottom-nav {
    padding-top: 20px;
    padding-bottom: 80px;
}

.back-link,
.next-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.back-link:hover,
.next-link:hover {
    color: var(--clr-action);
}

.back-link::before {
    content: '←';
    font-size: 1.1rem;
}

.next-link::after {
    content: '→';
    font-size: 1.1rem;
}

/* =========================================================================
   Blog Responsive
   ========================================================================= */

@media (min-width: 1000px) {
    .post-header {
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    .post-card {
        flex-direction: column;
        height: auto;
    }

    .post-card-image-wrapper {
        width: 100%;
        aspect-ratio: 16 / 9;
        height: auto;
    }

    .post-content {
        font-size: 1rem;
    }

    .back-link-container {
        padding-top: 100px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .back-link-container.bottom-nav {
        padding-top: 20px;
    }

    .blog-hero {
        padding: 100px 0 20px;
        width: 90%;
    }
}

/* =========================================================================
   Image Comparison Component
   ========================================================================= */

.image-comparison {
    margin: 2.5rem 0;
}

.image-comparison-container {
    --position: 50%;
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    user-select: none;
    -webkit-user-select: none;
}

.image-comparison-container img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    margin: 0 !important;
}



.comparison-image-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: polygon(0 0, var(--position) 0, var(--position) 100%, 0 100%);
    z-index: 1;
}

.comparison-slider {
    position: absolute;
    top: 0;
    left: var(--position);
    width: 40px;
    height: 100%;
    z-index: 2;
    transform: translateX(-50%);
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: var(--clr-bg);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: -1;
    transition: background 0.2s ease;
}

.comparison-slider-icon {
    width: 40px;
    height: 40px;
    background: var(--clr-bg);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background 0.2s ease;
}

.comparison-slider-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.image-comparison-container.dragging .comparison-slider::before,
.image-comparison-container.dragging .comparison-slider-icon {
    background: var(--clr-action);
}

.image-comparison-figcaption {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--clr-text-muted);
    font-style: italic;
}