/*
Theme Name: Astra Modern Child
Theme URI: https://thecarbonbuddy.com
Description: Modern blog post design child theme for Astra
Author: The Carbonbuddy
Author URI: https://thecarbonbuddy.com
Template: astra
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astra-modern-child
*/

/* Modern Single Post Styles */

/* Override Astra container on single posts and custom post types */
body.single .site-content {
    padding: 0 !important;
}

body.single .ast-container {
    max-width: 100% !important;
    padding: 0 !important;
}

body.single .site-main {
    margin: 0 !important;
}

body.single {
    background: #f6f7fb;
}

/* Hide default Astra elements */
body.single .entry-header,
body.single .ast-single-post-meta,
body.single .post-navigation,
body.single .entry-title,
body.single .ast-post-meta {
    display: none !important;
}

/* Modern post wrapper */
.modern-post-wrapper {
    max-width: 1140px;
    margin: 0 auto;
    padding: 60px 40px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    align-items: start;
}

.modern-post-main {
    max-width: 760px;
}

.modern-post-sidebar {
    position: sticky;
    top: 100px;
}

/* Category badge */
.modern-post-category-single {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 16px;
    font-weight: 500;
}

.modern-post-category-single .category-name {
    color: #374151;
}

.modern-post-category-single .post-date {
    color: #9ca3af;
}

.modern-post-meta-sep {
    color: #d1d5db;
}

/* Title */
.modern-post-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
    color: #111827;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Author meta */
.modern-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.modern-post-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modern-post-author img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.modern-post-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.modern-post-author-name {
    font-weight: 500;
    color: #111827;
}

.modern-post-details {
    color: #6b7280;
}

.modern-post-details::before {
    content: "•";
    margin-right: 8px;
    color: #d1d5db;
}

/* Featured image */
.modern-post-featured-image {
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
}

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

/* Content */
.modern-post-content {
    font-size: 16px;
    line-height: 1.7;
    color: #4b5563;
    margin-bottom: 48px;
}

.modern-post-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 16px;
    line-height: 1.3;
    color: #111827;
}

.modern-post-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin-top: 36px;
    margin-bottom: 12px;
    line-height: 1.4;
    color: #111827;
}

.modern-post-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 12px;
    line-height: 1.4;
    color: #1f2937;
}

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

.modern-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 32px 0;
}

.modern-post-content figure {
    margin: 32px 0;
}

.modern-post-content figcaption {
    margin-top: 12px;
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    font-style: italic;
}

.modern-post-content ul,
.modern-post-content ol {
    margin: 24px 0;
    padding-left: 28px;
}

.modern-post-content li {
    margin-bottom: 8px;
    line-height: 1.7;
    color: #4b5563;
}

.modern-post-content ol {
    counter-reset: item;
}

.modern-post-content ol > li {
    counter-increment: item;
    position: relative;
}

.modern-post-content blockquote {
    border-left: 3px solid #e5e7eb;
    padding-left: 20px;
    margin: 32px 0;
    font-style: normal;
    color: #6b7280;
    font-size: 16px;
}

.modern-post-content a {
    color: #3b59ff;
    text-decoration: none;
    transition: color 0.2s;
}

.modern-post-content a:hover {
    color: #2f46d6;
    text-decoration: underline;
}

.modern-post-content strong {
    font-weight: 600;
    color: #1f2937;
}

.modern-post-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Courier New', monospace;
    color: #e11d48;
}

.modern-post-content pre {
    background: #1f2937;
    color: #f3f4f6;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 32px 0;
}

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

/* Sidebar */
.modern-sidebar-section {
    margin-bottom: 40px;
}

.modern-sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 20px;
}

.modern-related-posts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modern-related-post {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    text-decoration: none;
    color: inherit;
}

.modern-related-post:hover .related-post-title {
    color: #3b59ff;
}

.modern-related-post-image {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f4f6;
}

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

.modern-related-post-content {
    flex: 1;
}

.related-post-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.related-post-date {
    font-size: 12px;
    color: #9ca3af;
}

.modern-categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.modern-category-tag {
    display: inline-block;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s;
}

.modern-category-tag:hover {
    background: #e5e7eb;
    color: #111827;
}

.modern-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.modern-tag-link {
    display: inline-block;
    padding: 4px 0;
    font-size: 13px;
    color: #3b59ff;
    text-decoration: none;
    transition: color 0.2s;
}

.modern-tag-link::before {
    content: "#";
}

.modern-tag-link:hover {
    color: #2f46d6;
    text-decoration: underline;
}

/* Prev / Next navigation */
.modern-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}

.modern-post-nav-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 140px;
    padding: 22px 22px;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.modern-post-nav-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

.modern-post-nav-prev {
    background: #eef2ff;
    color: #111827;
    align-items: flex-start;
}

.modern-post-nav-next {
    background: #3b59ff;
    color: #ffffff;
    align-items: flex-end;
    text-align: right;
}

.modern-post-nav-label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.85;
    margin-bottom: 10px;
}

.modern-post-nav-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
}

.modern-post-nav-empty {
    visibility: hidden;
}

/* Latest posts (sidebar) */
.modern-latest-posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modern-latest-post {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.modern-latest-post-thumb {
    width: 80px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    flex: 0 0 auto;
    background: #eef2f7;
}

.modern-latest-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modern-thumb-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
}

.modern-latest-post-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
    margin-bottom: 6px;
}

.modern-latest-post-date {
    font-size: 12px;
    color: #9ca3af;
}

.modern-latest-post:hover .modern-latest-post-title {
    color: #3b59ff;
}

/* Social icons */
.modern-social-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.modern-social-link {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #ffffff;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.modern-social-link:hover {
    transform: translateY(-1px);
    filter: brightness(0.95);
}

.modern-social-facebook {
    background: #1877f2;
}

.modern-social-twitter {
    background: #111827;
}

.modern-social-instagram {
    background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af);
}

.modern-social-linkedin {
    background: #0a66c2;
}

.modern-social-icon {
    width: 18px;
    height: 18px;
    display: block;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.modern-social-facebook .modern-social-icon {
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M13.5 22v-8h2.7l.4-3.2H13.5V9.1c0-.9.3-1.5 1.6-1.5h1.7V4.8a23 23 0 0 0-2.5-.1c-2.5 0-4.2 1.5-4.2 4.3V11H8v3.2h2.1V22h3.4Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.modern-social-twitter .modern-social-icon {
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M18.2 3H21l-6.6 7.5L22 21h-5.9l-4.6-6-5.3 6H3.2l7.1-8.1L2 3h6l4.2 5.6L18.2 3Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.modern-social-instagram .modern-social-icon {
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M7 3h10a4 4 0 0 1 4 4v10a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V7a4 4 0 0 1 4-4Zm0 2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H7Zm5 3.5A4.5 4.5 0 1 1 7.5 13 4.5 4.5 0 0 1 12 8.5Zm0 2A2.5 2.5 0 1 0 14.5 13 2.5 2.5 0 0 0 12 10.5Zm5.25-3.75a1 1 0 1 1-1 1 1 1 0 0 1 1-1Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.modern-social-linkedin .modern-social-icon {
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M6.5 8.5h-4V21h4V8.5ZM4.5 3a2.25 2.25 0 1 0 2.25 2.25A2.25 2.25 0 0 0 4.5 3ZM21 13.2c0-3.2-1.7-4.7-4-4.7a3.8 3.8 0 0 0-3.4 1.9V8.5h-4V21h4v-6.8c0-1.4.7-2.3 2-2.3s1.8.8 1.8 2.4V21h4v-7.8Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.screen-reader-text {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Related carousel */
.modern-related-carousel-section {
    background: #ffffff;
    border-top: 1px solid #eef2f7;
    padding: 28px 0 70px;
}

.modern-related-carousel-inner {
    display: block;
    padding-top: 10px;
    padding-bottom: 10px;
}

.modern-related-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modern-related-carousel-title {
    position: relative;
    font-size: 28px;
    font-weight: 900;
    color: #111827;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
}

.modern-related-carousel-accent {
    position: relative;
    display: inline-block;
    z-index: 1;
}

.modern-related-carousel-accent::before {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    left: -18px;
    top: -40px;
    border-radius: 999px;
    background: rgba(255, 64, 129, 0.18);
    z-index: -1;
    pointer-events: none;
}

.modern-related-carousel-controls {
    display: inline-flex;
    gap: 10px;
}

.modern-related-arrow {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.modern-related-arrow:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
}

.modern-related-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.modern-related-track {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}

.modern-related-track::-webkit-scrollbar {
    height: 8px;
}

.modern-related-track::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 999px;
}

.modern-related-card {
    flex: 0 0 min(280px, 78vw);
    scroll-snap-align: start;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #eef2f7;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.modern-related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(17, 24, 39, 0.08);
}

.modern-related-card-image {
    height: 170px;
    background: #eef2f7;
}

.modern-related-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modern-related-card-body {
    padding: 14px 14px 16px;
}

.modern-related-card-tag {
    display: inline-flex;
    align-self: flex-start;
    background: #ff4081;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.modern-related-card-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    color: #111827;
    margin-bottom: 10px;
}

.modern-related-card-date {
    font-size: 13px;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.modern-related-card-date::before {
    content: "";
    width: 14px;
    height: 14px;
    display: inline-block;
    background: #9ca3af;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8Zm1-13h-2v6l5 3 1-1.6-4-2.4V7Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* The Events Calendar — single event detail */
.modern-event-details {
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 28px;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04);
}

.modern-event-detail-row {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 16px 20px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 15px;
    line-height: 1.55;
    color: #4b5563;
}

.modern-event-detail-row:first-child {
    padding-top: 0;
}

.modern-event-detail-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.modern-event-detail-row--cta {
    grid-template-columns: 1fr;
    padding-top: 16px;
}

.modern-event-detail-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9ca3af;
}

.modern-event-detail-value {
    color: #111827;
    font-weight: 600;
}

.modern-event-detail-sub {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
}

.modern-event-website-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 10px;
    background: #b4f481;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.modern-event-website-btn:hover {
    filter: brightness(0.97);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .modern-event-detail-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* Mobile responsive */
@media (max-width: 1024px) {
    .modern-post-wrapper {
        grid-template-columns: 1fr;
        padding: 40px 24px;
        gap: 40px;
    }
    
    .modern-post-sidebar {
        position: relative;
        top: 0;
    }
}

@media (max-width: 640px) {
    .modern-post-wrapper {
        padding: 32px 20px;
    }
    
    .modern-post-title {
        font-size: 32px;
    }
    
    .modern-post-content {
        font-size: 15px;
    }
    
    .modern-post-content h2 {
        font-size: 24px;
        margin-top: 32px;
    }
    
    .modern-post-content h3 {
        font-size: 20px;
    }
    
    .modern-post-content blockquote {
        font-size: 15px;
    }

    .modern-post-nav {
        grid-template-columns: 1fr;
    }

    .modern-related-carousel-accent::before {
        width: 90px;
        height: 90px;
        top: -34px;
    }
}
