/*
 * Blog Typography Enhancements
 * Clean, readable typography for blog posts only
 */

/* Blog post content typography improvements */
.post_dtl_sec {
    /* Use site default font - Titillium Web */
    font-family: 'Titillium Web', sans-serif;
}

/* Blog post title styling */
.post_dtl_sec h1 {
    font-family: 'Titillium Web', sans-serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: #060520; /* Using site's default dark color */
}

/* Blog post headings */
.post_dtl_sec h2 {
    font-family: 'Titillium Web', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 2rem 0 1rem 0;
    color: #060520;
}

.post_dtl_sec h3 {
    font-family: 'Titillium Web', sans-serif;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin: 1.75rem 0 0.75rem 0;
    color: #060520;
}

.post_dtl_sec h4 {
    font-family: 'Titillium Web', sans-serif;
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    font-weight: 600;
    line-height: 1.4;
    margin: 1.5rem 0 0.5rem 0;
    color: #060520;
}

/* Blog post body text */
.post_dtl_sec p {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: #060520; /* Site default color */
    font-weight: 400;
}

/* First paragraph after title - make it larger like Medium */
.post_dtl_sec .post_thumbl + p,
.post_dtl_sec h1 + p {
    font-size: clamp(1.25rem, 2.2vw, 1.375rem);
    line-height: 1.6;
    color: #6b6b6b;
    margin-bottom: 2rem;
}

/* List styling */
.post_dtl_sec ul,
.post_dtl_sec ol {
    margin: 1.5rem 0;
    padding-left: 0;
}

.post_dtl_sec ul li,
.post_dtl_sec ol li {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    line-height: 1.7;
    margin-bottom: 0.75rem;
    color: #060520; /* Site's dark color */
    padding-left: 1.5rem;
    position: relative;
}

.post_dtl_sec ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #6b6b6b;
    font-weight: bold;
}

.post_dtl_sec ol {
    counter-reset: list-counter;
}

.post_dtl_sec ol li {
    counter-increment: list-counter;
    padding-left: 2rem;
}

.post_dtl_sec ol li::before {
    content: counter(list-counter) ".";
    position: absolute;
    left: 0;
    color: #6b6b6b;
    font-weight: 600;
    font-family: 'Titillium Web', sans-serif;
}

/* Links styling */
.post_dtl_sec a {
    color: #FFB216; /* Site's orange color */
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.2s ease;
}

.post_dtl_sec a:hover {
    border-bottom: 1px solid #FFB216;
    color: #FFB216;
}

/* Blockquote styling */
.post_dtl_sec blockquote {
    background: #F2F6F9; /* Keep existing site style */
    border-left: 4px solid #FFB216; /* Use site orange */
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    font-style: italic;
    font-size: clamp(1.25rem, 2.2vw, 1.375rem);
    line-height: 1.6;
    color: #727272; /* Site's gray text */
    border-radius: 5px;
}

.post_dtl_sec blockquote p {
    margin-bottom: 0.75rem;
}

.post_dtl_sec blockquote strong,
.post_dtl_sec blockquote cite {
    font-family: 'Titillium Web', sans-serif;
    font-style: normal;
    font-weight: 600;
    color: #060520;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Code styling */
.post_dtl_sec code {
    background: #f6f6f6;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9em;
    color: #d73a49;
}

.post_dtl_sec pre {
    background: #f6f6f6;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post_dtl_sec pre code {
    background: transparent;
    padding: 0;
    color: #24292e;
}

/* Image styling - Better text wrapping and alignment */
.post_dtl_sec img {
    max-width: 100% !important;
    max-height: 500px !important; /* Prevent excessive height */
    height: auto !important;
    width: auto !important;
    border-radius: 5px;
    margin: 1rem 0;
    object-fit: contain !important; /* Maintain aspect ratio */
}

/* Default image styling - center block */
.post_dtl_sec p img {
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
    max-height: 600px; /* Reasonable max height for content images */
    object-fit: contain;
}

/* Images with alignment classes */
.post_dtl_sec img.alignleft,
.post_dtl_sec .wp-block-image .alignleft img,
.post_dtl_sec figure.alignleft img {
    float: left;
    margin: 0.5rem 1.5rem 1rem 0;
    max-width: 50%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.post_dtl_sec img.alignright,
.post_dtl_sec .wp-block-image .alignright img,
.post_dtl_sec figure.alignright img {
    float: right;
    margin: 0.5rem 0 1rem 1.5rem;
    max-width: 50%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.post_dtl_sec img.aligncenter,
.post_dtl_sec .wp-block-image .aligncenter img,
.post_dtl_sec figure.aligncenter img {
    display: block;
    margin: 1.5rem auto;
    max-height: 600px;
    width: auto;
    height: auto;
    object-fit: contain;
    clear: both;
}

/* WordPress figure elements */
.post_dtl_sec figure {
    margin: 1.5rem 0;
    max-width: 100%;
    max-height: 600px;
    overflow: hidden;
}

.post_dtl_sec figure.alignleft {
    float: left;
    margin: 0.5rem 1.5rem 1rem 0;
    max-width: 50%;
    max-height: 400px;
}

.post_dtl_sec figure.alignright {
    float: right;
    margin: 0.5rem 0 1rem 1.5rem;
    max-width: 50%;
    max-height: 400px;
}

.post_dtl_sec figure.aligncenter {
    margin: 1.5rem auto;
    text-align: center;
    max-height: 600px;
    clear: both;
}

.post_dtl_sec figure img {
    max-height: inherit;
    object-fit: contain;
    width: auto;
    height: auto;
}

/* Figure captions */
.post_dtl_sec figcaption {
    font-family: 'Titillium Web', sans-serif;
    font-size: 0.875rem;
    color: #6b6b6b;
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Clear floats after paragraphs to prevent layout issues */
.post_dtl_sec p:after {
    content: "";
    display: table;
    clear: both;
}

/* Ensure text flows properly around images */
.post_dtl_sec p {
    overflow: hidden; /* Establishes new block formatting context */
}

/* Clearfix utility for containers with floated images */
.post_dtl_sec .post_data:after,
.post_dtl_sec article:after {
    content: "";
    display: table;
    clear: both;
}

/* Better spacing around images in content */
.post_dtl_sec img + p,
.post_dtl_sec figure + p {
    margin-top: 1rem;
}

.post_dtl_sec p + img,
.post_dtl_sec p + figure {
    margin-top: 1rem;
}

/* Prevent images from being too small when floated */
.post_dtl_sec img.alignleft,
.post_dtl_sec img.alignright {
    min-width: 200px;
}

.post_dtl_sec figure.alignleft,
.post_dtl_sec figure.alignright {
    min-width: 200px;
}

/* For smaller images that should be inline or smaller */
.post_dtl_sec img[width] {
    max-width: 100%; /* Ensure responsiveness while respecting width */
    height: auto;
}

/* Specific handling for medium-sized images that should float well */
.post_dtl_sec img[width="200"],
.post_dtl_sec img[width="250"],
.post_dtl_sec img[width="300"],
.post_dtl_sec img[width="350"],
.post_dtl_sec img[width="400"] {
    max-width: 45%; /* Allow these to float nicely beside text */
}

/* For larger images, treat them as full-width */
.post_dtl_sec img[width="500"],
.post_dtl_sec img[width="600"],
.post_dtl_sec img[width="700"],
.post_dtl_sec img[width="800"] {
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
}

/* Better handling of images with captions */
.post_dtl_sec .wp-caption {
    max-width: 100%;
    max-height: 600px;
    margin: 1rem 0;
    overflow: hidden;
}

.post_dtl_sec .wp-caption.alignleft {
    float: left;
    margin: 0.5rem 1.5rem 1rem 0;
    max-width: 45%;
    max-height: 400px;
}

.post_dtl_sec .wp-caption.alignright {
    float: right;
    margin: 0.5rem 0 1rem 1.5rem;
    max-width: 45%;
    max-height: 400px;
}

.post_dtl_sec .wp-caption.aligncenter {
    margin: 1.5rem auto;
    text-align: center;
    max-height: 600px;
}

.post_dtl_sec .wp-caption img {
    max-height: inherit;
    object-fit: contain;
    width: auto;
    height: auto;
}

.post_dtl_sec .wp-caption-text {
    font-family: 'Titillium Web', sans-serif;
    font-size: 0.875rem;
    color: #6b6b6b;
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
    padding: 0.5rem;
}

/* Featured image */
.post_dtl_sec .post_thumbl img {
    border-radius: 8px;
    margin: 1.5rem 0 2rem 0;
    display: block;
    width: 100%;
}

/* Tags styling */
.post_dtl_sec .insght_tags {
    margin: 1rem 0 2rem 0;
}

.post_dtl_sec .insght_tags span {
    font-family: 'Titillium Web', sans-serif;
    background: #F2F6F9; /* Site's light blue-gray background */
    color: #060520; /* Site's dark color */
    padding: 0.375rem 0.75rem;
    border-radius: 5px; /* Match site's border radius */
    font-size: 0.875rem;
    font-weight: 600; /* Site's default bold weight */
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.post_dtl_sec .insght_tags span:hover {
    background: #e8e8e8;
}

/* Improve content width and readability */
.post_dtl_sec .container-xxl {
    max-width: 1200px;
}

.post_dtl_sec .row .col-lg-10 {
    max-width: 800px; /* Optimal reading width like Medium */
}

/* Add better spacing for sections */
.post_dtl_sec .post_data {
    padding: 0;
}

/* Strong/bold text */
.post_dtl_sec strong,
.post_dtl_sec b {
    font-weight: 600;
    color: #060520; /* Site's dark color */
}

/* Emphasis styling */
.post_dtl_sec em,
.post_dtl_sec i {
    font-style: italic;
    color: #727272; /* Site's gray text */
}

/* Better spacing for paragraphs after headings */
.post_dtl_sec h2 + p,
.post_dtl_sec h3 + p,
.post_dtl_sec h4 + p {
    margin-top: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .post_dtl_sec {
        font-size: 1rem;
    }
    
    .post_dtl_sec p {
        font-size: 1.125rem;
        line-height: 1.6;
    }
    
    .post_dtl_sec .post_thumbl + p,
    .post_dtl_sec h1 + p {
        font-size: 1.25rem;
        line-height: 1.5;
    }
    
    .post_dtl_sec blockquote {
        margin: 1.5rem 0;
        padding-left: 1rem;
    }
    
    /* Better image handling on tablets */
    .post_dtl_sec img.alignleft,
    .post_dtl_sec img.alignright,
    .post_dtl_sec figure.alignleft,
    .post_dtl_sec figure.alignright {
        max-width: 60%;
    }
    
    .post_dtl_sec figure.alignleft {
        margin: 0.5rem 1rem 1rem 0;
    }
    
    .post_dtl_sec figure.alignright {
        margin: 0.5rem 0 1rem 1rem;
    }
}

/* Additional Medium-inspired enhancements */
.post_dtl_sec hr {
    border: none;
    border-top: 1px solid #e6e6e6;
    margin: 3rem 0;
    width: 100%;
}

/* Table styling */
.post_dtl_sec table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 1rem;
}

.post_dtl_sec table th,
.post_dtl_sec table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e6e6e6;
}

.post_dtl_sec table th {
    font-family: 'Titillium Web', sans-serif;
    font-weight: 600;
    background: #F2F6F9; /* Site's light background */
    color: #060520; /* Site's dark color */
}

.post_dtl_sec table td {
    color: #060520; /* Site's dark color */
}

/* Better content spacing and flow */
.post_dtl_sec .post_data > *:first-child {
    margin-top: 0;
}

.post_dtl_sec .post_data > *:last-child {
    margin-bottom: 0;
}

/* Improve focus states for accessibility */
.post_dtl_sec a:focus {
    outline: 2px solid #FFB216; /* Site's orange color */
    outline-offset: 2px;
}

/* Better quote mark styling */
.post_dtl_sec blockquote::before {
    content: """;
    font-size: 3rem;
    color: #FFB216; /* Site's orange color */
    position: absolute;
    left: -0.5rem;
    top: -0.5rem;
    font-family: Georgia, serif;
}

.post_dtl_sec blockquote {
    position: relative;
}

/* Subtle animation for hover states */
.post_dtl_sec a,
.post_dtl_sec .insght_tags span {
    transition: all 0.2s ease-in-out;
}

/* Additional responsive image handling */
.post_dtl_sec .wp-block-image {
    margin: 1.5rem 0;
    max-height: 600px;
    overflow: hidden;
}

.post_dtl_sec .wp-block-image img {
    max-width: 100%;
    max-height: 600px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.post_dtl_sec .wp-block-image.alignleft,
.post_dtl_sec .wp-block-image.alignright {
    max-height: 400px;
}

.post_dtl_sec .wp-block-image.alignleft img,
.post_dtl_sec .wp-block-image.alignright img {
    max-height: 400px;
}

/* Improve readability on smaller screens */
@media (max-width: 480px) {
    .post_dtl_sec p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .post_dtl_sec h1 {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    .post_dtl_sec h2 {
        font-size: 1.5rem;
    }
    
    .post_dtl_sec h3 {
        font-size: 1.25rem;
    }
    
    /* On mobile, stack images instead of floating */
    .post_dtl_sec img.alignleft,
    .post_dtl_sec img.alignright,
    .post_dtl_sec figure.alignleft,
    .post_dtl_sec figure.alignright,
    .post_dtl_sec .wp-caption.alignleft,
    .post_dtl_sec .wp-caption.alignright {
        float: none !important;
        display: block;
        margin: 1rem auto !important;
        max-width: 100% !important;
        min-width: unset !important;
    }
    
    /* Ensure proper text flow on mobile */
    .post_dtl_sec p {
        overflow: visible;
    }
    
    .post_dtl_sec p:after {
        display: none;
    }
}