/**
 * Advanced Posts Manager Elementor frontend widgets.
 */
.apm-el-empty {
    padding: 18px 20px;
    border: 1px dashed rgba(100, 116, 139, 0.45);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.92), rgba(241, 245, 249, 0.82));
    color: #64748b;
    font-size: 14px;
}

.apm-el-stat-pill,
.apm-el-stat-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.10);
    border: 1px solid rgba(226, 232, 240, 0.95);
    color: #0f172a;
    backdrop-filter: blur(12px);
}

.apm-el-stat-card {
    border-radius: 24px;
    padding: 20px 22px;
    min-width: 170px;
}

.apm-el-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #eff6ff, #f5f3ff);
    font-size: 18px;
    flex: 0 0 auto;
}

.apm-el-stat-text {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.15;
}

.apm-el-stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.apm-el-stat-text strong {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.apm-el-stat-text em {
    font-size: 12px;
    color: #64748b;
    font-style: normal;
}

.apm-el-card {
    height: 100%;
    overflow: hidden;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.92);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.11);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.apm-el-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 62px rgba(15, 23, 42, 0.16);
    border-color: rgba(147, 197, 253, 0.75);
}

.apm-el-card__thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe, #ede9fe, #fce7f3);
}

.apm-el-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.apm-el-card:hover .apm-el-card__thumb img {
    transform: scale(1.055);
}

.apm-el-card__placeholder {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.34), transparent 35%), radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.28), transparent 38%), linear-gradient(135deg, #eff6ff, #f8fafc);
}

.apm-el-card__body {
    padding: 20px;
}

.apm-el-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.apm-el-card__meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.apm-el-card__title {
    margin: 0 0 10px;
    font-size: clamp(18px, 2vw, 23px);
    line-height: 1.25;
    font-weight: 850;
}

.apm-el-card__title a {
    color: #0f172a;
    text-decoration: none;
}

.apm-el-card__title a:hover {
    color: #2563eb;
}

.apm-el-card__excerpt {
    margin: 0 0 16px;
    color: #475569;
    line-height: 1.75;
    font-size: 14px;
}

.apm-el-card__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #2563eb;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.apm-el-card__link::after {
    content: "→";
    transition: transform .18s ease;
}

.apm-el-card__link:hover::after {
    transform: translateX(4px);
}

.apm-el-slider {
    position: relative;
    --apm-cards-per-view: 3;
}

.apm-el-slider__viewport {
    overflow: hidden;
    border-radius: 28px;
}

.apm-el-slider__track {
    display: flex;
    gap: 22px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 4px 4px 20px;
    scrollbar-width: none;
}

.apm-el-slider__track::-webkit-scrollbar {
    display: none;
}

.apm-el-slide {
    scroll-snap-align: start;
    flex: 0 0 calc((100% - (22px * (var(--apm-cards-per-view) - 1))) / var(--apm-cards-per-view));
    min-width: 260px;
}

.apm-el-slider__controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.apm-el-slider__btn {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    background: #0f172a;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.22);
    transition: transform .18s ease, opacity .18s ease;
}

.apm-el-slider__btn:hover {
    transform: translateY(-2px);
}

.apm-el-slider__btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

.apm-el-category-posts {
    --apm-grid-columns: 3;
}

.apm-el-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding: 8px;
    border-radius: 24px;
    background: rgba(241, 245, 249, .85);
    border: 1px solid rgba(226, 232, 240, .95);
}

.apm-el-category-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 14px;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    background: transparent;
    color: #334155;
    font-weight: 800;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.apm-el-category-tab em {
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .20);
    color: currentColor;
    font-size: 12px;
    font-style: normal;
}

.apm-el-category-tab:hover,
.apm-el-category-tab.is-active {
    background: #0f172a;
    color: #ffffff;
    transform: translateY(-1px);
}

.apm-el-category-posts__grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--apm-grid-columns), minmax(0, 1fr));
    gap: 22px;
    min-height: 160px;
}

.apm-el-category-posts.is-loading .apm-el-category-posts__grid {
    opacity: .52;
    pointer-events: none;
}

.apm-el-category-posts.is-loading .apm-el-category-posts__grid::after {
    content: attr(data-loading-text);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: rgba(255, 255, 255, .72);
    color: #0f172a;
    font-weight: 900;
    backdrop-filter: blur(5px);
}

.rtl .apm-el-card__link::after {
    content: "←";
}

.rtl .apm-el-card__link:hover::after {
    transform: translateX(-4px);
}

@media (max-width: 1024px) {
    .apm-el-slider {
        --apm-cards-per-view: 2;
    }
    .apm-el-category-posts {
        --apm-grid-columns: 2;
    }
}

@media (max-width: 640px) {
    .apm-el-slider {
        --apm-cards-per-view: 1;
    }
    .apm-el-slide {
        min-width: 86%;
    }
    .apm-el-category-posts {
        --apm-grid-columns: 1;
    }
    .apm-el-slider__controls {
        justify-content: center;
    }
    .apm-el-card__body {
        padding: 17px;
    }
}

/* Prebuilt Elementor post templates */
.apm-el-post-template {
    --apm-template-text: #0f172a;
    --apm-template-muted: #64748b;
    --apm-template-border: rgba(148, 163, 184, .28);
    --apm-template-card: #ffffff;
    --apm-template-accent: #2563eb;
    font-family: inherit;
}
.apm-el-post-template a { color: inherit; }
.apm-template-post-terms { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.apm-template-post-terms a { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; background: color-mix(in srgb, var(--apm-template-accent) 12%, #fff); color: var(--apm-template-accent); }
.apm-template-post-title { margin: 0; color: var(--apm-template-text); font-weight: 900; letter-spacing: -.055em; line-height: .98; font-size: clamp(42px, 7vw, 92px); }
.apm-template-post-excerpt { color: var(--apm-template-muted); font-size: clamp(18px, 2vw, 24px); line-height: 1.65; margin: 24px 0 0; max-width: 820px; }
.apm-template-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 24px 0; color: var(--apm-template-muted); }
.apm-template-meta-item { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--apm-template-border); border-radius: 999px; padding: 8px 12px; background: rgba(255,255,255,.72); font-size: 13px; font-weight: 700; }
.apm-template-meta-item:before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--apm-template-accent); }
.apm-template-featured-image { margin: 34px 0; overflow: hidden; border-radius: 30px; background: linear-gradient(135deg, #e2e8f0, #f8fafc); box-shadow: 0 30px 80px rgba(15, 23, 42, .14); }
.apm-template-featured-image img { display: block; width: 100%; height: auto; object-fit: cover; }
.apm-template-featured-image--empty { min-height: 380px; }
.apm-template-featured-image--empty span { display: block; min-height: 380px; background: linear-gradient(135deg, color-mix(in srgb, var(--apm-template-accent) 22%, #e2e8f0), #f8fafc); }
.apm-template-post-content { color: #1f2937; font-size: 18px; line-height: 1.86; max-width: 860px; margin: 40px auto 0; }
.apm-template-post-content :where(h2,h3,h4) { color: #0f172a; letter-spacing: -.025em; line-height: 1.15; margin-top: 1.8em; }
.apm-template-post-content p { margin-bottom: 1.25em; }
.apm-template-post-content img { border-radius: 22px; }
.apm-template-reading-time,
.apm-template-post-visits,
.apm-template-post-date,
.apm-template-post-author { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 1px solid var(--apm-template-border); border-radius: 18px; padding: 12px 14px; background: #fff; color: #0f172a; box-sizing: border-box; }
.apm-template-stat-label { color: var(--apm-template-muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.apm-template-aurora { --apm-template-accent: #7c3aed; padding: clamp(42px, 7vw, 96px) clamp(18px, 5vw, 72px); background: radial-gradient(circle at 85% 8%, rgba(124,58,237,.18), transparent 28%), linear-gradient(180deg, #fbfaff, #fff); border-radius: 40px; }
.apm-template-aurora .apm-template-post-title { max-width: 1050px; }
.apm-template-aurora .apm-template-featured-image img,
.apm-template-glass .apm-template-featured-image img,
.apm-template-dark .apm-template-featured-image img { min-height: 520px; }
.apm-template-split { --apm-template-accent: #0ea5e9; padding: clamp(30px, 5vw, 70px); background: #f8fafc; border-radius: 38px; }
.apm-template-split .elementor-row,
.apm-template-split .elementor-container { align-items: center; }
.apm-template-split .apm-template-image-column { padding-right: 28px; }
.apm-template-split .apm-template-copy-column { padding-left: 28px; }
.apm-template-split .apm-template-featured-image { margin: 0; min-height: 620px; }
.apm-template-split .apm-template-featured-image img { min-height: 620px; height: 100%; }
.apm-template-split .apm-template-post-title { font-size: clamp(40px, 5.5vw, 76px); }
.apm-template-split-body { padding: 20px clamp(18px, 5vw, 72px) 70px; }
.apm-template-dark { --apm-template-accent: #38bdf8; --apm-template-text: #f8fafc; --apm-template-muted: #cbd5e1; padding: clamp(42px, 7vw, 96px) clamp(18px, 5vw, 72px); background: radial-gradient(circle at top right, rgba(56,189,248,.2), transparent 30%), linear-gradient(135deg, #020617, #111827); border-radius: 40px; color: #e5e7eb; }
.apm-template-dark .apm-template-post-title,
.apm-template-dark .apm-template-post-content,
.apm-template-dark .apm-template-post-content :where(h2,h3,h4) { color: #f8fafc; }
.apm-template-dark .apm-template-post-content { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 28px; padding: clamp(24px, 4vw, 56px); }
.apm-template-dark .apm-template-meta-item { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #e5e7eb; }
.apm-template-dark .apm-template-post-terms a { background: rgba(56,189,248,.15); color: #7dd3fc; }
.apm-template-minimal { --apm-template-accent: #059669; padding: clamp(40px, 6vw, 92px) 18px; background: #fff; text-align: center; }
.apm-template-minimal .elementor-widget-wrap { max-width: 960px; margin: 0 auto; }
.apm-template-minimal .apm-template-post-terms,
.apm-template-minimal .apm-template-post-meta { justify-content: center; }
.apm-template-minimal .apm-template-post-excerpt { margin-left: auto; margin-right: auto; }
.apm-template-minimal .apm-template-post-title { font-size: clamp(42px, 6.2vw, 84px); }
.apm-template-minimal .apm-template-post-content { text-align: left; }
.apm-template-glass { --apm-template-accent: #db2777; padding: clamp(36px, 6vw, 88px) clamp(18px, 5vw, 72px); background: radial-gradient(circle at 25% 0%, rgba(219,39,119,.18), transparent 30%), radial-gradient(circle at 80% 20%, rgba(14,165,233,.16), transparent 28%), #fff7fb; border-radius: 42px; }
.apm-template-glass .apm-template-title-widget,
.apm-template-glass .apm-template-meta-widget,
.apm-template-glass .apm-template-excerpt-widget { max-width: 900px; margin-left: auto; margin-right: auto; padding-left: clamp(20px, 4vw, 54px); padding-right: clamp(20px, 4vw, 54px); }
.apm-template-glass .apm-template-featured-image { position: relative; margin-bottom: -80px; }
.apm-template-glass .apm-template-terms-widget,
.apm-template-glass .apm-template-title-widget,
.apm-template-glass .apm-template-meta-widget,
.apm-template-glass .apm-template-excerpt-widget { position: relative; z-index: 2; }
.apm-template-glass .apm-template-title-widget { margin-top: 110px; background: rgba(255,255,255,.74); border: 1px solid rgba(255,255,255,.86); border-radius: 30px 30px 0 0; padding-top: 34px; backdrop-filter: blur(18px); }
.apm-template-glass .apm-template-meta-widget,
.apm-template-glass .apm-template-excerpt-widget { background: rgba(255,255,255,.74); border-left: 1px solid rgba(255,255,255,.86); border-right: 1px solid rgba(255,255,255,.86); backdrop-filter: blur(18px); }
.apm-template-glass .apm-template-excerpt-widget { border-radius: 0 0 30px 30px; padding-bottom: 30px; }
.apm-template-digest-head { --apm-template-accent: #f97316; padding: clamp(36px, 5vw, 76px) clamp(18px, 5vw, 72px) 20px; background: linear-gradient(180deg, #fff7ed, #fff); border-radius: 38px 38px 0 0; }
.apm-template-digest-head .apm-template-post-title { max-width: 1050px; font-size: clamp(42px, 6vw, 82px); }
.apm-template-digest-body { --apm-template-accent: #f97316; padding: 20px clamp(18px, 5vw, 72px) 78px; background: #fff; border-radius: 0 0 38px 38px; }
.apm-template-digest-body .apm-template-main-column { padding-right: 34px; }
.apm-template-digest-body .apm-template-sidebar-column { padding-left: 18px; }
.apm-template-sidebar-column .elementor-widget-wrap { position: sticky; top: 32px; border: 1px solid var(--apm-template-border); border-radius: 28px; padding: 22px; background: #fffaf5; box-shadow: 0 20px 50px rgba(15, 23, 42, .08); }
.apm-template-sidebar-heading h3 { margin: 0 0 14px; font-size: 20px; }
.apm-template-sidebar-stat { margin-bottom: 10px; }
.apm-template-sidebar-terms .apm-template-post-terms { margin-top: 16px; }
@media (max-width: 767px) {
    .apm-template-post-title { font-size: clamp(34px, 11vw, 54px); }
    .apm-template-post-meta { align-items: stretch; }
    .apm-template-meta-item { width: 100%; justify-content: center; }
    .apm-template-split .apm-template-image-column,
    .apm-template-split .apm-template-copy-column,
    .apm-template-digest-body .apm-template-main-column,
    .apm-template-digest-body .apm-template-sidebar-column { padding-left: 0; padding-right: 0; }
    .apm-template-featured-image,
    .apm-template-featured-image img,
    .apm-template-featured-image--empty,
    .apm-template-featured-image--empty span,
    .apm-template-split .apm-template-featured-image,
    .apm-template-split .apm-template-featured-image img { min-height: 300px; }
}
