/* ================================
   TrunkMonkey.life Styles
   ================================ */

/* ================================
   Web Fonts (self-hosted)
   ================================ */

@font-face {
    font-family: 'Fraunces';
    src: url('../fonts/Fraunces-Variable.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* CSS Variables for easy customization */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --text-color: #333;
    --text-light: #666;
    --background: #f5f5f5;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: 0.3s ease;
}

/* ================================
   Base Styles
   ================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', serif;
    line-height: 1.8;
    color: var(--text-color);
    background: var(--background);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* ================================
   Site Header
   ================================ */

.site-header {
    position: relative;
    overflow: hidden;
    color: var(--white);
    text-align: left;
    padding: 80px 40px 30px;
    min-height: 50vh;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    background: var(--secondary-color);
}

.header-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.header-slideshow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2;
}

.header-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: headerFade 126s infinite;
}

.header-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-slide:nth-child(1)  { animation-delay: 0s; }
.header-slide:nth-child(2)  { animation-delay: 6s; }
.header-slide:nth-child(3)  { animation-delay: 12s; }
.header-slide:nth-child(4)  { animation-delay: 18s; }
.header-slide:nth-child(5)  { animation-delay: 24s; }
.header-slide:nth-child(6)  { animation-delay: 30s; }
.header-slide:nth-child(7)  { animation-delay: 36s; }
.header-slide:nth-child(8)  { animation-delay: 42s; }
.header-slide:nth-child(9)  { animation-delay: 48s; }
.header-slide:nth-child(10) { animation-delay: 54s; }
.header-slide:nth-child(11) { animation-delay: 60s; }
.header-slide:nth-child(12) { animation-delay: 66s; }
.header-slide:nth-child(13) { animation-delay: 72s; }
.header-slide:nth-child(14) { animation-delay: 78s; }
.header-slide:nth-child(15) { animation-delay: 84s; }
.header-slide:nth-child(16) { animation-delay: 90s; }
.header-slide:nth-child(17) { animation-delay: 96s; }
.header-slide:nth-child(18) { animation-delay: 102s; }
.header-slide:nth-child(19) { animation-delay: 108s; }
.header-slide:nth-child(20) { animation-delay: 114s; }
.header-slide:nth-child(21) { animation-delay: 120s; }

@keyframes headerFade {
    0%     { opacity: 0; }
    1.19%  { opacity: 1; }
    3.57%  { opacity: 1; }
    4.76%  { opacity: 0; }
    100%   { opacity: 0; }
}

.header-content {
    position: relative;
    z-index: 3;
}

.site-header h1 {
    font-size: 3.5em;
    margin-bottom: 0.2em;
    font-weight: normal;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.site-header .tagline {
    font-size: 1.3em;
    opacity: 0.9;
    font-style: italic;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ================================
   Navigation
   ================================ */

.main-nav {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 4px;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--primary-color);
    color: var(--white);
}

/* ================================
   Container
   ================================ */

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* ================================
   Blog Post Cards (Homepage)
   ================================ */

.blog-posts h2 {
    font-size: 2.5em;
    margin-bottom: 1em;
    color: var(--secondary-color);
    font-weight: normal;
}

.post-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.post-card a {
    color: inherit;
    display: block;
}

.post-image {
    height: 300px;
    overflow: hidden;
}

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

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-content {
    padding: 30px;
}

.post-content h3 {
    font-size: 2em;
    margin-bottom: 0.3em;
    color: var(--secondary-color);
    font-weight: normal;
}

.post-meta {
    color: var(--text-light);
    font-size: 0.95em;
    margin-bottom: 1em;
    font-style: italic;
}

.post-excerpt {
    font-size: 1.1em;
    margin-bottom: 1.5em;
    line-height: 1.6;
}

.read-more {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-block;
}

.post-card:hover .read-more {
    transform: translateX(5px);
    display: inline-block;
    transition: transform var(--transition);
}

/* ================================
   About & Contact Sections
   ================================ */

.about-section,
.contact-section {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.about-section h2,
.contact-section h2 {
    font-size: 2em;
    margin-bottom: 0.5em;
    color: var(--secondary-color);
    font-weight: normal;
}

.about-section p,
.contact-section p {
    font-size: 1.15em;
    line-height: 1.8;
}

/* ================================
   Footer
   ================================ */

.site-footer {
    background: var(--secondary-color);
    color: var(--white);
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
}

/* ================================
   Individual Post Page Styles
   ================================ */

.hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-align: center;
    overflow: hidden;
    background: #000;
}

.hero-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-image-container picture,
.hero-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Ken Burns Scale */
    transform: scale(var(--hero-scale, 1.15)) translateY(var(--hero-y, 0));
    will-change: transform;
}

.hero-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    padding: 20px;
}

.hero-content h1 {
    font-size: 3.5em;
    margin-bottom: 0.3em;
    font-weight: normal;
    color: var(--white);
}

.hero-content .date {
    font-size: 1.2em;
    opacity: 0.9;
    font-style: italic;
    color: var(--white);
}

.section {
    margin-bottom: 60px;
}

.section h2 {
    font-size: 2.2em;
    margin-bottom: 0.5em;
    color: var(--secondary-color);
    font-weight: normal;
}

.section h3 {
    font-size: 1.6em;
    margin: 1.5em 0 0.5em;
    color: #34495e;
    font-weight: normal;
}

.section p {
    font-size: 1.1em;
    margin-bottom: 1.2em;
    text-align: justify;
}

/* Image Layouts */
.single-image {
    margin: 40px auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    width: fit-content;
}

.single-image img {
    max-width: 100%;
    max-height: clamp(300px, 70vh, 800px);
    max-height: clamp(300px, 70dvh, 800px);
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.image-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-container:hover img {
    transform: scale(1.05);
}

/* Carousel Layout */
.carousel-container {
    position: relative;
    margin: 40px 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow);
    background: #000;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 600px;
    /* Fixed height for consistency */
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    transition: opacity 0.5s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 20px;
    border-radius: 50%;
    z-index: 10;
    transition: background 0.3s;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active {
    background: white;
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .carousel-track {
        height: 400px;
    }

    .carousel-btn {
        padding: 10px 15px;
        font-size: 16px;
    }
}

/* Video Container */
.video-container {
    margin: 40px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #000;
}

.video-container video {
    width: 100%;
    max-height: clamp(300px, 60vh, 600px);
    max-height: clamp(300px, 60dvh, 600px);
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* YouTube / iframe embeds */
.video-container iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    border: none;
}

.video-container.youtube-short {
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
}

.video-container.youtube-short iframe {
    aspect-ratio: 9 / 16;
}

/* Parallax Break Layout */
.parallax-break {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: 60px;
    margin-bottom: 60px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.3);
    background: #000;
}

.parallax-image-container {
    position: absolute;
    top: -20%;
    /* Extra height for parallax travel */
    left: 0;
    width: 100%;
    height: 140%;
    z-index: 1;
}

.parallax-image-container picture,
.parallax-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;

    /* Cinematic Scaling and Parallax */
    transform: scale(var(--parallax-scale, 1)) translateY(var(--parallax-y, 0));
    will-change: transform;
}

.parallax-content {
    background: rgba(0, 0, 0, 0.4);
    padding: 30px 60px;
    border-radius: 12px;
    color: white;
    text-align: center;
    max-width: 80%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow);

    /* Smoother reveal animations */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    opacity: 0;
    transform: translateY(20px);
}

.parallax-content h2 {
    font-size: 3em;
    margin: 0;
    color: white !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: normal;
}

/* Editor Previews for Parallax */
.parallax-break-preview {
    width: 100%;
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.parallax-break-preview.empty {
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
    border: 2px dashed #ccc;
}

/* Highlight Box / Quote */
.highlight-box {
    background: #f0f4f8;
    border-left: 4px solid rgba(52, 152, 219, 0.3);
    padding: 30px 40px;
    margin: 40px 0;
    font-family: 'Fraunces', serif;
    font-size: 1.5em;
    line-height: 1.4;
    color: #333;
    border-radius: 0 12px 12px 0;

    /* Variable Font Setup */
    font-variation-settings: "wght" 400, "opsz" 72, "SOFT" 0;
    will-change: font-variation-settings, background-color, border-left-color;
    transition: font-variation-settings 0.1s linear;
}

/* ================================
   Scroll Animation Classes
   ================================ */

/* Base Animation Classes */
.fade-in,
.slide-left,
.slide-right,
.zoom-in {
    transition-delay: calc(var(--i, 0) * 100ms);
}

/* Fade In */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide from Left */
.slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Slide from Right */
.slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Zoom In */
.zoom-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.zoom-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* ================================
   Responsive Design
   ================================ */

@media (max-width: 768px) {
    .site-header h1 {
        font-size: 2em;
    }

    .site-header .tagline {
        font-size: 1em;
    }

    .hero-content h1 {
        font-size: 2em;
    }

    .main-nav ul {
        gap: 20px;
        flex-wrap: wrap;
    }

    .section h2 {
        font-size: 1.8em;
    }

    .image-grid {
        grid-template-columns: 1fr;
    }

    .post-image {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 30px 15px;
    }

    .post-content {
        padding: 20px;
    }

    .site-header {
        padding: 30px 20px 20px;
        min-height: 35vh;
    }
}

/* ================================
   Utility Classes
   ================================ */

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 1em;
}

.mt-2 {
    margin-top: 2em;
}

.mb-1 {
    margin-bottom: 1em;
}

.mb-2 {
    margin-bottom: 2em;
}

/* ================================
   Post Navigation (Prev/Next)
   ================================ */

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin: 80px 0 40px;
    padding: 40px 0;
    border-top: 2px solid var(--border-color);
}

.post-nav-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 25px 30px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    color: var(--text-color);
    text-decoration: none;
}

.post-nav-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.post-nav-prev {
    text-align: left;
}

.post-nav-next {
    text-align: right;
}

.post-nav-label {
    font-size: 0.9em;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.post-nav-title {
    font-size: 1.2em;
    color: var(--secondary-color);
    line-height: 1.3;
}

.post-nav-spacer {
    flex: 1;
}

@media (max-width: 768px) {
    .post-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .post-nav-link {
        padding: 20px;
    }

    .post-nav-next {
        text-align: left;
    }
}

/* ================================
   Back to Top Button
   ================================ */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition),
        visibility var(--transition),
        transform var(--transition),
        background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}