﻿/* Post Hub Page Styles */

.hero-section {
    position: relative;
    background-color: #0d2c53;
    background-size: cover;
    min-height: 380px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .hero-section .container {
        margin-top: 90px;
    }

    .hero-section .row {
        text-align: center;
    }

    .hero-section h1 {
        font-size: 3rem;
        font-weight: bold;
        margin: 0;
    }

    .hero-section p {
        font-size: 1.25rem;
        margin-top: 1rem;
        color: var(--brand-red);
        font-family: 'Exo', sans-serif;
        font-weight: 400;
        font-size: clamp(22px,2.3vw,32px);
        line-height: 1.25;
        letter-spacing: .2px;
        margin: 0;
    }

    .hero-section .row h1 {
        color: white;
    }

    .hero-section .row h2 {
        color: #d31a38;
    }


/* Blog Posts Section */
.blog-posts {
    background-color: #fff;
}

    .blog-posts .container {
        margin-top: 30px;
    }

/* ========================================
   FILTER AND SORT CONTROLS (Plain Layout)
   ======================================== */

.post-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    gap: 20px;
    flex-wrap: wrap;
}

.post-filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.filter-btn {
    background-color: transparent;
    color: #1a3a5c;
    border: none;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border-radius: 25px;
    position: relative;
}

    .filter-btn:hover {
        color: #d31a38;
    }

    .filter-btn.active {
        background-color: #d31a38;
        color: white;
    }

.post-sort-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sort-btn {
    background-color: white;
    border: 2px solid #e0e0e0;
    color: #1a3a5c;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    position: relative;
}

    .sort-btn:hover {
        border-color: #d31a38;
        color: #d31a38;
    }

    .sort-btn.active {
        background-color: #1a3a5c;
        border-color: #1a3a5c;
        color: white;
    }

        .sort-btn.active .sort-indicator {
            display: block;
            position: absolute;
            bottom: -6px;
            left: 50%;
            transform: translateX(-50%);
            width: 8px;
            height: 8px;
            background-color: #d31a38;
            border-radius: 50%;
        }

    .sort-btn .sort-indicator {
        display: none;
    }

    .sort-btn svg {
        width: 20px;
        height: 20px;
    }

    .sort-btn .sort-text {
        font-size: 14px;
        font-weight: 600;
    }

/* Date Range Picker */
.date-range-picker {
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.date-range-inputs {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .date-input-group label {
        font-size: 12px;
        font-weight: 600;
        color: #666;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

.date-input {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

    .date-input:focus {
        outline: none;
        border-color: #1a3a5c;
    }

.apply-date-btn,
.clear-date-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apply-date-btn {
    background-color: #1a3a5c;
    color: white;
}

    .apply-date-btn:hover {
        background-color: #0d2c53;
    }

.clear-date-btn {
    background-color: transparent;
    color: #666;
    border: 2px solid #e0e0e0;
}

    .clear-date-btn:hover {
        border-color: #d31a38;
        color: #d31a38;
    }

/* Posts Container for filtering */
.posts-container {
    position: relative;
}

/* ========================================
   HOMEPAGE GRID LAYOUT WITH FLIP CARDS
   ======================================== */

.homepage-layout .homepage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 32px;
}

@media (min-width: 768px) {
    .homepage-layout .homepage-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .homepage-layout .homepage-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Flip Card Container */
.homepage-layout .flip-card {
    background-color: transparent;
    perspective: 1000px;
    height: 380px;
    cursor: pointer;
}

.homepage-layout .flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 4px;
}

.homepage-layout .flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.homepage-layout .flip-card-front,
.homepage-layout .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 4px;
    overflow: hidden;
}

.homepage-layout .flip-card-front {
    background-color: #000;
    color: black;
    z-index: 2;
}

    .homepage-layout .flip-card-front img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.homepage-layout .flip-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0.3), transparent);
    padding: 24px;
    display: flex;
    align-items: flex-end;
}

.homepage-layout .flip-card-category {
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.homepage-layout .flip-card-back {
    background: linear-gradient(135deg, #0d2c53 0%, #004987 100%);
    color: white;
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 28px;
}

.homepage-layout .flip-card-back-content {
    width: 100%;
}

    .homepage-layout .flip-card-back-content h3 {
        font-family: 'gotham book';
        font-size: 20px;
        font-weight: 700;
        margin-bottom: 16px;
        color: white;
        line-height: 1.25;
    }

    .homepage-layout .flip-card-back-content p {
        font-family: 'gotham book';
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 22px;
        color: rgba(255,255,255,0.95);
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

.homepage-layout .flip-card-link {
    display: inline-block;
    color: white;
    text-decoration: none;
    font-family: 'gotham book';
    font-weight: 700;
    font-size: 14px;
    border: 2px solid white;
    padding: 10px 24px;
    border-radius: 999px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .homepage-layout .flip-card-link:hover {
        background: white;
        color: #0d2c53;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(255,255,255,0.3);
    }

/* Mobile adjustments for flip cards */
@media (max-width: 767.98px) {
    .homepage-layout .homepage-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .homepage-layout .flip-card {
        height: 350px;
    }

    .homepage-layout .flip-card-back-content h3 {
        font-size: 18px;
    }

    .homepage-layout .flip-card-back-content p {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }
}

/* ========================================
   HORIZONTAL LAYOUT (Existing)
   ======================================== */

/* Post Row - Alternating Layout */
.post-row {
    margin-bottom: 80px;
    align-items: stretch;
    position: relative;
}

.post-image-col {
    position: relative;
    z-index: 1;
}

.post-image-link {
    display: block;
    text-decoration: none;
    height: 100%;
}

.post-image-wrapper {
    position: relative;
    overflow: visible;
    height: 100%;
}

.post-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    min-height: 380px;
    transition: transform 0.6s ease;
}

.post-image-link:hover .post-image {
    transform: scale(1.08);
}

/* Date Badge - White style with dividers */
.post-date-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: #ffffff;
    padding: 12px 16px;
    text-align: center;
    z-index: 3;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 60px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.image-right .post-image-link .post-date-badge,
.image-right .post-image-wrapper .post-date-badge {
    left: auto;
    right: 20px;
}

.date-month {
    font-size: 11px;
    text-transform: uppercase;
    color: #8b1a1a;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding-bottom: 6px;
    border-bottom: 1px solid #ddd;
}

.date-day {
    font-size: 32px;
    font-weight: 700;
    color: #1a3a5c;
    line-height: 1;
    padding: 6px 0;
    border-bottom: 1px solid #ddd;
}

.date-year {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    padding-top: 6px;
}

/* Category Label */
.post-category-label {
    position: absolute;
    bottom: 20px; /* Changed from top to bottom */
    left: 20px;
    background-color: rgba(13, 44, 83, 0.9);
    padding: 4px 10px;
    font-size: 9px;
    color: #fff;
    font-weight: 600;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1;
    height: auto;
    width: auto;
    display: inline-block;
    align-self: flex-start;
}

.image-right .post-image-link .post-category-label,
.image-right .post-image-wrapper .post-category-label {
    left: auto;
    right: 20px;
}

/* ========================================
   VERTICAL SINGLE COLUMN LAYOUT (New)
   ======================================== */

.vertical-layout .post-card-vertical {
    background-color: transparent;
    margin-bottom: 60px;
    position: relative;
}

.vertical-layout .post-card-image-link {
    display: block;
    text-decoration: none;
}

.vertical-layout .post-card-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 650px;
    margin: 0 auto;
    overflow: hidden;
}

.vertical-layout .post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.vertical-layout .post-card-image-link:hover .post-card-image {
    transform: scale(1.08);
}

.vertical-layout .post-date-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    left: auto !important;
    background-color: #ffffff;
    padding: 12px 16px;
    text-align: center;
    z-index: 3;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 60px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.vertical-layout .date-month {
    font-size: 11px;
    text-transform: uppercase;
    color: #8b1a1a;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding-bottom: 6px;
    border-bottom: 1px solid #ddd;
}

.vertical-layout .date-day {
    font-size: 32px;
    font-weight: 700;
    color: #1a3a5c;
    line-height: 1;
    padding: 6px 0;
    border-bottom: 1px solid #ddd;
}

.vertical-layout .date-year {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.vertical-layout .post-card-content {
    position: relative;
    max-width: 900px;
    margin: -120px auto 0;
    padding: 35px 40px;
    background-color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.vertical-layout .post-card-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a3a5c;
    margin-bottom: 12px;
    line-height: 1.3;
}

.vertical-layout .post-card-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 0;
}

.vertical-layout .post-card-read-more {
    font-size: 14px;
    font-weight: 700;
    color: #1a3a5c;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

    .vertical-layout .post-card-read-more:hover {
        color: #8b1a1a;
        text-decoration: none;
    }

    .vertical-layout .post-card-read-more span {
        font-weight: 700;
        transition: transform 0.2s ease;
    }

    .vertical-layout .post-card-read-more:hover span {
        transform: translateX(3px);
    }

/* ========================================
   PLAIN LAYOUT (No Overlapping)
   ======================================== */

.plain-layout .post-card-plain {
    margin-bottom: 60px;
    background-color: #fff;
}

    .plain-layout .post-card-plain .row {
        align-items: stretch;
    }

.plain-layout .post-plain-image-col {
    position: relative;
}

.plain-layout .post-plain-image-link {
    display: block;
    text-decoration: none;
    height: 100%;
}

.plain-layout .post-plain-image-wrapper {
    position: relative; /* Ensure absolute positioning of children works correctly */
    height: 100%;
    overflow: hidden;
    background-color: #000;
}

.plain-layout .post-plain-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 400px;
    transition: transform 0.6s ease;
}

.plain-layout .post-plain-image-link:hover .post-plain-image {
    transform: scale(1.08);
}

.plain-layout .post-date-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #ffffff;
    padding: 10px 14px;
    text-align: center;
    z-index: 3;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 55px;
    width: auto; /* Ensure it doesn't stretch full width */
    max-width: fit-content; /* Fit to content size */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.plain-layout .date-month {
    font-size: 10px;
    text-transform: uppercase;
    color: #8b1a1a;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
}

.plain-layout .date-day {
    font-size: 28px;
    font-weight: 700;
    color: #1a3a5c;
    line-height: 1;
    padding: 4px 0;
    border-bottom: 1px solid #ddd;
}

.plain-layout .date-year {
    font-size: 10px;
    color: #666;
    font-weight: 500;
    padding-top: 4px;
}

.plain-layout .post-category-label {
    position: absolute;
    bottom: 20px; /* Changed from top to bottom */
    left: 20px;
    background-color: rgba(13, 44, 83, 0.9);
    padding: 4px 10px;
    font-size: 9px;
    color: #fff;
    font-weight: 600;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1;
    height: auto;
    width: auto;
    display: inline-block;
    align-self: flex-start;
}

.plain-layout .post-plain-content-col {
    display: flex;
    align-items: center;
    background-color: #fff;
}

.plain-layout .post-plain-content {
    padding: 40px;
    width: 100%;
}

.plain-layout .post-plain-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a3a5c;
    margin-bottom: 12px;
    line-height: 1.2;
}

.plain-layout .post-plain-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
}

.plain-layout .post-plain-summary {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 24px;
}

.plain-layout .post-plain-read-more {
    font-size: 14px;
    font-weight: 700;
    color: #1a3a5c;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

    .plain-layout .post-plain-read-more:hover {
        color: #8b1a1a;
        text-decoration: none;
    }

    .plain-layout .post-plain-read-more span {
        font-weight: 700;
        transition: transform 0.2s ease;
    }

    .plain-layout .post-plain-read-more:hover span {
        transform: translateX(3px);
    }

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

/* Filter and Sort Controls Responsive */
@media (max-width: 767.98px) {
    .post-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .post-filters {
        flex-wrap: wrap;
        justify-content: center;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .post-sort-controls {
        justify-content: center;
    }

    .date-range-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .apply-date-btn,
    .clear-date-btn {
        width: 100%;
    }
}

/* Horizontal Layout Responsive */
@media (max-width: 991.98px) {
    .post-row {
        margin-bottom: 50px;
    }

    .image-left .post-content-col,
    .image-right .post-content-col {
        margin-left: 0;
        margin-right: 0;
    }

    .post-content-wrapper {
        padding: 25px 20px;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        box-shadow: none !important;
    }

    .image-left .post-content-wrapper,
    .image-right .post-content-wrapper {
        background-color: #f8f9fa;
    }

    .post-date-badge {
        top: 10px;
        left: 10px !important;
        right: auto !important;
    }

    .post-category-label {
        bottom: 10px;
        left: 10px !important;
    }

    .image-right .post-category-label {
        left: auto !important;
        right: 10px !important;
    }

    .post-image {
        min-height: 280px;
    }
}

@media (max-width: 575.98px) {
    .post-title {
        font-size: 20px;
    }

    .post-summary {
        font-size: 13px;
    }

    .post-image {
        min-height: 220px;
    }

    .post-content-wrapper {
        padding: 20px 15px;
    }
}

/* Vertical Layout Responsive */
@media (max-width: 991.98px) {
    .vertical-layout .post-card-vertical {
        margin-bottom: 50px;
    }

    .vertical-layout .post-card-image-wrapper {
        height: 500px;
    }

    .vertical-layout .post-card-content {
        margin-top: -100px;
        padding: 30px 25px;
        max-width: 85%;
    }

    .vertical-layout .post-card-title {
        font-size: 24px;
    }
}

/* Plain Layout Responsive */
@media (max-width: 991.98px) {
    .plain-layout .post-card-plain {
        margin-bottom: 50px;
    }

    .plain-layout .post-plain-image {
        min-height: 300px;
    }

    .plain-layout .post-plain-content {
        padding: 30px 25px;
    }

    .plain-layout .post-plain-title {
        font-size: 26px;
    }
}

@media (max-width: 575.98px) {
    .vertical-layout .post-card-vertical {
        margin-bottom: 40px;
    }

    .vertical-layout .post-card-image-wrapper {
        height: 350px;
    }

    .vertical-layout .post-card-content {
        margin-top: -80px;
        padding: 25px 20px;
        max-width: 90%;
    }

    .vertical-layout .post-card-title {
        font-size: 20px;
    }

    .vertical-layout .post-card-meta {
        font-size: 12px;
    }

    .vertical-layout .post-date-badge {
        top: 15px;
        right: 15px;
        padding: 10px 14px;
        min-width: 50px;
    }

    .vertical-layout .date-day {
        font-size: 28px;
    }

    .plain-layout .post-card-plain {
        margin-bottom: 40px;
    }

    .plain-layout .post-plain-image {
        min-height: 250px;
    }

    .plain-layout .post-plain-content {
        padding: 25px 20px;
    }

    .plain-layout .post-plain-title {
        font-size: 22px;
    }

    .plain-layout .post-plain-summary {
        font-size: 14px;
    }

    .plain-layout .post-date-badge {
        top: 15px;
        right: 15px;
        padding: 10px 14px;
        min-width: 50px;
    }

    .plain-layout .post-category-label {
        bottom: 15px; /* Changed from top to bottom */
        left: 15px;
        padding: 4px 10px;
        font-size: 9px;
    }

    .plain-layout .date-day {
        font-size: 28px;
    }
}
