/* ============================================
   CTSFW News – Article Body & Image Blocks
   File: assets/css/ctsfw-news.css
   ============================================ */

/* Basic tokens (used only inside .prose) */
.prose {
    --ctsfw-navy: #001846;
    --ctsfw-maroon: #7b1824;
    --ctsfw-eggshell: #f6f4ee;
    --ctsfw-ink: #111827;
    --ctsfw-muted: #4b5563;
}

/* Ensure images inside prose scale nicely */
.prose img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   CTA Row + Button (for links tagged as buttons)
   ============================================ */

.prose .news-cta-row {
    margin: 1.75rem 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* Base ghost button style – assumes .btn.btn--ghost set by parser */
.prose .btn.btn--ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    padding: 0.5rem 1.5rem;
    border-width: 2px;
    border-style: solid;
    border-color: var(--ctsfw-navy);

    background-color: transparent;
    color: var(--ctsfw-navy);
    text-decoration: none;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;

    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

/* Hover / focus state */
.prose .btn.btn--ghost:hover,
.prose .btn.btn--ghost:focus-visible {
    background-color: var(--ctsfw-navy);
    color: #ffffff;
    border-color: var(--ctsfw-navy);
    text-decoration: none;
    outline: none;
}

/* Optional subtle focus ring */
.prose .btn.btn--ghost:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 24, 70, 0.25);
}

/* ============================================
   Image + Caption Block
   Structure created by the parser:

   <div class="news-image-block-wrapper">
     <div class="news-image">
       <img ...>
     </div>
     <div class="news-image-caption">
       <span class="caption-text">...</span>
     </div>
   </div>
   ============================================ */

/* Wrapper: stack on mobile, row on larger screens */
.prose .news-image-block-wrapper {
    margin: 0rem auto;
    display: flex;
    flex-direction: column;
    /* mobile default – stacked */
    gap: 1rem;
    align-items: flex-start;
}

/* Keep it from overflowing prose width */
.prose .news-image-block-wrapper,
.prose .news-image-block-wrapper * {
    box-sizing: border-box;
}

/* Image container */
.prose .news-image-block-wrapper .news-image {
    flex: 0 0 auto;
    max-width: 100%;
    margin: 0 auto;
}

.prose .news-image-block-wrapper .news-image img {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 5px;
}

/* Caption container */
.prose .news-image-block-wrapper .news-image-caption {
    flex: 1 1 auto;
    font-size: 0.875rem;
    /* ~14px */
    line-height: 1.5;
    color: var(--ctsfw-muted);
}

.prose .news-image-block-wrapper .news-image-caption .caption-text {
    display: block;
}

/* ============================================
   Responsive layout – tablet/desktop
   --------------------------------------------
   On >= 768px:
   - two-column flex row
   - image fixed to 30% width
   - caption takes remaining space
   ============================================ */

@media (min-width: 768px) {
    .prose .news-image-block-wrapper {
        flex-direction: row;
        align-items: flex-start;
    }

    .prose .news-image-block-wrapper .news-image {
        flex: 0 0 30%;
        max-width: 30%;
        margin: 0;
        /* no auto-centering on larger screens */
    }

    .prose .news-image-block-wrapper .news-image-caption {
        flex: 1 1 70%;
        padding-left: 1.75rem;
    }
}

/* ============================================
   Small refinements for spacing / typography
   ============================================ */

/* Give a bit more breathing room above/below headings inside the article body */
.prose h2:first-child,
.prose h3:first-child {
    margin-top: 0;
}

.prose h2,
.prose h3 {
    color: var(--ctsfw-navy);
}

/* Slightly tighten spacing above/below the image block when it sits
   right after a heading or before a CTA. */
.prose h2+.news-image-block-wrapper,
.prose h3+.news-image-block-wrapper {
    margin-top: 1.25rem;
}

.prose .news-image-block-wrapper+.news-cta-row {
    margin-top: 1.25rem;
}