/* ==========================================================================
   Blog Page Styles — DOYIL Theme
   Reference: Mau Pets (https://www.maupets.com/blogs/mau-cat-and-dog-blog)

   Key specs from theme.css:
   - Container: max-width 1260px
   - Hero: full-width, featured article with overlay gradient
   - Grid: 3 columns (lap-and-up), 2 (tablet), 1 (mobile)
   - Grid gap: 30px tablet / 60px desktop
   - Card margin-bottom: 60px tablet / 100px desktop
   - Image ratio: padding-bottom 58% (aspect-ratio ~1.7)
   - Title: 17px, weight 500, letter-spacing 3px, text font (not heading)
   - No borders, no shadows, no background on cards
   - Hover: image scale(1.2) over 8s cubic-bezier
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Blog Hero — Featured Article (first post)
   -------------------------------------------------------------------------- */
.blog-hero {
    margin: 0 0 5%;
}

.blog-hero__link {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
}

.blog-hero__image {
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.blog-hero__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 6px;
    color: rgba(255, 255, 255, 0.3);
}

.blog-hero__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.4));
    pointer-events: none;
}

.blog-hero__content {
    position: absolute;
    bottom: 40px;
    left: 40px;
    right: 40px;
    z-index: 2;
}

.blog-hero__title {
    font-size: 28px;
    font-weight: 500;
    line-height: 1.3;
    color: #fff;
    margin: 0 0 16px;
    max-width: 600px;
}

.blog-hero__cta {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    border-bottom: 2px solid #fff;
    padding-bottom: 4px;
    transition: opacity 0.2s ease;
}

.blog-hero__link:hover .blog-hero__cta {
    opacity: 0.7;
}

/* --------------------------------------------------------------------------
   2. Blog List Wrapper
   -------------------------------------------------------------------------- */
.blog-list-wrapper {
    max-width: 1260px;
    margin: 0 auto 60px;
    padding: 0 30px;
}

/* --------------------------------------------------------------------------
   3. Blog Grid — 3 Columns
   -------------------------------------------------------------------------- */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.blog-grid--3 {
    grid-template-columns: 1fr;
}

@media screen and (min-width: 641px) {
    .blog-grid--3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    /* Single post responsive */
    .article-image-wrapper .article-image {
        height: 450px;
    }

    .article-title {
        font-size: 34px;
    }
}

@media screen and (min-width: 1008px) {
    .blog-hero__image {
        height: 400px;
    }

    .blog-hero__title {
        font-size: 36px;
    }

    .blog-list-wrapper {
        margin-bottom: 100px;
    }

    .blog-grid--3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 60px;
        margin-bottom: 60px;
    }

    /* Single post responsive */
    .article-image-wrapper .article-image {
        height: 600px;
    }

    .article-wrapper {
        max-width: 780px;
        margin-top: -70px;
        padding: 40px 40px 0;
    }

    .article-title {
        font-size: 40px;
    }

    .article-nav {
        padding: 140px 24px;
    }

    .article-nav__image {
        height: 350px;
    }
}

@media screen and (min-width: 1140px) {
    .blog-grid--3 {
        gap: 60px;
    }
}

/* --------------------------------------------------------------------------
   4. Blog Card
   -------------------------------------------------------------------------- */
.blog-card {
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    overflow: hidden;
    transition: all var(--transition-base);
}

.blog-card:hover {
    border-color: var(--color-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.blog-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Image wrapper — aspect ratio via padding-bottom */
.blog-card__image {
    position: relative;
    width: 100%;
    padding-bottom: 58%; /* ~1.7:1 ratio */
    overflow: hidden;
    background-color: var(--color-bg-secondary);
}

.blog-card__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.blog-card__img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-bg-dark), var(--color-bg-dark-alt));
}

.blog-card__placeholder-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--color-text-light-dim);
    opacity: 0.25;
}

@media (hover: hover) {
    .blog-card:hover .blog-card__img {
        transform: scale(1.08);
    }
}

/* Card content */
.blog-card__content {
    padding: var(--space-6);
}

.blog-card__date {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-accent-wood);
    margin-bottom: var(--space-3);
}

.blog-card__date::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-accent-wood);
    flex-shrink: 0;
}

.blog-card__title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    line-height: var(--leading-snug);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-3);
    transition: color var(--transition-fast);
}

.blog-card:hover .blog-card__title {
    color: var(--color-accent-wood);
}

.blog-card__excerpt {
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__read-more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
}

.blog-card__read-more::after {
    content: '→';
    transition: transform var(--transition-fast);
    font-size: var(--text-xs);
}

.blog-card:hover .blog-card__read-more {
    background: var(--color-primary-dark);
    color: var(--color-text-light);
    border-color: var(--color-primary-dark);
}

.blog-card:hover .blog-card__read-more::after {
    transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   5. Empty State
   -------------------------------------------------------------------------- */
.blog-grid__empty {
    text-align: center;
    padding: 80px 20px;
    font-size: 16px;
    color: var(--text-color, #666);
}

/* --------------------------------------------------------------------------
   6. Pagination
   -------------------------------------------------------------------------- */
.blog-pagination {
    margin-top: 80px;
    text-align: center;
}

.blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    margin: 0 4px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-color, #666);
    text-decoration: none;
    border-radius: 0;
    transition: color 0.2s ease;
}

.blog-pagination .page-numbers.current {
    color: var(--heading-color, #1a1a1a);
    font-weight: 600;
}

.blog-pagination .page-numbers:hover:not(.current) {
    color: var(--heading-color, #1a1a1a);
}

.blog-pagination .prev,
.blog-pagination .next {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   7. Single Post Page
   Reference: Mau Pets article detail (Prestige theme)
   - Full-width featured image
   - White content card floats up over image (negative margin-top)
   - Narrow column (max-width 620px / 780px)
   - Body 14px / line-height 27px (1.93)
   - H2 uppercase + letter-spacing 3px
   - Share buttons table layout 60x45px
   - Article nav: dark background + large image cards
   -------------------------------------------------------------------------- */

/* Featured Image */
.article-image-wrapper {
    width: 100%;
    overflow: hidden;
}

.article-image-wrapper .article-image {
    display: block;
    width: 100%;
    height: 335px;
    object-fit: cover;
    object-position: center;
}

/* Content Card — floats up over image */
.article-wrapper {
    max-width: 620px;
    margin: -45px auto 0;
    padding: 24px 24px 0;
    background: var(--background, #fff);
    position: relative;
    z-index: 2;
}

/* Header */
.article-header {
    margin-bottom: 24px;
}

.article-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--text-color, #666);
}

.article-meta__item {
    display: inline-block;
}

.article-meta__item + .article-meta__item::before {
    content: "\00B7";
    margin-right: 8px;
}

.article-title {
    font-family: var(--heading-font-family, var(--text-font-family, inherit));
    font-size: 28px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--heading-color, #1a1a1a);
    margin: 0 0 18px;
}

/* Title divider line */
.article-title::after {
    content: "";
    display: block;
    width: 40px;
    height: 2px;
    background: var(--heading-color, #1a1a1a);
    margin-top: 18px;
}

/* Share Buttons */
.share-buttons {
    display: table;
    margin-bottom: 30px;
}

.share-btn {
    display: table-cell;
    width: 60px;
    height: 45px;
    text-align: center;
    vertical-align: middle;
    border: 1px solid var(--border-color, #e5e5e5);
    border-right: none;
    color: var(--heading-color, #1a1a1a);
    transition: background 0.2s ease, color 0.2s ease;
}

.share-btn:last-child {
    border-right: 1px solid var(--border-color, #e5e5e5);
}

.share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    vertical-align: middle;
}

.share-btn:hover {
    background: var(--heading-color, #1a1a1a);
    color: #fff;
}

.share-btn--facebook:hover { background: #1877f2; border-color: #1877f2; }
.share-btn--instagram:hover { background: #e4405f; border-color: #e4405f; }
.share-btn--whatsapp:hover { background: #25d366; border-color: #25d366; }

/* Article Content */
.article-content {
    font-size: 14px;
    line-height: 1.93;
    color: var(--text-color, #333);
}

.article-content h2 {
    font-family: var(--heading-font-family, var(--text-font-family, inherit));
    font-size: 20px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--heading-color, #1a1a1a);
    margin: 40px 0 16px;
}

.article-content h3 {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
    margin: 30px 0 12px;
}

.article-content p {
    margin: 0 0 16px;
}

.article-content a {
    color: var(--heading-color, #1a1a1a);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-content figure {
    margin: 0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 24px 0;
}

.article-content blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    border-left: 3px solid var(--accent-color, #c49a6c);
    background: rgba(196, 154, 108, 0.06);
    font-style: italic;
    color: var(--text-color, #555);
}

.article-content ul,
.article-content ol {
    margin: 0 0 16px 24px;
    padding: 0;
}

.article-content li {
    margin-bottom: 8px;
}

/* Article Footer */
.article-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color, #e5e5e5);
    margin-bottom: 60px;
}

.article-footer .share-buttons {
    margin-bottom: 16px;
}

.article-author {
    display: block;
    font-size: 13px;
    color: var(--text-color, #666);
}

/* Article Navigation (dark background + large image cards) */
.article-nav {
    padding: 80px 24px;
    background: #1a1a1a;
}

.article-nav__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1260px;
    margin: 0 auto;
}

.article-nav__item {
    display: block;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s ease;
}

.article-nav__item:hover {
    opacity: 0.8;
}

.article-nav__image {
    width: 100%;
    height: 280px;
    overflow: hidden;
    margin-bottom: 20px;
}

.article-nav__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.article-nav__label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.article-nav__title {
    font-family: var(--heading-font-family, var(--text-font-family, inherit));
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
    color: #fff;
}

/* --------------------------------------------------------------------------
   7. Post Navigation
   -------------------------------------------------------------------------- */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: var(--space-6);
    padding: var(--space-12) 0;
    margin-top: var(--space-8);
    border-top: 1px solid var(--color-border-light);
}

.post-navigation__prev,
.post-navigation__next {
    flex: 1;
    max-width: 50%;
}

.post-navigation__prev a,
.post-navigation__next a {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.post-navigation__next a {
    flex-direction: row-reverse;
    text-align: right;
}

.post-navigation__next {
    text-align: right;
}

.post-navigation__next--full {
    max-width: 100%;
    margin-left: auto;
}

.post-navigation a {
    text-decoration: none;
    display: block;
}

.post-navigation__label {
    display: block;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.post-navigation__title {
    display: block;
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
    line-height: var(--leading-snug);
    transition: color var(--transition-fast);
}

.post-navigation a:hover .post-navigation__title {
    color: var(--color-accent-wood);
}

.post-navigation__thumb {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-bg-secondary);
}

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

.post-navigation__prev .post-navigation__thumb + .post-navigation__label,
.post-navigation__prev .post-navigation__thumb + .post-navigation__label + .post-navigation__title {
    /* text wraps around thumb on left side */
}

.post-navigation__text {
    flex: 1;
    min-width: 0;
}

.post-navigation__next .post-navigation__text {
    text-align: right;
}

/* Comments Area */
.comments-area {
    padding: var(--space-12) 0;
    margin-top: var(--space-8);
    border-top: 1px solid var(--color-border-light);
}

.comments-area .comment-list {
    list-style: none;
    padding: 0;
}

.comments-area .comment {
    padding: var(--space-6) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.comments-area .comment-author {
    font-weight: var(--font-semibold);
}

.comments-area .comment-metadata {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.comments-area .reply {
    margin-top: var(--space-2);
}

.comments-area .reply a {
    font-size: var(--text-sm);
    color: var(--color-accent-wood);
    text-decoration: none;
}

.comments-area .comment-form label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-2);
}

.comments-area .comment-form input,
.comments-area .comment-form textarea {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--text-base);
}

.comments-area .comment-form .submit {
    background: var(--color-primary-dark);
    color: var(--color-text-light);
    border: none;
    padding: var(--space-3) var(--space-8);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: var(--font-semibold);
    transition: background var(--transition-fast);
}

.comments-area .comment-form .submit:hover {
    background: var(--color-accent-wood);
}

/* --------------------------------------------------------------------------
   8. Responsive — Mobile
   -------------------------------------------------------------------------- */
@media screen and (max-width: 640px) {
    .blog-hero {
        margin-top: 20px;
        padding: 0 16px;
    }

    .blog-hero__image {
        height: 400px;
    }

    .blog-hero__content {
        bottom: 24px;
        left: 24px;
        right: 24px;
    }

    .blog-hero__title {
        font-size: 20px;
        max-width: 100%;
    }

    .blog-hero__cta {
        font-size: 12px;
        letter-spacing: 2px;
    }

    .blog-list-wrapper {
        padding: 0 16px;
        margin-bottom: 40px;
    }

    .blog-grid {
        gap: 40px;
    }

    .blog-card__content {
        padding: 0 8px;
    }

    .blog-card__title {
        font-size: 15px;
        letter-spacing: 2px;
    }

    .blog-pagination {
        margin-top: 40px;
    }

    /* Single post mobile */
    .article-image-wrapper .article-image {
        height: 215px;
    }

    .article-wrapper {
        margin-top: -30px;
        padding: 20px 16px 0;
    }

    .article-title {
        font-size: 22px;
    }

    .article-title::after {
        margin-top: 14px;
    }

    .article-content h2 {
        font-size: 16px;
        letter-spacing: 2px;
    }

    .article-nav {
        padding: 60px 16px;
    }

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

    .article-nav__image {
        height: 200px;
    }
}
