/**
 * MagFlow Blocks Styles
 *
 * @package MagFlow_Core
 */

/* ==========================================================================
   Block Common Styles
   ========================================================================== */

.mf-block {
    margin-bottom: 30px;
}

/* Section Heading */
.mf-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
    --mf-heading-border-color: var(--mf-color-primary, #0066ff);
}

.mf-heading-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.mf-heading-subtitle {
    margin: 5px 0 0;
    font-size: 0.875rem;
    color: var(--mf-text-muted, #6c757d);
}

.mf-view-all {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mf-color-primary, #0066ff);
    white-space: nowrap;
}

.mf-view-all:hover {
    color: var(--mf-color-secondary, #57a9f2);
}

/* Heading Styles */
.mf-heading-border {
    border-bottom: 2px solid var(--mf-border-color, #e5e5e5);
    padding-bottom: 15px;
}

.mf-heading-border .mf-heading-title {
    position: relative;
    padding-bottom: 15px;
}

.mf-heading-border .mf-heading-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--mf-heading-border-color);
}

.mf-heading-modern .mf-heading-title {
    display: inline-block;
    padding-left: 15px;
    border-left: 4px solid var(--mf-heading-border-color);
}

.mf-heading-minimal .mf-heading-title {
    font-size: 1.125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mf-heading-boxed .mf-heading-title {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--mf-heading-border-color);
    color: #fff;
}

/* Alignment */
.mf-align-center {
    justify-content: center;
    text-align: center;
}

.mf-align-center .mf-heading-inner {
    text-align: center;
}

.mf-align-right {
    flex-direction: row-reverse;
    text-align: right;
}

/* ==========================================================================
   Posts Grid
   ========================================================================== */

.mf-posts-grid {
    display: grid;
    gap: 30px;
}

.mf-post-card {
    background: var(--mf-bg-primary, #fff);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.mf-post-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.mf-post-thumbnail {
    position: relative;
    overflow: hidden;
}

.mf-post-thumb-link {
    display: block;
}

.mf-post-thumbnail img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.mf-post-category {
    position: absolute;
    bottom: 10px;
    left: 10px;
}

.mf-category-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background: var(--mf-color-primary, #0066ff);
    border-radius: 4px;
}

.mf-category-badge:hover {
    background: var(--mf-color-secondary, #57a9f2);
    color: #fff;
}

.mf-post-content {
    padding: 20px;
}

.mf-post-title {
    margin: 0 0 10px;
    font-size: 1.125rem;
    line-height: 1.4;
}

.mf-post-title a {
    color: var(--mf-text-primary, #1a1a1a);
}

.mf-post-title a:hover {
    color: var(--mf-color-primary, #0066ff);
}

.mf-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.875rem;
    color: var(--mf-text-muted, #6c757d);
}

.mf-meta-author a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--mf-text-muted, #6c757d);
}

.mf-meta-author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.mf-post-excerpt {
    margin-top: 15px;
    color: var(--mf-text-secondary, #4a4a4a);
}

/* ==========================================================================
   Posts List
   ========================================================================== */

.mf-posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mf-list-item {
    display: flex;
    gap: 20px;
    background: var(--mf-bg-primary, #fff);
    border-radius: 8px;
    overflow: hidden;
}

.mf-list-thumbnail {
    flex-shrink: 0;
    width: 300px;
    overflow: hidden;
}

.mf-list-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mf-list-item:hover .mf-list-thumbnail img {
    transform: scale(1.05);
}

.mf-list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
}

/* List Style Compact */
.mf-list-compact .mf-list-thumbnail {
    width: 150px;
}

.mf-list-compact .mf-post-title {
    font-size: 1rem;
}

/* List Style Large */
.mf-list-large .mf-list-thumbnail {
    width: 400px;
}

.mf-list-large .mf-post-title {
    font-size: 1.5rem;
}

/* Image Position */
.mf-image-right .mf-list-item {
    flex-direction: row-reverse;
}

/* ==========================================================================
   Posts Overlay
   ========================================================================== */

.mf-overlay-grid {
    display: grid;
    gap: 20px;
}

.mf-overlay-item {
    position: relative;
    height: 350px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
}

.mf-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    transition: background 0.3s ease;
}

.mf-overlay-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.mf-overlay-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px;
    z-index: 2;
    color: #fff;
}

.mf-content-top .mf-overlay-content {
    top: 0;
    bottom: auto;
}

.mf-content-center .mf-overlay-content {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    text-align: center;
}

.mf-overlay-content .mf-post-title {
    color: #fff;
}

.mf-overlay-content .mf-post-meta {
    color: rgba(255, 255, 255, 0.8);
}

.mf-overlay-content .mf-meta-author a {
    color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   Featured Grid
   ========================================================================== */

.mf-featured-grid {
    display: grid;
    gap: 10px;
}

.mf-featured-item {
    position: relative;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
}

.mf-featured-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 70%);
}

.mf-featured-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.mf-featured-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 2;
    color: #fff;
}

.mf-featured-content .mf-post-title {
    color: #fff;
    margin-bottom: 10px;
}

.mf-featured-main .mf-post-title {
    font-size: 1.75rem;
}

.mf-featured-small .mf-post-title {
    font-size: 1rem;
}

.mf-featured-content .mf-post-meta {
    color: rgba(255, 255, 255, 0.8);
}

/* Layout Styles */
.mf-layout-style-1 .mf-featured-grid {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(2, 1fr);
}

.mf-layout-style-1 .mf-featured-main {
    grid-row: span 2;
}

.mf-layout-style-2 .mf-featured-grid {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: repeat(2, 1fr);
}

.mf-layout-style-2 .mf-featured-main {
    grid-row: span 2;
}

.mf-layout-style-3 .mf-featured-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.mf-layout-style-4 .mf-featured-grid {
    grid-template-columns: repeat(3, 1fr);
}

.mf-layout-style-5 .mf-featured-grid {
    grid-template-columns: 2fr 1fr;
}

.mf-layout-style-5 .mf-featured-main {
    grid-row: span 3;
}

/* ==========================================================================
   Posts Carousel
   ========================================================================== */

.mf-carousel-wrapper {
    position: relative;
}

.mf-carousel {
    overflow: hidden;
}

.mf-carousel-track {
    display: flex;
    transition: transform 0.3s ease;
}

.mf-carousel-slide {
    flex-shrink: 0;
}

.mf-carousel-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    padding: 0 10px;
}

.mf-carousel-prev,
.mf-carousel-next {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--mf-bg-primary, #fff);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
}

.mf-carousel-prev:hover,
.mf-carousel-next:hover {
    background: var(--mf-color-primary, #0066ff);
    color: #fff;
}

.mf-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.mf-carousel-dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--mf-border-color, #e5e5e5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.mf-carousel-dots button.active,
.mf-carousel-dots button:hover {
    background: var(--mf-color-primary, #0066ff);
}

/* ==========================================================================
   Posts Ticker
   ========================================================================== */

.mf-ticker {
    display: flex;
    align-items: center;
    background: var(--mf-bg-primary, #fff);
    border-radius: 8px;
    overflow: hidden;
}

.mf-ticker-label {
    flex-shrink: 0;
    padding: 12px 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--mf-color-primary, #0066ff);
    color: #fff;
}

.mf-ticker-content {
    flex: 1;
    overflow: hidden;
}

.mf-ticker-track {
    display: flex;
    animation: ticker 20s linear infinite;
}

.mf-pause-on-hover:hover .mf-ticker-track {
    animation-play-state: paused;
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.mf-ticker-item {
    flex-shrink: 0;
    padding: 12px 30px;
    white-space: nowrap;
}

.mf-ticker-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--mf-text-primary, #1a1a1a);
}

.mf-ticker-date {
    font-size: 0.875rem;
    color: var(--mf-text-muted, #6c757d);
}

.mf-ticker-title {
    font-weight: 500;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.mf-breadcrumbs {
    font-size: 0.875rem;
}

.mf-breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mf-breadcrumbs a {
    color: var(--mf-text-muted, #6c757d);
}

.mf-breadcrumbs a:hover {
    color: var(--mf-color-primary, #0066ff);
}

.mf-breadcrumbs .mf-separator {
    color: var(--mf-text-light, #adb5bd);
}

.mf-breadcrumbs .mf-current {
    color: var(--mf-text-secondary, #4a4a4a);
}

/* ==========================================================================
   Social Icons
   ========================================================================== */

.mf-social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mf-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mf-text-muted, #6c757d);
    transition: all 0.3s ease;
}

.mf-social-link svg {
    width: 20px;
    height: 20px;
}

/* Default Style */
.mf-social-default .mf-social-link:hover {
    color: var(--mf-color-primary, #0066ff);
}

/* Filled Style */
.mf-social-filled .mf-social-link {
    width: 40px;
    height: 40px;
    background: var(--mf-bg-secondary, #f8f9fa);
    border-radius: 6px;
}

.mf-social-filled .mf-social-link:hover {
    background: var(--mf-color-primary, #0066ff);
    color: #fff;
}

/* Outlined Style */
.mf-social-outlined .mf-social-link {
    width: 40px;
    height: 40px;
    border: 1px solid var(--mf-border-color, #e5e5e5);
    border-radius: 6px;
}

.mf-social-outlined .mf-social-link:hover {
    border-color: var(--mf-color-primary, #0066ff);
    background: var(--mf-color-primary, #0066ff);
    color: #fff;
}

/* Rounded Style */
.mf-social-rounded .mf-social-link {
    width: 40px;
    height: 40px;
    background: var(--mf-bg-secondary, #f8f9fa);
    border-radius: 50%;
}

.mf-social-rounded .mf-social-link:hover {
    background: var(--mf-color-primary, #0066ff);
    color: #fff;
}

/* Sizes */
.mf-social-small .mf-social-link {
    width: 32px;
    height: 32px;
}

.mf-social-small svg {
    width: 16px;
    height: 16px;
}

.mf-social-large .mf-social-link {
    width: 50px;
    height: 50px;
}

.mf-social-large svg {
    width: 24px;
    height: 24px;
}

/* Brand Colors */
.mf-brand-colors .mf-social-facebook:hover { background-color: #1877f2; color: #fff; }
.mf-brand-colors .mf-social-twitter:hover { background-color: #1da1f2; color: #fff; }
.mf-brand-colors .mf-social-instagram:hover { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); color: #fff; }
.mf-brand-colors .mf-social-youtube:hover { background-color: #ff0000; color: #fff; }
.mf-brand-colors .mf-social-linkedin:hover { background-color: #0077b5; color: #fff; }
.mf-brand-colors .mf-social-pinterest:hover { background-color: #e60023; color: #fff; }
.mf-brand-colors .mf-social-tiktok:hover { background-color: #000; color: #fff; }
.mf-brand-colors .mf-social-telegram:hover { background-color: #0088cc; color: #fff; }
.mf-brand-colors .mf-social-whatsapp:hover { background-color: #25d366; color: #fff; }

/* ==========================================================================
   Newsletter
   ========================================================================== */

.mf-newsletter {
    padding: 30px;
    background: var(--mf-bg-secondary, #f8f9fa);
    border-radius: 8px;
    text-align: center;
}

.mf-newsletter-title {
    margin: 0 0 10px;
    font-size: 1.5rem;
}

.mf-newsletter-desc {
    margin: 0 0 20px;
    color: var(--mf-text-muted, #6c757d);
}

.mf-newsletter-field {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

.mf-newsletter-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid var(--mf-border-color, #e5e5e5);
    border-right: none;
    border-radius: 6px 0 0 6px;
    outline: none;
}

.mf-newsletter-input:focus {
    border-color: var(--mf-color-primary, #0066ff);
}

.mf-newsletter-btn {
    padding: 12px 24px;
    font-weight: 600;
    color: #fff;
    background: var(--mf-color-primary, #0066ff);
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background 0.3s ease;
}

.mf-newsletter-btn:hover {
    background: var(--mf-color-secondary, #57a9f2);
}

/* Newsletter Boxed */
.mf-newsletter-boxed {
    background: var(--mf-color-primary, #0066ff);
    color: #fff;
}

.mf-newsletter-boxed .mf-newsletter-title {
    color: #fff;
}

.mf-newsletter-boxed .mf-newsletter-desc {
    color: rgba(255, 255, 255, 0.8);
}

.mf-newsletter-boxed .mf-newsletter-btn {
    background: #fff;
    color: var(--mf-color-primary, #0066ff);
}

/* Newsletter Inline */
.mf-newsletter-inline {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 30px;
    text-align: left;
}

.mf-newsletter-inline .mf-newsletter-title {
    margin: 0;
}

.mf-newsletter-inline .mf-newsletter-desc {
    display: none;
}

.mf-newsletter-inline .mf-newsletter-form {
    flex: 1;
}

/* ==========================================================================
   Author Box
   ========================================================================== */

.mf-author-box {
    display: flex;
    gap: 25px;
    padding: 25px;
    background: var(--mf-bg-secondary, #f8f9fa);
    border-radius: 8px;
}

.mf-author-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
}

.mf-author-info {
    flex: 1;
}

.mf-author-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mf-text-muted, #6c757d);
}

.mf-author-name {
    margin: 5px 0 10px;
    font-size: 1.25rem;
}

.mf-author-name a {
    color: var(--mf-text-primary, #1a1a1a);
}

.mf-author-bio {
    color: var(--mf-text-secondary, #4a4a4a);
}

.mf-author-social {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.mf-author-social .mf-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--mf-text-muted, #6c757d);
    background: var(--mf-bg-tertiary, #e9ecef);
    border-radius: 50%;
}

.mf-author-social .mf-social-link:hover {
    color: #fff;
    background: var(--mf-color-primary, #0066ff);
}

.mf-author-posts-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
    font-weight: 500;
    color: var(--mf-color-primary, #0066ff);
}

/* Author Centered */
.mf-author-centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Author Card */
.mf-author-card {
    background: var(--mf-bg-primary, #fff);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   No Posts
   ========================================================================== */

.mf-no-posts {
    padding: 40px;
    text-align: center;
    color: var(--mf-text-muted, #6c757d);
    background: var(--mf-bg-secondary, #f8f9fa);
    border-radius: 8px;
}

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

@media (max-width: 1024px) {
    .mf-layout-style-1 .mf-featured-grid,
    .mf-layout-style-2 .mf-featured-grid {
        grid-template-columns: 1fr 1fr;
    }

    .mf-layout-style-2 .mf-featured-main {
        grid-column: span 2;
        grid-row: auto;
    }

    .mf-layout-style-5 .mf-featured-grid {
        grid-template-columns: 1fr;
    }

    .mf-layout-style-5 .mf-featured-main {
        grid-row: auto;
    }
}

@media (max-width: 768px) {
    .mf-list-item {
        flex-direction: column;
    }

    .mf-list-thumbnail {
        width: 100% !important;
    }

    .mf-list-thumbnail img {
        aspect-ratio: 16/9;
    }

    .mf-image-right .mf-list-item {
        flex-direction: column;
    }

    .mf-overlay-grid {
        grid-template-columns: 1fr !important;
    }

    .mf-layout-style-1 .mf-featured-grid,
    .mf-layout-style-2 .mf-featured-grid,
    .mf-layout-style-3 .mf-featured-grid,
    .mf-layout-style-4 .mf-featured-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .mf-layout-style-1 .mf-featured-main,
    .mf-layout-style-2 .mf-featured-main {
        grid-row: auto;
        grid-column: auto;
    }

    .mf-section-heading {
        flex-direction: column;
        text-align: center;
    }

    .mf-newsletter-field {
        flex-direction: column;
    }

    .mf-newsletter-input {
        border-right: 1px solid var(--mf-border-color, #e5e5e5);
        border-radius: 6px;
    }

    .mf-newsletter-btn {
        border-radius: 6px;
        margin-top: 10px;
    }

    .mf-newsletter-inline {
        flex-direction: column;
        text-align: center;
    }

    .mf-author-box {
        flex-direction: column;
        text-align: center;
    }

    .mf-author-social {
        justify-content: center;
    }
}
