/* ═══════════════════════════════════════════════
   BLOG STYLES — Maretex Blog
   ═══════════════════════════════════════════════ */

/* Ensure scroll is enabled on blog pages */
html,
body {
    overflow: auto !important;
    height: auto !important;
}

/* ─── Blog Hero ─── */
.blog-hero {
    padding: 160px 40px 60px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.blog-hero-inner {
    max-width: 700px;
    margin: 0 auto;
}

.blog-badge {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 20px;
    border-radius: 30px;
    margin-bottom: 24px;
    backdrop-filter: blur(4px);
}

.blog-hero-title {
    font-family: 'Switzer', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 300;
    color: #fff;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

.blog-hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.7;
    margin: 0;
}

/* ─── Blog Listing ─── */
.blog-listing {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px 80px;
    position: relative;
    z-index: 1;
}

/* Loading / Empty States */
.blog-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.4);
    gap: 16px;
}

.blog-state svg {
    opacity: 0.3;
}

.blog-state p {
    font-size: 1rem;
    margin: 0;
}

.blog-spinner {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Blog Grid ─── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    /* Increased gap */
}

/* ─── Blog Card ─── */
.blog-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Darker border initial */
    border-radius: 20px;
    /* Larger radius */
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    animation: cardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    height: 100%;
    /* Equal height */
}

.blog-card::before {
    /* Glow effect container */
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity 0.5s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.5);
}

.blog-card:hover::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Image */
.blog-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    /* Taller image */
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.08);
}

.blog-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.1);
}

.blog-card-category {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 2;
}

/* Card Body */
.blog-card-body {
    padding: 32px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-date {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
    font-family: 'Switzer', sans-serif;
}

.blog-card-title {
    font-family: 'Switzer', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    /* Thin/Elegant */
    color: #fff;
    margin: 0 0 16px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.blog-card:hover .blog-card-title {
    color: #fff;
    /* Could add accent color here if desired */
}

.blog-card-excerpt {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.7;
    margin: 0 0 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    margin-top: auto;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.blog-card:hover .blog-card-link {
    opacity: 1;
    gap: 12px;
}

.blog-card-link svg {
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-link svg {
    transform: translateX(4px);
}


/* ═══════════════════════════════════════════════
   SINGLE POST PAGE
   ═══════════════════════════════════════════════ */

/* Back Link */
.post-back-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 120px 40px 0;
    position: relative;
    z-index: 1;
}

.post-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.3s ease;
    letter-spacing: 0.5px;
}

.post-back-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Cover Image */
.post-cover {
    max-width: 1000px;
    margin: 40px auto 0;
    padding: 0 40px;
    position: relative;
    z-index: 1;
}

.post-cover img {
    width: 100%;
    border-radius: 16px;
    object-fit: cover;
    max-height: 500px;
}

/* Post Container */
.post-container {
    max-width: 750px;
    margin: 0 auto;
    padding: 48px 40px 80px;
    position: relative;
    z-index: 1;
}

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.post-meta time {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.5px;
}

.post-category-badge {
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 14px;
    border-radius: 20px;
}

/* Post Title */
.post-title {
    font-family: 'Switzer', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    color: #fff;
    margin: 0 0 40px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Post Body — Portable Text Content */
.post-body {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.05rem;
    line-height: 1.85;
}

.post-body h1 {
    font-family: 'Switzer', sans-serif;
    font-size: 2rem;
    font-weight: 400;
    color: #fff;
    margin: 48px 0 20px;
}

.post-body h2 {
    font-family: 'Switzer', sans-serif;
    font-size: 1.6rem;
    font-weight: 400;
    color: #fff;
    margin: 40px 0 16px;
}

.post-body h3 {
    font-family: 'Switzer', sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    color: #fff;
    margin: 32px 0 12px;
}

.post-body h4 {
    font-family: 'Switzer', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    margin: 28px 0 10px;
}

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

.post-body strong {
    color: #fff;
    font-weight: 600;
}

.post-body em {
    color: rgba(255, 255, 255, 0.85);
}

.post-body a {
    color: rgba(180, 200, 255, 0.9);
    text-decoration: underline;
    text-decoration-color: rgba(180, 200, 255, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.3s ease;
}

.post-body a:hover {
    text-decoration-color: rgba(180, 200, 255, 0.8);
}

.post-body blockquote {
    margin: 30px 0;
    padding: 20px 24px;
    border-left: 3px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0 12px 12px 0;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.post-body code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.88em;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: rgba(255, 200, 150, 0.9);
}

.post-body pre {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
}

.post-body pre code {
    background: none;
    padding: 0;
    color: rgba(255, 200, 150, 0.9);
    font-size: 0.85rem;
    line-height: 1.6;
}

.post-body ul,
.post-body ol {
    padding-left: 28px;
    margin: 0 0 20px;
}

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

.post-body li::marker {
    color: rgba(255, 255, 255, 0.35);
}

.post-body hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 40px 0;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.post-body th,
.post-body td {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.post-body th {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-weight: 500;
}

.post-body img {
    max-width: 100%;
    border-radius: 12px;
    margin: 20px 0;
}

/* Post Images */
.post-image {
    margin: 32px 0;
}

.post-image img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.post-image figcaption {
    margin-top: 10px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    font-style: italic;
}


/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 130px 24px 40px;
    }

    .blog-listing {
        padding: 0 24px 60px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

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

    .blog-card-title {
        font-size: 1.1rem;
    }

    /* Post page */
    .post-back-wrapper {
        padding: 100px 24px 0;
    }

    .post-cover {
        padding: 0 24px;
    }

    .post-cover img {
        border-radius: 12px;
        max-height: 300px;
    }

    .post-container {
        padding: 32px 24px 60px;
    }

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

@media (max-width: 480px) {
    .blog-hero-title {
        font-size: 2rem;
    }

    .blog-hero-subtitle {
        font-size: 0.95rem;
    }

    .blog-card-image {
        aspect-ratio: 16/9;
    }
}