/**
 * Post Shortcode Styles
 *
 * Displays blog posts with various layouts.
 * Layouts: grid, list, card, compact, featured
 *
 * @since 1.0.0
 */

/* ==========================================================================
   Base Container
   ========================================================================== */

.oe-posts {
    margin: 1.5em 0;
}

/* ==========================================================================
   Grid Layout (Default)
   ========================================================================== */

.oe-posts--grid {
    display: grid;
    gap: 1.5rem;
}

.oe-posts--cols-1 {
    grid-template-columns: 1fr;
}

.oe-posts--cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.oe-posts--cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.oe-posts--cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ==========================================================================
   Post Card
   ========================================================================== */

.oe-post {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--oe-color-border);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.oe-post:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* ==========================================================================
   Thumbnail / Image
   ========================================================================== */

.oe-post__image-wrapper {
    position: relative;
}

.oe-post__image-wrapper,
.oe-post__image-link {
    display: block;
    text-decoration: none;
}

.oe-post__image {
    position: relative;
    overflow: hidden;
    background: var(--oe-color-bg-alt);
    aspect-ratio: 16 / 10;
}

.oe-posts--grid .oe-post__image,
.oe-posts--card .oe-post__image {
    aspect-ratio: 16 / 10;
}

.oe-post__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.oe-post:hover .oe-post__image img {
    transform: scale(1.05);
}

/* ==========================================================================
   Content
   ========================================================================== */

.oe-post__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.25rem;
}

.oe-post__image-wrapper .oe-post__category {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1;
}

.oe-post__category {
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.625rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    text-decoration: none;
}

.oe-post__category:hover {
    background: #fff;
    color: var(--oe-color-text-dark);
}

.oe-post__title {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
}

.oe-post__title a {
    color: var(--oe-color-text-dark);
    text-decoration: none;
}

.oe-post__title a:hover {
    color: var(--oe-color-primary);
}

/* ==========================================================================
   Meta
   ========================================================================== */

.oe-post__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    color: var(--oe-color-text-muted);
}

.oe-post__author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.oe-post__author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.oe-post__author-name {
    font-weight: 500;
    color: #374151;
}

.oe-post__author-by {
    color: var(--oe-color-text-muted);
}

.oe-post__author a {
    color: #374151;
    text-decoration: none;
}

.oe-post__author a:hover {
    color: var(--oe-color-primary);
}

.oe-post__date {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.oe-post__date-icon {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   List Layout
   ========================================================================== */

.oe-posts--list .oe-post {
    flex-direction: row;
}

.oe-posts--list .oe-post__image-wrapper {
    flex-shrink: 0;
    width: 280px;
    aspect-ratio: auto;
    height: 180px;
}

.oe-posts--list .oe-post__content {
    justify-content: center;
}

/* ==========================================================================
   Compact Layout
   ========================================================================== */

.oe-posts--compact .oe-post {
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.oe-posts--compact .oe-post__image-wrapper {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    aspect-ratio: 1;
    border-radius: 6px;
}

.oe-posts--compact .oe-post__content {
    padding: 0 0 0 1rem;
}

.oe-posts--compact .oe-post__category {
    display: none;
}

.oe-posts--compact .oe-post__title {
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.oe-posts--compact .oe-post__meta {
    font-size: 0.75rem;
}

/* ==========================================================================
   Card Layout
   ========================================================================== */

.oe-posts--card .oe-post {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.oe-posts--card .oe-post:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Featured Layout
   ========================================================================== */

.oe-posts--featured {
    display: grid;
    gap: 1rem;
}

.oe-posts--featured.oe-posts--cols-2 {
    grid-template-columns: 2fr 1fr;
}

.oe-posts--featured.oe-posts--cols-3 {
    grid-template-columns: 2fr 1fr 1fr;
}

.oe-posts--featured .oe-post:first-child {
    grid-row: span 2;
}

.oe-posts--featured .oe-post:first-child .oe-post__image-wrapper {
    aspect-ratio: auto;
    height: 100%;
    min-height: 300px;
}

.oe-posts--featured .oe-post:first-child .oe-post__title {
    font-size: 1.5rem;
}

.oe-posts--featured .oe-post:not(:first-child) .oe-post__image-wrapper {
    aspect-ratio: 16 / 10;
}

/* ==========================================================================
   Single Post
   ========================================================================== */

.oe-post--single {
    max-width: 1140px;
    margin: 0 auto;
}

.oe-post--single .oe-post__image-wrapper {
    aspect-ratio: 21 / 9;
}

.oe-post--single .oe-post__content {
    padding: 1.5rem;
}

.oe-post--single .oe-post__title {
    font-size: 1.5rem;
}

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

@media (max-width: 1024px) {
    .oe-posts--cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    .oe-posts--featured.oe-posts--cols-3 {
        grid-template-columns: 1.5fr 1fr;
    }
}

@media (max-width: 768px) {
    .oe-posts--cols-3,
    .oe-posts--cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .oe-posts--list .oe-post {
        flex-direction: column;
    }

    .oe-posts--list .oe-post__image-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .oe-posts--featured,
    .oe-posts--featured.oe-posts--cols-2,
    .oe-posts--featured.oe-posts--cols-3 {
        grid-template-columns: 1fr;
    }

    .oe-posts--featured .oe-post:first-child {
        grid-row: auto;
    }

    .oe-posts--featured .oe-post:first-child .oe-post__image-wrapper {
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .oe-posts--cols-2,
    .oe-posts--cols-3,
    .oe-posts--cols-4 {
        grid-template-columns: 1fr;
    }

    .oe-post__content {
        padding: 1rem;
    }

    .oe-post__title {
        font-size: 1rem;
    }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .oe-posts--grid {
        display: block;
    }

    .oe-post {
        break-inside: avoid;
        margin-bottom: 1rem;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .oe-post__image-wrapper {
        max-height: 150px;
    }
}