/* =========================================================
   DECREES — DOCTRINE & CANONS
   Layout: Full-width intro + alternating text/image sections
   Contrast: Ember core with frost highlights
   ========================================================= */

.iv-decrees {
    position: relative;
    padding: 64px 0;

    background: radial-gradient(1000px 520px at 18% 28%, rgba(255, 77, 46, 0.10), transparent 62%), radial-gradient(1200px 720px at 70% 50%, rgba(127, 166, 201, 0.08), transparent 65%), linear-gradient(180deg, rgba(6, 8, 11, 0.92), rgba(10, 12, 16, 0.98));
    --ritual: 0;
}



/* =========================================================
   WRAPPER
   ========================================================= */

.iv-decrees__inner {
    position: relative;
    z-index: 2;
    width: min(1140px, calc(100% - 64px));
    margin: 0 auto;
}


/* =========================================================
   INTRO SECTION (Full Width)
   ========================================================= */

.iv-decrees__intro {
    text-align: center;
    margin-bottom: 48px;
    padding: 0 16px;
}

.iv-decrees__kicker {
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    color: var(--ash-gray);
    opacity: 0.85;
    margin-bottom: 16px;
}

.iv-decrees__title {
    font-size: clamp(2.4rem, 4vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 24px;

    text-shadow:
        0 0 10px rgba(0, 0, 0, 0.7),
        0 0 26px rgba(255, 77, 46, 0.12);
}

.iv-decrees__subtitle {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    line-height: 1.2;
    margin-bottom: 32px;
    color: var(--ember-core);
    letter-spacing: 0.06em;
}

.iv-decrees__text {
    max-width: 780px;
    margin: 0 auto;
}

.iv-decrees__text p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--bone-white);
    opacity: 0.88;
    margin-bottom: 16px;
}

.iv-decrees__text p:last-child {
    margin-bottom: 0;
}

.iv-decrees__text strong {
    color: var(--bone-white);
    font-weight: 700;
    opacity: 1;
}


/* =========================================================
   SECTION TITLE (THE CANONS)
   ========================================================= */

.iv-decrees__sectionTitle {
    font-size: clamp(2rem, 3.2vw, 2.8rem);
    line-height: 1.1;
    text-align: center;
    margin: 48px 0 40px;
    letter-spacing: 0.08em;

    text-shadow:
        0 0 10px rgba(0, 0, 0, 0.7),
        0 0 26px rgba(127, 166, 201, 0.12);
}


/* =========================================================
   CANON SECTIONS (Alternating Text + Image)
   ========================================================= */

.iv-canon {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 48px;
}

.iv-canon__text {
    padding: 16px;
}

.iv-canon__title {
    font-size: clamp(1.3rem, 2vw, 1.65rem);
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--ember-core);
    letter-spacing: 0.04em;
}

.iv-canon__text p {
    font-size: 0.98rem;
    line-height: 1.75;
    color: var(--bone-white);
    opacity: 0.87;
    margin-bottom: 16px;
}

.iv-canon__text p:last-child {
    margin-bottom: 0;
}

.iv-canon__text strong {
    color: var(--bone-white);
    font-weight: 700;
    opacity: 1;
}

.iv-canon__image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(127, 166, 201, 0.14);
    background: var(--stone-dark);
    will-change: box-shadow;

    animation: canon-image-pulse 3.5s ease-in-out infinite;
}

@keyframes canon-image-pulse {
    0% {
        box-shadow:
            0 0 28px rgba(255, 77, 46, 0.06),
            0 4px 24px rgba(0, 0, 0, 0.4);
    }
    50% {
        box-shadow:
            0 0 56px rgba(255, 77, 46, 0.24),
            0 6px 32px rgba(0, 0, 0, 0.5);
    }
    100% {
        box-shadow:
            0 0 28px rgba(255, 77, 46, 0.06),
            0 4px 24px rgba(0, 0, 0, 0.4);
    }
}

.iv-canon__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.iv-canon:hover .iv-canon__image img {
    transform: scale(1.05);
}

/* Reverse layout for alternating effect */
.iv-canon--reverse {
    grid-template-columns: 1fr 1fr;
}

.iv-canon--reverse .iv-canon__image {
    order: -1;
}


/* =========================================================
   WHY THIS EXISTS (Full Width)
   ========================================================= */

.iv-decrees__why {
    text-align: center;
    margin: 48px 0;
    padding: 40px 32px;
    border-radius: 16px;

    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.22));
    border: 1px solid rgba(255, 77, 46, 0.18);
    box-shadow:
        0 0 40px rgba(255, 77, 46, 0.08),
        inset 0 0 60px rgba(255, 77, 46, 0.02);
}

.iv-decrees__whyTitle {
    font-size: clamp(2rem, 3.2vw, 2.8rem);
    line-height: 1.1;
    margin-bottom: 32px;
    letter-spacing: 0.08em;

    text-shadow:
        0 0 10px rgba(0, 0, 0, 0.7),
        0 0 26px rgba(255, 77, 46, 0.14);
}

.iv-decrees__why .iv-decrees__text {
    max-width: 720px;
    margin: 0 auto;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 980px) {
    .iv-decrees {
        padding: 48px 0;
    }

    .iv-decrees__intro {
        margin-bottom: 40px;
    }

    .iv-canon {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 40px;
    }

    .iv-canon--reverse {
        grid-template-columns: 1fr;
    }

    /* Ensure consistent text-then-image order on mobile */
    .iv-canon__text {
        order: 1;
    }

    .iv-canon__image {
        order: 2;
    }

    .iv-canon--reverse .iv-canon__image {
        order: 2;
    }

    .iv-decrees__sectionTitle {
        margin: 40px 0 32px;
    }

    .iv-decrees__why {
        margin: 48px 0;
        padding: 32px 24px;
    }
}

@media (max-width: 640px) {
    .iv-decrees {
        padding: 40px 0;
    }

    .iv-decrees__intro {
        padding: 0 16px;
        margin-bottom: 32px;
    }

    .iv-decrees__text p {
        font-size: 0.94rem;
        line-height: 1.7;
    }

    .iv-canon {
        margin-bottom: 32px;
    }

    .iv-canon__text {
        padding: 16px;
    }

    .iv-canon__text p {
        font-size: 0.92rem;
        line-height: 1.7;
    }

    .iv-canon__image {
        border-radius: 12px;
    }

    .iv-decrees__why {
        margin: 40px 0;
        padding: 32px 16px;
    }

    .iv-decrees__sectionTitle {
        margin: 32px 0 24px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .iv-canon__image {
        animation: none;
    }

    .iv-canon__image img {
        transition: none;
    }

    .iv-canon:hover .iv-canon__image img {
        transform: none;
    }
}
