/*
TemplateMo 552 Video Catalog
https://templatemo.com/tm-552-video-catalog
*/

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Lora', serif;
    font-size: 18px;
    line-height: 2em;
    overflow-x: hidden;
    /* Background settings */
    background-color: #000; 
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

a { transition: all 0.3s ease; color: #666; }
a:hover { color: #29BBCC; text-decoration: none; }
h2, p { color: #666666; }

/* ========================================= */
/* UNIFORM GRID & CARD STYLES          */
/* ========================================= */

/* 1. The Card Container */
.tm-catalog-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 30px; /* Space between rows */
    height: 100%;       /* Fills the Bootstrap column height */
    background: transparent;
}

/* 2. The Image Area - Fixed Height for Uniformity */
.tm-thumbnail-container {
    overflow: hidden;
    height: 380px;      /* Fixed height for all book covers */
    width: 100%;
    position: relative;
    background-color: #eee;
}

.tm-thumbnail-container img {
    transition: all 0.3s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;      /* Crops image to fill box */
    object-position: top;   /* Anchors image to the top */
}

.tm-thumbnail-container:hover img { transform: scale(1.05); }

/* 3. The Description Box (White/Snowy Area) */
.tm-catalog-item-description {
    background-image: url('../img/festive-bg.png'); 
    background-color: #fff; 
    background-size: cover;    
    background-repeat: no-repeat;
    background-position: center;
    border: 1px solid #ddd;
    
    /* This connects the Title, Text, and Buttons */
    flex: 1;                /* Grows to match neighbor height */
    display: flex;
    flex-direction: column; /* Stacks content vertically */
    padding: 25px;          /* Internal spacing */
}

/* 4. Book Title */
.tm-catalog-item-title {
    font-family: 'Mountains of Christmas', cursive;
    color: #C41E3A !important; 
    font-size: 2.0rem; 
    font-weight: 700;
    border-bottom: 2px solid #2E8B57; 
    padding-bottom: 10px;
    margin-bottom: 15px;
    line-height: 1.2;
    /* Thick White Outline */
    text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff;
}

/* 5. Book Text */
.tm-catalog-item-text {
    font-family: 'Lora', serif;
    color: #000 !important; 
    font-weight: 700;       
    font-size: 1.1rem;      
    line-height: 1.5;
    /* Thick White Outline */
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
    margin-bottom: 20px;
}

/* 6. Button Wrapper - Pushes to Bottom */
.tm-catalog-actions {
    margin-top: auto; /* CRITICAL: Pushes buttons to bottom of card */
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* 7. Buttons */
.amazon-btn, .spotify-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 30px;
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s;
    border: 2px solid white;
    text-align: center;
    white-space: nowrap;
}

.amazon-btn { background-color: #FF9900; color: #000; }
.amazon-btn:hover { background-color: #e68a00; color: #000; transform: translateY(-2px); text-decoration: none; }

.spotify-btn { background-color: #1DB954; color: #fff !important; }
.spotify-btn:hover { background-color: #1ed760; color: #fff; transform: translateY(-2px); text-decoration: none; }

.amazon-icon { margin-right: 5px; }

/* ========================================= */
/* LAYOUT & HEADER STYLES               */
/* ========================================= */

.tm-page-wrap { background: rgba(255, 255, 255, 0.15); }
.tm-content-container { max-width: 1422px; padding-top: 60px; padding-bottom: 35px; }

/* Grid Spacing Fixes */
.row { display: flex; flex-wrap: wrap; }
.col-lg-4 { display: flex; flex-direction: column; } /* Ensures column stretches */

.tm-section-title {
    color: #C41E3A !important;
    font-size: 2.8rem;
    border-bottom: 2px solid #2E8B57;
    padding-bottom: 10px;
    margin-bottom: 40px;
    text-shadow: 3px 3px 0px #fff;
    text-align: center;
}

/* 5. Author Images - UPDATED to prevent cutoff */
.author-img-container {
    border: 5px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    height: auto; /* CHANGED: Allows image to show fully */
    background: #fff;
}
.author-img { 
    width: 100%; 
    height: auto; /* CHANGED: Natural height */
    display: block;
}

/* Text Outline Helper */
.text-outline {
    font-family: 'Lora', serif;
    color: #000 !important;
    font-weight: 800;
    font-size: 1.2rem;
    line-height: 1.6;
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
}

/* Glass Panel for Text */
.glass-panel {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Background Video */
#video-background {
    position: fixed; right: 0; bottom: 0;
    min-width: 100%; min-height: 100%;
    z-index: -100;
}
#video-background video {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    object-fit: cover;
}

/* Nav & Header specifics from template */
.tm-site-header { position: absolute; z-index: 1000; width: 100%; top: 0; left: 0; padding: 40px; }
.tm-logo-container { display: block; padding: 30px; width: 320px; }
.tm-site-logo { font-size: 3rem; }
.tm-site-name { font-size: 1.9rem; }
.tm-bg-black { background-color: rgba(0,0,0,0.5); color: white; }
.tm-bg-gray { background-color: #F4F4F4; }
.tm-nav-link { color: white; font-size: 1.4rem; }
.tm-welcome-container { position: absolute; width: 100%; height: 100%; display: flex; justify-content: center; flex-direction: column; z-index: 999; }
.tm-welcome-container-inner { margin-top: 100px; }
.tm-btn-cta { color: white; background-color: rgba(0,0,0,0.5); padding: 15px 60px; font-size: 1.6rem; border: none; }
.tm-subscribe-form { display: flex; align-items: center; }
.tm-subscribe-form > input { padding: 5px 15px; margin-right: 20px; flex: 1; }

/* Video Strip */
.video-split-container { display: flex; width: 100%; height: 500px; overflow: hidden; background-color: #000; }
.video-col { flex: 1; position: relative; border-right: 2px solid white; overflow: hidden; }
.video-col video { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* Responsive */
@media (max-width: 991px) {
    .navbar { max-width: 220px; position: absolute; top: 0; right: 0; padding: 0; }
    .navbar-collapse { background-color: rgba(0,0,0,0.5); padding: 10px 15px; }
    .tm-logo-container { height: auto; width: 250px; }
    .tm-site-header { padding: 20px; }
}
@media (max-width: 768px) {
    .video-split-container { flex-direction: column; height: auto; }
    .video-col { width: 100%; height: 250px; border-right: none; border-bottom: 2px solid white; }
    .tm-subscribe-form { flex-direction: column; align-items: stretch; }
    .tm-subscribe-form input { margin-right: 0; margin-bottom: 15px; }
}