/* ==========================================
   JOURNAL DETAIL PAGE - EXPERT DESIGN
   ========================================== */

/* Article Container */
.journal-detail {
    position: relative;
    background: #000000;
}

/* Featured Image Hero */
.journal-detail-hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
    margin-top: 80px;
}

.journal-detail-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.journal-detail-hero-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #171717 0%, #000000 100%);
}

.journal-detail-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #000000, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.4));
}

.journal-detail-hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
}

.journal-detail-hero-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
    width: 100%;
}

.journal-detail-hero-wrapper {
    max-width: 64rem;
}

/* Category Badge */
.journal-detail-category {
    display: inline-block;
    padding: 0.25rem 1rem;
    background: rgba(201, 162, 39, 0.2);
    border: 1px solid rgba(201, 162, 39, 0.4);
    color: #c9a227;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    border-radius: 2px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(4px);
}

/* Article Title */
.journal-detail-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-family: var(--font-display);
    color: #ffffff;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

/* Meta Info */
.journal-detail-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: #d1d5db;
}

.journal-detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.journal-detail-meta-icon {
    width: 1rem;
    height: 1rem;
    color: #c9a227;
}

/* Article Content Section */
.journal-detail-content-section {
    background: #000000;
    padding: 5rem 0;
}

.journal-detail-content-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.journal-detail-content-wrapper {
    max-width: 48rem;
    margin: 0 auto;
}

/* Article Body - Prose Styling */
.journal-detail-prose {
    color: #d1d5db;
    font-size: 1.125rem;
    line-height: 1.8;
    overflow-wrap: break-word;
    word-break: break-word;
}

.journal-detail-prose h2 {
    font-family: var(--font-display);
    color: #ffffff;
    font-weight: 500;
    font-size: 1.875rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #c9a227;
    padding-left: 1.5rem;
}

.journal-detail-prose h3 {
    font-family: var(--font-display);
    color: #ffffff;
    font-weight: 500;
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.journal-detail-prose p {
    color: #d1d5db;
    line-height: 1.75;
    margin-bottom: 1.5rem;
}

.journal-detail-prose a {
    color: #c9a227;
    text-decoration: none;
}

.journal-detail-prose a:hover {
    text-decoration: underline;
}

.journal-detail-prose strong {
    color: #ffffff;
    font-weight: 600;
}

.journal-detail-prose ul,
.journal-detail-prose ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.journal-detail-prose li {
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

.journal-detail-prose blockquote {
    border-left: 4px solid #c9a227;
    padding-left: 1.5rem;
    font-style: italic;
    color: #9ca3af;
    margin: 1.5rem 0;
}

.journal-detail-prose img,
.journal-detail-prose figure,
.journal-detail-prose video,
.journal-detail-prose iframe {
    max-width: 100% !important;
    height: auto !important;
}

.journal-detail-prose figure {
    margin: 2rem 0;
    overflow: hidden;
}

.journal-detail-prose img {
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    margin: 2rem 0;
    display: block;
}

.journal-detail-prose figure img {
    margin: 0;
}

/* Article Footer */
.journal-detail-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.journal-detail-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #c9a227;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.journal-detail-back-link:hover {
    color: #ffffff;
}

.journal-detail-back-icon {
    width: 1rem;
    height: 1rem;
}

/* Related Posts Section */
.journal-related {
    background: #0a0a0a;
    padding: 5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.journal-related-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.journal-related-title {
    font-size: 1.875rem;
    font-family: var(--font-display);
    color: #ffffff;
    margin-bottom: 3rem;
    text-align: center;
}

.journal-related-title-accent {
    color: #c9a227;
}

.journal-related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .journal-related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Related Post Card */
.journal-related-card {
    display: block;
    background: rgba(23, 23, 23, 0.5);
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
    transition: all 0.3s ease;
}

.journal-related-card:hover {
    border-color: rgba(201, 162, 39, 0.3);
    transform: translateY(-4px);
}

.journal-related-card-image-wrapper {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.journal-related-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.journal-related-card:hover .journal-related-card-image {
    transform: scale(1.05);
}

.journal-related-card-image-placeholder {
    width: 100%;
    height: 100%;
    background: #262626;
}

.journal-related-card-content {
    padding: 1.5rem;
}

.journal-related-card-date {
    font-size: 0.75rem;
    color: #c9a227;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.journal-related-card-title {
    font-size: 1.125rem;
    font-family: var(--font-display);
    color: #ffffff;
    margin-top: 0.75rem;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.journal-related-card:hover .journal-related-card-title {
    color: #c9a227;
}

/* ==========================================
   BUILDER IMAGE BLOCKS
   ========================================== */

/* Base block image styling */
.block-image {
    margin: 2.5rem 0;
    overflow: hidden;
}

.block-image img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    display: block;
}

.block-image figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 0.75rem;
    font-style: italic;
}

/* Alignment */
.block-align-center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.block-align-left {
    margin-right: auto;
    margin-left: 0;
    text-align: left;
}

.block-align-right {
    margin-left: auto;
    margin-right: 0;
    text-align: right;
}

/* Width classes applied to the figure container */
.block-img-w-full {
    width: 100%;
}

.block-img-w-3-4 {
    width: 75%;
}

.block-img-w-1-2 {
    width: 50%;
}

.block-img-w-1-3 {
    width: 33.333%;
}

.block-img-w-1-4 {
    width: 25%;
}

.block-image img {
    width: 100%; /* Make image fill its figure container */
    max-width: 100% !important;
    height: auto !important;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    display: block;
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */
@media (max-width: 768px) {
    .journal-detail-hero {
        height: 60vh;
        min-height: 400px;
    }

    .journal-detail-content-section {
        padding: 3rem 0;
    }

    .journal-related {
        padding: 3rem 0;
    }

    /* Force builder figures to full width on mobile */
    .builder-image-block {
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* ==========================================
   AGRESSIVE FALLBACK FOR PASTED IMAGES
   ========================================== */
.prose-text-content img,
.prose-text-content figure {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important; /* Strip any pasted width="3000" */
    display: block;
    margin-left: auto;
    margin-right: auto;
}