/*
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
*/

/* —— The Carbon Buddy brand (logo: #000000 + #b68d40) —— */
:root {
    --cb-brand-black: #000000;
    --cb-brand-gold: #b68d40;
    --cb-brand-gold-bright: #d4b87a;
    --cb-brand-gold-dark: #9a7635;
    --cb-brand-gold-soft: rgba(182, 141, 64, 0.15);
}

/* 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;
}

/* Pull post layout up under fixed masthead + body padding (≤768px only; masthead is fixed there). */
@media (max-width: 768px) {
    body.has-carbon-masthead.single article.modern-post-article {
        margin-top: -170px;
    }
}

/*
 * Single detail on wide viewports: masthead is sticky in-flow — no body padding-top from us.
 * Astra can still add top padding/margin for transparent header; strip it so layout matches intent.
 */
@media (min-width: 769px) {
    body.has-carbon-masthead.single {
        padding-top: 0 !important;
    }

    body.has-carbon-masthead.single #page,
    body.has-carbon-masthead.single #content,
    body.has-carbon-masthead.single .site-content,
    body.has-carbon-masthead.single .site-main,
    body.has-carbon-masthead.single #primary {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    body.has-carbon-masthead.single article.modern-post-article {
        margin-top: 0 !important;
    }
}

/* 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: var(--cb-brand-gold, #b68d40);
    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: var(--cb-brand-gold);
    color: var(--cb-brand-black);
    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;
    }
}

/* —— Magazine CPT archive (Articles / Events / Industry updates) —— */

.magazine-archive {
    --magazine-accent: var(--cb-brand-gold, #b68d40);
    --magazine-ink: var(--cb-brand-black, #000000);
    --magazine-muted: #64748b;
    --magazine-line: #e2e8f0;
    --magazine-surface: #f8fafc;
}

body.magazine-cpt-archive {
    background: #f8fafc;
}

body.magazine-cpt-archive .site-content {
    padding-top: 0 !important;
    /*
     * Do not use overflow-x: hidden here: with overflow-y visible, browsers treat overflow-y as
     * auto, which clips vertically — upward negative margin on the full-bleed hero is cut off and
     * a white band (body padding) stays visible. `clip` contains horizontal bleed without that.
     */
    overflow-x: clip;
    overflow-y: visible;
}

/* Let the archive use the full content width (Astra often uses % / flex on #primary). */
body.magazine-cpt-archive #primary,
body.magazine-cpt-archive #primary.content-area {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex: 1 1 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.magazine-cpt-archive .site-content #primary {
    margin-top: 0;
    margin-bottom: 0;
}

body.magazine-cpt-archive .ast-separate-container #primary,
body.magazine-cpt-archive .ast-plain-container #primary,
body.magazine-cpt-archive .ast-page-builder-template #primary {
    padding: 0 !important;
}

/* Astra often uses a 2-column CSS grid on .ast-container (primary + sidebar). Force one column on archives. */
body.magazine-cpt-archive .site-content > .ast-container {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
}

/* Pull archive hero under body masthead offset; same breakpoint as fixed masthead (≤768px). */
@media (max-width: 768px) {
    body.has-carbon-masthead.magazine-cpt-archive .magazine-archive-hero {
        margin-top: -80px;
    }

    /* Extra top padding so the white panel sits lower and more of the hero image shows above the card. */
    body.has-carbon-masthead.magazine-cpt-archive .magazine-archive-hero-inner {
        padding-top: clamp(88px, 22vw, 140px);
        justify-content: flex-start;
    }
}

body.magazine-cpt-archive #secondary {
    display: none !important;
}

body.magazine-cpt-archive #primary .ast-row,
body.magazine-cpt-archive #primary .ast-flex {
    display: block !important;
    width: 100% !important;
}

body.magazine-cpt-archive #primary .ast-row > *,
body.magazine-cpt-archive #primary .ast-flex > * {
    width: 100% !important;
    max-width: 100% !important;
}

/* One centered column for our markup — do not nest a second .ast-container inside Astra’s. */
.magazine-archive-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(16px, 4vw, 32px);
    padding-right: clamp(16px, 4vw, 32px);
}

.magazine-archive {
    color: var(--magazine-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: transparent;
    width: 100%;
}

.magazine-archive-accent-line {
    display: block;
    width: 36px;
    height: 3px;
    background: var(--magazine-accent);
    margin-bottom: 14px;
    border-radius: 2px;
}

.magazine-archive-meta-sep {
    margin: 0 8px;
    color: #cbd5e1;
}

.magazine-archive-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--magazine-muted);
    margin: 0 0 10px;
}

.magazine-archive-list-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 36px;
    color: var(--magazine-ink);
}

/* Hero — full-bleed band so the image spans the viewport */
.magazine-archive-hero {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: stretch;
    margin-bottom: 48px;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.magazine-archive-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #0a0a0a;
}

.magazine-archive-hero-bg--placeholder {
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
}

.magazine-archive-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-top: 56px;
    padding-bottom: 56px;
    width: 100%;
}

.magazine-archive-hero-panel {
    max-width: 520px;
    background: #fff;
    padding: 36px 40px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.magazine-archive-hero-meta {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--magazine-muted);
    margin-bottom: 8px;
}

.magazine-archive-hero-title {
    font-size: clamp(26px, 3.2vw, 34px);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 16px;
}

.magazine-archive-hero-title a {
    color: var(--magazine-ink);
    text-decoration: none;
    transition: color 0.15s ease;
}

.magazine-archive-hero-title a:hover {
    color: var(--magazine-accent);
}

.magazine-archive-hero-excerpt {
    font-size: 15px;
    line-height: 1.65;
    color: #475569;
    margin: 0 0 20px;
}

.magazine-archive-hero-read,
.magazine-archive-card-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--magazine-accent);
    text-decoration: none;
    transition: gap 0.15s ease, color 0.15s ease;
}

.magazine-archive-hero-read:hover,
.magazine-archive-card-more:hover {
    gap: 12px;
    color: var(--cb-brand-gold-dark, #9a7635);
}

.magazine-archive-arrow {
    font-size: 14px;
    line-height: 1;
}

/* List + grid — inner wrapper prevents themes that grid “section > *” into columns */
.magazine-archive-list-wrap {
    padding-bottom: 72px;
}

.magazine-archive-list-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.magazine-archive-list-head {
    width: 100%;
    max-width: 100%;
    margin: 0 0 40px;
}

.magazine-archive-list-head .magazine-archive-kicker {
    text-align: center;
    margin-bottom: 12px;
}

.magazine-archive-list-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 20px;
}

.magazine-archive-list-head-row .magazine-archive-list-title {
    margin: 0;
    text-align: center;
    line-height: 1.15;
}

.magazine-archive-top-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.magazine-archive-filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--magazine-line, #e2e8f0);
    background: #fff;
    color: var(--magazine-ink, #000000);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.magazine-archive-filter-chip:hover {
    border-color: var(--magazine-accent, #b68d40);
    color: var(--magazine-accent, #b68d40);
}

.magazine-archive-filter-chip.is-active {
    border-color: var(--magazine-accent, #b68d40);
    color: #fff;
    background: var(--magazine-accent, #b68d40);
    box-shadow: 0 6px 20px rgba(182, 141, 64, 0.35);
}

.magazine-archive-filter-chip--all.is-active:hover {
    color: #fff;
    filter: brightness(0.95);
}

.magazine-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 28px;
    width: 100%;
    min-width: 0;
    clear: both;
}

/* Astra / block defaults on articles */
.magazine-archive-grid .magazine-archive-card {
    display: flex;
    flex-direction: column;
    background: transparent;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    float: none !important;
    box-sizing: border-box;
}

.magazine-archive-card-image {
    display: block;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    aspect-ratio: 4 / 3;
    background: #e2e8f0;
}

.magazine-archive-card-img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.magazine-archive-card:hover .magazine-archive-card-img {
    transform: scale(1.04);
}

.magazine-archive-card-img--placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
}

.magazine-archive-card-body {
    position: relative;
    margin: -28px 16px 0;
    padding: 24px 8px 8px;
    background: #fff;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}

.magazine-archive-card-meta {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--magazine-muted);
    margin-bottom: 10px;
}

.magazine-archive-card-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
    margin: 0 0 12px;
}

.magazine-archive-card-title a {
    color: var(--magazine-ink);
    text-decoration: none;
    transition: color 0.15s ease;
}

.magazine-archive-card:hover .magazine-archive-card-title a {
    color: var(--magazine-accent);
}

.magazine-archive-card-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #64748b;
    margin: 0 0 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pagination → “More posts” pill (wrapper is a div; core outputs inner .navigation.pagination) */
.magazine-archive-pagination {
    margin-top: 48px;
    width: 100%;
    clear: both;
    display: block;
}

.magazine-archive-pagination .navigation.pagination {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    float: none;
}

.magazine-archive-pagination .nav-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 0;
    float: none;
}

.magazine-archive-pagination .nav-links::before,
.magazine-archive-pagination .nav-links::after {
    display: none;
}

.magazine-archive-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--magazine-line);
    color: var(--magazine-muted);
    background: #fff;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.magazine-archive-pagination a.page-numbers:hover {
    border-color: #cbd5e1;
    color: var(--magazine-ink);
}

.magazine-archive-pagination .page-numbers.current {
    background: var(--magazine-ink);
    color: #fff;
    border-color: var(--magazine-ink);
}

.magazine-archive-pagination a.next.page-numbers,
.magazine-archive-pagination a.prev.page-numbers {
    background: var(--magazine-accent);
    color: #fff !important;
    border-color: var(--magazine-accent);
    padding: 0 32px;
}

.magazine-archive-pagination a.next.page-numbers:hover,
.magazine-archive-pagination a.prev.page-numbers:hover {
    background: var(--cb-brand-gold-dark, #9a7635);
    border-color: var(--cb-brand-gold-dark, #9a7635);
    color: #fff !important;
}

/* Staff picks */
.magazine-archive-staff {
    padding-bottom: 80px;
}

.magazine-archive-staff-head {
    text-align: center;
    margin-bottom: 40px;
}

.magazine-archive-staff-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 36px;
    align-items: start;
}

.magazine-archive-staff-lead {
    background: #fff;
    box-shadow: 0 16px 50px rgba(15, 23, 42, 0.08);
}

.magazine-archive-staff-lead-image {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e2e8f0;
}

.magazine-archive-staff-lead-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.magazine-archive-staff-lead:hover .magazine-archive-staff-lead-img {
    transform: scale(1.03);
}

.magazine-archive-staff-lead-body {
    padding: 28px 32px 32px;
}

.magazine-archive-staff-lead-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 12px;
}

.magazine-archive-staff-lead-title a {
    color: var(--magazine-ink);
    text-decoration: none;
}

.magazine-archive-staff-lead-title a:hover {
    color: var(--magazine-accent);
}

.magazine-archive-staff-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.magazine-archive-staff-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 18px;
    align-items: center;
    background: #fff;
    padding: 14px 16px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
    margin: 0;
    border: 0;
}

.magazine-archive-staff-row-image {
    display: block;
    width: 120px;
    height: 80px;
    overflow: hidden;
    background: #e2e8f0;
}

.magazine-archive-staff-row-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.magazine-archive-staff-row-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    margin: 6px 0 0;
}

.magazine-archive-staff-row-title a {
    color: var(--magazine-ink);
    text-decoration: none;
}

.magazine-archive-staff-row-title a:hover {
    color: var(--magazine-accent);
}

.magazine-archive-empty {
    padding: 80px 24px;
    text-align: center;
    color: var(--magazine-muted);
}

@media (max-width: 1024px) {
    .magazine-archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .magazine-archive-staff-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .magazine-archive-hero-inner {
        padding-top: 32px;
        padding-bottom: 32px;
        justify-content: center;
    }

    .magazine-archive-hero-panel {
        padding: 28px 24px;
        max-width: 100%;
    }

    .magazine-archive-grid {
        grid-template-columns: 1fr;
    }

    .magazine-archive-card-body {
        margin-left: 12px;
        margin-right: 12px;
    }

    .magazine-archive-staff-row {
        grid-template-columns: 96px 1fr;
    }

    .magazine-archive-staff-row-image {
        width: 96px;
        height: 72px;
    }
}

/* —— Carbon sticky masthead (replaces default Astra header) —— */

.astra-modern-masthead {
    position: sticky;
    top: 0;
    z-index: 10000;
    background: #f4f7f6;
    border-bottom: 1px solid #e3e8e6;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

body.admin-bar .astra-modern-masthead {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .astra-modern-masthead {
        top: 46px;
    }
}

.astra-modern-masthead-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
        "logo nav social"
        "logo nav social";
    align-items: center;
    gap: 16px 24px;
    min-height: 72px;
    padding-top: 12px;
    padding-bottom: 12px;
    max-width: 1200px;
}

.astra-modern-masthead-logo-link {
    grid-area: logo;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.astra-modern-masthead-title-link {
    display: none;
    text-decoration: none;
    color: var(--cb-brand-black, #000000);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
}

.astra-modern-masthead-logo {
    width: auto;
    max-width: min(200px, 42vw);
    height: 52px;
    border-radius: 0;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.astra-modern-masthead-nav {
    grid-area: nav;
    min-width: 0;
}

.astra-modern-masthead-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.astra-modern-masthead-menu > li {
    position: relative;
    margin: 0;
    padding: 0;
}

/* Top-level: uppercase bar nav (brand gold + black) */
.astra-modern-masthead-menu > li > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--cb-brand-black, #000000);
    text-decoration: none;
    padding: 0.55rem 1.05rem;
    border-radius: 6px;
    line-height: 1.2;
    transition: background 0.2s ease, color 0.2s ease;
}

.astra-modern-masthead-menu > li.current-menu-item > a,
.astra-modern-masthead-menu > li.current-menu-ancestor > a,
.astra-modern-masthead-menu > li.current_page_item > a,
.astra-modern-masthead-menu > li.current-menu-parent > a {
    background: var(--cb-brand-black, #000000);
    color: var(--cb-brand-gold, #b68d40) !important;
}

.astra-modern-masthead-menu > li.current-menu-item > a:hover,
.astra-modern-masthead-menu > li.current-menu-item > a:focus,
.astra-modern-masthead-menu > li.current-menu-ancestor > a:hover,
.astra-modern-masthead-menu > li.current-menu-ancestor > a:focus,
.astra-modern-masthead-menu > li.current_page_item > a:hover,
.astra-modern-masthead-menu > li.current_page_item > a:focus,
.astra-modern-masthead-menu > li.current-menu-parent > a:hover,
.astra-modern-masthead-menu > li.current-menu-parent > a:focus {
    background: var(--cb-brand-black, #000000);
    color: var(--cb-brand-gold-bright, #d4b87a) !important;
}

.astra-modern-masthead-menu > li:not(.current-menu-item):not(.current_page_item):not(.current-menu-ancestor):not(.current-menu-parent) > a:hover,
.astra-modern-masthead-menu > li:not(.current-menu-item):not(.current_page_item):not(.current-menu-ancestor):not(.current-menu-parent) > a:focus-visible {
    color: var(--cb-brand-gold, #b68d40);
}

.astra-modern-masthead-menu > li:not(.current-menu-item):not(.current_page_item):not(.current-menu-ancestor):not(.current-menu-parent) > a:focus-visible {
    outline: 2px solid var(--cb-brand-gold, #b68d40);
    outline-offset: 2px;
}

/* Any link (fallback + submenu base) */
.astra-modern-masthead-menu a {
    text-decoration: none;
}

.astra-modern-masthead-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    margin: 8px 0 0;
    padding: 10px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
    z-index: 10001;
}

.astra-modern-masthead-menu li:hover > .sub-menu,
.astra-modern-masthead-menu li:focus-within > .sub-menu {
    display: block;
}

.astra-modern-masthead-menu .sub-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    color: #475569;
    border-radius: 0;
    background: transparent;
}

.astra-modern-masthead-menu .sub-menu a:hover,
.astra-modern-masthead-menu .sub-menu a:focus {
    color: var(--cb-brand-black, #000000);
    background: #f1f5f9;
}

.astra-modern-masthead-menu .sub-menu .current-menu-item > a,
.astra-modern-masthead-menu .sub-menu .current_page_item > a {
    color: var(--cb-brand-gold, #b68d40);
    font-weight: 600;
    background: var(--cb-brand-black, #000000);
}

.astra-modern-masthead-menu .sub-menu .current-menu-item > a:hover,
.astra-modern-masthead-menu .sub-menu .current-menu-item > a:focus,
.astra-modern-masthead-menu .sub-menu .current_page_item > a:hover,
.astra-modern-masthead-menu .sub-menu .current_page_item > a:focus {
    color: var(--cb-brand-gold-bright, #d4b87a);
    background: var(--cb-brand-black, #000000);
}

.astra-modern-masthead-placeholder {
    margin: 0;
    font-size: 13px;
}

.astra-modern-masthead-placeholder a {
    color: #64748b;
}

.astra-modern-masthead-divider {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: #d1d9d6;
    flex-shrink: 0;
}

/* No menu assigned: social stays a direct child of the inner grid. */
.astra-modern-masthead-inner > .astra-modern-masthead-social {
    grid-area: social;
    justify-self: end;
    padding-right: 6px;
}

.astra-modern-masthead-end {
    grid-area: social;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    justify-self: end;
    padding-right: 6px;
}

.astra-modern-masthead-social {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

/* Hamburger: black lines only, no fill; visible only ≤640px (center column). */
.astra-modern-masthead-menu-toggle {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--cb-brand-black, #000000);
    cursor: pointer;
    box-shadow: none;
    transition: opacity 0.2s ease;
}

.astra-modern-masthead-menu-toggle:hover,
.astra-modern-masthead-menu-toggle:active,
.astra-modern-masthead-menu-toggle:focus-visible,
.astra-modern-masthead.is-menu-open .astra-modern-masthead-menu-toggle {
    background: transparent;
    border: none;
    color: var(--cb-brand-black, #000000);
    box-shadow: none;
}

.astra-modern-masthead-menu-toggle:focus-visible {
    outline: 2px solid var(--cb-brand-black, #000000);
    outline-offset: 3px;
}

.astra-modern-masthead-menu-toggle-box {
    position: relative;
    display: block;
    width: 20px;
    height: 14px;
}

.astra-modern-masthead-menu-toggle-bar {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 1px;
    background: var(--cb-brand-black, #000000);
    transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}

.astra-modern-masthead-menu-toggle-bar:nth-child(1) {
    top: 0;
}

.astra-modern-masthead-menu-toggle-bar:nth-child(2) {
    top: 6px;
}

.astra-modern-masthead-menu-toggle-bar:nth-child(3) {
    top: 12px;
}

.astra-modern-masthead.is-menu-open .astra-modern-masthead-menu-toggle-bar:nth-child(1) {
    top: 6px;
    transform: rotate(45deg);
}

.astra-modern-masthead.is-menu-open .astra-modern-masthead-menu-toggle-bar:nth-child(2) {
    opacity: 0;
}

.astra-modern-masthead.is-menu-open .astra-modern-masthead-menu-toggle-bar:nth-child(3) {
    top: 6px;
    transform: rotate(-45deg);
}

.astra-modern-masthead-social-link {
    display: inline-flex;
    width: 22px;
    height: 22px;
    color: #475569;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, transform 0.15s ease;
}

.astra-modern-masthead-social-link:hover {
    color: var(--cb-brand-gold, #b68d40);
    transform: translateY(-1px);
}

.astra-modern-masthead-social-icon {
    display: block;
    width: 100%;
    height: 100%;
    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='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;
}

.astra-modern-masthead-social-instagram .astra-modern-masthead-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;
}

@media (max-width: 640px) {
    /*
     * Row 1: logo | centered hamburger | social. Row 2: menu panel (gold on black when open).
     */
    .astra-modern-masthead-inner {
        grid-template-columns: 1fr auto 1fr;
        grid-template-rows: auto auto;
        grid-template-areas:
            "logo burger social"
            "nav nav nav";
        align-items: center;
        column-gap: 10px;
        row-gap: 0;
        position: relative;
    }

    .astra-modern-masthead-menu-toggle {
        display: inline-flex;
        grid-area: burger;
        justify-self: center;
        align-self: center;
    }

    .astra-modern-masthead-end {
        grid-area: social;
        justify-self: end;
        align-self: center;
        padding-right: 0;
        gap: 8px;
    }

    /* Site name is redundant next to the logo on small screens — keep it out of the visual layout. */
    .astra-modern-masthead-title-link {
        display: none;
    }

    .astra-modern-masthead-logo-link {
        justify-self: start;
        align-self: center;
        min-width: 0;
        max-width: 100%;
    }

    .astra-modern-masthead-logo {
        max-width: 100%;
    }

    .astra-modern-masthead-nav {
        grid-area: nav;
        width: 100%;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        z-index: 10002;
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.38s ease, opacity 0.28s ease, visibility 0.28s ease;
        background: var(--cb-brand-black, #000000);
        border-bottom: 1px solid var(--cb-brand-gold, #b68d40);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    }

    .astra-modern-masthead.is-menu-open .astra-modern-masthead-nav {
        max-height: min(78vh, 560px);
        overflow-y: auto;
        opacity: 1;
        visibility: visible;
        -webkit-overflow-scrolling: touch;
        padding: 14px clamp(16px, 4vw, 28px) 20px;
    }

    .astra-modern-masthead-menu .sub-menu {
        position: static;
        display: none;
        margin: 6px 0 0;
        padding: 0.35rem 0 0.35rem 0.5rem;
        border: 0;
        border-radius: 0;
        border-left: 2px solid rgba(182, 141, 64, 0.45);
        box-shadow: none;
        background: rgba(182, 141, 64, 0.08);
    }

    .astra-modern-masthead-menu li:focus-within > .sub-menu,
    .astra-modern-masthead-menu li:hover > .sub-menu {
        display: block;
    }

    .astra-modern-masthead-menu .sub-menu a {
        color: var(--cb-brand-gold-bright, #d4b87a);
    }

    .astra-modern-masthead-menu .sub-menu a:hover,
    .astra-modern-masthead-menu .sub-menu a:focus {
        color: var(--cb-brand-gold-bright, #d4b87a);
        background: rgba(182, 141, 64, 0.12);
    }

    .astra-modern-masthead-menu .sub-menu .current-menu-item > a,
    .astra-modern-masthead-menu .sub-menu .current_page_item > a {
        color: var(--cb-brand-gold, #b68d40);
        background: var(--cb-brand-black, #000000);
    }

    /*
     * 2×2 grid: keeps four top-level items on two rows (flex-wrap was yielding 3+ rows after larger mobile root font).
     */
    .astra-modern-masthead-menu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 10px;
        justify-content: initial;
        align-items: stretch;
    }

    .astra-modern-masthead-menu > li > a {
        width: 100%;
        justify-content: center;
        text-align: center;
        padding: 0.5rem 0.6rem;
        font-size: 0.72rem;
        letter-spacing: 0.05em;
        box-sizing: border-box;
        color: var(--cb-brand-gold, #b68d40) !important;
        background: transparent !important;
        border: 1px solid transparent;
    }

    .astra-modern-masthead-menu > li:not(.current-menu-item):not(.current_page_item):not(.current-menu-ancestor):not(.current-menu-parent) > a:hover,
    .astra-modern-masthead-menu > li:not(.current-menu-item):not(.current_page_item):not(.current-menu-ancestor):not(.current-menu-parent) > a:focus-visible {
        color: var(--cb-brand-gold-bright, #d4b87a) !important;
        background: rgba(182, 141, 64, 0.12) !important;
        border-color: rgba(182, 141, 64, 0.35);
    }

    .astra-modern-masthead-menu > li.current-menu-item > a,
    .astra-modern-masthead-menu > li.current-menu-ancestor > a,
    .astra-modern-masthead-menu > li.current_page_item > a,
    .astra-modern-masthead-menu > li.current-menu-parent > a {
        background: var(--cb-brand-black, #000000) !important;
        color: var(--cb-brand-gold, #b68d40) !important;
        border-color: var(--cb-brand-gold, #b68d40);
    }

    .astra-modern-masthead-menu > li.current-menu-item > a:hover,
    .astra-modern-masthead-menu > li.current-menu-item > a:focus,
    .astra-modern-masthead-menu > li.current-menu-ancestor > a:hover,
    .astra-modern-masthead-menu > li.current-menu-ancestor > a:focus,
    .astra-modern-masthead-menu > li.current_page_item > a:hover,
    .astra-modern-masthead-menu > li.current_page_item > a:focus,
    .astra-modern-masthead-menu > li.current-menu-parent > a:hover,
    .astra-modern-masthead-menu > li.current-menu-parent > a:focus {
        background: var(--cb-brand-black, #000000) !important;
        color: var(--cb-brand-gold-bright, #d4b87a) !important;
    }

    .astra-modern-masthead-menu > li:not(.current-menu-item):not(.current_page_item):not(.current-menu-ancestor):not(.current-menu-parent) > a:focus-visible {
        outline: 2px solid var(--cb-brand-gold, #b68d40);
        outline-offset: 2px;
    }

    /* Match the 2×2 column edges to row 1: left col flush left, right col flush right (with icons). */
    .astra-modern-masthead-menu > li:nth-child(odd) > a {
        justify-content: flex-start;
        text-align: left;
    }

    .astra-modern-masthead-menu > li:nth-child(even) > a {
        justify-content: flex-end;
        text-align: right;
    }

    .astra-modern-masthead-divider {
        display: none;
    }
}

/*
 * Mobile sticky reliability:
 * Some mobile browsers + theme wrappers (overflow/transform) can break `position: sticky`.
 * Switch to fixed positioning on smaller screens and reserve space so content doesn't slide under.
 *
 * Spacer must match the real masthead height (not oversized): extra padding-top on body shows as
 * a blank strip between the fixed bar and the page. --carbon-masthead-bar ≈ inner padding + row
 * (logo vs. 46px toggle) + 1px masthead border.
 *
 * With `admin-bar`, WordPress already shifts the layout via `html { margin-top: … }` (~46px on
 * small screens). Do not add that height again on `body` — only reserve the masthead bar height.
 */
@media (max-width: 768px) {
    body.has-carbon-masthead {
        /* Tablet / small desktop: inline nav may wrap — keep a bit more room than the one-row bar. */
        --carbon-masthead-bar: 100px;
        padding-top: var(--carbon-masthead-bar);
    }

    body.has-carbon-masthead .astra-modern-masthead {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
    }

    /* Astra sometimes adds top margin on the content wrapper; avoid doubling with body offset. */
    body.has-carbon-masthead #content,
    body.has-carbon-masthead .site-content,
    body.has-carbon-masthead .ast-separate-container .site-content {
        margin-top: 0 !important;
    }
}

@media (max-width: 640px) {
    /* One visible bar; menu opens as overlay (no longer stacked in document flow). */
    body.has-carbon-masthead {
        --carbon-masthead-bar: 84px;
    }
}

/* —— Carbon footer —— */

/*
 * Flush main content with the custom footer: strip Astra’s bottom padding/margins and avoid
 * margin-top:auto on the footer (flex layouts use it to pin the footer to the viewport bottom,
 * which reads as a large empty band above the footer on short pages and stacks with theme spacing).
 */
body.has-carbon-footer #page,
body.has-carbon-footer #content,
body.has-carbon-footer .site-content,
body.has-carbon-footer #primary,
body.has-carbon-footer .site-main {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

body.has-carbon-footer .ast-container,
body.has-carbon-footer .ast-separate-container,
body.has-carbon-footer .ast-plain-container {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

body.has-carbon-footer #colophon,
body.has-carbon-footer .site-footer {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.astra-modern-footer {
    background: #f7f7f7;
    color: #334155;
    margin-top: 0;
}

.astra-modern-footer-top {
    border-top: 1px solid #e8e8e8;
    padding: clamp(40px, 6vw, 72px) 0 clamp(36px, 5vw, 56px);
}

.astra-modern-footer-top-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 64px);
    align-items: start;
}

.astra-modern-footer-heading {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--cb-brand-black, #000000);
    margin: 0 0 20px;
    line-height: 1.2;
}

.astra-modern-footer-bio {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: #475569;
    max-width: 62ch;
}

.astra-modern-footer-bio p {
    margin: 0 0 1em;
}

.astra-modern-footer-bio p:last-child {
    margin-bottom: 0;
}

.astra-modern-footer-contact {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.astra-modern-footer-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    transition: color 0.15s ease;
}

.astra-modern-footer-contact-link:hover {
    color: var(--cb-brand-gold, #b68d40);
}

.astra-modern-footer-icon {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    background: currentColor;
    color: #475569;
}

.astra-modern-footer-icon--mail {
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Zm-.4 2.5L12 13 4.4 6.5 4 6.17V6h16v.17l-.4.33ZM4 18V8.25l7.3 5.84a1 1 0 0 0 1.4 0L20 8.25V18H4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.astra-modern-footer-icon--linkedin {
    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;
}

.astra-modern-footer-icon--instagram {
    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;
}

.astra-modern-footer-bar {
    border-top: 1px solid #e0e4e2;
    padding: 16px 0 20px;
    background: #f2f4f3;
}

.astra-modern-footer-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.astra-modern-footer-bar-logo {
    width: auto;
    max-width: 120px;
    height: 32px;
    border-radius: 0;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.astra-modern-footer-copy {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    color: #94a3b8;
}

@media (max-width: 900px) {
    .astra-modern-footer-top-inner {
        grid-template-columns: 1fr;
    }

    .astra-modern-footer-bio {
        max-width: none;
    }
}

/* —— Site preloader (brand black + gold) —— */

.cb-site-preloader {
    --cb-pl-base: #0a0a0a;
    --cb-pl-mid: #1a1a1a;
    --cb-pl-gold: var(--cb-brand-gold, #b68d40);
    --cb-pl-gold-bright: var(--cb-brand-gold-bright, #d4b87a);
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-sizing: border-box;
    background: linear-gradient(165deg, var(--cb-pl-mid) 0%, var(--cb-pl-base) 52%, #000000 100%);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.cb-site-preloader.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.cb-site-preloader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    text-align: center;
}

.cb-site-preloader-mark {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--cb-pl-base);
    background: linear-gradient(145deg, var(--cb-pl-gold-bright) 0%, var(--cb-pl-gold) 45%, var(--cb-brand-gold-dark, #9a7635) 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(182, 141, 64, 0.45);
}

.cb-site-preloader-wordmark {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--cb-pl-gold-bright);
}

.cb-site-preloader-track {
    width: min(220px, 55vw);
    height: 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.cb-site-preloader-bar {
    display: block;
    height: 100%;
    width: 40%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cb-pl-gold), var(--cb-pl-gold-bright));
    animation: cb-preloader-slide 1.1s ease-in-out infinite;
}

@keyframes cb-preloader-slide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(280%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cb-site-preloader-bar {
        animation: none;
        width: 100%;
        opacity: 0.85;
    }

    .cb-site-preloader {
        transition: none;
    }
}

/* —— Mobile: site-wide readable text (single knob for rem-based UI) —— */
/*
 * Tune one value: --cb-mobile-root-font-size (default 112.5% ≈ 18px from a 16px root).
 * Applies below 768px. Elements sized in rem grow; fixed px in plugins/themes may not.
 */
@media (max-width: 768px) {
    :root {
        --cb-mobile-root-font-size: 112.5%;
    }

    html {
        font-size: var(--cb-mobile-root-font-size);
    }
}
