/**
 * Blog Page Styles
 * Shared styles for blog index, category pages, and individual posts
 */

/* ============================================
   BLOG HERO SECTION
   ============================================ */

.blog-hero {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Background image set in page HTML using PHP constants */
}

.blog-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
}

.blog-hero .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.blog-hero h1 {
    color: #fff;
    font-size: 48px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Category hero - smaller for category/archive pages */
.blog-hero.category-hero {
    height: 300px;
}

.blog-hero.category-hero h1 {
    font-size: 36px;
}

/* ============================================
   BLOG GRID LAYOUT
   ============================================ */

.blog-grid-section {
    padding: 60px 0;
    background: #fff;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* ============================================
   BLOG CARD COMPONENT
   ============================================ */

.blog-card {
    background: #fff;
    border-radius: 0;
    overflow: hidden;
}

.blog-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

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

.blog-card-content {
    width: 90%;
    margin: -25px auto 0;
    padding: 20px;
    background: #fff;
    position: relative;
    z-index: 1;
}

.blog-card-category {
    display: inline-block;
    color: #0d55d2;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.blog-card-category a {
    color: #0d55d2;
    text-decoration: none;
}

.blog-card-category a:hover {
    text-decoration: underline;
}

.blog-card-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 15px 0;
}

.blog-card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card-title a:hover {
    color: #0d55d2;
}

.blog-card-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
}

.blog-card-link {
    display: inline-block;
    color: #0d55d2;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-card-link:hover {
    text-decoration: underline;
}

/* Blog Card Button - styled like original site */
.blog-card-btn {
    display: inline-block;
    background: #0d55d2;
    color: #fff;
    padding: 12px 25px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.blog-card-btn:hover {
    background: transparent;
    color: #000;
    box-shadow: inset 0px 0px 0px 2px #000;
}

/* ============================================
   BLOG SIDEBAR
   ============================================ */

.blog-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    max-width: 100%;
}

.blog-post-main {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.blog-sidebar {
    padding-left: 20px;
}

.sidebar-widget {
    background: #fff;
    padding: 25px;
    margin-bottom: 30px;
}

.sidebar-widget h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #0d55d2;
}

/* ADO 8176 blog listing (Chief Officer's read 11-11): card text and side headings as on the old listing */
.blog-listing .blog-card-content { padding: 10px 25px; }
.blog-listing .blog-card-title { color: #292b2c; }
.blog-listing .blog-card-title a { color: #292b2c; }
.blog-listing .blog-card-title a:hover { color: #0d55d2; }
.blog-listing .sidebar-widget h3 { color: #292b2c; padding-top: 10px; border-bottom: 0; }
.blog-listing .sidebar-widget h3 { font-family: proxima-nova, sans-serif; }
@media (min-width: 768px) { .blog-listing .blog-card-title, .blog-listing .sidebar-widget h3 { font-size: 16px; } }
/* end ADO 8176 blog listing */

/* Categories Widget */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 10px;
}

.category-list a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.category-list a:hover {
    color: #0d55d2;
}

/* Related Stories Widget */
.related-story {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.related-story:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.related-story-image {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    overflow: hidden;
}

.related-story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-story-title {
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.related-story-title a {
    color: #333;
    text-decoration: none;
}

.related-story-title a:hover {
    color: #0d55d2;
}

/* ============================================
   PAGINATION
   ============================================ */

.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    padding-top: 40px;
}

.blog-pagination a,
.blog-pagination span {
    display: inline-block;
    font-size: 25px;
    text-decoration: none;
    color: #0d55d2;
    transition: color 0.3s ease;
}

.blog-pagination a:hover {
    color: #0a3d99;
    text-decoration: underline;
}

.blog-pagination .current {
    color: #333;
    text-decoration: underline;
}

.blog-pagination .prev,
.blog-pagination .next {
    color: #0d55d2;
}

/* ============================================
   SINGLE BLOG POST
   ============================================ */

.blog-post-section {
    padding: 60px 0;
    background: #fff;
    overflow-x: hidden;
}

.blog-post-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
}

.blog-post-category {
    display: inline-block;
    color: #0d55d2;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.blog-post-category a {
    color: #0d55d2;
    text-decoration: none;
}

.blog-post-title {
    font-size: 42px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 20px 0;
    color: #000;
}

.blog-post-meta {
    font-size: 14px;
    color: #666;
}

.blog-post-meta .author {
    font-weight: 600;
    color: #333;
}

.blog-post-featured-image {
    margin-bottom: 40px;
}

.blog-post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Blog Post Content */
.blog-post-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    overflow-x: hidden;
    word-wrap: break-word;
}

.blog-post-content h2 {
    font-size: 44px;
    font-weight: 600;
    margin: 40px 0 20px;
    color: #000;
}

.blog-post-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 30px 0 15px;
    color: #000;
}

.blog-post-content p {
    margin-bottom: 20px;
}

/* In-text links (ADO 5425, L4): live's blue and pointing state (live style.lib.min.css: a { color: #0275d8; text-decoration: none } and
   a:focus, a:hover { color: #014c8c; text-decoration: underline }). Only links in the post text: on some posts the footer block
   (.blog-post-footer) sits inside .blog-post-content, so it is left out here and keeps its own #0d55d2 rule further down. */
.blog-post-content > :not(.blog-post-footer) a {
    color: #0275d8;
}

.blog-post-content > :not(.blog-post-footer) a:hover,
.blog-post-content > :not(.blog-post-footer) a:focus {
    color: #014c8c;
    text-decoration: underline;
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
    margin: 30px 0;
}

.blog-post-content ul,
.blog-post-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.blog-post-content li {
    margin-bottom: 10px;
}

.blog-post-content blockquote {
    margin: 30px 0;
    padding: 20px 0;
    background: transparent;
    border: none;
    color: rgb(0, 0, 255);
    font-style: italic;
    font-size: 26px;
    font-weight: bold;
}

.blog-post-content blockquote p {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    margin-bottom: 0;
}

.blog-post-content blockquote cite {
    display: block;
    font-size: 18px;
    font-weight: normal;
    font-style: normal;
    color: #555;
    margin-top: 15px;
}

/* Related Posts Section */
.related-posts-section {
    padding: 60px 0;
    background: #f9f9f9;
}

.related-posts-section h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 40px;
}

/* ============================================
   FEATURED SLIDER (Blog Index)
   ============================================ */

.blog-featured-slider {
    position: relative;
    height: 560px;
    overflow: hidden;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.featured-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: top center;
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: 1;
}

.featured-slide.active {
    opacity: 1;
    z-index: 2;
}

.featured-slide-overlay {
    display: none;
}

.featured-slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    padding: 20px 20px 50px;
    z-index: 3;
    background: rgba(0, 0, 0, 0.75);
}

.featured-slide-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.featured-slide-title a {
    color: #fff;
    text-decoration: none;
}

.featured-slide-title a:hover {
    text-decoration: underline;
}

/* Slider Navigation Arrows */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 40px;
    cursor: pointer;
    padding: 20px;
    transition: color 0.3s ease;
}

.slider-arrow:hover {
    color: #fff;
}

.slider-prev {
    left: 20px;
}

.slider-next {
    right: 20px;
}

/* Slider Navigation Dots */
.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.slider-dot:hover {
    border-color: #fff;
}

.slider-dot.active {
    background: #fff;
    border-color: #fff;
}

/* ============================================
   QUOTE BANNER (Blog Index)
   ============================================ */

.blog-quote-banner {
    background: rgb(5, 72, 107);
    padding: 0; /* ADO 8176: layout.css "section > .container" gives the 50px above and below, as the old .divider-strip .container did */
    text-align: center;
}

.blog-quote-banner blockquote {
    max-width: none;
    padding: 0 50px; /* ADO 8176: as the old .divider-strip .text-wrap */
    margin: 0 auto;
    color: #fff;
}

.blog-quote-banner p {
    font-size: 20.8px;
    font-style: normal;
    line-height: 30.04px;
    margin-bottom: 0;
}

.blog-quote-banner cite {
    display: inline;
    font-size: inherit;
    font-style: normal;
    margin-top: 0;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 991px) { /* tablet breakpoint */
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-with-sidebar {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .blog-sidebar {
        padding-left: 0;
    }

    .blog-hero h1 {
        font-size: 36px;
    }

    .blog-post-title {
        font-size: 32px;
    }
}

@media (max-width: 767px) { /* mobile breakpoint */
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-with-sidebar {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .blog-hero {
        height: 300px;
    }

    .blog-hero h1 {
        font-size: 28px;
    }

    .blog-hero.category-hero {
        height: 250px;
    }

    .blog-hero.category-hero h1 {
        font-size: 24px;
    }

    .blog-post-title {
        font-size: 26px;
    }

    .blog-post-content {
        font-size: 15px;
    }

    .blog-featured-slider {
        height: 400px;
    }

    .featured-slide-title {
        font-size: 14px;
        letter-spacing: 1px;
    }

    .featured-slide-content {
        padding: 20px 15px 50px;
    }

    .slider-arrow {
        font-size: 30px;
        padding: 15px;
    }

    .slider-prev {
        left: 10px;
    }

    .slider-next {
        right: 10px;
    }

    .blog-quote-banner p {
        font-size: 20.8px;
    }
    .blog-quote-banner blockquote { padding: 0 15px; }

    .blog-pagination a,
    .blog-pagination span {
        font-size: 16px;
    }
}

/* ============================================
   BLOG POST CONTENT - SPECIAL ELEMENTS
   (for The C Color Theory Explained and similar posts)
   ============================================ */

/* Header alignment override for posts with sidebar */
.blog-post-header--left {
    text-align: left;
    max-width: 100%;
}

/* CTA button spacing in header - minimal space to image below */
.blog-post-header .cta-btn {
    margin-bottom: 15px;
}

/* Blog post meta with border separator */
.blog-post-meta--bordered {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

/* Full width content override */
.blog-post-content--full {
    max-width: 100%;
}

/* Video wrapper with spacing */
.blog-post-content .video-wrapper {
    margin: 30px 0;
    max-width: 100%;
    overflow: hidden;
}

.blog-post-content .video-wrapper iframe {
    max-width: 100%;
}

/* Floated video (vertical mobile demo) */
.video-float-right {
    float: right;
    margin: 30px 10px 30px 20px;
    max-width: 45%;
}

.video-float-right iframe {
    max-width: 100%;
}

/* Clear float */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Centered heading in content */
.blog-post-content h1.text-center {
    text-align: center;
}

/* Centered paragraph */
.blog-post-content .text-center {
    text-align: center;
}

/* C Color Coordinates grid - 4 column desktop, 2 column mobile */
.c-color-coordinates-spectrums {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
    max-width: 900px;
}

.c-color-coordinates-spectrums > div {
    text-align: center;
}

/* Spectrum title - fixed height to align images */
.c-color-coordinates-spectrums h5 {
    font-size: 14px;
    margin: 0 0 10px 0;
    height: 45px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.c-color-coordinates-spectrums h5 a {
    color: #333;
    text-decoration: none;
    line-height: 1.3;
}

.c-color-coordinates-spectrums h5 a:hover {
    text-decoration: underline;
}

/* Image and button container */
.c-color-coordinates-spectrums > div > p {
    margin: 0;
}

.c-color-coordinates-spectrums img {
    max-width: 100%;
    height: auto;
    margin: 0;
}

/* Shop button styling */
.c-color-coordinates-spectrums > div > p b,
.c-color-coordinates-spectrums > div > p a b {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    font-size: 12px;
}

/* Shop Palettes link at bottom */
.c-color-coordinates-spectrums > p {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 10px;
}

/* Post footer section */
.blog-post-footer {
    margin-top: 30px;
    max-width: 100%;
    overflow-x: hidden;
}

/* Blog post footer links - blue styling */
.blog-post-footer a {
    color: #0d55d2;
    text-decoration: none;
}

.blog-post-footer a:hover {
    text-decoration: underline;
}

/* Socialize With Us section */
.blog-social-section {
    margin: 30px 0;
    text-align: left;
}

.blog-social-section h4 {
    font-size: 24px;
    font-weight: normal;
    font-style: italic;
    margin-bottom: 15px;
    color: #333;
}

.blog-social-icons {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

.blog-social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #333;
    border-radius: 50%;
}

.blog-social-icons a:hover {
    background: #555;
}

.blog-social-icons img {
    width: 20px;
    height: 20px;
    margin: 0;
    filter: brightness(0) invert(1);
}

/* Blog post navigation cards (Previous/Next) */
.blog-post-nav-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 40px 0 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.nav-card {
    display: flex;
    flex-direction: column;
}

.nav-label {
    color: #0d55d2;
    font-size: 18px;
    margin-bottom: 15px;
    display: block;
}

.nav-card-prev .nav-label {
    text-align: left;
}

.nav-card-next .nav-label {
    text-align: right;
}

.nav-card-link img {
    width: 100%;
    height: auto;
    margin: 0;
    display: block;
}

.nav-card-title {
    font-size: 18px;
    font-weight: bold;
    margin: 15px 0 10px;
    line-height: 1.3;
}

.nav-card-title a {
    color: #333;
    text-decoration: none;
}

.nav-card-title a:hover {
    text-decoration: underline;
}

.nav-card-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 767px) { /* mobile breakpoint */
    .blog-post-nav-cards {
        gap: 10px;
    }

    .nav-label {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .nav-card-link img {
        width: 100%;
        max-width: 100%;
    }

    .nav-card-title {
        font-size: 13px;
        margin: 8px 0 5px;
        word-wrap: break-word;
    }

    .nav-card-excerpt {
        font-size: 11px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* Copyright spacing in blog footer */
.blog-post-footer .blog-copyright {
    margin-top: 30px;
}

/* Amazon product image constraint */
.blog-post-content img.product-collage {
    max-width: min(610px, 100%);
}

/* Image captions (h6 with images) - margin below caption, not above */
.blog-post-content h6 {
    margin-top: 10px;
    margin-bottom: 30px;
    font-size: 14px;
    line-height: 1.5;
}

/* H6 containing image should have image margin reset */
.blog-post-content h6 img {
    margin: 0 0 10px 0;
    display: block;
}

@media (max-width: 767px) { /* mobile breakpoint */
    .video-float-right {
        float: none;
        margin: 30px 0;
        max-width: 100%;
    }

    .video-float-right iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 9/16;
    }

    .blog-post-footer {
        overflow-x: hidden;
    }

    .blog-post-footer p {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .c-color-coordinates-spectrums {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px 15px;
        justify-items: center;
    }

    .c-color-coordinates-spectrums h5 {
        font-size: 13px;
        height: 40px;
    }

    .c-color-coordinates-spectrums > div > p b,
    .c-color-coordinates-spectrums > div > p a b {
        font-size: 11px;
        padding: 6px 10px;
    }
}
