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

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

.bf-post {
    margin: 1.5em 0;
}

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

.bf-post--grid {
    display: grid;
    gap: 1.5rem;
}

.bf-post--cols-1 {
    grid-template-columns: 1fr;
}

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

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

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

.bf-post--grid .bf-post__item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.bf-post--grid .bf-post__item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

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

.bf-post--card {
    display: grid;
    gap: 1.5rem;
}

.bf-post--card .bf-post__item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.bf-post--card .bf-post__item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

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

.bf-post--list .bf-post__item {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.bf-post--list .bf-post__item:first-child {
    padding-top: 0;
}

.bf-post--list .bf-post__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.bf-post--list .bf-post__image-link {
    flex-shrink: 0;
    width: 200px;
}

.bf-post--list .bf-post__image {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.bf-post--list .bf-post__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

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

.bf-post--compact .bf-post__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.bf-post--compact .bf-post__item:last-child {
    border-bottom: none;
}

.bf-post--compact .bf-post__image-link {
    flex-shrink: 0;
    width: 80px;
}

.bf-post--compact .bf-post__image {
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 1;
}

.bf-post--compact .bf-post__content {
    flex: 1;
    min-width: 0;
}

.bf-post--compact .bf-post__title {
    font-size: 0.9375rem;
    margin: 0 0 0.25rem;
}

.bf-post--compact .bf-post__excerpt,
.bf-post--compact .bf-post__readmore {
    display: none;
}

.bf-post--compact .bf-post__meta {
    margin-top: 0;
}

.bf-post--compact .bf-post__date {
    font-size: 0.75rem;
}

/* ==========================================================================
   Featured Layout (First post large)
   ========================================================================== */

.bf-post--featured {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(3, 1fr);
}

.bf-post--featured .bf-post__item--featured {
    grid-column: span 2;
    grid-row: span 2;
}

.bf-post--featured .bf-post__item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}

.bf-post--featured .bf-post__item--featured .bf-post__image {
    aspect-ratio: 16 / 9;
}

.bf-post--featured .bf-post__item--featured .bf-post__title {
    font-size: 1.5rem;
}

.bf-post--featured .bf-post__item--featured .bf-post__excerpt {
    font-size: 1rem;
}

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

.bf-post__image-link {
    display: block;
    text-decoration: none;
}

.bf-post__image {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
}

.bf-post--grid .bf-post__image,
.bf-post--card .bf-post__image {
    aspect-ratio: 16 / 10;
}

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

.bf-post__item:hover .bf-post__image img {
    transform: scale(1.05);
}

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

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

.bf-post--list .bf-post__content,
.bf-post--compact .bf-post__content {
    padding: 0;
}

/* ==========================================================================
   Category Badge
   ========================================================================== */

.bf-post__meta-top {
    margin-bottom: 0.5rem;
}

.bf-post__category {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: #ecfdf5;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #059669;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: background-color 0.15s;
}

.bf-post__category:hover {
    background: #d1fae5;
    color: #047857;
}

/* ==========================================================================
   Title
   ========================================================================== */

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

.bf-post__title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.15s;
}

.bf-post__title a:hover {
    color: #0066cc;
}

/* ==========================================================================
   Excerpt
   ========================================================================== */

.bf-post__excerpt {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    flex: 1;
}

/* ==========================================================================
   Meta (Date, Author)
   ========================================================================== */

.bf-post__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
    font-size: 0.8125rem;
    color: #9ca3af;
}

.bf-post__date {
    color: #6b7280;
}

.bf-post__author {
    color: #6b7280;
}

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

.bf-post__author a:hover {
    color: #0066cc;
}

.bf-post__author-by {
    color: #9ca3af;
}

/* ==========================================================================
   Read More
   ========================================================================== */

.bf-post__readmore {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0066cc;
    text-decoration: none;
    transition: color 0.15s;
}

.bf-post__readmore:hover {
    color: #0052a3;
}

.bf-post__readmore-icon {
    transition: transform 0.15s;
}

.bf-post__readmore:hover .bf-post__readmore-icon {
    transform: translateX(3px);
}

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

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

    .bf-post--featured {
        grid-template-columns: repeat(2, 1fr);
    }

    .bf-post--featured .bf-post__item--featured {
        grid-column: span 2;
        grid-row: span 1;
    }
}

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

    .bf-post--list .bf-post__item {
        flex-direction: column;
        gap: 1rem;
    }

    .bf-post--list .bf-post__image-link {
        width: 100%;
    }

    .bf-post--list .bf-post__image {
        aspect-ratio: 16 / 9;
    }

    .bf-post--featured {
        grid-template-columns: 1fr;
    }

    .bf-post--featured .bf-post__item--featured {
        grid-column: span 1;
    }

    .bf-post--featured .bf-post__item--featured .bf-post__title {
        font-size: 1.25rem;
    }
}

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

    .bf-post__content {
        padding: 1rem;
    }

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

    .bf-post--compact .bf-post__image-link {
        width: 70px;
    }
}

/* ==========================================================================
   Dark Mode
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .bf-post--grid .bf-post__item,
    .bf-post--card .bf-post__item,
    .bf-post--featured .bf-post__item {
        background: #1f2937;
    }

    .bf-post--card .bf-post__item {
        border-color: #374151;
    }

    .bf-post--grid .bf-post__item:hover,
    .bf-post--card .bf-post__item:hover,
    .bf-post--featured .bf-post__item:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }

    .bf-post--list .bf-post__item {
        border-color: #374151;
    }

    .bf-post--compact .bf-post__item {
        border-color: #374151;
    }

    .bf-post__image {
        background: #374151;
    }

    .bf-post__category {
        background: #064e3b;
        color: #a7f3d0;
    }

    .bf-post__category:hover {
        background: #065f46;
        color: #6ee7b7;
    }

    .bf-post__title a {
        color: #f9fafb;
    }

    .bf-post__title a:hover {
        color: #60a5fa;
    }

    .bf-post__excerpt {
        color: #9ca3af;
    }

    .bf-post__meta {
        color: #6b7280;
    }

    .bf-post__date,
    .bf-post__author {
        color: #9ca3af;
    }

    .bf-post__author a {
        color: #e5e7eb;
    }

    .bf-post__author a:hover {
        color: #60a5fa;
    }

    .bf-post__readmore {
        color: #60a5fa;
    }

    .bf-post__readmore:hover {
        color: #93c5fd;
    }
}

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

@media print {
    .bf-post--grid .bf-post__item,
    .bf-post--card .bf-post__item,
    .bf-post--featured .bf-post__item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .bf-post__image img {
        max-height: 150px;
        object-fit: contain;
    }

    .bf-post__readmore {
        display: none;
    }
}
