/* Featured Pages Magazine Layout */

.fpm-magazine {
    width: 100%;
    margin: 1.5em 0;
}

/* Header */
.fpm-header {
    margin-bottom: 1.25em;
}

.fpm-title {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--fpm-title-color, #212529);
    margin-bottom: 0;
}

/* Layout */
.fpm-layout {
    display: flex;
    gap: var(--fpm-gap, 20px);
    align-items: flex-start;
}

.fpm-main {
    flex: 1 1 55%;
    min-width: 0;
}

.fpm-side {
    flex: 1 1 45%;
    min-width: 0;
}

/* Main Card */
.fpm-main-card {
    background: var(--fpm-card-bg, #fff);
    border-radius: var(--fpm-border-radius, 12px);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.fpm-main-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

/* Transparent Background Variant */
.fpm-main-card.fpm-transparent,
.fpm-side-item.fpm-transparent {
    background: transparent;
    box-shadow: none;
}

.fpm-main-card.fpm-transparent:hover,
.fpm-side-item.fpm-transparent:hover {
    box-shadow: none;
    transform: none;
}

.fpm-main-body.fpm-transparent,
.fpm-side-body.fpm-transparent {
    background: transparent;
}

/* Main Image - 16:9 aspect ratio */
.fpm-main-image {
    position: relative;
    display: block;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
}

.fpm-main-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.fpm-main-card:hover .fpm-main-image img {
    transform: scale(1.05);
}

/* No Image Placeholder */
.fpm-no-image {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.fpm-no-image i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5em;
    color: #adb5bd;
}

/* Main Body */
.fpm-main-body {
    padding: 1.25em;
}

/* Category */
.fpm-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #868e96;
    margin-bottom: 0.5em;
}

/* Main Title */
.fpm-main-title {
    font-size: 0.95rem !important;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75em;
}

.fpm-main-title a {
    color: var(--fpm-title-color, #212529);
    text-decoration: none;
    transition: color 0.2s ease;
}

.fpm-main-title a:hover {
    color: var(--fpm-title-hover-color, #4263eb);
    text-decoration: underline;
}

/* Main Introtext */
.fpm-main-intro {
    font-size: 0.95em;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 0;
}

/* Side Items Container */
.fpm-side-items {
    display: flex;
    flex-direction: column;
    gap: var(--fpm-gap, 20px);
}

/* Side Item */
.fpm-side-item {
    background: var(--fpm-card-bg, #fff);
    border-radius: var(--fpm-border-radius, 12px);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.fpm-side-item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.fpm-side-item-inner {
    display: flex;
}

/* Side Image - Fixed 160px width */
.fpm-side-image {
    position: relative;
    display: block;
    width: 160px;
    min-width: 160px;
    height: 110px;
    overflow: hidden;
    border-radius: var(--fpm-border-radius, 12px) 0 0 var(--fpm-border-radius, 12px);
}

.fpm-side-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.fpm-side-item:hover .fpm-side-image img {
    transform: scale(1.08);
}

/* Side Body */
.fpm-side-body {
    padding: 0.75em 1em;
    display: flex;
    flex-direction: column;
    justify-content: top;
    min-width: 0;
}

/* Side Title */
.fpm-side-title {
    font-size: 0.95rem !important;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0;
}

.fpm-side-title a {
    color: var(--fpm-title-color, #212529);
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fpm-side-title a:hover {
    color: var(--fpm-title-hover-color, #4263eb);
    text-decoration: underline;
}

/* Dark mode */
[data-bs-theme="dark"] .fpm-main-card,
[data-bs-theme="dark"] .fpm-side-item {
    background: var(--fpm-card-bg, #1a1d23);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .fpm-main-card:hover,
[data-bs-theme="dark"] .fpm-side-item:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .fpm-main-card.fpm-transparent,
[data-bs-theme="dark"] .fpm-side-item.fpm-transparent {
    background: transparent;
    box-shadow: none;
}

[data-bs-theme="dark"] .fpm-main-card.fpm-transparent:hover,
[data-bs-theme="dark"] .fpm-side-item.fpm-transparent:hover {
    box-shadow: none;
}

[data-bs-theme="dark"] .fpm-title {
    color: var(--fpm-title-color, #e9ecef);
}

[data-bs-theme="dark"] .fpm-category {
    color: #868e96;
}

[data-bs-theme="dark"] .fpm-main-title a,
[data-bs-theme="dark"] .fpm-side-title a {
    color: var(--fpm-title-color, #e9ecef);
}

[data-bs-theme="dark"] .fpm-main-title a:hover,
[data-bs-theme="dark"] .fpm-side-title a:hover {
    color: var(--fpm-title-hover-color, #748ffc);
}

[data-bs-theme="dark"] .fpm-main-intro {
    color: #adb5bd;
}

[data-bs-theme="dark"] .fpm-no-image {
    background: linear-gradient(135deg, #2c2c2c 0%, #343a40 100%);
}

[data-bs-theme="dark"] .fpm-no-image i {
    color: #495057;
}

/* Responsive */
@media (max-width: 767px) {
    .fpm-layout {
        flex-direction: column;
    }

    .fpm-main,
    .fpm-side {
        flex: 1 1 100%;
    }

    .fpm-main-title {
        font-size: 0.85rem !important;
    }

    .fpm-main-body {
        padding: 1em;
    }

    .fpm-side-body {
        padding: 0.875em;
    }

    .fpm-side-title {
        font-size: 0.85rem !important;
    }

    .fpm-category {
        font-size: 0.65rem;
    }

    .fpm-main-intro {
        font-size: 0.875em;
    }

    .fpm-side-image {
        width: 100%;
        min-width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        border-radius: var(--fpm-border-radius, 12px) var(--fpm-border-radius, 12px) 0 0;
    }

    .fpm-side-item-inner {
        flex-direction: column;
    }
}
