/* ============================================================
   Mountain Author Theme — Frontend Styles
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%;
    margin-left: auto;
    margin-right: auto; height: auto; display: block; }

/* ── Layout Utilities ─────────────────────────────────────── */
.ma-main-content,
.ma-homepage {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Site Header ──────────────────────────────────────────────────────────────
 *
 * Structure: <header class="ma-site-header"> (wp:group tagName:header)
 *   — min-height set via block style attr so FSE doesn't collapse it
 *   — background-image injected inline by render_block filter in functions.php
 *   — ::before pseudo-element creates side gradients (15px each edge)
 *   — content (title + nav) is pushed to the bottom via flex-end
 *
 * ──────────────────────────────────────────────────────────────────────────── */

.ma-site-header {
    position: relative;
    width: 100%;
    height: 355px !important;
    min-height: unset !important;
    max-height: 355px !important;
    background-color: #1A2530;     /* overridden per page by wp_head             */
    /* background-image, background-size, background-position, background-repeat  */
    /* are all set dynamically by the wp_head hook in functions.php               */
    display: block !important;
    padding: 30px 0 0 60px !important;
    overflow: hidden !important;
    box-sizing: border-box;
}

/* Side gradients are layered directly onto .ma-site-header as additional
   background-image layers by the wp_head hook in functions.php */

/* Title and nav sit above the gradient overlay */
.ma-site-header > * {
    position: relative;
    z-index: 2;
    width: 100%;
}

/* ── Site title ───────────────────────────────────────────── */
.ma-hero-title.wp-block-site-title,
.ma-hero-title.wp-block-site-title a,
.ma-site-header .wp-block-site-title,
.ma-site-header .wp-block-site-title a {
    display: block;
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: clamp(2rem, 5vw, 3.5rem) !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    color: #ffffff !important;
    text-shadow:
        0 0 20px rgba(40,40,40,0.95),
        0 0 40px rgba(40,40,40,0.85),
        0 0 70px rgba(40,40,40,0.6),
        0 2px 4px rgba(0,0,0,0.9) !important;
    text-decoration: none !important;
    letter-spacing: 0.03em;
    margin: 0 0 0.5rem 0;
    padding: 0;
}

/* ── Nav wrapper ──────────────────────────────────────────── */
.ma-nav-bar {
    width: 100%;
    padding: 0;
    margin: 0;
}

/* ── Navigation ───────────────────────────────────────────── */
.ma-main-nav .wp-block-navigation__container {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0 1.75rem;
}

.ma-main-nav a,
.ma-main-nav .wp-block-navigation-item__content {
    color: rgba(255,255,255,0.9) !important;
    font-family: 'Lato', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none !important;
    text-shadow:
        0 0 6px rgba(40,40,40,0.95),
        0 0 12px rgba(40,40,40,0.7),
        0 1px 3px rgba(0,0,0,0.9);
    transition: color 0.2s ease;
    padding: 0.25rem 0;
}

.ma-main-nav a:hover,
.ma-main-nav .wp-block-navigation-item__content:hover {
    color: #ffffff !important;
}

.ma-main-nav .wp-block-navigation__responsive-container-open,
.ma-main-nav .wp-block-navigation__responsive-container-close {
    color: #ffffff !important;
}

.ma-main-nav .wp-block-navigation__responsive-container-open svg,
.ma-main-nav .wp-block-navigation__responsive-container-close svg {
    fill: #ffffff;
}

/* ── Per-page header colors + background image ────────────── */
/* Handled entirely in PHP via wp_head in functions.php.       */
/* The hook emits background-color, background-image, and      */
/* the ::before gradient with correct rgba() values for the    */
/* current page type — no CSS body-class selectors needed.     */
:root {
    --ma-header-bg: #1A2530; /* fallback only */
}


/* ── Main content padding after header ───────────────────── */
.ma-homepage,
.ma-main-content,
main.wp-block-group,
[role="main"],
.wp-site-blocks > main {
    padding-top: 0;
    margin-top: 0;
}

/* Kill any WordPress default block spacing above first section */
.wp-site-blocks {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* ── "View All Books" and similar outline buttons ────────── */
/* wp-element-button forces white text; these overrides restore
   the dark green text on transparent/outline buttons           */
.wp-block-button__link[style*="background:transparent"],
.wp-block-button__link[style*="background-color:transparent"],
.wp-block-button__link[style*="background: transparent"],
.wp-block-button__link[style*="color:#2D5A3D"] {
    color: #2D5A3D !important;
}
.wp-block-button__link[style*="color:#2D5A3D"]:hover {
    color: #1A2530 !important;
    border-color: #1A2530 !important;
}

.ma-btn-outline-green {
    background-color: transparent !important;
    color: #2D5A3D !important;
    border: 2px solid #2D5A3D !important;
}
.ma-btn-outline-green:hover {
    color: #1A2530 !important;
    border-color: #1A2530 !important;
    background-color: transparent !important;
}

/* ── Single Book Page ─────────────────────────────────────── */
.ma-book-page {
    width: 100%;
}

.ma-breadcrumb {
    font-size: 0.85rem;
    margin: 0 0 0.5rem;
}
.ma-breadcrumb a {
    color: #4A8B8C;
    text-decoration: none;
    font-weight: 600;
}
.ma-breadcrumb a:hover { color: #2D5A3D; }

.ma-book-page-columns {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.ma-book-page-cover {
    width: 250px;
    vertical-align: top;
    padding-right: 3rem;
    padding-bottom: 2rem;
}

.ma-book-page-info {
    vertical-align: top;
    padding-bottom: 2rem;
}

.ma-book-cover-wrap {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(26,37,48,0.18);
    width: 250px;
}
.ma-book-cover-img {
    width: 250px;
    height: auto;
    display: block;
}

.ma-book-buy-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0.75rem;
    width: 250px;
}

.ma-book-buy-links .ma-buy-btn {
    margin: 0 0 0.2rem 0 !important;
}

.ma-buy-btn {
    display: block;
    text-align: center;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-family: 'Lato', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s ease;
    background: #E8EEF0;
    color: #3D4A5C !important;
    border: 1px solid #C8D4D8;
}
.ma-buy-btn:hover { background: #C8D4D8; }
.ma-buy-btn--primary {
    background: #2D5A3D;
    color: #ffffff !important;
    border-color: #2D5A3D;
}
.ma-buy-btn--primary:hover { background: #1A3D28; }

.ma-book-genre-tags {
    margin: 0 0 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.ma-genre-tag {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #4A8B8C;
    background: #E8EEF0;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
}

.ma-book-series {
    font-size: 0.85rem;
    color: #7A8B8C;
    margin: 0 0 0.5rem;
    font-style: italic;
}

.ma-book-page-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    line-height: 1.15;
    color: #1A2530;
    margin: 0 0 1rem;
}

.ma-book-page-excerpt {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #3D4A5C;
    margin: 0 0 1.5rem;
}

.ma-book-meta-panel {
    background: #F5F0E8;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ma-book-meta-row {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}
.ma-book-meta-label {
    font-weight: 700;
    color: #3D4A5C;
    min-width: 90px;
    flex-shrink: 0;
}
.ma-book-meta-value {
    color: #1A2530;
}

.ma-book-divider {
    border: none;
    border-top: 1px solid #E8EEF0;
    margin: 2.5rem 0;
}
.ma-book-body-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: #3D4A5C;
    margin: 0 0 1.25rem;
}
.ma-book-body-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #1A2530;
    width: 100%;
}

.ma-book-reviews {
    margin-top: 0;
}

@media (max-width: 700px) {
    .ma-book-page-columns,
    .ma-book-page-columns tbody,
    .ma-book-page-columns tr {
        display: block;
        width: 100%;
    }
    .ma-book-page-cover,
    .ma-book-page-info {
        display: block;
        width: 100%;
        padding-right: 0;
    }
    .ma-book-cover-wrap {
        max-width: 200px;
    }
}

/* ── Page layout classes (replaces block inline styles) ────── */
.ma-page-main {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.ma-page-header {
    padding: 2rem 5vw 0;
}

.ma-page-content {
    padding: 1.5rem 5vw 3rem;
}

.ma-page-subtitle {
    color: #7A8B8C;
    margin: 0.25rem 0 0;
}

.ma-page-featured-image img {
    border-radius: 6px;
    margin-bottom: 2rem;
    width: 100%;
    height: auto;
}

.ma-post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem 0;
}

.ma-post-date {
    font-size: 0.8rem;
    color: #7A8B8C;
}

.ma-post-card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
}

.ma-book-breadcrumb-wrap {
    padding-bottom: 0;
}

/* ── Footer classes (replaces block inline styles) ────────── */
.ma-site-footer {
    background-color: #1A2530;
    width: 100%;
}

.ma-footer-main {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 3rem;
    padding: 4rem 5vw 3rem;
}

.ma-footer-col {
    min-width: 180px;
    flex: 1;
}

.ma-footer-col-heading {
    color: #4A8B8C !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.15em !important;
    text-transform: uppercase !important;
    margin: 0 0 1rem !important;
}

.ma-contact-email a {
    color: #4A8B8C;
    text-decoration: none;
}

.ma-footer-social-tagline {
    font-size: 0.8rem;
    color: #7A8B8C;
    line-height: 1.6;
    margin-top: 1rem;
}

.ma-footer-divider {
    border: none !important;
    border-top: 1px solid #3D4A5C !important;
    margin: 0 !important;
}

.ma-footer-copyright {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 5vw;
}

.ma-copyright-text {
    font-size: 0.8rem;
    color: #7A8B8C;
    margin: 0;
}

.ma-footer-legal-nav a,
.ma-footer-legal-nav .wp-block-navigation-item__content {
    font-size: 0.8rem !important;
    color: #7A8B8C !important;
    text-decoration: none;
}

/* Footer nav links */
.ma-footer-nav a,
.ma-footer-nav .wp-block-navigation-item__content {
    color: rgba(200,212,216,0.85) !important;
    font-size: 0.9rem;
    line-height: 2;
    text-decoration: none !important;
    display: block;
}
.ma-footer-nav a:hover,
.ma-footer-nav .wp-block-navigation-item__content:hover {
    color: #fff !important;
}

/* Footer paragraphs */
.ma-site-footer p,
.ma-contact-info p {
    color: #C8D4D8;
    font-size: 0.9rem;
    line-height: 1.8;
    margin: 0 0 0.5rem;
}

/* ── About page photo ─────────────────────────────────────── */
.ma-about-content {
    overflow: hidden;
}

.ma-about-photo,
.ma-about-photo figure,
.ma-about-photo .wp-block-post-featured-image,
figure.ma-about-photo {
    width: 200px !important;
    height: 200px !important;
    float: left;
    margin: 0 2rem 1rem 0 !important;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(26,37,48,0.15);
    flex-shrink: 0;
}

.ma-about-photo img,
.ma-about-photo figure img,
.ma-about-photo .wp-block-post-featured-image img,
figure.ma-about-photo img {
    width: 200px !important;
    height: 200px !important;
    object-fit: cover !important;
    display: block !important;
    max-width: none !important;
}

.ma-about-content .wp-block-post-content {
    overflow: hidden;
}

@media (max-width: 500px) {
    .ma-about-photo,
    .ma-about-photo figure,
    figure.ma-about-photo {
        float: none !important;
        margin: 0 auto 1.5rem !important;
        display: block !important;
    }
}

/* ── Page titles (H2, used on Books/Reviews/Press/About etc.) ─ */
.ma-page-title,
h2.ma-page-title,
.wp-block-post-title.ma-page-title {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: clamp(1.6rem, 3vw, 2.2rem) !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    color: var(--wp--preset--color--summit-slate, #3D4A5C) !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Section Spacing ──────────────────────────────────────── */
.ma-section {
    width: 100%;
}

/* ── Books Grid ───────────────────────────────────────────── */
.ma-books-grid {
    display: grid;
    gap: 2rem;
}
.ma-books-grid.ma-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ma-books-grid.ma-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ma-books-grid.ma-cols-4 { grid-template-columns: repeat(4, 1fr); }

.ma-book-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(26,37,48,0.10);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}
.ma-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(26,37,48,0.16);
}

.ma-book-cover {
    display: block;
    overflow: hidden;
}
.ma-book-cover img {
    width: 200px;
    height: auto;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.ma-book-card:hover .ma-book-cover img {
    transform: scale(1.04);
}

.ma-book-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ma-book-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15rem;
    margin: 0;
    line-height: 1.3;
}
.ma-book-title a {
    color: #1A2530;
    text-decoration: none;
}
.ma-book-title a:hover { color: #2D5A3D; }

.ma-book-date {
    font-size: 0.8rem;
    color: #7A8B8C;
    margin: 0;
}

.ma-book-excerpt {
    font-size: 0.9rem;
    line-height: 1.65;
    color: #3D4A5C;
    flex: 1;
    margin: 0;
}

/* ── Reviews Grid ─────────────────────────────────────────── */
.ma-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
}

.ma-review-card {
    background: #ffffff;
    border: 1px solid #E8EEF0;
    border-radius: 8px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 600px;
    box-shadow: 0 2px 12px rgba(26,37,48,0.07);
    transition: background 0.25s ease, box-shadow 0.25s ease;
}
.ma-review-card:hover {
    box-shadow: 0 4px 20px rgba(26,37,48,0.12);
}

/* Dark card style only on the homepage reviews section */
.ma-section--reviews .ma-review-card {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    box-shadow: none;
}
.ma-section--reviews .ma-review-card:hover {
    background: rgba(255,255,255,0.13);
}

.ma-star-rating {
    color: #C87941;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

/* Card body holds the quote/content and clips it to a consistent size;
   a fade + "Read full review" button appear only when it's actually cut off. */
.ma-review-body {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.ma-review-body::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.5rem;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #ffffff 85%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.ma-review-card.has-more .ma-review-body::after {
    opacity: 1;
}
.ma-section--reviews .ma-review-card .ma-review-body::after {
    background: linear-gradient(to bottom, rgba(26,37,48,0), #24343f 85%);
}

.ma-review-readmore {
    display: none;
    align-self: flex-start;
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    margin-top: -0.25rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4A8B8C;
    cursor: pointer;
}
.ma-review-readmore:hover {
    text-decoration: underline;
}
.ma-review-card.has-more .ma-review-readmore {
    display: inline-block;
}

.ma-review-quote {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.1rem;
    font-style: italic;
    line-height: 1.6;
    color: #3D4A5C;
    margin: 0;
    border: none;
    padding: 0;
}
.ma-review-quote p {
    margin: 0 0 1em;
}
.ma-review-quote p:last-child {
    margin-bottom: 0;
}

.ma-section--reviews .ma-review-card .ma-review-quote {
    color: rgba(255,255,255,0.9);
}

.ma-review-footer {
    font-size: 0.85rem;
    color: #7A8B8C;
    border-top: 1px solid #E8EEF0;
    padding-top: 0.75rem;
    margin-top: auto;
    flex-shrink: 0;
}
.ma-section--reviews .ma-review-card .ma-review-footer {
    color: rgba(255,255,255,0.6);
    border-top-color: rgba(255,255,255,0.1);
}
.ma-review-footer a {
    color: #4A8B8C;
    text-decoration: none;
}

.ma-review-bio {
    font-size: 0.8rem;
    line-height: 1.6;
    color: #55666B;
    margin-top: 0.5rem;
    flex-shrink: 0;
    max-height: 4.5em;
    overflow: hidden;
}
.ma-review-bio p:last-child {
    margin-bottom: 0;
}
.ma-section--reviews .ma-review-card .ma-review-bio {
    color: rgba(255,255,255,0.75);
}
.ma-review-bio a {
    color: #4A8B8C;
}

/* Full-review modal (populated from each card's hidden <template>) */
.ma-review-modal-box {
    background: #ffffff;
    color: #1A2530;
    border-radius: 8px;
    max-width: 620px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
}
.ma-review-modal-box .ma-review-quote {
    color: #3D4A5C;
    font-size: 1.25rem;
}
.ma-review-modal-box .ma-review-footer {
    color: #7A8B8C;
}
.ma-review-modal-box .ma-review-bio {
    color: #55666B;
    max-height: none;
    overflow: visible;
}

/* ── Press Clippings Grid ─────────────────────────────────── */
.ma-press-grid {
    display: grid;
    gap: 1.5rem;
}
.ma-press-grid.ma-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ma-press-grid.ma-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ma-press-grid.ma-cols-4 { grid-template-columns: repeat(4, 1fr); }

.ma-press-clipping {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(26,37,48,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.ma-press-clipping:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(26,37,48,0.14);
}
.ma-press-clipping img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}
.ma-press-clipping a { display: block; overflow: hidden; }
.ma-press-clipping a img { transition: transform 0.4s ease; }
.ma-press-clipping a:hover img { transform: scale(1.04); }

.ma-press-meta {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.ma-press-source {
    font-size: 0.8rem;
    font-weight: 700;
    color: #3D4A5C;
    letter-spacing: 0.05em;
}
.ma-press-date {
    font-size: 0.75rem;
    color: #7A8B8C;
    white-space: nowrap;
}

/* ── Buttons ──────────────────────────────────────────────── */
.ma-btn,
.wp-element-button {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    background: #2D5A3D;
    color: #fff !important;
    font-family: 'Lato', system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s ease, transform 0.15s ease;
    margin-top: auto;
    align-self: flex-start;
}
.ma-btn:hover, .wp-element-button:hover {
    background: #3D4A5C;
    transform: translateY(-1px);
}

/* ── Footer ───────────────────────────────────────────────── */
.ma-site-footer {
    width: 100%;
}

.ma-footer-col {
    min-width: 180px;
    flex: 1;
}

.ma-footer-main .wp-block-group {
    flex-wrap: wrap;
    gap: 3rem;
}

.ma-footer-copyright {
    flex-wrap: wrap;
    gap: 1rem;
}

.ma-social-links li {
    margin: 0;
}
.ma-social-links .wp-social-link {
    background: #3D4A5C !important;
    transition: background 0.2s ease, transform 0.15s ease;
}
.ma-social-links .wp-social-link:hover {
    background: #4A8B8C !important;
    transform: translateY(-2px);
}

/* Navigation in footer */
.ma-site-footer .wp-block-navigation a {
    color: rgba(200,212,216,0.85) !important;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    padding: 0.15rem 0;
}
.ma-site-footer .wp-block-navigation a:hover {
    color: #fff !important;
}

/* ── Page Hero ────────────────────────────────────────────── */
.ma-page-hero {
    width: 100%;
}

/* ── Book Single ──────────────────────────────────────────── */
.ma-book-single .wp-block-post-featured-image img {
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(26,37,48,0.18);
}

.ma-book-metadata p {
    margin: 0;
}

.ma-book-metadata strong {
    color: #3D4A5C;
    min-width: 120px;
    display: inline-block;
}

.ma-author-photo img {
    width: 100%;
    height: auto;
}

/* ── Media & Videos ───────────────────────────────────────── */
.ma-media-section {
    margin-bottom: 3rem;
}
.ma-media-section:last-child {
    margin-bottom: 0;
}
.ma-media-section-title {
    color: #1A2530;
    margin-bottom: 0.5rem;
}
.ma-media-section-intro {
    color: #4A4A4A;
    margin-bottom: 1.5rem;
    max-width: 65ch;
}

.ma-media-grid {
    display: grid;
    gap: 2rem;
}
.ma-media-grid.ma-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ma-media-grid.ma-cols-3 { grid-template-columns: repeat(3, 1fr); }

.ma-media-card {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(26,37,48,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.ma-media-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(26,37,48,0.14);
}

.ma-media-embed {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    padding-bottom: 56.25%; /* 16:9, relative to width only */
    height: 0;
    background: #1A2530;
    border: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
}
.ma-media-embed img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, opacity 0.2s ease;
}
.ma-media-embed:hover img {
    transform: scale(1.04);
    opacity: 0.85;
}
.ma-media-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: rgba(26,37,48,0.8);
    border: 2px solid rgba(255,255,255,0.85);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    padding-left: 0.2rem; /* optically center the triangle */
    transition: background 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 1;
}
.ma-media-embed:hover .ma-media-play-icon {
    background: #2D5A3D;
    border-color: #fff;
    transform: translate(-50%, -50%) scale(1.08);
}

/* Enlarged video playback modal */
.ma-media-modal-box {
    width: 100%;
    max-width: 1200px;
}
.ma-media-modal-box .ma-media-modal-frame {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
}
.ma-media-modal-box .ma-media-modal-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.ma-media-info {
    padding: 1rem 1.25rem;
}
.ma-media-title {
    font-size: 1.1rem;
    margin: 0 0 0.4rem;
    color: #1A2530;
}
.ma-media-meta {
    font-size: 0.85rem;
    color: #6b6b6b;
    margin: 0 0 0.6rem;
}
.ma-media-source {
    font-weight: 600;
    color: #2D5A3D;
}
.ma-media-text {
    position: relative;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.95rem;
    color: #4A4A4A;
    line-height: 1.6;
}
.ma-media-text p:last-child {
    margin-bottom: 0;
}
.ma-media-text::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1.6em;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #ffffff 80%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.ma-media-text.has-more::after {
    opacity: 1;
}

.ma-media-readmore {
    display: inline-block;
    margin-top: 0.5rem;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4A8B8C;
    cursor: pointer;
}
.ma-media-readmore:hover {
    text-decoration: underline;
}

.ma-review-modal-box .ma-media-modal-title {
    margin-top: 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .ma-books-grid.ma-cols-3,
    .ma-books-grid.ma-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .ma-press-grid.ma-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .ma-press-grid.ma-cols-3 { grid-template-columns: repeat(2, 1fr); }
    .ma-media-grid.ma-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .ma-books-grid,
    .ma-reviews-grid,
    .ma-press-grid,
    .ma-media-grid { grid-template-columns: 1fr; }

    .ma-footer-main > .wp-block-group {
        flex-direction: column;
        gap: 2.5rem;
    }

    .ma-header-top-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ── Copyright year auto-update ───────────────────────────── */
.ma-copyright-year::before {
    content: attr(data-year);
}

/* ── Accessibility ────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid #4A8B8C;
    outline-offset: 3px;
}

a { transition: color 0.2s ease; }

/* ── Print ────────────────────────────────────────────────── */
@media print {
    .ma-site-header, .ma-site-footer, .ma-main-nav { display: none; }
}
