/* General Styles */
body {
    margin: 0;
    padding: 0;
    background-color: #121212; /* Dark background */
    color: #FFFFFF; /* Light text */
    font-family: Arial, sans-serif;
    display: flex;
    /* Ensure touch events work properly */
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Ensure pageflip container captures all touch events */
#pageflip {
    touch-action: none;
    width: 100%;
    height: 100%;
}

/* Ensure pages can capture touch events across their full surface */
.pf-page-container {
    touch-action: none;
}

.pf-left-side {
	/* background-color: white; */
	background-color: #121212;
	touch-action: none;
}

.pf-right-side {
	/* background-color: white; */
	background-color: #121212;
	touch-action: none;
}

header {
    background-color: #1F1F1F; /* Slight contrast for the header */
    padding: 5px 0;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 18px;
}

h2 {
    font-size: 24px;
    padding: 10px;
}

#pf-stage {
    background-color: #121212;;
}

.intro {
    font-size: 17px; /* 1 point bigger than body text */
    font-style: italic;
    padding: 0 10px;
}

.body-text-container {
    flex-grow: 1; 
    overflow-y: hidden; 
    padding-bottom: 10px; /* Reduced padding since no button overlay */
}

/* Default line clamp for smaller screens (e.g., mobile phones) */
.text-container {
    -webkit-line-clamp: 3; /* Show 3 lines by default */
    line-clamp: 3; /* Standard property for compatibility */
    min-height: 60px; /* Minimum height for the container */
}

/* For medium screens (e.g., larger mobile phones or small tablets) */
@media (min-height: 500px) {
    .text-container {
        -webkit-line-clamp: 4; /* Show 4 lines */
        line-clamp: 4;
         min-height: 80px; /*Increase min height for larger screens */
    }
}

/* For larger screens (e.g., tablets or small desktops) */
@media (min-height: 700px) {
    .text-container {
        -webkit-line-clamp: 5; /* Show 5 lines */
        line-clamp: 5;
        min-height: 100px; /* Adjust the min height */
    }
}

/* For even larger screens (e.g., desktops or large tablets) */
@media (min-height: 900px) {
    .text-container {
        -webkit-line-clamp: 6; /* Show 6 lines */
        line-clamp: 6;
        min-height: 120px; /* Increase min height for large screens */
    }
}

.body-text {
    font-size: 16px;
    line-height: 1.5;
    overflow: hidden;
    word-wrap: break-word; /* Handle long words */
}



/* Image Container Styles */

.full-width-image {
    width: 100vw; 
    height: 35vh; 
    object-fit: cover; /* Ensures the image covers the space, cropping if necessary */
    object-position: center;
}

.image-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.top-image-container {
    height: 200px; /* Adjust as needed */
}

.bottom-image-container {
    height: 200px; /* Must match top-image-container height */
    position: relative;
}

.article-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    /* display: block; */
    position: absolute;
    top: 0;
    left: 0;
}

/* Image Splitting */
.top-page .article-image {
    /* Display the top half of the image */
    clip-path: inset(0 0 50% 0);
}

.bottom-page .article-image {
    /* Display the bottom half of the image */
    clip-path: inset(50% 0 0 0);
    top: -100px; /* Negative value equal to half of the container height */
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    h2 {
        font-size: 20px;
        padding: 8px;
    }

    .intro {
        font-size: 16px;
        padding: 0 8px;
    }

    .body-text {
        font-size: 15px;
    }



    .top-image-container,
    .bottom-image-container {
        height: 150px; /* Adjust height for smaller screens */
    }

    .bottom-page .article-image {
        top: -75px; /* Adjust based on new container height */
    }
}

.article-content-wrapper {
    position: relative; /* Needed for absolute positioning of child */
    height: 100%; /* Ensure it fills the page container */
    display: flex; 
    flex-direction: column; 
    box-sizing: border-box; /* Ensure padding/border don't expand overall size */
}

.page {
    height: 100%;
}

.mobile-cover-page {
    overflow: hidden;
    background: #121212;
}

.mobile-cover-page header {
    flex: 0 0 auto;
    padding: 7px 8px;
}

.mobile-cover-page header h1 {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #ffffff;
    font-size: clamp(13px, 4vw, 18px);
    line-height: 1.15;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.cover-image-frame {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.mobile-cover-page .full-width-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none !important;
    object-fit: cover;
}

.cover-heading {
    display: -webkit-box;
    flex: 0 0 auto;
    margin: 0;
    max-height: 62px;
    overflow: hidden;
    padding: 8px 10px;
    box-sizing: border-box;
    color: #ffffff;
    font-size: clamp(16px, 4.5vw, 19px);
    line-height: 1.1;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.mobile-component-page {
    min-height: 100%;
    padding: 18px;
    background: #fdfbf7;
    color: #17212b;
    justify-content: center;
    overflow: hidden;
}

.component-label {
    display: inline-flex;
    align-self: flex-start;
    width: fit-content;
    margin-bottom: 12px;
    padding: 4px 8px;
    border-radius: 5px;
    background: #e9f4f2;
    color: #00534f;
    font-size: 11px;
    line-height: 1.1;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quote-component-page blockquote {
    margin: 0;
    color: #1f2930;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(22px, 7.5vw, 34px);
    line-height: 1.16;
}

.component-supporting-text,
.component-image-text {
    margin: 16px 0 0;
    color: #3d4a55;
    font-size: clamp(14px, 4.3vw, 18px);
    line-height: 1.42;
}

.image-component-page {
    justify-content: flex-start;
    padding: 0;
    background: #ffffff;
}

.component-image {
    width: 100%;
    height: 58%;
    object-fit: cover;
    display: block;
    background: #eef1f4;
}

.component-image-text {
    margin: 0;
    padding: 14px 16px 0;
    color: #18242f;
}

.crosshead-component-page {
    background: #18242f;
    color: #ffffff;
}

.crosshead-component-page .component-label {
    background: rgba(255, 255, 255, 0.9);
    color: #18242f;
}

.crosshead-component-page h2 {
    margin: 0;
    padding: 0;
    color: #ffffff;
    font-size: clamp(26px, 8vw, 38px);
    line-height: 1.08;
    letter-spacing: 0;
}

.mobile-ad-page {
    position: relative;
    overflow: hidden;
    background: #111820;
    color: #ffffff;
}

.mobile-spacer-page {
    background: #121212;
}

.mobile-ad-spread-page {
    background: #0b0f14;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
}

.mobile-ad-spread-canvas {
    position: absolute;
    left: 0;
    width: 100%;
    height: 200%;
    min-height: 200%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pf-page-container .mobile-ad-spread-page {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
}

.mobile-ad-spread-top .mobile-ad-spread-canvas {
    top: 0;
}

.mobile-ad-spread-bottom .mobile-ad-spread-canvas {
    bottom: 0;
}

.mobile-ad-spread-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mobile-ad-full-bleed .mobile-ad-spread-image {
    object-fit: cover;
}

.mobile-ad-image-frame {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #0b0f14;
}

.mobile-ad-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mobile-ad-full-bleed .mobile-ad-image {
    object-fit: cover;
}

.mobile-ad-copy {
    flex: 0 0 auto;
    padding: 10px 12px 12px;
    background: #ffffff;
    color: #16202a;
}

.mobile-ad-copy h2 {
    margin: 0;
    padding: 0;
    color: #16202a;
    font-size: clamp(16px, 4.8vw, 21px);
    line-height: 1.1;
    letter-spacing: 0;
}

.mobile-ad-copy p {
    margin: 5px 0 0;
    color: #4a5661;
    font-size: clamp(12px, 3.8vw, 15px);
    line-height: 1.2;
}

@media (max-width: 600px) {
    .mobile-component-page {
        padding: 14px;
    }

    .image-component-page {
        padding: 0;
    }
}
