/* ==============================================
   Shared Subpage Styles — Clean Professional
   ============================================== */

body {
    font-family: 'Gotham Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #3d4f63;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f0f4f8;
}

main {
    flex: 1 0 auto;
    background: #f0f4f8;
    padding-bottom: 0;
    position: relative;
    z-index: 1;
    margin-top: 0;
}

main {
    padding-top: 80px;   /* desktop header height */
}

@media screen and (max-width: 780px) {
    main {
        padding-top: 70px;
    }
}

.bg-pattern {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(4,24,50,0.02) 0%, transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(51,105,176,0.02) 0%, transparent 20%);
    pointer-events: none;
    z-index: 0;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
@keyframes slowZoom {
    from { transform: scale(1); }
    to   { transform: scale(1.1); }
}
@keyframes pulseSpin {
    0%   { transform: scale(1) rotate(0); }
    50%  { transform: scale(1.1) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

section {
    position: relative;
    z-index: 2;
    animation: fadeIn 1s ease;
}

/* ========== HERO / CHAPTER INFO ========== */
.chapter-info {
    width: 100%;
    height: 650px;
    display: flex;
    position: relative;
    overflow: hidden;
    animation: fadeIn 1.2s ease;
    z-index: 3;
    min-width: 320px;
}

.chapter-info::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 70%);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

.text-block {
    width: 65%;
    height: 100%;
    display: flex;
    align-items: center;
    background: linear-gradient(160deg, #041832 0%, #0a2d4a 50%, #1a4b6e 100%);
    position: relative;
    overflow: hidden;
}

.text-block::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(74,158,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.text-content {
    width: 60%;
    height: auto;
    margin-left: 12.5%;
    position: relative;
    z-index: 4;
    animation: slideInLeft 1s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 280px;
    max-width: 60%;
}

.text-content span {
    font-weight: 800;
    font-size: 32px;
    line-height: 1.3;
    color: #ffffff;
    text-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: inline-block;
    position: relative;
    letter-spacing: -0.3px;
}

.text-content span::after {
    content: '';
    position: absolute;
    bottom: -10px; left: 0;
    width: 56px; height: 3px;
    background: white;
    border-radius: 2px;
}

.text-content p {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255,255,255,0.8);
    margin-top: 25px;
}

/* ========== DOWNLOAD BUTTON ========== */
.download-file {
    margin-top: 30px;
}

.download-file a {
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.download-file a:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.25);
}

.download-file img {
    margin-right: 12px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.download-file a:hover img {
    transform: translateY(-2px) rotate(5deg);
}

/* ========== IMAGE BLOCK ========== */
.img-block {
    width: 35%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.img-block::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, #041832 0%, rgba(10,45,74,0.6) 30%, transparent 70%);
    z-index: 3;
    pointer-events: none;
}

.img-block img {
    height: 100%;
    width: 100%;
    position: absolute;
    left: 0;
    object-fit: cover;
    object-position: right center;
    transition: transform 10s ease;
    animation: slowZoom 20s infinite alternate;
}

/* ========== GLOBAL SAFEGUARDS ========== */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========== RESPONSIVE ========== */
@media screen and (max-width: 1200px) {
    .text-content {
        margin-left: 8%;
        width: 84%;
        max-width: 84%;
    }
}

@media screen and (max-width: 780px) {
    .chapter-info {
        flex-wrap: wrap;
        height: auto;
        min-height: auto;
    }

    .text-block {
        width: 100%;
        height: auto;
        min-height: auto;
        padding: 30px 0;
    }

    .text-content {
        margin-left: 6%;
        width: 88%;
        max-width: 90%;
        height: auto;
        padding: 15px 0;
    }

    .img-block {
        width: 100%;
        height: 250px;
    }

    .img-block img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        left: 0;
        top: 0;
    }

    .text-content span {
        font-size: 22px;
    }

    .text-content p {
        font-size: 15px;
    }
}

@media screen and (max-width: 500px) {
    .text-content span {
        font-size: 20px;
    }

    .text-content p {
        font-size: 14px;
    }
}

@media screen and (max-width: 380px) {
    .text-content p {
        font-size: 13px;
    }
}

@media screen and (min-width: 2000px) {
    .chapter-info {
        height: 800px;
    }

    .img-block img {
        left: auto;
        right: 0;
        object-position: 70% center;
    }

    .text-content {
        margin-left: 19.5%;
    }
}

@media screen and (min-width: 2500px) {
    .chapter-info {
        height: 850px;
    }

    .text-content {
        margin-left: 27%;
    }
}

@media print {
    .chapter-info::before {
        transform: none;
        box-shadow: none;
    }

    .bg-pattern,
    #preloader {
        display: none;
    }
}

.chapter-info::before {
    animation: none;
}