/* MBW Magazine ************************************************************/


/* Archive grid -----------------------------------------------------------
   Custom flex grid rather than the Bootstrap col-* classes, so cards
   in a row stretch to equal heights regardless of title length.
   Breakpoints: 1 col under 420px, 2 col phones, 3 col tablets, 4 col
   desktop - one card never spans the whole viewport on any device. */

.mbw-magazine-archive {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.mbw-magazine-archive > .post-nav {
    flex: 0 0 100%;
}

.mbw-magazine-card-col {
    width: 100%;
    padding: 0 15px;
    margin-bottom: 30px;
    display: flex;
}

@media (min-width: 420px) {
    .mbw-magazine-card-col {
        width: 50%;
    }
}

@media (min-width: 768px) {
    .mbw-magazine-card-col {
        width: 33.3333%;
    }
}

@media (min-width: 992px) {
    .mbw-magazine-card-col {
        width: 25%;
    }
}

.mbw-magazine-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.mbw-magazine-card:hover,
.mbw-magazine-card:focus {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
}

.mbw-magazine-card__image {
    width: 100%;
    aspect-ratio: 3 / 4;
    background-size: cover;
    background-position: center;
    background-color: #f4f4f4;
}

.mbw-magazine-card__body {
    padding: 1.25rem 1.5rem 1.5rem;
    flex: 1 1 auto;
}

/* Date + title mirror .mb-article__meta--date and .mb-listing__headline
   (Roboto Condensed bold, uppercase). Those rules are scoped under
   .mb-article / .mb-listing in the source LESS, so we re-apply the
   typography here for cards that sit outside either context. */

.mbw-magazine-card__date {
    display: block;
    margin: 0 0 0.4rem;
    padding: 0;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    font-size: 1em;
    line-height: 1.4;
    text-transform: uppercase;
    color: #999;
}

.mbw-magazine-card__date time {
    font: inherit;
    color: inherit;
    text-transform: inherit;
}

.mbw-magazine-card__title {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: bold;
    font-size: 1.2em;
    text-transform: uppercase;
    line-height: 1.25;
    margin: 2px 0 0;
    color: #333;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.1);
}

.mbw-magazine-card:hover .mbw-magazine-card__title,
.mbw-magazine-card:focus .mbw-magazine-card__title {
    color: #FF7D00;
}

/* Featured (page 1, first post) ------------------------------------------
   Full-width hero. Cover image left, content right on desktop; stacks
   below the tablet breakpoint. Reuses the same card classes as the
   grid items - .mbw-magazine-card--featured just overrides layout. */

.mbw-magazine-card-col--featured {
    width: 100%;
}

.mbw-magazine-card--featured {
    flex-direction: row;
}

.mbw-magazine-card--featured .mbw-magazine-card__image {
    flex: 0 0 280px;
}

.mbw-magazine-card--featured .mbw-magazine-card__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 3rem;
}

.mbw-magazine-card--featured .mbw-magazine-card__title {
    font-size: 2em;
    line-height: 1.15;
}

/* Excerpt mirrors .mb-listing__strap (Roboto body, #5E5E5E grey, 1em). */
.mbw-magazine-card__excerpt {
    margin: 0.75rem 0 0;
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
    line-height: 1.5;
    color: #5E5E5E;
    text-transform: none;
    font-weight: normal;
}

@media (max-width: 768px) {
    .mbw-magazine-card--featured {
        flex-direction: column;
    }
    .mbw-magazine-card--featured .mbw-magazine-card__image {
        flex: 0 0 auto;
        width: 100%;
    }
    .mbw-magazine-card--featured .mbw-magazine-card__body {
        padding: 1.5rem;
    }
}

/* Section heading (book icon + "MBW Magazine" label) ---------------------- */

.mb-heading--magazine {
    font-size: 1.3em;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: bold;
    color: #999999;
    margin: 0;
    padding: 0;
    margin-bottom: 3px;
}

.mb-heading--magazine i {
    margin-right: 3px;
}

.mb-icon-magazine {
    color: #FF7D00;
    margin-right: 5px;
}

/* Single issue: intro, viewer, download CTA ------------------------------ */

/* Drop the article-body bottom border - the <hr> below the intro is the
   separator on this template, matching how data posts render. */
.mbw-magazine-single .mb-article__body {
    border-bottom: 0;
}

.mbw-magazine-single__viewer {
    width: 100%;
    margin: 1rem auto 2rem;
    min-height: 600px;
    background: #f4f4f4;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .mbw-magazine-single__viewer {
        min-height: 400px;
    }
}

/* Download CTA card ------------------------------------------------------- */

.mbw-magazine-single__download {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    margin-top: 1rem;
    padding: 2rem 2.25rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-left: 4px solid #FF7D00;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mbw-magazine-single__download-icon {
    flex: 0 0 auto;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;
    border-radius: 4px;
    font-size: 2.4rem;
    color: #999;
}

.mbw-magazine-single__download-text {
    flex: 1 1 auto;
    min-width: 0;
}

.mbw-magazine-single__download-heading {
    font-weight: bold;
    font-size: 1.7rem;
    line-height: 1.2;
    margin: 0 0 0.4rem;
    color: #222;
}

.mbw-magazine-single__download-sub {
    color: #666;
    margin: 0 0 0.6rem;
    font-size: 1.15rem;
    line-height: 1.4;
}

.mbw-magazine-single__download-meta {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin: 0;
}

.mbw-magazine-single__download-btn {
    flex: 0 0 auto;
    display: inline-block;
    padding: 1rem 2.25rem;
    background: #FF7D00;
    color: #fff;
    text-decoration: none;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: bold;
    font-size: 1.25rem;
    text-transform: uppercase;
    border-radius: 2px;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.15);
    transition: opacity 0.15s ease;
}

.mbw-magazine-single__download-btn i {
    margin-right: 0.4rem;
}

.mbw-magazine-single__download-btn:hover,
.mbw-magazine-single__download-btn:focus {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

/* Mobile: stack the CTA contents, add bottom breathing room. */
@media (max-width: 768px) {
    .mbw-magazine-single__download {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
}

/* Return-to-index button -------------------------------------------------- */

.mbw-magazine-single__back {
    display: block;
    margin-top: 2rem;
    padding: 1.15rem 1.5rem;
    background: #fff;
    color: #FF7D00;
    text-align: center;
    text-decoration: none;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: bold;
    font-size: 1.25rem;
    text-transform: uppercase;
    border: 2px solid #FF7D00;
    border-radius: 2px;
    transition: background 0.15s ease, color 0.15s ease;
}

.mbw-magazine-single__back:hover,
.mbw-magazine-single__back:focus {
    background: #FF7D00;
    color: #fff;
    text-decoration: none;
}
