/* ============================================================
   BULLETIN LISTING PAGE — bulletin-* styles
   ============================================================ */

/* ── Top section: insight LEFT + flipbook RIGHT ────────────── */
.bulletin-top {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-10);
    align-items: stretch;
    min-height: 500px;
    background: #fff;
    padding-top: var(--space-7);
}

/* ── Left panel ────────────────────────────────────────────── */
.bulletin-top__left {
    display: flex;
    flex-direction: column;
    background: #EBEBEB;
    overflow: hidden;
    border-top: 4px solid var(--color-primary, #FFC200);
    border-bottom: 4px solid var(--color-primary, #FFC200);
}

.bulletin-top__photo {
    width: 100%;
    /* Absorbs any spare height when the flipbook column is taller than the
       (collapsed) Insight text, instead of leaving an empty grey band. */
    flex: 1 0 auto;
    min-height: 340px;
    position: relative;
}

.bulletin-top__photo img {
    width: 100%;
    height: 100%;
    min-height: 340px;
    position: absolute;
    inset: 0;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.bulletin-top__insight {
    padding: var(--space-5) var(--space-5) var(--space-6);
    flex: 1;
}

/* When there's a photo it takes the spare height; the text block stays its natural size */
.bulletin-top__photo + .bulletin-top__insight {
    flex: 0 0 auto;
}

.bulletin-top__insight-label {
    font-family: var(--font-heading, sans-serif);
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1a1a1a;
    margin: 0 0 var(--space-2);
}

.bulletin-top__insight-name {
    font-family: var(--font-body, sans-serif);
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.1rem;
}

.bulletin-top__insight-title {
    font-size: 0.78rem;
    color: #555;
    margin: 0 0 var(--space-3);
}

.bulletin-top__insight-text {
    font-size: 10px;
    line-height: 1.7;
    color: #444;
}

.bulletin-top__insight-text p {
    margin-bottom: var(--space-2);
}

.bulletin-top__insight-text p:last-child {
    margin-bottom: 0;
}

/* Collapsed Insight message (see the toggle script in _BulletinListing.cshtml) */
.bulletin-top__insight-text.is-clamped {
    position: relative;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.bulletin-top__insight-text.is-clamped:not(.is-expanded)::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.6em;
    background: linear-gradient(to bottom, rgba(235, 235, 235, 0), #EBEBEB);
    pointer-events: none;
}
.bulletin-top__insight-toggle {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0;
    background: none;
    border: 0;
    border-bottom: 2px solid var(--color-primary, #FFC200);
    font-family: var(--font-heading, sans-serif);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1a1a1a;
    cursor: pointer;
    transition: color 0.2s;
}
/* group.css has a legacy "button:hover/focus { background:#c36; color:#fff }" reset (pink),
   so every state needs an explicit transparent background. */
.bulletin-top__insight-toggle:hover,
.bulletin-top__insight-toggle:focus,
.bulletin-top__insight-toggle:active {
    background: none;
    color: var(--color-primary, #FFC200);
    text-decoration: none;
}
.bulletin-top__insight-toggle[hidden] { display: none; }

.bulletin-top__insight-more {
    display: inline-block;
    margin-top: 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.bulletin-top__insight-more:hover,
.bulletin-top__insight-more:focus {
    color: var(--color-primary, #FFC200);
    text-decoration: none;
}

/* ── Right panel ───────────────────────────────────────────── */
.bulletin-top__right {
    grid-column: span 2;
    background: #fff;
    padding: var(--space-6) var(--space-6) var(--space-6);
    display: flex;
    flex-direction: column;
}

/* ── Featured bulletin callout ─────────────────────────────── */
.bulletin-featured__callout {
    background: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.9rem var(--space-5) var(--space-2);
    margin-bottom: var(--space-6);
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.bulletin-featured__callout p {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #1a1a1a;
    margin: 0;
}

.bulletin-featured__callout-arrow {
    display: block;
    font-size: 1rem;
    color: #555;
    margin-top: 0.3rem;
}

/* ── Download button row ───────────────────────────────────── */
.bulletin-featured__dl-wrap {
    text-align: center;
    padding: var(--space-6) 0 var(--space-2);
}

/* ── Flipbook wrapper ──────────────────────────────────────── */
.bulletin-flipbook-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 4px;
    min-height: 340px;
    padding: var(--space-5);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* Small preview is click-to-expand only — the modal owns the interactive flip */
#bulletin-flipbook {
    pointer-events: none;
}

/* ── Fullscreen flipbook modal ──────────────────────────────── */
.bulletin-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.88);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-4);
}

.bulletin-modal__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.bulletin-modal__close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
}

.bulletin-modal__controls .bulletin-ctrl-info {
    color: #eee;
}

.bulletin-flipbook__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    color: #666;
    font-size: 0.9rem;
    padding: var(--space-7);
}

.bulletin-spinner {
    width: 40px;
    height: 40px;
    animation: bulletin-spin 1s linear infinite;
}

.bulletin-spinner circle {
    stroke: var(--color-primary, #FDBA31);
    stroke-linecap: round;
    stroke-dasharray: 80;
    stroke-dashoffset: 60;
}

@keyframes bulletin-spin {
    to { transform: rotate(360deg); }
}

#bulletin-flipbook {
    max-width: 100%;
    transition: transform 0.3s ease;
}

#bulletin-modal-flipbook {
    max-width: 100%;
    overflow: hidden;
    transition: width 0.3s ease;
}

#bulletin-modal-flipbook > * {
    transition: transform 0.3s ease;
}

/* ── Flipbook controls ─────────────────────────────────────── */
.bulletin-flipbook__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-6);
    flex-wrap: wrap;
}

.bulletin-ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem var(--space-4);
    background-color: var(--color-btn, #fff);
    color: var(--color-btn-text, #1a1a1a);
    font-family: var(--font-body, sans-serif);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.bulletin-ctrl-btn:hover,
.bulletin-ctrl-btn:focus {
    background-color: var(--color-btn-hover, #FDBA31);
    color: var(--color-btn-hover-text, var(--color-btn-text, #1a1a1a));
    text-decoration: none;
}

.bulletin-ctrl-info {
    font-size: 0.82rem;
    color: #555;
    min-width: 55px;
    text-align: center;
}

/* ── Archive section ───────────────────────────────────────── */
.bulletin-archive {
    padding: var(--space-7) 0 var(--space-4);
}

.bulletin-archive__heading {
    font-family: var(--font-heading, sans-serif);
    font-size: 1.1rem;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: var(--space-5);
    text-align: left;
}

.bulletin-archive__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-10);
}

/* ── Archive card ──────────────────────────────────────────── */
.bulletin-acard {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: #1a1a1a;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.bulletin-acard:hover,
.bulletin-acard:focus {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
    text-decoration: none;
    color: #1a1a1a;
}

.bulletin-acard__img {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #fff;
}

.bulletin-acard__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.bulletin-acard__img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bulletin-acard__img--placeholder svg {
    width: 48px;
    height: 48px;
    color: #aaa;
}

.bulletin-acard__body {
    padding: var(--space-3) 0.9rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    flex: 1;
}

.bulletin-acard__title {
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    color: var(--color-card-title, #1a1a1a);
}

.bulletin-acard__dl {
    font-size: 0.78rem;
    color: var(--color-primary, #FDBA31);
    font-weight: 700;
    margin-top: auto;
    padding-top: 0.4rem;
}

/* ── CTA Banner ────────────────────────────────────────────── */
.bulletin-cta {
    /* dark only in the centre 150px; the 50px overhang zones stay transparent */
    padding: var(--space-9) 0;
    background: linear-gradient(
        to bottom,
        transparent 50px,
        var(--color-footer-bg, #1a1a1a) 50px,
        var(--color-footer-bg, #1a1a1a) calc(100% - 50px),
        transparent calc(100% - 50px)
    );
    overflow: visible;
}

.bulletin-cta__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    padding: 0 var(--space-8);
    height: 150px;
    overflow: visible;
    text-decoration: none;
    color: var(--color-footer-text, #fff);
    transition: opacity 0.2s ease;
}

.bulletin-cta__inner:hover,
.bulletin-cta__inner:focus {
    text-decoration: none;
    color: var(--color-footer-text, #fff);
}

.bulletin-cta__inner:hover .bulletin-cta__label,
.bulletin-cta__inner:focus .bulletin-cta__label {
    opacity: 0.8;
}

.bulletin-cta__img {
    width: 645px;
    height: 250px; /* 50px overhang top + 150px strip + 50px overhang bottom */
    flex-shrink: 0;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
}

.bulletin-cta__label {
    font-family: var(--font-heading, sans-serif);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--color-footer-text, #fff);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .bulletin-top {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .bulletin-top__right {
        grid-column: 1;
    }

    .bulletin-top__photo img {
        height: 260px;
    }

    .bulletin-top__right {
        padding: var(--space-6);
    }

    .bulletin-archive__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
}

@media (max-width: 767px) {
    .bulletin-top__insight-text {
        font-size: 13px;
    }

    /* Fixed 645px image + flex-shrink:0 overflows any viewport under ~750px.
       Let it shrink to fit instead — height/gap/padding stay put so the
       parent's overhang gradient (sized for a 150px strip) still lines up. */
    .bulletin-cta__inner {
        gap: var(--space-4);
        padding: 0 var(--space-4);
    }

    .bulletin-cta__img {
        width: auto;
        max-width: 45%;
        flex-shrink: 1;
    }

    .bulletin-cta__label {
        font-size: 1.3rem;
    }
}

@media (max-width: 479px) {
    .bulletin-archive__grid {
        grid-template-columns: 1fr;
    }

    .bulletin-cta__label {
        font-size: 1.2rem;
    }
}
