/**
 * IABLOG Premium Post Layout
 * Theme-adaptive · PageSpeed optimized · Google News ready
 * GPU-accelerated animations · Accessibility-first
 */

/* ═══════════════════════════════════════════
   CSS VARIABLES — Only for accent decorations
   Text colors are NEVER overridden (theme handles it)
   ═══════════════════════════════════════════ */
.iablog-content {
    --ia-accent: var(--wp--preset--color--primary, var(--e-global-color-primary, var(--ast-global-color-0, #e94560)));
    --ia-accent-dark: var(--wp--preset--color--secondary, var(--e-global-color-secondary, var(--ast-global-color-1, #1a1a2e)));
    --ia-radius: 12px;
    --ia-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --ia-shadow-md: 0 8px 32px rgba(0, 0, 0, 0.1);
    --ia-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
}

/* ═══════════════════════════════════════════
   SCROLL ANIMATIONS (GPU-only: transform + opacity)
   ═══════════════════════════════════════════ */
@keyframes iaFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes iaSlideIn {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes iaPulseAccent {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════
   CONTENT WRAPPER
   ═══════════════════════════════════════════ */
.iablog-content {

    max-width: 780px;
    margin: 0 auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ═══════════════════════════════════════════
   HEADINGS — Animated entry, accent underline
   ═══════════════════════════════════════════ */
.iablog-content h2 {

    font-weight: 800;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    position: relative;
    animation: iaFadeUp 0.5s ease-out both;
}

.iablog-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--ia-accent);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.iablog-content h2:hover::after {
    width: 100%;
}

.iablog-content h3 {
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-left: 16px;
    position: relative;
    animation: iaSlideIn 0.5s ease-out both;
}

.iablog-content h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: linear-gradient(180deg, var(--ia-accent), var(--ia-accent-dark));
    border-radius: 4px;
}

/* ═══════════════════════════════════════════
   PARAGRAPHS
   ═══════════════════════════════════════════ */
.iablog-content p {
    margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════
   BOLD — No color override, just weight
   ═══════════════════════════════════════════ */
.iablog-content strong {
    font-weight: 700;
}

/* ═══════════════════════════════════════════
   LISTS — Custom animated bullets
   ═══════════════════════════════════════════ */
.iablog-content ul,
.iablog-content ol {
    margin: 1.5rem 0;
    padding-left: 0;
    list-style: none;
}

.iablog-content ul li,
.iablog-content ol li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 0.85rem;
    animation: iaFadeUp 0.4s ease-out both;
}

.iablog-content ul li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 11px;
    width: 8px;
    height: 8px;
    background: var(--ia-accent);
    border-radius: 50%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.iablog-content ul li:hover::before {
    transform: scale(1.5);
    box-shadow: 0 0 8px var(--ia-accent);
}

/* Staggered animation for list items */
.iablog-content ul li:nth-child(1) {
    animation-delay: 0.05s;
}

.iablog-content ul li:nth-child(2) {
    animation-delay: 0.1s;
}

.iablog-content ul li:nth-child(3) {
    animation-delay: 0.15s;
}

.iablog-content ul li:nth-child(4) {
    animation-delay: 0.2s;
}

.iablog-content ul li:nth-child(5) {
    animation-delay: 0.25s;
}

.iablog-content ul li:nth-child(6) {
    animation-delay: 0.3s;
}

/* ═══════════════════════════════════════════
   IMAGES — Hover zoom + overlay caption
   ═══════════════════════════════════════════ */
.iablog-content figure {
    margin: 2.5rem 0;
    padding: 0;
    position: relative;
    overflow: hidden;
    border-radius: var(--ia-radius);
    box-shadow: var(--ia-shadow-md);
    animation: iaFadeUp 0.6s ease-out both;
    content-visibility: auto;
    contain-intrinsic-size: auto 450px;
    line-height: 0;
    display: flex;
    flex-direction: column;
}

.iablog-content figure img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: bottom;
    /* Removes the tiny gap below inline images */
    margin: 0;
    padding: 0;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.iablog-content figure:hover img {
    transform: scale(1.04);
}

.iablog-content figcaption {
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.75) 100%);
    color: #fff !important;
    padding: 40px 24px 16px;
    margin: 0 !important;
    font-size: 0.85rem;
    font-style: italic;
    position: absolute;
    bottom: 0 !important;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.5;
    letter-spacing: 0.02em;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.iablog-content figure:hover figcaption {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════
   BLOCKQUOTE — Editorial pull quote
   ═══════════════════════════════════════════ */
.iablog-content blockquote,
.iablog-content .iablog-pullquote {
    margin: 2.5rem 0;
    padding: 28px 32px 28px 36px;
    border: none;
    border-left: 5px solid var(--ia-accent);
    border-radius: 0 var(--ia-radius) var(--ia-radius) 0;
    background: rgba(0, 0, 0, 0.03);
    font-size: 1.2rem;
    font-style: italic;
    position: relative;
    animation: iaSlideIn 0.5s ease-out both;
    transition: box-shadow 0.3s ease;
}

.iablog-content blockquote:hover,
.iablog-content .iablog-pullquote:hover {
    box-shadow: var(--ia-shadow-sm);
}

.iablog-content blockquote::before,
.iablog-content .iablog-pullquote::before {
    content: '\201C';
    font-size: 5rem;
    color: var(--ia-accent);
    position: absolute;
    top: -8px;
    left: 12px;
    line-height: 1;
    opacity: 0.15;
    animation: iaPulseAccent 3s ease-in-out infinite;
}

.iablog-content blockquote p,
.iablog-content .iablog-pullquote p {
    text-align: left;
    margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════
   HIGHLIGHT BOX — Key insight / data
   ═══════════════════════════════════════════ */
.iablog-content .iablog-highlight {
    margin: 2.5rem 0;
    padding: 28px 32px;
    background: var(--ia-accent-dark);
    color: #fff;
    border-radius: var(--ia-radius);
    font-size: 1.05rem;
    line-height: 1.75;
    box-shadow: var(--ia-shadow-md);
    position: relative;
    overflow: hidden;
    animation: iaFadeUp 0.5s ease-out both;
}

.iablog-content .iablog-highlight::before {
    content: '💡';
    font-size: 3rem;
    position: absolute;
    top: -8px;
    right: 16px;
    opacity: 0.12;
}

.iablog-content .iablog-highlight strong {
    color: var(--ia-accent);
}

.iablog-content .iablog-highlight p {
    text-align: left;
    color: #fff;
}

/* ═══════════════════════════════════════════
   CTA BOX — Call to action
   ═══════════════════════════════════════════ */
.iablog-content .iablog-cta {
    margin: 2.5rem 0;
    padding: 32px 36px;
    background: var(--ia-accent);
    color: #fff;
    border-radius: var(--ia-radius);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    box-shadow: var(--ia-shadow-md);
    position: relative;
    overflow: hidden;
    animation: iaFadeUp 0.5s ease-out both;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.iablog-content .iablog-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--ia-shadow-lg);
}

.iablog-content .iablog-cta::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%);
    transform: rotate(25deg) translateX(-100%);
    transition: transform 0.7s ease;
}

.iablog-content .iablog-cta:hover::after {
    transform: rotate(25deg) translateX(100%);
}

.iablog-content .iablog-cta p {
    color: #fff;
    text-align: center;
}

.iablog-content .iablog-cta a {
    color: #fff;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
    border-bottom: none;
    transition: text-decoration-thickness 0.2s ease;
}

.iablog-content .iablog-cta a:hover {
    text-decoration-thickness: 4px;
}

/* ═══════════════════════════════════════════
   LINKS — Accent color only on actual links
   ═══════════════════════════════════════════ */
.iablog-content a:not(.iablog-cta a) {
    color: var(--ia-accent);
    text-decoration: none;
    font-weight: 600;
    background-image: linear-gradient(var(--ia-accent), var(--ia-accent));
    background-size: 0% 2px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease;
    border-bottom: none;
}

.iablog-content a:not(.iablog-cta a):hover {
    background-size: 100% 2px;
}

/* ═══════════════════════════════════════════
   SEPARATOR — Gradient divider
   ═══════════════════════════════════════════ */
.iablog-content hr {
    border: none;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--ia-accent), var(--ia-accent-dark), transparent);
    margin: 3rem 0;
    border-radius: 2px;
    opacity: 0.6;
}

/* ═══════════════════════════════════════════
   ACCESSIBILITY — Reduced motion
   ═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {

    .iablog-content *,
    .iablog-content *::before,
    .iablog-content *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    .iablog-content {
        font-size: 1rem;
        line-height: 1.8;
    }

    .iablog-content h2 {
        font-size: 1.4rem;
        margin-top: 2.5rem;
    }

    .iablog-content h3 {
        font-size: 1.15rem;
    }

    .iablog-content figure {
        margin: 2rem 0;
        border-radius: 8px;
    }

    .iablog-content figcaption {
        transform: translateY(0);
        padding: 12px 16px 10px;
    }

    .iablog-content blockquote,
    .iablog-content .iablog-pullquote {
        padding: 20px 20px 20px 24px;
        font-size: 1.05rem;
    }

    .iablog-content .iablog-highlight,
    .iablog-content .iablog-cta {
        padding: 22px 24px;
        border-radius: 8px;
    }
}