/* Masoretes editorial chrome — huaxia.click layout, masoretes gold/navy/blue.
   Loaded on every page. Does not remove notes, topics, or colour tokens. */

html.mas-editorial {
    --ed-navy: #1E3A5F;
    --ed-blue: #0284C8;
    --ed-gold: #D4AF37;
    --ed-gold-dark: #B8860B;
    --ed-gold-pale: #FEF3C7;
    --ed-line: #D4E4F0;
    --ed-max: 1180px;
}

html.mas-editorial .mas-ed-bar {
    background: var(--ed-navy);
    color: #F8F4EC;
    font-size: 11px;
    letter-spacing: 1.2px;
    font-family: var(--font-body);
}
html.mas-editorial .mas-ed-bar-inner {
    width: min(var(--ed-max), calc(100% - 48px));
    margin-inline: auto;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
html.mas-editorial .mas-ed-dot {
    width: 6px;
    height: 6px;
    /* border-radius: 50%; */
    background: var(--ed-gold);
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

html.mas-editorial .mas-ed-header {
    background: var(--bg-card, #fff);
    border-bottom: 1px solid var(--ed-line);
    position: sticky;
    top: 0;
    z-index: 70;
    font-family: var(--font-body);
}
html.mas-editorial .mas-ed-header-inner {
    width: min(var(--ed-max), calc(100% - 48px));
    margin-inline: auto;
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
html.mas-editorial .mas-ed-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}
html.mas-editorial .mas-ed-brand img {
    width: 42px !important;
    height: 42px !important;
    /* border-radius: 50%; */
}
html.mas-editorial .mas-ed-brand-type {
    display: flex;
    flex-direction: column;
    font-weight: 700;
    letter-spacing: 0.16em;
    font-size: 1.05rem;
    color: var(--ed-navy);
    line-height: 1.05;
}
html.mas-editorial .mas-ed-brand-type span {
    font-size: 9px;
    letter-spacing: 0.14em;
    font-weight: 600;
    color: var(--ed-gold-dark);
    margin-top: 5px;
}
html.mas-editorial .mas-ed-nav {
    display: flex;
    gap: 22px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
html.mas-editorial .mas-ed-nav a {
    color: var(--ed-navy);
    text-decoration: none;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}
html.mas-editorial .mas-ed-nav a:hover {
    color: var(--ed-gold-dark);
    border-bottom-color: var(--ed-gold);
}
html.mas-editorial .mas-ed-nav a[aria-current="page"] {
    color: var(--ed-gold-dark);
    border-bottom-color: var(--ed-gold);
}
html.mas-editorial .mas-ed-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
html.mas-editorial .mas-ed-btn {
    border: 1px solid var(--ed-line);
    background: var(--bg-card, #fff);
    color: var(--ed-navy);
    min-height: 42px;
    padding: 0 14px;
    border-radius: 2px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
html.mas-editorial .mas-ed-btn:hover {
    border-color: var(--ed-navy);
}
html.mas-editorial .mas-ed-btn--solid {
    background: var(--ed-navy);
    color: #fff;
    border-color: var(--ed-navy);
}
html.mas-editorial .mas-ed-btn--solid:hover {
    background: var(--ed-blue);
    border-color: var(--ed-blue);
    color: #fff;
}

/* Journal (WordPress): same heading bar; hide the old mobile brand bar;
   flatten the two-column scriptorium grid so the bar spans the page. */
html.mas-editorial .mobile-bar {
    display: none !important;
}
html.mas-editorial body.masoretes-theme .site-layout {
    display: block !important;
    grid-template-columns: none !important;
    background: var(--bg-body, #fff) !important;
}
html.mas-editorial body.masoretes-theme .site-main {
    width: min(var(--ed-max), calc(100% - 72px));
    margin-inline: auto;
    max-width: none;
}
body.admin-bar .mas-ed-header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar .mas-ed-header { top: 46px; }
}

/* Sidebar becomes a topics drawer on every viewport */
html.mas-editorial .site-layout {
    display: block !important;
    grid-template-columns: none !important;
}
html.mas-editorial .site-sidebar {
    position: fixed !important;
    left: 0;
    top: 0;
    height: 100vh !important;
    max-height: 100vh !important;
    width: min(320px, 92vw) !important;
    transform: translateX(-110%);
    transition: transform 0.28s ease;
    box-shadow: 8px 0 28px rgba(30, 58, 95, 0.16);
    background: var(--bg-card, #fff) !important;
    z-index: 80;
}
html.mas-editorial .site-sidebar.open {
    transform: translateX(0);
}
html.mas-editorial .sidebar-overlay.open {
    display: block !important;
    position: fixed !important;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 75;
}
html.mas-editorial .sidebar-toggle {
    display: none !important;
}
html.mas-editorial {
    --ed-navy: var(--blue-primary, #1E3A5F);
    --ed-blue: var(--blue-bright, #0284C8);
    --ed-gold: var(--gold, #D4AF37);
    --ed-gold-dark: var(--gold-dark, #B8860B);
    --ed-gold-pale: var(--gold-pale, #FEF3C7);
    --ed-line: var(--border-color, #D4E4F0);
    background-color: var(--bg-body, #fff);
}
html.mas-editorial body,
html.mas-editorial .site-main,
html.mas-editorial .site-main-header,
html.mas-editorial .site-main-body,
html.mas-editorial .hub-page {
    background-color: var(--bg-body, #fff);
    background-image: none;
}
html.mas-editorial[data-theme="light"] .site-main-header,
html.mas-editorial[data-theme="light"] .site-main-body,
html.mas-editorial[data-theme="light"] .hub-page {
    background-color: #fff;
}

html.mas-editorial .site-main,
html.mas-editorial .hub-page .site-main {
    width: min(var(--ed-max), calc(100% - 72px));
    margin-inline: auto;
}

/* Hub lead */
html.mas-editorial.hub-page .site-main-header,
html.mas-editorial .hub-page .site-main-header {
    padding-top: 1.25rem;
}
html.mas-editorial .hub-page .site-main-header .hub-hero-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) !important;
    gap: 2.25rem 2.5rem !important;
    align-items: start !important;
    width: 100% !important;
}
html.mas-editorial .hub-page .hub-hero-title {
    font-size: clamp(1.85rem, 3.4vw, 2.65rem) !important;
    font-weight: 500 !important;
    letter-spacing: -0.03em;
    color: var(--ed-navy);
    line-height: 1.15 !important;
}
html.mas-editorial .hub-page .site-main-header .hero-intro {
    font-size: 1.05rem !important;
    line-height: 1.65 !important;
    max-width: 38rem;
}
html.mas-editorial .hub-page .hub-hero-figure img {
    width: 100%;
    height: auto;
    min-height: 0;
    object-fit: contain;
    object-position: center;
}
html.mas-editorial .hub-page .hub-hero-quicklinks-label {
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--ed-gold-dark);
    font-weight: 700;
    text-transform: uppercase;
}

/* Popular entry points and Explore modules share the same large 3-column cards */
html.mas-editorial .hub-page #modules-grid.hub-modules-gallery,
html.mas-editorial .hub-page #modules-grid.hub-grid.hub-modules-gallery,
html.mas-editorial .hub-page .hub-hero-quicklinks-grid,
html.mas-editorial .hub-page .site-main-header .hub-hero-quicklinks-grid,
html.mas-editorial .hub-page .hub-hero-quicklinks-grid.hub-modules-gallery,
html.mas-editorial .hub-page .site-main-header .hub-hero-quicklinks-grid.hub-modules-gallery {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 2.75rem 2.25rem !important;
    padding: 0.75rem 0 2.5rem;
    width: 100% !important;
    max-width: none !important;
}
html.mas-editorial .hub-page .module-card {
    border: 1px solid transparent;
    box-shadow: none;
    border-radius: 0;
    background: var(--bg-card, #fff);
    margin: 0;
}
html.mas-editorial .hub-page .module-card-thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid transparent;
    background: var(--bg-mute, #fff);
}
html.mas-editorial .hub-page .module-card .thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
html.mas-editorial .hub-page .module-card .card-body {
    padding: 1.05rem 0.15rem 0.2rem !important;
}
html.mas-editorial .hub-page .module-card .card-title {
    font-size: 1.2rem !important;
    line-height: 1.28 !important;
    min-height: 0 !important;
    -webkit-line-clamp: 4 !important;
    font-weight: 500 !important;
    color: var(--ed-navy);
}
html.mas-editorial .hub-page .module-card .card-blurb {
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
    -webkit-line-clamp: 4 !important;
    margin-top: 0.4rem !important;
    color: var(--muted);
}
html.mas-editorial .hub-page .module-card .card-foot {
    font-size: 0.72rem !important;
    letter-spacing: 0.06em;
    color: var(--ed-gold-dark) !important;
    text-transform: uppercase;
    border-top: 0 !important;
}

html.mas-editorial .hub-page .filter-pills,
html.mas-editorial #filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.75rem 0 1rem;
}
html.mas-editorial #filter-pills .filter-pill,
html.mas-editorial .filter-pill {
    border: 1px solid var(--ed-line);
    background: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    cursor: pointer;
}
html.mas-editorial #filter-pills .filter-pill.active,
html.mas-editorial .filter-pill.active {
    background: var(--ed-navy);
    color: #fff;
    border-color: var(--ed-navy);
}

/* Notes: full-width reader */
html.mas-editorial.note-page .site-main-header,
html.mas-editorial .note-page .site-main-header {
    max-width: 760px;
    margin-inline: auto;
    padding-top: 2rem;
}
html.mas-editorial .note-page .page-title {
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--ed-navy);
    line-height: 1.15;
}
html.mas-editorial .note-page .lede {
    font-size: 1.1rem;
    line-height: 1.7;
}
html.mas-editorial .note-page .site-main-body {
    max-width: 760px;
    margin-inline: auto;
}

/* Map is a two-column tool, not a reader column */
html.mas-editorial .map-page .site-main {
    width: min(var(--ed-max), calc(100% - 48px));
}
html.mas-editorial .map-page .site-main-header,
html.mas-editorial .map-page .site-main-body,
html.mas-editorial .map-page .site-main-body.max-w-6xl {
    max-width: none;
    width: 100%;
    margin-inline: 0;
}
html.mas-editorial .map-page .scholarship-map-canvas {
    min-height: 560px;
    height: min(72vh, 760px);
    position: relative;
}
html.mas-editorial .map-page .leaflet-container,
html.mas-editorial .map-page .maplibregl-map {
    z-index: 1;
    background: #F7F1E3;
}

html.mas-editorial .mini-timeline {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 1024px) {
    html.mas-editorial .mas-ed-nav { display: none; }
    html.mas-editorial .hub-page .site-main-header .hub-hero-grid {
        grid-template-columns: 1fr !important;
    }
    html.mas-editorial .hub-page #modules-grid.hub-modules-gallery,
    html.mas-editorial .hub-page #modules-grid.hub-grid.hub-modules-gallery,
    html.mas-editorial .hub-page .hub-hero-quicklinks-grid,
    html.mas-editorial .hub-page .site-main-header .hub-hero-quicklinks-grid,
    html.mas-editorial .hub-page .hub-hero-quicklinks-grid.hub-modules-gallery,
    html.mas-editorial .hub-page .site-main-header .hub-hero-quicklinks-grid.hub-modules-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    html.mas-editorial .mini-timeline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    html.mas-editorial .mas-ed-header-inner,
    html.mas-editorial .mas-ed-bar-inner,
    html.mas-editorial .site-main {
        width: calc(100% - 36px);
    }
    html.mas-editorial .mas-ed-brand-type { font-size: 0.85rem; }
    html.mas-editorial .hub-page #modules-grid.hub-modules-gallery,
    html.mas-editorial .hub-page #modules-grid.hub-grid.hub-modules-gallery,
    html.mas-editorial .hub-page .hub-hero-quicklinks-grid,
    html.mas-editorial .hub-page .site-main-header .hub-hero-quicklinks-grid,
    html.mas-editorial .hub-page .hub-hero-quicklinks-grid.hub-modules-gallery,
    html.mas-editorial .hub-page .site-main-header .hub-hero-quicklinks-grid.hub-modules-gallery {
        grid-template-columns: 1fr !important;
    }
    html.mas-editorial .mas-ed-btn--explore { display: none; }
}

/* Kill the old floating Theme & Font overlay */
html.mas-editorial .theme-picker-fixed {
    display: none !important;
}

/* Appearance menu — same facility as huaxia.click */
html.mas-editorial .mas-ed-header { overflow: visible; }
html.mas-editorial .mas-ed-actions { position: relative; }
html.mas-editorial .mas-appearance {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}
html.mas-editorial .mas-ed-icon {
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid var(--ed-line);
    background: var(--bg-card, #fff);
    color: var(--ed-navy);
    border-radius: 2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
html.mas-editorial .mas-ed-icon:hover,
html.mas-editorial .mas-ed-icon[aria-expanded="true"] {
    border-color: var(--ed-navy);
    background: #f8fafc;
}
html.mas-editorial .mas-ed-icon svg { display: block; }
html.mas-editorial .mas-ed-icon .mas-icon-sun { display: none; }
html.mas-editorial .mas-ed-icon.is-dark .mas-icon-moon { display: none; }
html.mas-editorial .mas-ed-icon.is-dark .mas-icon-sun { display: block; }

html.mas-editorial .mas-palette-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 90;
    width: 336px;
    max-width: calc(100vw - 20px);
    max-height: min(78vh, 640px);
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-card, #fff);
    color: var(--ed-navy);
    border: 1px solid var(--ed-line);
    border-radius: 8px;
    box-shadow: 0 14px 36px rgba(30, 58, 95, 0.18);
    font-family: var(--font-body);
}
html.mas-editorial .mas-palette-panel[hidden] { display: none !important; }
html.mas-editorial .mas-palette-title {
    margin: 0;
    padding: 2px 4px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #64748b;
}
html.mas-editorial .mas-palette-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
}
html.mas-editorial .mas-palette-list > li { margin: 0; padding: 0; min-width: 0; }
html.mas-editorial .mas-palette-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    width: 100%;
    min-height: 64px;
    margin: 0;
    padding: 7px 2px 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    text-align: center;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    line-height: 1.15;
}
html.mas-editorial .mas-palette-option:hover { background: rgba(30, 58, 95, 0.07); }
html.mas-editorial .mas-palette-option[aria-pressed="true"] {
    background: rgba(212, 175, 55, 0.16);
    font-weight: 700;
}
html.mas-editorial .mas-palette-swatch {
    width: 30px;
    height: 30px;
    /* border-radius: 50%; */
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, var(--sw-bg) 0 52%, var(--sw-accent) 52% 100%);
    flex: 0 0 auto;
}
html.mas-editorial .mas-palette-swatch--custom {
    background: conic-gradient(#e11d48, #f59e0b, #84cc16, #06b6d4, #6366f1, #d946ef, #e11d48);
}
html.mas-editorial .mas-palette-option[aria-pressed="true"] .mas-palette-swatch {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ed-gold);
}
html.mas-editorial .mas-palette-name {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
}
html.mas-editorial .mas-panel-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--ed-line);
}
html.mas-editorial .mas-panel-section--reset {
    margin: 12px 0 18px;
    padding: 0 0 2px;
    border-top: 0;
}
html.mas-editorial .mas-panel-label {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
html.mas-editorial .mas-panel-hint {
    font-weight: 400;
    color: #64748b;
    font-size: 11px;
}
html.mas-editorial .mas-reset-btn {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--ed-line);
    border-radius: 6px;
    background: #fff;
    color: var(--ed-navy);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
html.mas-editorial .mas-reset-btn:hover {
    border-color: var(--ed-gold-dark);
    color: var(--ed-gold-dark);
}
html.mas-editorial .mas-palette-panel .font-picker-label,
html.mas-editorial .mas-palette-panel .font-size-picker-label,
html.mas-editorial .mas-palette-panel .theme-picker-label {
    display: none;
}
html.mas-editorial .mas-palette-panel .font-picker-select,
html.mas-editorial .mas-palette-panel select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--ed-line);
    border-radius: 6px;
    background: #fff;
    color: var(--ed-navy);
    font: inherit;
    font-size: 13px;
}
html.mas-editorial .mas-palette-panel .theme-rgb-picker {
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    width: 100%;
}
html.mas-editorial .mas-custom-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
html.mas-editorial .mas-color-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    min-width: 0;
}
html.mas-editorial .mas-color-field input[type="color"] {
    -webkit-appearance: auto;
    appearance: auto;
    width: 100%;
    height: 40px;
    min-height: 40px;
    padding: 3px;
    border: 1px solid var(--ed-line);
    border-radius: 6px;
    background: var(--bg-card, #fff);
    cursor: pointer;
    color-scheme: light;
}
html.mas-editorial .mas-color-field input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}
html.mas-editorial .mas-color-field input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}
html.mas-editorial .mas-palette-panel .theme-rgb-row,
html.mas-editorial .mas-palette-panel .theme-rgb-preview,
html.mas-editorial .mas-palette-panel .theme-rgb-field {
    display: none;
}

html[data-theme="dark"] .mas-palette-panel {
    background: #0B1220;
    color: #e8eef2;
    border-color: #33424c;
}
html[data-theme="dark"] .mas-ed-icon {
    background: #0B1220;
    color: #e8eef2;
    border-color: #33424c;
}
html[data-theme="dark"] .mas-reset-btn,
html[data-theme="dark"] .mas-palette-panel .font-picker-select,
html[data-theme="dark"] .mas-palette-panel select {
    background: #0B1220;
    color: #e8eef2;
    border-color: #33424c;
}

/* Map: fill the main column, keep tiles unscaled */
html.mas-editorial .map-page .site-main {
    width: min(1280px, calc(100% - 40px));
}
html.mas-editorial .map-page .map-layout {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1rem;
    align-items: stretch;
}
html.mas-editorial .map-page .scholarship-map-canvas,
html.mas-editorial .map-page .scholarship-map-canvas.leaflet-container,
html.mas-editorial .map-page .scholarship-map-canvas.maplibregl-map {
    width: 100% !important;
    min-height: 560px !important;
    height: min(72vh, 760px) !important;
}
html.mas-editorial .map-page .leaflet-container img.leaflet-tile,
html.mas-editorial .map-page .leaflet-container .leaflet-marker-icon,
html.mas-editorial .map-page .leaflet-container .leaflet-marker-shadow,
html.mas-editorial .map-page .scholarship-map-canvas canvas,
html.mas-editorial .map-page .scholarship-map-canvas img {
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    object-fit: unset !important;
}
@media (max-width: 900px) {
    html.mas-editorial .map-page .map-layout {
        grid-template-columns: 1fr;
    }
    html.mas-editorial .map-page .scholarship-map-canvas,
    html.mas-editorial .map-page .scholarship-map-canvas.leaflet-container,
    html.mas-editorial .map-page .scholarship-map-canvas.maplibregl-map {
        min-height: 420px !important;
        height: 55vh !important;
    }
}

/* Popular entry points: same card size, type, and gaps as Explore modules.
   Beats later 4-column compact rules in site.css. */
html.mas-editorial .hub-page .site-main-header .hub-hero-quicklinks-grid,
html.mas-editorial .hub-page .site-main-header .hub-hero-quicklinks-grid.hub-modules-gallery {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 2.75rem 2.25rem !important;
    align-content: start !important;
}
html.mas-editorial body:not(#p1).hub-page .site-main-header .hub-hero-figure-col {
    height: auto !important;
    margin-top: 0 !important;
    min-height: 0 !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: flex-start !important;
    align-self: start !important;
    position: relative !important;
}
html.mas-editorial body:not(#p1).hub-page .site-main-header .hub-hero-figure {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: 0 !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
}
html.mas-editorial body:not(#p1).hub-page .site-main-header .hub-hero-figure picture,
html.mas-editorial body:not(#p1).hub-page .site-main-header .hub-hero-figure img {
    border-radius: 16px !important;
    overflow: hidden !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    object-position: center center !important;
    display: block !important;
}
html.mas-editorial body:not(#p1).hub-page .site-main-header .hub-hero-figure-caption {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin-top: 0.5rem !important;
    color: var(--gold-deep, #B8860B) !important;
    text-shadow: none !important;
}
html.mas-editorial body:not(#p1).hub-page .hub-hero-quicklinks .module-card,
html.mas-editorial body:not(#p1).hub-page #modules-grid .module-card,
html.mas-editorial body:not(#p1).hub-page .module-card {
    border: 1px solid transparent !important;
    box-shadow: none !important;
    background: var(--bg-card, #fff) !important;
    height: auto !important;
    min-height: 0 !important;
    transform: none !important;
}
html.mas-editorial body:not(#p1).hub-page .hub-hero-quicklinks .module-card {
    border-radius: 16px !important;
    overflow: visible !important;
}
html.mas-editorial body:not(#p1).hub-page .hub-hero-quicklinks .module-card:hover,
html.mas-editorial body:not(#p1).hub-page #modules-grid .module-card:hover,
html.mas-editorial body:not(#p1).hub-page .module-card:hover {
    border-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}
html.mas-editorial body:not(#p1).hub-page .hub-hero-quicklinks .module-card-thumb,
html.mas-editorial body:not(#p1).hub-page .hub-hero-quicklinks .module-card .thumb,
html.mas-editorial body:not(#p1).hub-page .hub-hero-quicklinks .module-card img,
html.mas-editorial body:not(#p1).hub-page .module-card-thumb,
html.mas-editorial body:not(#p1).hub-page .module-card .thumb,
html.mas-editorial body:not(#p1).hub-page .module-card img {
    border-radius: 16px !important;
    border: 1px solid transparent !important;
    background-clip: padding-box;
}
html.mas-editorial body:not(#p1).hub-page .hub-hero-quicklinks .module-card-thumb,
html.mas-editorial body:not(#p1).hub-page .module-card-thumb {
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
}
html.mas-editorial .hub-page .hub-hero-quicklinks .module-card .card-body {
    padding: 1.05rem 0.15rem 0.2rem !important;
}
html.mas-editorial .hub-page .hub-hero-quicklinks .module-card .card-title {
    font-size: 1.2rem !important;
    line-height: 1.28 !important;
    min-height: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    -webkit-line-clamp: 4 !important;
    font-weight: 500 !important;
}
html.mas-editorial .hub-page .hub-hero-quicklinks .module-card .card-blurb {
    display: -webkit-box !important;
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
    -webkit-line-clamp: 4 !important;
    margin-top: 0.4rem !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: unset !important;
}
html.mas-editorial .hub-page .hub-hero-quicklinks .module-card .card-foot {
    font-size: 0.72rem !important;
    letter-spacing: 0.06em;
    color: var(--ed-gold-dark) !important;
    text-transform: uppercase;
    border-top: 0 !important;
}
@media (max-width: 1024px) {
    html.mas-editorial .hub-page .site-main-header .hub-hero-quicklinks-grid,
    html.mas-editorial .hub-page .site-main-header .hub-hero-quicklinks-grid.hub-modules-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 640px) {
    html.mas-editorial .hub-page .site-main-header .hub-hero-quicklinks-grid,
    html.mas-editorial .hub-page .site-main-header .hub-hero-quicklinks-grid.hub-modules-gallery {
        grid-template-columns: 1fr !important;
    }
}

/* Hub hero: full uncropped picture, 16px radius, right edge flush with modules. */
html.mas-editorial body:not(#p1).hub-page .site-main-header .hub-hero-figure picture {
    border: 1px solid transparent !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* ==== 19 Oct 2026: FULL-SCREEN LAYOUT BY DEFAULT ====
   The page fills the screen unless the reader picked a narrower width on the Margins / Width slide rule
   (site.js then adds html.mas-fixed-width). Fluid gutters, grids gain columns instead of stretching cards,
   headings scale a little, and long-form text keeps a comfortable reading measure. */
html.mas-editorial:not(.mas-fixed-width) {
    --ed-gutter: clamp(20px, 4vw, 72px);
    --ed-max: none;
    --content-max-width: none;
    --ed-measure: 860px; /* about 75ch of body text */
}
html.mas-editorial:not(.mas-fixed-width) .mas-ed-header-inner,
html.mas-editorial:not(.mas-fixed-width) .mas-ed-bar-inner,
html.mas-editorial:not(.mas-fixed-width) .site-main,
html.mas-editorial:not(.mas-fixed-width) .hub-page .site-main,
html.mas-editorial:not(.mas-fixed-width) body.masoretes-theme .site-main,
html.mas-editorial:not(.mas-fixed-width) .map-page .site-main {
    width: calc(100% - 2 * var(--ed-gutter)) !important;
    max-width: none !important;
    margin-inline: auto !important;
}
html.mas-editorial:not(.mas-fixed-width) .site-main-header,
html.mas-editorial:not(.mas-fixed-width) .site-main-body,
html.mas-editorial:not(.mas-fixed-width) .hub-page .hub-panel,
html.mas-editorial:not(.mas-fixed-width) .content-wrap {
    max-width: none !important;
}
/* Hero: text and picture share the width, picture capped so it never gets enormous */
html.mas-editorial:not(.mas-fixed-width) .hub-hero-grid { gap: clamp(28px, 3vw, 64px) !important; align-items: center; }
html.mas-editorial:not(.mas-fixed-width) .hub-hero-figure img { max-height: min(62vh, 640px); width: 100%; object-fit: cover; }
html.mas-editorial:not(.mas-fixed-width) .hub-hero-copy h1,
html.mas-editorial:not(.mas-fixed-width) .site-main-header h1,
html.mas-editorial:not(.mas-fixed-width) .site-main h1 { font-size: clamp(2rem, 1.2rem + 1.9vw, 3.75rem) !important; line-height: 1.1; }
html.mas-editorial:not(.mas-fixed-width) .site-main h2 { font-size: clamp(1.4rem, 1rem + 0.9vw, 2.2rem); }
/* Card grids gain columns on wide screens (about 300px minimum card width) */
html.mas-editorial:not(.mas-fixed-width) .hub-page #modules-grid.hub-modules-gallery,
html.mas-editorial:not(.mas-fixed-width) .hub-page #modules-grid.hub-grid.hub-modules-gallery,
html.mas-editorial:not(.mas-fixed-width) .hub-page .hub-hero-quicklinks-grid,
html.mas-editorial:not(.mas-fixed-width) .hub-page .site-main-header .hub-hero-quicklinks-grid,
html.mas-editorial:not(.mas-fixed-width) .hub-page .hub-hero-quicklinks-grid.hub-modules-gallery,
html.mas-editorial:not(.mas-fixed-width) .hub-page .site-main-header .hub-hero-quicklinks-grid.hub-modules-gallery,
html.mas-editorial:not(.mas-fixed-width) .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)) !important;
}
/* Long-form reading: centred column at a comfortable measure; wide media can use more room */
html.mas-editorial:not(.mas-fixed-width) .note-page .site-main-body,
html.mas-editorial:not(.mas-fixed-width) .site-main-body.max-w-4xl,
html.mas-editorial:not(.mas-fixed-width) body.single .entry-content,
html.mas-editorial:not(.mas-fixed-width) body.single .entry-header,
html.mas-editorial:not(.mas-fixed-width) body.single .entry-footer,
html.mas-editorial:not(.mas-fixed-width) body.page .entry-content {
    max-width: var(--ed-measure) !important;
    margin-inline: auto !important;
}
html.mas-editorial:not(.mas-fixed-width) .note-page .site-main-header { max-width: var(--ed-measure) !important; margin-inline: auto !important; }
html.mas-editorial:not(.mas-fixed-width) body.single .entry-thumbnail { max-width: var(--ed-measure) !important; margin-inline: auto !important; }
@media (max-width: 640px) {
    html.mas-editorial:not(.mas-fixed-width) .mas-ed-header-inner,
    html.mas-editorial:not(.mas-fixed-width) .site-main { width: calc(100% - 36px) !important; }
}
/* Phones: the header actions used to run ~110px off the right edge (sideways scroll). Keep the seal and every
   button on screen: tighter buttons, and the wordmark text gives way to the seal on narrow phones. */
@media (max-width: 640px) {
    html.mas-editorial .mas-ed-header-inner { gap: 8px; }
    html.mas-editorial .mas-ed-actions { gap: 4px !important; flex-shrink: 0; }
    html.mas-editorial .mas-ed-actions .mas-ed-btn { padding-inline: 9px !important; min-width: 0; }
    html.mas-editorial .mas-ed-brand { min-width: 0; flex-shrink: 1; }
    html.mas-editorial .mas-ed-brand img { width: 42px; height: 42px; }
}
@media (max-width: 460px) {
    html.mas-editorial .mas-ed-brand-type { display: none; }
}
html.mas-editorial:not(.mas-fixed-width) body.single .entry,
html.mas-editorial:not(.mas-fixed-width) body.page .entry { max-width: none !important; margin-inline: auto !important; }
html.mas-editorial:not(.mas-fixed-width) body.single .entry-header { padding-inline: 0 !important; }

/* ==== 19 Oct 2026: Sister sites footer column (huaxia.click, nekud.click) ==== */
html body .mso-footer-cols { grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { html body .mso-footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } html body .mso-footer-col-brand { grid-column: 1 / -1; } }
@media (max-width: 900px) { html body .mso-footer-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { html body .mso-footer-cols { grid-template-columns: 1fr; } }
.mso-footer-sister li { display: flex; flex-direction: column; gap: 1px; margin-bottom: 0.7rem; }
.mso-footer-sister a { font-weight: 600; }
.mso-sister-blurb { font-size: 0.75rem; line-height: 1.4; color: #AEB7C4; }
html[data-theme]:not([data-theme="light"]):not([data-theme="dark"]) .mso-sister-blurb { color: var(--bg-body); opacity: .75; }
html[data-theme="dark"] .mso-sister-blurb { color: #98A3B3; }

/* =========================================================
   Live Journal Update Pill (Compact & Non-intrusive)
   ========================================================= */
.mas-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 9px;
    border-radius: 4px;
    background: var(--gold-wash, rgba(212, 175, 55, 0.08));
    border: 1px solid var(--gold, #D4AF37);
    color: var(--text-main, #1e293b);
    font-size: 10px;
    line-height: 1;
    text-decoration: none !important;
    transition: all 0.18s ease;
}
.mas-live-pill:hover {
    background: var(--gold-light, rgba(212, 175, 55, 0.18));
    border-color: var(--gold-dark, #b8860b);
    color: var(--blue-bright, #0284C8);
}
.mas-live-dot {
    width: 6px;
    height: 6px;
    /* border-radius: 50%; */
    background-color: #10b981;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: mas-live-pulse 2s infinite;
}
@keyframes mas-live-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.75); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.mas-live-kicker {
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #047857;
}
html[data-theme="dark"] .mas-live-kicker {
    color: #34d399;
}
.mas-live-title {
    color: inherit;
    font-weight: 500;
}
.tag.tag-live {
    background: #047857 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
}


/* Remove gold vertical bar from hub-hero-eyebrow */
html body:not(#p1) .hub-hero-eyebrow,
html body .hub-hero-eyebrow {
    border-left: none !important;
    padding-left: 0 !important;
}

/* ==== 2026-10-29: SQUIRCLE BUTTONS (static hub + /wordpress journal) ====
   Same technique as huaxia.click 1.10.8 / nekud Fieldline 1.5.12: where Chrome supports corner-shape, every button gets a
   larger radius drawn as a squircle (superellipse); browsers without it keep their existing corners unchanged.
   Round icon buttons (slideshow arrows and dots, audio, back-to-top), map controls and the sidebar toggle stay as they are. */
@supports (corner-shape: squircle) {
  html body:not(#mso-sq) :is(
    button, [role="button"], input[type="submit"], input[type="button"], input[type="reset"],
    a[class*="btn"], a[class*="button"], a[class*="pill"], button[class*="pill"],
    .mas-ed-btn, .hub-hero-pillar, .mas-live-pill, .hero-slideshow-badge,
    .more-link, .read-more, a.read-more, .wp-block-button__link, .wp-element-button,
    .search-submit, .wp-block-search__button, .page-numbers, .pagination a, .pagination span, .nav-links a,
    .post-navigation a, .chip, .post-card-cat, .category-chips a, .tags-links a, .tag-cloud-link, .wp-block-tag-cloud a,
    .font-picker-btn
  ):not(.dot):not(.slideshow-arrow):not(.audio-btn):not(.back-to-top):not(.ribbon-scroll-arrow-btn):not([class*="maplibregl"]):not(.scholarship-map-marker-wrap):not(.sidebar-toggle):not(.cite-tab):not(.cite-close-btn) {
    border-radius: var(--mso-sq, 11px) !important;
    corner-shape: squircle !important;
  }
  /* small chips and tags: a tighter squircle */
  html body:not(#mso-sq) :is(.mas-live-pill, .hero-slideshow-badge, .chip, .post-card-cat, .category-chips a, .tags-links a, .tag-cloud-link,
    .wp-block-tag-cloud a, .page-numbers, .hero-btn-featured .rounded-full) { --mso-sq: 8px; }
  html body:not(#mso-sq) .hero-btn-featured .rounded-full { border-radius: 8px !important; corner-shape: squircle !important; }
  /* link cards on the homepage */
  html body .hub-hero-pillar { --mso-sq: 16px; }
  /* buttons that were pill-shaped become squircle capsules */
  html body:not(#mso-sq) :is(.filter-pill, .main-filter-pill, .map-filter-btn, .writing-mode-btn, .hub-confessional-close, button.rounded-full, a.rounded-full) { --mso-sq: 999px; }
}

/* Homepage feature boxes (Masorah & Text, Diaspora Centers, Ancient Codices): three equal squircle cards in a row */
html body:not(#mso-sq) .hub-hero-pillars-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 10px !important; padding-top: 12px !important; margin-top: 2px; border-top: 1px solid #E2E8F0; }
@media (min-width: 640px) { html body:not(#mso-sq) .hub-hero-pillars-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
html body:not(#mso-sq) .hub-hero-pillars-grid .hub-hero-pillar { display: flex !important; flex-direction: column; justify-content: flex-start; gap: 4px; height: 100%; padding: 11px 14px 12px !important; margin: 0 !important; border-radius: 12px !important; background: #FFFFFF !important; border: 1px solid #E2E8F0 !important; }
html body:not(#mso-sq) .hub-hero-pillars-grid .hub-hero-pillar > div { display: flex; align-items: center; gap: 7px; margin: 0 !important; }
html body:not(#mso-sq) .hub-hero-pillars-grid .hub-hero-pillar > div i { width: 16px; text-align: center; flex: none; }
html body:not(#mso-sq) .hub-hero-pillars-grid .hub-hero-pillar p { margin: 0 !important; padding-left: 23px; line-height: 1.4; }
@supports (corner-shape: squircle) { html body:not(#mso-sq) .hub-hero-pillars-grid .hub-hero-pillar { border-radius: 18px !important; corner-shape: squircle !important; } }

/* Homepage: no divider lines between the timeline strip and the topic explorer */
html body:not(#mso-sq).hub-page .hub-hero-lower, html body:not(#mso-sq).hub-page .hub-hero-quicklinks { border-top: 0 !important; }
html body:not(#mso-sq).hub-page .hub-hero-quicklinks { padding-top: 0 !important; margin-top: 14px !important; }
