/*
Theme Name: Astra Child
Theme URI: https://baroin.org
Description: Astra Child Theme for baroin.org
Author: baroin.org
Template: astra
Version: 1.0.8
*/

/* ── Header Widget 1: Astra Customizer sets font-size to 118px — reset to normal ── */
/* This causes the About button and search form to render as giant "D" shapes in the header. */
.header-widget-area[data-section="sidebar-widgets-header-widget-1"] .header-widget-area-inner {
    font-size: 1rem !important;
}

/* ── Header search: dark theme ── */
/* Astra slide-search panel — icon in primary header */
.ast-primary-header-bar .ast-search-menu-icon .search-form,
.ast-search-menu-icon .search-form,
.ast-search-menu-icon.slide-search .search-field,
.search-field {
    background: #12102a !important;
    color: #e8e0f8 !important;
    border: 1px solid #4a3880 !important;
    border-radius: 4px !important;
}
.search-field::placeholder { color: #7a6a9a !important; }
.search-submit,
.ast-search-submit {
    background: #2a1e5e !important;
    color: #baa3f6 !important;
    border: 1px solid #4a3880 !important;
}
.search-submit:hover,
.ast-search-submit:hover {
    background: #6246ea !important;
    color: #fff !important;
}

/* Search icon color in primary header */
.ast-primary-header-bar .ast-header-search .ast-icon,
.ast-primary-header-bar .ast-header-search .astra-search-icon svg {
    color: rgba(186,163,246,0.9) !important;
    fill: rgba(186,163,246,0.9) !important;
}
.ast-primary-header-bar .ast-header-search .astra-search-icon:hover .ast-icon {
    color: #fff !important;
}

/* Gutenberg block search in header widget */
.wp-block-search__input {
    background: #12102a !important;
    color: #e8e0f8 !important;
    border: 1px solid #4a3880 !important;
    border-radius: 4px 0 0 4px !important;
}
.wp-block-search__input::placeholder { color: #7a6a9a !important; }
.wp-block-search__button.wp-element-button {
    background: #2a1e5e !important;
    color: #baa3f6 !important;
    border: 1px solid #4a3880 !important;
    border-left: none !important;
    border-radius: 0 4px 4px 0 !important;
}
.wp-block-search__button.wp-element-button:hover {
    background: #6246ea !important;
    color: #fff !important;
}
.wp-block-search__inside-wrapper {
    border: none !important;
    background: transparent !important;
}

/* ── Search results: make result titles obviously clickable ── */
.search-results .entry-title a,
.search .entry-title a {
    color: #4a3380;
    text-decoration: none;
    border-bottom: 1px dashed #baa3f6;
    transition: color 0.15s, border-color 0.15s;
}
.search-results .entry-title a:hover,
.search .entry-title a:hover,
.search-results .entry-title a:focus,
.search .entry-title a:focus {
    color: #baa3f6;
    border-bottom: 1px solid #baa3f6;
    text-decoration: none;
}

/* ── Breadcrumbs: dark theme ── */
.ast-breadcrumbs-wrapper {
    background: transparent !important;
}
.ast-breadcrumbs a,
.breadcrumb-trail a {
    color: #baa3f6 !important;
    text-decoration: none;
}
.ast-breadcrumbs a:hover,
.breadcrumb-trail a:hover {
    color: #ffffff !important;
    text-decoration: underline;
}
.ast-breadcrumbs,
.breadcrumb-trail {
    color: #7a6a9a !important;
}

/* ── Hide empty above-header bar (confirmed empty in settings, causes white band) ── */
.ast-above-header-bar {
    display: none !important;
}

/* ── Kill the white band on the primary header ── */
/* Astra parent CSS sets .main-header-bar{background-color:#fff}. On desktop the header      */
/* expands to 80px (menu line-height) while background-size:contain may leave uncovered area. */
/* Setting a dark background-color prevents white showing through. */
.ast-primary-header-bar {
    background-color: #0D0614 !important;
}

/* ── Primary header: remove top whitespace ── */
.ast-primary-header-bar .site-primary-header-wrap {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.ast-primary-header-bar,
.ast-primary-header-bar .site-primary-header-wrap {
    min-height: 60px !important;
}

.ast-desktop:not(:has(.ast-header-sticked))
.ast-primary-header-bar .main-header-menu > .menu-item {
    line-height: 60px !important;
}

/* ── Compact nav items so menu stays horizontal at higher zoom levels ── */
.main-header-menu .menu-link {
    font-size: 0.82em !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    letter-spacing: 0.01em;
}

/* ── Remove empty paragraph whitespace between Gutenberg blocks ── */
.entry-content p:empty {
    display: none;
}

/* ── Tighten block spacing on content pages ── */
.entry-content .wp-block-uagb-container,
.entry-content .wp-block-uagb-buttons {
    margin-top: 1em !important;
    margin-bottom: 1em !important;
}

/* ═════════════════════════════════════════════════════════
   MMVM Manual — 3-level tabs (Enjoy / Understand / Deepen)
   ═════════════════════════════════════════════════════════ */

.mmvm-tabs {
    margin: 1.5em 0;
    border: 1px solid #e0d6f7;
    border-radius: 8px;
    background: #1a1a2e;
    overflow: hidden;
}

.mmvm-tab-buttons {
    display: flex;
    background: #16213e;
    border-bottom: 1px solid #baa3f6;
}

.mmvm-tab-btn {
    flex: 1;
    padding: 14px 18px;
    background: transparent;
    border: none;
    border-right: 1px solid #3a3060;
    color: #c9b2f9;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.mmvm-tab-btn:last-child {
    border-right: none;
}

.mmvm-tab-btn:hover {
    background: #2a1e5e;
    color: #ffffff;
}

.mmvm-tab-btn.active {
    background: #1a1a2e;
    color: #ffffff;
    box-shadow: inset 0 -3px 0 #baa3f6;
}

.mmvm-tab-content {
    display: none;
    padding: 1.8em 2em;
    background: #1a1a2e;
    color: #e8e0f8;
    line-height: 1.8;
}

.mmvm-tab-content.active {
    display: block;
}

.mmvm-tab-content p {
    color: #e8e0f8;
    margin-bottom: 1em;
}

.mmvm-tab-content h2,
.mmvm-tab-content h3,
.mmvm-tab-content h4 {
    color: #baa3f6;
    margin-top: 1.4em;
    margin-bottom: 0.5em;
}

.mmvm-tab-content strong {
    color: #ffffff;
}

.mmvm-tab-content em {
    color: #c9b2f9;
}

.mmvm-tab-content a {
    color: #baa3f6;
    text-decoration: underline;
}

.mmvm-tab-content a:hover {
    color: #ffffff;
}

.mmvm-tab-content ul {
    color: #e8e0f8;
    padding-left: 1.5em;
}

.mmvm-tab-content li {
    margin-bottom: 0.4em;
}

.mmvm-tab-content p:first-child {
    margin-top: 0;
}

.mmvm-tab-content hr {
    border: none;
    border-top: 1px solid #3a3060;
    margin: 1.5em 0;
}

/* ── Credits section ── */
.mmvm-credits {
    padding: 1.2em 2em;
    background: #12102a;
    border-top: 1px solid #3a3060;
    color: #a090c8;
}

.mmvm-credits h3 {
    color: #baa3f6;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6em;
}

.mmvm-credits ul {
    padding-left: 1.2em;
    margin: 0;
}

.mmvm-credits li {
    font-size: 0.9rem;
    margin-bottom: 0.3em;
    color: #a090c8;
}

.mmvm-credits strong {
    color: #c9b2f9;
}

/* ── MMVM Manual TOC list ── */
.mmvm-manual-toc {
    list-style: none;
    padding: 0;
    margin: 1.5em 0;
}

.mmvm-manual-toc li {
    margin: 0.5em 0;
    padding: 0.7em 1em;
    background: #1a1a2e;
    border-left: 4px solid #baa3f6;
    border-radius: 4px;
    transition: background 0.2s;
}

.mmvm-manual-toc li:hover {
    background: #2a1e5e;
}

.mmvm-manual-toc a {
    text-decoration: none;
    color: #e8e0f8;
    font-weight: 500;
}

.mmvm-manual-toc a:hover {
    color: #ffffff;
}

/* ── Home page overlay image blocks: let clicks reach the overlay link ── */
/* The UAGB overlay-layout puts a transparent <a> under the text headings.  */
/* pointer-events:none on the text lets clicks fall through to that link.   */
.wp-block-uagb-image--layout-overlay .uagb-image-heading,
.wp-block-uagb-image--layout-overlay .uagb-image-caption {
    pointer-events: none;
}

/* ── Mobile hamburger: larger tap target ── */
@media (max-width: 921px) {
    .ast-mobile-menu-trigger-minimal,
    .ast-mobile-menu-trigger,
    button.ast-mobile-menu-trigger {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 10px !important;
    }
    .ast-mobile-menu-trigger svg,
    .ast-mobile-menu-trigger-minimal svg {
        width: 28px !important;
        height: 28px !important;
    }
}

/* ── Mobile tab adjustments ── */
@media (max-width: 600px) {
    .mmvm-tab-buttons {
        flex-direction: column;
    }
    .mmvm-tab-btn {
        border-right: none;
        border-bottom: 1px solid #3a3060;
    }
    .mmvm-tab-btn:last-child {
        border-bottom: none;
    }
    .mmvm-tab-content {
        padding: 1.2em 1em;
    }
}

/* ============================================================
   MatheMusic Video Library (.mm-)
   Desktop-first (landscape). Phone portrait = secondary.
   ============================================================ */

.mm-library {
    width: 100%;
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 2em;
    box-sizing: border-box;
    font-family: inherit;
}

/* ── TOP SECTION: flexbox 2-column layout ───────────────── */

.mm-library {
    min-width: 900px; /* prevent collapse under zoom */
}

/* Top row: player + controls side by side */
.mm-top-row {
    display: flex;
    gap: 2em;
    align-items: flex-start;
    margin-bottom: 2em;
}
.mm-player-wrap {
    flex: 0 0 56%;
    position: sticky;
    top: 1em;
    align-self: flex-start;
    z-index: 10;
}
.mm-controls {
    flex: 1;
    min-width: 0;
}

/* Player */
.mm-player-wrap { margin-bottom: 0; }
.mm-player-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 6px;
}
.mm-player-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Video info — dark theme */
.mm-video-info {
    margin-top: 0.9em;
    background: #1a1a2e;
    border-radius: 6px;
    padding: 0.9em 1em;
}
.mm-video-info h3 { margin: 0 0 0.4em; font-size: 1.25em; color: #ffffff; font-weight: 700; }
.mm-video-info p { margin: 0 0 0.3em; font-size: 0.9em; color: #e8e0f8; line-height: 1.6; }

#mm-info-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
#mm-info-desc.mm-expanded {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}
#mm-expand-btn {
    background: none;
    border: none;
    color: #baa3f6;
    font-size: 0.82em;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.5em;
    display: block;
}
#mm-expand-btn:hover { text-decoration: underline; color: #ffffff; }

.mm-video-links {
    display: flex;
    align-items: center;
    gap: 1.2em;
    flex-wrap: wrap;
    margin-top: 0.4em;
    margin-bottom: 1em;
}
.mm-video-info a { font-size: 0.88em; color: #baa3f6; text-decoration: none; }
.mm-video-info a:hover { text-decoration: underline; color: #ffffff; }
.mm-subscribe-btn {
    display: inline-block;
    color: #c00;
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 600;
}
.mm-subscribe-btn:hover { color: #900; text-decoration: underline; }

/* Search row */
.mm-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 1em;
    flex-wrap: wrap;
}
#mm-search {
    flex: 1;
    min-width: 120px;
    padding: 0.55em 0.8em;
    border: 1px solid #4a3880;
    border-radius: 4px;
    font-size: 0.88em;
    box-sizing: border-box;
    background: #12102a;
    color: #e8e0f8;
}
#mm-search::placeholder { color: #7a6a9a; }
.mm-apply-btn {
    background: #6246ea;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.55em 1em;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.mm-apply-btn:hover { background: #7a5cf5; }
.mm-reset-inline {
    background: #2a1e5e;
    color: #c9b2f9;
    border: 1px solid #4a3880;
    border-radius: 4px;
    padding: 0.55em 0.9em;
    font-size: 0.85em;
    cursor: pointer;
    white-space: nowrap;
}
.mm-reset-inline:hover { background: #3a2e7e; color: #ffffff; }
#mm-count {
    font-size: 0.8em;
    color: #9a8ab8;
    white-space: nowrap;
}

/* Filters */
.mm-filters { margin-bottom: 0.5em; }
.mm-filter-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3em 0.35em;
    margin-bottom: 0.45em;
}
.mm-filter-label {
    font-size: 0.68em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7a6a9a;
    min-width: 110px;
    flex-shrink: 0;
}
.mm-filter-btn {
    background: #1e1640;
    border: 1px solid #4a3880;
    border-radius: 20px;
    padding: 0.22em 0.65em;
    font-size: 0.78em;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    color: #c9b2f9;
    white-space: nowrap;
}
.mm-filter-btn:hover { background: #2e2268; border-color: #7a5cf5; color: #ffffff; }
.mm-filter-btn.active { background: #6246ea; color: #fff; border-color: #7a5cf5; }

/* Grid — 6 cols desktop, scales down */
.mm-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.85em;
}
.mm-video-item {
    cursor: pointer;
    border: 1px solid #3a3060;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.15s, transform 0.12s;
    background: #1a1a2e;
}
.mm-video-item:hover {
    box-shadow: 0 4px 18px rgba(186,163,246,0.25);
    transform: translateY(-2px);
}
.mm-video-item img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}
.mm-video-title {
    padding: 0.45em 0.55em;
    font-size: 0.75em;
    line-height: 1.3;
    color: #e8e0f8;
}
.mm-video-item.mm-hidden { display: none; }

/* Card expand */
.mm-card-details { border-top: 1px solid #3a3060; margin: 0; }
.mm-card-details summary {
    font-size: 0.73em;
    color: #baa3f6;
    padding: 0.3em 0.55em;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.mm-card-details summary::-webkit-details-marker { display: none; }
.mm-card-details summary::before { content: '▾ '; }
.mm-card-details[open] summary::before { content: '▴ '; }
.mm-card-desc {
    font-size: 0.73em;
    color: #c9b2f9;
    line-height: 1.45;
    padding: 0.2em 0.55em 0.55em;
    margin: 0;
}

/* ── Responsive: tablet ──────────────────────────────────── */
@media (max-width: 1100px) {
    .mm-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 900px) {
    .mm-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Responsive: phone portrait ─────────────────────────── */
@media (max-width: 600px) {
    .mm-library { min-width: 0; padding: 0 0.75em; }
    .mm-top-row { flex-direction: column; gap: 1em; }
    .mm-player-wrap { flex: none; width: 100%; position: static; z-index: auto; }
    .mm-controls { width: 100%; }
    .mm-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6em; }
    .mm-filter-label { min-width: 70px; font-size: 0.68em; }
    #mm-search { width: 100%; }
}

/* === YouTube facade — Phase 03 PERF-01 === */
.yt-facade{position:relative;display:block;width:100%;aspect-ratio:16/9;background-size:cover;background-position:center;cursor:pointer;border:0;background-color:#000;overflow:hidden;}
.yt-facade::before{content:"";position:absolute;inset:0;background:rgba(0,0,0,0.15);transition:background .2s;}
.yt-facade:hover::before,.yt-facade:focus::before{background:rgba(0,0,0,0.35);}
.yt-facade .yt-facade-play{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:68px;height:48px;display:flex;align-items:center;justify-content:center;pointer-events:none;}
.yt-facade .yt-facade-play svg{width:100%;height:100%;filter:drop-shadow(0 1px 2px rgba(0,0,0,.5));}
.yt-facade:focus{outline:3px solid #fff;outline-offset:2px;}

/* Phase 04 STRUCT-01: visual-label class replacing misused H6 */
.mm-label {
    font-size: 1.1em;
    font-weight: inherit;
    color: #808285;
    line-height: 1.7;
    margin-bottom: 20px;
    text-transform: none;
    letter-spacing: normal;
}

/* Post-carousel titles: preserve visual style after titleTag h6→p */
.uagb-post__title.uagb-post__text {
    font-size: 1.1em;
    color: #808285;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* === YouTube "Watch on YouTube" prominent button — Phase 04 NAV-01 === */
#mm-info-link,
a.yt-watch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
    background: #ff0000;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 0.95em;
    font-weight: 700;
    padding: 0.55em 1.1em;
    border-radius: 4px;
    line-height: 1.3;
    letter-spacing: 0.01em;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}
#mm-info-link:hover,
a.yt-watch-btn:hover {
    background: #cc0000;
    transform: translateY(-1px);
}
#mm-info-link::before,
a.yt-watch-btn::before {
    content: "▶";
    font-size: 0.85em;
}
/* Subtitle "full quality" shown as block on wider screens */
#mm-info-link .yt-quality,
a.yt-watch-btn .yt-quality {
    font-size: 0.72em;
    font-weight: 400;
    opacity: 0.88;
    display: block;
    line-height: 1;
}
@media (max-width: 480px) {
    #mm-info-link .yt-quality,
    a.yt-watch-btn .yt-quality { display: none; }
}
/* Subscribe button stays subordinate */
.mm-subscribe-btn {
    font-size: 0.82em !important;
}

/* === Footer — compact black bar === */
.site-footer,
#colophon,
.site-above-footer-wrap,
.site-below-footer-wrap,
.ast-builder-grid-row-container,
.site-footer-primary-section,
.footer-widget-area {
    background: #000 !important;
    background-color: #000 !important;
}
.site-footer *,
#colophon * {
    background: transparent !important;
    background-color: transparent !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.4 !important;
}
.site-footer .ast-builder-grid-row-container,
.site-footer .site-above-footer-wrap,
.site-footer .site-below-footer-wrap {
    min-height: 0 !important;
    padding: 3px 1em !important;
}
.site-footer a, #colophon a {
    color: #888 !important;
    text-decoration: none !important;
}
.site-footer .ast-footer-html-1,
.site-footer .ast-footer-html-2,
.site-footer .ast-footer-html-3,
.site-footer [class*="ast-footer"] p,
.site-footer .footer-widget-area p {
    white-space: nowrap !important;
    font-size: 0.7em !important;
    overflow: hidden;
    text-overflow: ellipsis;
}
.site-footer .site-footer-section {
    min-width: 0;
    flex: 1 1 auto !important;
}

/* === Lightbox — image popup === */
#gb-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 99999;
    cursor: zoom-out;
    align-items: center;
    justify-content: center;
}
#gb-lightbox.gb-open { display: flex; }
#gb-lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    border-radius: 2px;
}
.wp-block-image img, .wp-block-image figure img {
    cursor: zoom-in;
}


/* ============================================================
   MatheMusic Hub Page — /mathemusic/
   ============================================================ */
.mm-hub {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.mm-hub-hero {
  text-align: center;
  padding: 30px 0 20px;
}

.mm-hub-hero h1 {
  font-size: 2.4em;
  margin-bottom: 10px;
}

.mm-hub-tagline {
  font-size: 1.1em;
  color: #666;
  margin-bottom: 30px;
}

.mm-hub-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.mm-hub-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mm-hub-card:hover {
  border-color: #0073aa;
  box-shadow: 0 2px 12px rgba(0,115,170,0.15);
  text-decoration: none;
  color: inherit;
}

.mm-hub-icon {
  font-size: 2.2em;
  margin-bottom: 8px;
}

.mm-hub-label {
  font-weight: 700;
  font-size: 1.1em;
  margin-bottom: 4px;
}

.mm-hub-sub {
  font-size: 0.82em;
  color: #666;
  line-height: 1.3;
}
