/*
 * Blog Styles for Orbit Theme
 * Note: Body classes are filtered by theme, so styles target element classes directly
 */

/* =====================================================
   BLOG ARCHIVE LAYOUT
   ===================================================== */

/* Ensure archive wrapper takes full width */
.archive-wrapper {
    width: 100%;
}

.archive-wrapper .container {
    width: 100%;
    max-width: var(--wp--custom--layout--content, 1400px);
    margin: 0 auto;
}

.archive-wrapper .row {
    width: 100%;
}

.archive-wrapper .col-12 {
    width: 100%;
}

/* Override the theme's .posts.grid.columns-4 class */
.archive-wrapper .posts.grid {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: var(--wp--preset--spacing--medium, 24px);
    width: 100%;
}

.archive-wrapper .posts.grid.columns-4 {
    grid-template-columns: 1fr;
    /* Override 4 columns on mobile */
}

@media (min-width: 640px) {

    .archive-wrapper .posts.grid,
    .archive-wrapper .posts.grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--wp--preset--spacing--large, 32px);
    }
}

@media (min-width: 1024px) {

    .archive-wrapper .posts.grid,
    .archive-wrapper .posts.grid.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =====================================================
   BLOG POST CARD
   ===================================================== */

article.blog-post-entry {
    background: #fff;
    border-radius: var(--wp--custom--border--radius--medium, 12px);
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Allow flex shrink but not collapse */
    width: 100%;
}

article.blog-post-entry:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
}

/* Featured Image */
article.blog-post-entry .entry-thumbnail {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--wp--preset--color--slate, #e4eaf0);
}

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

article.blog-post-entry:hover .entry-thumbnail img {
    transform: scale(1.05);
}

article.blog-post-entry .entry-thumbnail.no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content Area */
article.blog-post-entry .entry-content-inner {
    padding: var(--wp--preset--spacing--medium, 24px);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Category Badges */
.entry-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--wp--preset--color--teal, #00ceb5);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.category-badge:hover {
    background-color: var(--wp--preset--color--navy, #05386B);
    color: #fff;
    text-decoration: none;
}

/* Title */
article.blog-post-entry .entry-title {
    font-size: var(--wp--preset--font-size--large, 1.25rem);
    line-height: 1.3;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

article.blog-post-entry .entry-title a {
    color: var(--wp--preset--color--navy, #05386B);
    text-decoration: none;
    transition: color 0.3s ease;
}

article.blog-post-entry .entry-title a:hover {
    color: var(--wp--preset--color--teal, #00ceb5);
}

/* Meta */
article.blog-post-entry .entry-meta {
    font-size: var(--wp--preset--font-size--small, 14px);
    color: #757575;
    margin-bottom: 1rem;
}

/* Summary */
article.blog-post-entry .entry-summary {
    font-size: var(--wp--preset--font-size--normal, 16px);
    line-height: 1.6;
    color: #616161;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

article.blog-post-entry .entry-summary p {
    margin: 0;
}

/* Read More Link */
article.blog-post-entry .read-more-link {
    font-weight: 700;
    font-size: var(--wp--preset--font-size--small, 14px);
    color: var(--wp--preset--color--navy, #05386B);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

article.blog-post-entry .read-more-link:hover {
    color: var(--wp--preset--color--teal, #00ceb5);
    text-decoration: none;
}

/* =====================================================
   PAGINATION - Blog Archive
   ===================================================== */

nav.archive-pagination,
nav.archive-pagination.pagination {
    margin-top: var(--wp--preset--spacing--x-large, 48px);
    margin-bottom: var(--wp--preset--spacing--large, 32px);
}

nav.archive-pagination ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav.archive-pagination ul li {
    list-style: none;
    margin: 0;
    padding: 0;
}

nav.archive-pagination ul li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: var(--wp--custom--border--radius--medium, 12px);
    background: #fff;
    color: var(--wp--preset--color--navy, #05386B);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--wp--preset--color--slate, #e4eaf0);
    transition: all 0.3s ease;
}

nav.archive-pagination ul li a:hover {
    background: var(--wp--preset--color--navy, #05386B);
    color: #fff;
    border-color: var(--wp--preset--color--navy, #05386B);
}

nav.archive-pagination ul li.active a {
    background: var(--wp--preset--color--navy, #05386B);
    color: #fff;
    border-color: var(--wp--preset--color--navy, #05386B);
}

nav.archive-pagination ul li.pagination-previous a,
nav.archive-pagination ul li.pagination-next a {
    padding: 0 12px;
}

nav.archive-pagination ul li.pagination-omission {
    color: #757575;
    padding: 0 8px;
}

/* =====================================================
   SINGLE POST STYLES
   ===================================================== */


/* Main container */
article.single-post-article {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--wp--preset--spacing--xx-large, 64px) 20px;
}

/* Header Section */
article.single-post-article .entry-header {
    text-align: center;
    margin-bottom: var(--wp--preset--spacing--x-large, 48px);
}

article.single-post-article .entry-header .container {
    max-width: 800px;
    margin: 0 auto;
}

article.single-post-article .entry-categories {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: var(--wp--preset--spacing--small, 16px);
}

article.single-post-article .entry-title {
    margin: 0 0 var(--wp--preset--spacing--medium, 24px) 0;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.15;
    font-weight: 800;
    color: var(--wp--preset--color--navy, #05386B);
    letter-spacing: -0.02em;
}

article.single-post-article .entry-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--wp--preset--font-size--small, 14px);
    color: #757575;
}

article.single-post-article .entry-meta .posted-on,
article.single-post-article .entry-meta .byline {
    display: inline-flex;
    align-items: center;
}

article.single-post-article .entry-meta .byline {
    padding-left: 0.75rem;
    border-left: 1px solid #ddd;
}

/* Featured Image */
article.single-post-article .featured-image {
    margin: var(--wp--preset--spacing--large, 32px) 0 var(--wp--preset--spacing--x-large, 48px) 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
}

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

/* Content Area */
article.single-post-article .entry-content {
    max-width: 720px;
    margin: 0 auto;
}

article.single-post-article .entry-content .container {
    max-width: 100%;
    padding: 0;
}

/* Typography */
article.single-post-article .entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #333;
}

article.single-post-article .entry-content p {
    margin-bottom: 1.75em;
}

article.single-post-article .entry-content a {
    color: var(--wp--preset--color--teal, #00ceb5);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.3s ease;
}

article.single-post-article .entry-content a:hover {
    color: var(--wp--preset--color--navy, #05386B);
}

/* Lists */
article.single-post-article .entry-content ul,
article.single-post-article .entry-content ol {
    margin: 1.5em 0;
    padding-left: 1.5em;
}

article.single-post-article .entry-content li {
    margin-bottom: 0.5em;
    padding-left: 0.5em;
}

article.single-post-article .entry-content ul li::marker {
    color: var(--wp--preset--color--teal, #00ceb5);
}

article.single-post-article .entry-content ol li::marker {
    color: var(--wp--preset--color--navy, #05386B);
    font-weight: 600;
}

/* Blockquotes */
article.single-post-article .entry-content blockquote {
    margin: 2em 0;
    padding: 1.5em 2em;
    background: linear-gradient(135deg, rgba(0, 206, 181, 0.08) 0%, rgba(5, 56, 107, 0.05) 100%);
    border-left: 4px solid var(--wp--preset--color--teal, #00ceb5);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    font-size: 1.125rem;
}

article.single-post-article .entry-content blockquote p:last-child {
    margin-bottom: 0;
}

article.single-post-article .entry-content figcaption {
    font-size: 0.875rem;
    color: #757575;
    text-align: center;
    margin-top: 0.75em;
    font-style: italic;
}

/* Code blocks */
article.single-post-article .entry-content code {
    background: var(--wp--preset--color--slate, #e4eaf0);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

article.single-post-article .entry-content pre {
    background: var(--wp--preset--color--navy, #05386B);
    color: #fff;
    padding: 1.5em;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2em 0;
}

article.single-post-article .entry-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Footer */
article.single-post-article .entry-footer {
    max-width: 720px;
    margin: 0 auto;
    padding-top: var(--wp--preset--spacing--xx-large, 64px);
}

article.single-post-article .entry-footer .container {
    max-width: 100%;
    padding: 0;
}

/* Post Navigation */
article.single-post-article .post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--wp--preset--spacing--large, 32px);
    padding-top: var(--wp--preset--spacing--large, 32px);
    border-top: 1px solid var(--wp--preset--color--slate, #e4eaf0);
}

article.single-post-article .post-navigation .nav-links {
    display: contents;
}

article.single-post-article .post-navigation .nav-previous,
article.single-post-article .post-navigation .nav-next {
    display: flex;
    flex-direction: column;
    padding: var(--wp--preset--spacing--medium, 24px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

article.single-post-article .post-navigation .nav-previous:hover,
article.single-post-article .post-navigation .nav-next:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

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

article.single-post-article .post-navigation .nav-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9E9E9E;
    margin-bottom: 0.5rem;
}

article.single-post-article .post-navigation .nav-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--wp--preset--color--navy, #05386B);
    text-decoration: none;
    line-height: 1.4;
}

article.single-post-article .post-navigation a:hover .nav-title {
    color: var(--wp--preset--color--teal, #00ceb5);
}

/* Mobile adjustments */
@media (max-width: 640px) {
    article.single-post-article {
        padding: var(--wp--preset--spacing--large, 32px) 16px;
    }

    article.single-post-article .entry-title {
        font-size: 1.75rem;
    }

    article.single-post-article .entry-content {
        font-size: 1rem;
    }

    article.single-post-article .post-navigation {
        grid-template-columns: 1fr;
    }

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