/* Museu Abelló theme. Colours, fonts and sizes come from theme.json (--wp--preset--…); this file adds the layout
   of the header, footer, home sections and the plugin's live blocks. Design: design/home/ (prototype, Oct 2026). */

:root {
  --red: var(--wp--preset--color--red, #ae0a24);
  --red-dark: var(--wp--preset--color--red-dark, #8c0a1f);
  --red-soft: var(--wp--preset--color--red-soft, #fbeef0);
  --ink: var(--wp--preset--color--ink, #1a1a1a);
  --ink-2: var(--wp--preset--color--ink-2, #4a4a4a);
  --ink-3: var(--wp--preset--color--ink-3, #6b6b6b);
  --line: var(--wp--preset--color--line, #e4e4e4);
  --bg-2: var(--wp--preset--color--bg-2, #f4f4f4);
  --serif: var(--wp--preset--font-family--poly, Georgia, serif);
}

img { max-width: 100%; height: auto; }
.eyebrow, .is-style-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); margin-bottom: 14px; }
.credit { font-size: 13px; color: var(--ink-3); margin: 8px 0 0; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; border-radius: 999px; background: var(--red); color: #fff; font-weight: 600; text-decoration: none; }
.btn:hover { background: var(--red-dark); color: #fff; }
.link-arrow { font-weight: 600; color: var(--red); text-decoration: none; white-space: nowrap; }
.link-arrow::after { content: " →"; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 28px; }
.badge { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 600; vertical-align: 2px; }
.badge.muted { background: var(--bg-2); color: var(--ink-2); }
.mab-noimg { display: block; width: 100%; height: 100%; background: var(--bg-2); }
:where(.wp-site-blocks) > * { margin-block-start: 0; }

/* Top bar */
.topbar { background: var(--red); color: #fff; font-size: 14px; }
.topbar-in { min-height: 40px; gap: 12px; }
.mab-today { margin: 0; }
.mab-today .dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #7ee08a; vertical-align: 1px; }
.mab-today.is-later .dot { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.8); } /* opens later today */
.mab-today.is-closed .dot { background: #ffb3bd; }
.mab-today .sep { opacity: 0.6; margin: 0 8px; }
.mab-langs { display: flex; gap: 2px; }
.mab-langs a { padding: 4px 8px; border-radius: 6px; color: #fff; text-decoration: none; font-weight: 600; opacity: 0.75; }
.mab-langs a[aria-current] { opacity: 1; background: rgba(255, 255, 255, 0.18); }
.mab-langs a:hover { opacity: 1; color: #fff; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); }
.admin-bar .site-header { top: 32px; }
.header-in { min-height: 84px; gap: 24px; }
.mab-logo img { display: block; width: 250px; }
.nav-top, .nav-top ul { list-style: none; margin: 0; padding: 0; }
.nav-top { display: flex; gap: 2px; }
.nav-top > li { position: relative; display: flex; align-items: center; border-radius: 8px; }
.nav-top > li > a, .sub-btn { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 600 16px var(--wp--preset--font-family--hanken); text-decoration: none; cursor: pointer; white-space: nowrap; }
.nav-top > li > a + .sub-btn { margin-left: -10px; padding-left: 4px; padding-right: 10px; }
.nav-top > li:hover, .nav-top > li.in-section, .nav-top > li:has([aria-expanded="true"]) { background: var(--red-soft); }
.nav-top > li:hover > a, .nav-top > li:hover > .sub-btn, .nav-top > li.in-section > a, .nav-top > li.in-section > .sub-btn, .sub-btn[aria-expanded="true"] { color: var(--red); }
.chev { flex: none; transition: transform 0.15s; }
.sub-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.sub { display: none; position: absolute; top: 100%; left: 0; z-index: 20; min-width: 250px; margin-top: 6px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.1); }
.sub::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; } /* keeps hover across the gap */
.sub-btn[aria-expanded="true"] ~ .sub { display: block; }
.sub a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.sub a:hover, .sub a[aria-current] { background: var(--red-soft); color: var(--red); }
.sub-in { margin: 0 0 4px 12px !important; padding-left: 8px !important; border-left: 2px solid var(--line); }
.sub-in a { padding: 5px 10px; font-size: 15px; color: #555; }
@media (hover: hover) and (min-width: 1181px) {
  .has-sub:hover > .sub { display: block; }
}
.menu-btn { display: none; }

/* Secondary menu: a band above the footer (".mab-menu" alone is the footer's columns, so both classes) */
.mab-menu.mab-menu-secondary { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 0; padding: 22px max(24px, calc((100% - 1240px) / 2)); background: var(--red-soft); border-top: 1px solid #f1dde0; }
.mab-menu-secondary span { display: flex; align-items: center; }
.mab-menu-secondary span + span::before { content: ""; width: 4px; height: 4px; margin: 0 6px; border-radius: 50%; background: var(--red); opacity: 0.45; }
.mab-menu-secondary a { padding: 6px 12px; border-radius: 999px; color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; transition: background 0.15s, color 0.15s; }
.mab-menu-secondary a:hover, .mab-menu-secondary .current-menu-item a { background: #fff; color: var(--red); }

/* In the editor: blocks with nothing to show right now */
.mab-editor-empty { margin: 0; padding: 10px 14px; border: 1px dashed #c8c8c8; border-radius: 6px; color: #6b6b6b; font: 13px/1.4 system-ui, sans-serif; }

/* Notices */
.mab-notice { background: #1a1a1a; }
.mab-notice a { display: block; max-width: 1240px; margin: 0 auto; padding: 12px 24px; color: #fff; text-decoration: none; }
.mab-notice b { color: #ffd1d8; margin-right: 8px; }
.mab-fallback-note { max-width: 1240px; margin: 16px auto 0; padding: 12px 18px; border-left: 4px solid var(--red); background: var(--red-soft); font-size: 15px; }

/* Home sections */
.home > .entry-content > * + * { margin-block-start: 0; }
.home .sec { padding-top: var(--wp--preset--spacing--60); }
.home .hero-after:has(.mab-hero) { margin-top: var(--wp--preset--spacing--50); } /* the featured exhibition, when shown after "Ara al museu" */
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.block-head h2 { margin: 0; font-size: var(--wp--preset--font-size--x-large); }
.block-head.stacked { display: block; }
.block-head .sub { color: var(--ink-2); margin: 10px 0 18px; }

.mab-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.mab-hero-img { padding: 32px 0 0 24px; }
.mab-hero-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.mab-hero-text { align-self: center; padding: 48px 56px; }
.mab-hero h1 { font-size: var(--wp--preset--font-size--xx-large); margin: 0 0 20px; }
.mab-hero .lead { font-size: 20px; color: var(--ink-2); max-width: 30em; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.card a { display: block; color: var(--ink); text-decoration: none; }
.card-img { overflow: hidden; background: var(--bg-2); aspect-ratio: 4 / 5; margin-bottom: 16px; }
.card-img.wide { aspect-ratio: 3 / 2; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s; }
.card a:hover img { transform: scale(1.03); }
.card .meta { font-size: 14px; font-weight: 600; color: var(--red); margin: 0 0 6px; }
.card h3 { font-size: 26px; margin: 0 0 8px; }
.card a:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.card .dates { color: var(--ink-2); font-size: 15px; margin: 0; }
.news .card h3 { font-size: 23px; }
.news .meta { color: var(--ink-3); font-weight: 500; }

.soon { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: center; margin-top: 56px; padding: 28px; background: var(--bg-2); color: var(--ink); text-decoration: none; }
.soon-img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.soon h3 { font-size: clamp(28px, 3vw, 38px); margin: 0 0 10px; }
.soon .dates { font-weight: 600; color: var(--ink-2); }
.soon p:last-child { margin: 0; color: var(--ink-2); max-width: 40em; }
.soon:hover h3 { color: var(--red); }

.mab-agenda { display: grid; grid-template-columns: 320px 1fr; gap: 56px; }
.agenda { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.agenda a { display: grid; grid-template-columns: 84px 1fr; gap: 24px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.agenda a:hover .title { color: var(--red); }
.when { display: grid; justify-items: center; line-height: 1; color: var(--red); }
.when b { font: 400 46px var(--serif); }
.when span { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 6px; }
.what { display: grid; gap: 2px; }
.type { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.title { font: 400 25px/1.2 var(--serif); }
.info { color: var(--ink-2); font-size: 15px; }

/* Visit (group with class "visit") */
.visit { margin-top: var(--wp--preset--spacing--60); background: var(--bg-2); padding-top: 72px; padding-bottom: 72px; }
.visit .wp-block-image img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.mab-visit { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 20px; }
.mab-visit h3, .visit h3 { font: 600 15px var(--wp--preset--font-family--hanken); text-transform: uppercase; letter-spacing: 0.08em; color: var(--red); margin: 0 0 6px; }
.hours { margin: 0; }
.hours div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #dcdcdc; font-size: 15px; }
.hours dt { color: var(--ink-2); }
.hours dd { margin: 0; font-weight: 600; text-align: right; }
.hours .is-today, .hours .is-today dt { color: var(--red); font-weight: 600; }

/* Spaces (cover blocks in a grid with class "spaces") */
.spaces { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.spaces > * { margin: 0 !important; }
/* White line under the tiles, as wide as the gaps between them, before the red band. */
.sec:has(> .spaces) { padding-bottom: 20px; }
/* Room between the news titles and the newsletter band's top line (the band's own margin is cancelled by the layout). */
.sec:has(> .mab-news) { padding-bottom: 48px; }
.spaces .wp-block-cover { aspect-ratio: 3 / 4; min-height: 0 !important; align-items: flex-end; padding: 20px; }
.spaces .wp-block-cover h3 { font-size: 26px; margin: 0 0 4px; }
.spaces .wp-block-cover h3 a { color: #fff; text-decoration: none; }
.spaces .wp-block-cover h3 a::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.spaces .wp-block-cover p { font-size: 15px; line-height: 1.4; margin: 0; }
/* Darken the bottom of each picture so the white text always reads. */
.spaces .wp-block-cover::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.8)); pointer-events: none; }
.spaces .wp-block-cover__inner-container { z-index: 2; }
.spaces .wp-block-cover__image-background { transition: transform 0.6s; }
.spaces .wp-block-cover:hover .wp-block-cover__image-background { transform: scale(1.04); }

/* Joan Abelló (group with class "artist") */
.artist { margin-top: var(--wp--preset--spacing--60); background: var(--red); color: #fff; padding-top: 72px; padding-bottom: 72px; }
.artist a { color: #fff; }
.artist .eyebrow { color: #fff; opacity: 0.85; }
.artist h2 { font-size: clamp(36px, 4.5vw, 60px); }
.artist .wp-block-image img { max-height: 640px; object-fit: cover; }
.artist figcaption { color: rgba(255, 255, 255, 0.75); font-size: 13px; }
.artist .wp-block-button__link { background: #fff; color: var(--red); }
.artist .wp-block-button__link:hover { background: var(--red-soft); color: var(--red); }

/* Newsletter (group with class "newsletter") */
.newsletter { margin-top: var(--wp--preset--spacing--60); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-top: 48px; padding-bottom: 48px; }
.newsletter h2 { font-size: 34px; margin: 0 0 6px; }
.newsletter p { margin: 0; color: var(--ink-2); }
.mab-nl { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.mab-nl-form { display: flex; gap: 8px; }
.mab-nl-form input[type="email"] { box-sizing: border-box; width: 320px; max-width: 100%; min-height: 48px; padding: 0 20px; border: 1px solid #c8c8c8; border-radius: 999px; font: 16px var(--wp--preset--font-family--hanken); color: var(--ink); background: #fff; }
.mab-nl-form input[type="email"]:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
.mab-nl-form button { min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px; cursor: pointer; }
.mab-nl-trap { position: absolute; left: -5000px; }
.mab-nl-archive { color: var(--ink-2); font-size: 14px; text-decoration: none; }
.mab-nl-archive:hover { color: var(--red); text-decoration: underline; }

/* Footer */
.site-footer { background: #161616; color: #d8d8d8; font-size: 15px; padding-top: 64px; margin-top: 0; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid .mab-logo img { width: 240px; margin-bottom: 20px; }
.mab-menu { display: grid; align-content: start; gap: 8px; }
.mab-menu h3 { font: 600 13px var(--wp--preset--font-family--hanken); text-transform: uppercase; letter-spacing: 0.1em; color: #9a9a9a; margin: 0 0 6px; }
.partners { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; margin-top: 48px; padding: 32px 0; border-top: 1px solid #333; }
.partners img { height: 40px; width: auto; padding: 8px 12px; background: #fff; border-radius: 6px; }
.legal { gap: 8px 24px; padding: 20px 0 28px; border-top: 1px solid #333; font-size: 14px; color: #9a9a9a; }
.legal p { margin: 0; }
.mab-menu-legal { display: flex; gap: 16px; }
.legal-links { gap: 16px; }
.legal .mab-cookie-link { color: #9a9a9a; font-size: 14px; text-decoration: none; }
.legal .mab-cookie-link:hover { color: #fff; text-decoration: underline; }

/* Ordinary pages */
main.page { padding-top: var(--wp--preset--spacing--50); padding-bottom: var(--wp--preset--spacing--60); }
/* Titles of pages, news and activities: in line with the exhibition pages, not the home hero's 84 px. */
main.page h1.wp-block-post-title { font-size: clamp(36px, 4.2vw, 56px); line-height: 1.08; }
/* A news item's or activity's featured picture: wide, whole (never cropped), on a light grey panel that frames
   posters and photos alike; the date above the title in the cards' red. */
.news-date { margin-bottom: 10px !important; color: var(--red); font-size: 15px; font-weight: 600; }
.news-hero.alignwide { max-width: 1000px !important; margin: 36px auto 44px !important; display: flex; justify-content: center; background: var(--bg-2); }
.news-hero img { display: block; width: auto !important; max-width: 100%; height: auto !important; max-height: min(72vh, 720px); object-fit: contain; }
@media (max-width: 640px) { .news-hero.alignwide { margin: 24px -24px 32px !important; max-width: none !important; } }

/* Tablet */
/* Mapa web */
.mab-sitemap ul { list-style: none; margin: 0; padding: 0; }
.mab-sitemap > ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 32px; padding: 24px 0; border-top: 1px solid var(--line); }
.mab-sitemap > ul:first-child { gap: 32px; }
.mab-sitemap > ul:first-child > li > a { font: 400 24px var(--serif); }
.mab-sitemap ul ul { margin-top: 6px; }
.mab-sitemap ul ul ul { margin: 2px 0 4px 14px; font-size: 15px; }
.mab-sitemap a { display: inline-block; padding: 3px 0; color: var(--ink); text-decoration: none; }
.mab-sitemap a:hover { color: var(--red); text-decoration: underline; }
.mab-sitemap > ul:not(:first-child) a { font-weight: 600; }

/* Col·laboradors */
.partner-logos { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px; }
.partner-logos figure { margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 8px; text-align: center; }
.partner-logos img { height: 90px; width: auto; max-width: 100%; object-fit: contain; }
.partner-logos figcaption { margin-top: 10px; font-weight: 600; }

/* Page not found, search, a space's or cycle's exhibitions */
.mab-exhibitions .eyebrow { margin-bottom: 8px; }
.mab-exhibitions > .lead { max-width: 46em; margin: -8px 0 32px; color: var(--ink-2); }
.mab-notfound h1, .mab-searchpage h1 { margin: 0 0 16px; }
.mab-notfound .lead { color: var(--ink-2); margin: 0 0 28px; }
.mab-search { display: flex; gap: 8px; max-width: 560px; margin: 0 0 28px; }
.mab-search input { flex: 1; min-width: 0; padding: 12px 18px; border: 1.5px solid var(--line); border-radius: 999px; font: inherit; }
.mab-search input:focus { outline: none; border-color: var(--red); }
.mab-search button { padding: 12px 22px; border: 0; border-radius: 999px; background: var(--red); color: #fff; font: 600 16px var(--wp--preset--font-family--hanken); cursor: pointer; }
.mab-search button:hover { background: var(--red-dark); }
.mab-search-count { color: var(--ink-2); margin: 0 0 8px; }
.mab-results { list-style: none; margin: 0; padding: 0; }
.mab-results li { border-top: 1px solid var(--line); }
.mab-results a { display: block; padding: 22px 0; color: var(--ink); text-decoration: none; }
.mab-results .meta { margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--red); }
.mab-results h2 { margin: 0 0 6px; font-size: 26px; }
.mab-results a:hover h2 { color: var(--red); }
.mab-results p:last-child { margin: 0; color: var(--ink-2); }

/* Botiga: product photos are shown whole on a light ground, never cropped */
.mab-shop h1 { margin: 0 0 12px; }
.mab-shop .lead { margin: 0 0 28px; color: var(--ink-2); }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 28px; }
.product-card a { display: block; color: var(--ink); text-decoration: none; }
.product-img { position: relative; aspect-ratio: 1; background: var(--bg-2); border-radius: 8px; }
.product-img img, .product-img .mab-noimg { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); object-fit: contain; }
.product-card h3 { margin: 14px 0 4px; font-size: 20px; line-height: 1.25; }
.product-card a:hover h3 { color: var(--red); }
.product-card .price, .mab-product .price { margin: 0; font-weight: 600; color: var(--red); }
.product-card .badge { margin: 6px 0 0; }
.mab-product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.product-photo { display: grid; place-items: center; padding: 32px; background: var(--bg-2); border-radius: 8px; }
.product-photo img { width: 100%; height: auto; max-height: 640px; object-fit: contain; display: block; }
.mab-product .eyebrow a { color: inherit; text-decoration: none; }
.mab-product .eyebrow a:hover { text-decoration: underline; }
.mab-product h1 { font-size: clamp(34px, 4vw, 54px); margin: 0 0 16px; }
.mab-product .price { font-size: 26px; margin-bottom: 24px; }
.product-body { color: var(--ink-2); }
.product-body p { margin: 0 0 14px; }
.product-note { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }

/* Menu as a button (tablets and phones) */
@media (max-width: 1180px) {
  .mainnav { display: none; }
  .menu-btn { display: grid; gap: 6px; place-content: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--red); cursor: pointer; }
  .menu-btn span { width: 20px; height: 2px; background: #fff; transition: transform 0.2s; }
  .menu-open .menu-btn span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-open .menu-btn span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .header-in { position: relative; }
  .menu-open .mainnav { display: block; position: absolute; top: 100%; left: -24px; right: -24px; max-height: calc(100dvh - 120px); overflow-y: auto; padding: 12px 16px 24px; background: #fff; border-bottom: 1px solid var(--line); }
  .nav-top { display: grid; gap: 0; }
  .nav-top > li { flex-wrap: wrap; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav-top > li:hover, .nav-top > li.in-section, .nav-top > li:has([aria-expanded="true"]) { background: none; }
  .nav-top > li > a, .sub-btn { flex: 1; justify-content: space-between; padding: 12px 8px; font: 400 26px var(--serif); }
  .nav-top > li > a + .sub-btn { flex: 0 0 52px; justify-content: center; margin: 0; padding: 12px 0; }
  .chev { width: 18px; height: 18px; }
  .nav-top > li > .sub-btn:first-child { padding-right: 17px; } /* chevron lines up with the ones beside links */
  .sub { position: static; flex: 0 0 100%; min-width: 0; margin: 0 0 12px; padding: 0 0 0 8px; border: 0; border-radius: 0; box-shadow: none; }
  .sub::before { display: none; }
  .sub a { padding: 9px 8px; font-size: 17px; white-space: normal; }
  .sub-in a { font-size: 16px; }
}

@media (max-width: 1080px) {
  .mab-hero { grid-template-columns: 1fr; }
  .mab-hero-img { padding: 0; }
  .mab-hero .credit { padding: 0 24px; }
  .mab-hero-text { padding: 32px 24px 0; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spaces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mab-agenda { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mab-product { grid-template-columns: 1fr; gap: 28px; }
}

/* Phone */
@media (max-width: 640px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .product-card h3 { font-size: 17px; }
  .mab-menu.mab-menu-secondary { display: grid; grid-template-columns: 1fr 1fr; justify-items: start; gap: 2px 8px; padding: 20px 16px; }
  .mab-menu-secondary span + span::before { display: none; }
  body { font-size: 16px; }
  .topbar .price { display: none; }
  /* The strip on phones: the state on one line, when that changes on the next, under the text (not the dot) */
  .topbar-in { padding-top: 7px; padding-bottom: 7px; }
  .mab-today { line-height: 1.35; }
  .mab-today .change { display: block; padding-left: 16px; }
  .mab-today .change .sep { display: none; }
  .header-in { min-height: 68px; }
  .mab-logo img { width: 190px; }
  .mab-hero .lead { font-size: 18px; }
  .block-head { flex-wrap: wrap; }
  .cards { grid-template-columns: 1fr; gap: 40px; }
  .cards.swipe { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -24px; padding: 0 24px 8px; scrollbar-width: none; }
  .cards.swipe::-webkit-scrollbar { display: none; }
  .cards.swipe .card { flex: 0 0 78%; scroll-snap-align: start; scroll-margin-left: 24px; }
  .cards.swipe .card h3 { font-size: 22px; }
  .soon { grid-template-columns: 1fr; gap: 20px; padding: 18px; }
  .agenda a { grid-template-columns: 60px 1fr; gap: 16px; }
  .when b { font-size: 38px; }
  .title { font-size: 21px; }
  .mab-visit { grid-template-columns: 1fr; gap: 8px; }
  .spaces { grid-template-columns: 1fr; }
  .newsletter .mab-nl { width: 100%; align-items: stretch; }
  .mab-nl-form { flex-direction: column; }
  .mab-nl-form input[type="email"] { width: 100%; }
  .spaces .wp-block-cover { aspect-ratio: 4 / 3; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Exposicions: tabs over the dates */
.mab-exhibitions h1, .mab-news-archive h1 { margin: 0 0 24px; }
.mab-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.mab-tabs a { padding: 10px 18px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--ink); font-weight: 600; text-decoration: none; }
.mab-tabs a:hover { border-color: var(--red); color: var(--red); }
.mab-tabs a[aria-current] { background: var(--red); border-color: var(--red); color: #fff; }
.mab-exhibitions .cards, .mab-news-archive .cards { row-gap: 48px; }
.mab-empty { color: var(--ink-2); }
.mab-pager { display: flex; justify-content: space-between; align-items: center; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); font-weight: 600; }
.mab-pager a { text-decoration: none; }

/* One exhibition */
.mab-exhibition-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; margin-bottom: 56px; }
.mab-exhibition-header img { width: 100%; height: auto; max-height: 720px; object-fit: contain; object-position: left center; display: block; }
.mab-exhibition-header h1 { font-size: clamp(36px, 4.5vw, 60px); margin: 0 0 28px; }
.facts { margin: 0; border-top: 2px solid var(--ink); }
.facts div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.facts dd { margin: 0; font-weight: 500; }
.exhibition .wp-block-post-content { font-size: 18px; }

/* Visita: one page, sections with an in-page menu */
.mab-hours-full { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.mab-hours-full .season { padding: 24px; background: var(--bg-2); }
.mab-hours-full .season.is-now { background: #fff; outline: 2px solid var(--red); }
.mab-hours-full h3 { margin: 0; font-size: 26px; }
.mab-hours-full .badge { vertical-align: 4px; }
.mab-hours-full .months { color: var(--ink-3); margin: 2px 0 12px; font-size: 15px; }
.mab-hours-full .closed { grid-column: 1 / -1; }
.mab-hours-full .closed h3 { font: 600 15px var(--wp--preset--font-family--hanken); text-transform: uppercase; letter-spacing: 0.08em; color: var(--red); margin-bottom: 6px; }
.mab-hours-full .closed p { margin: 0 0 6px; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; padding: 0; list-style: none; }
.jump a { display: block; padding: 8px 16px; border-radius: 999px; background: var(--bg-2); color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; }
.jump a:hover { background: var(--red-soft); color: var(--red); }
.visit-sec { padding-top: 56px; scroll-margin-top: 110px; }
.visit-sec > h2 { margin-bottom: 20px; }
.visit-sec h3 { font-size: 24px; margin: 28px 0 8px; }
.price-list { margin: 0; }
.price-list div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.price-list dd { margin: 0; font-weight: 600; }
.contact-box { padding: 24px; border-left: 4px solid var(--red); background: var(--red-soft); }

@media (max-width: 1080px) {
  .mab-hours-full { grid-template-columns: 1fr 1fr; }
  .mab-exhibition-header { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .mab-hours-full { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 96px 1fr; }
  /* Filter pills on phones (29 Oct 2026): all visible, equal widths; one row for two or three, a 2 x 2 grid for four. */
  .mab-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 28px; }
  .mab-tabs:has(> :nth-child(4)) { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mab-tabs a { padding: 9px 10px; font-size: 15px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Price tables: light rules, amounts on the right */
.price-table table { border-collapse: collapse; width: 100%; }
.price-table td { border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; }
.price-table tr:first-child td { border-top: 2px solid var(--ink); }
.price-table td:last-child { font-weight: 600; text-align: right; white-space: nowrap; }
.mab-hours-full dd { white-space: nowrap; }

/* "Ara al museu" as one row: three cards in view, the rest a swipe or an arrow away */
.cards.row { display: flex; gap: 32px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.cards.row::-webkit-scrollbar { display: none; }
.cards.row > .card { flex: 0 0 calc((100% - 64px) / 3); scroll-snap-align: start; }
.head-end { display: flex; align-items: center; gap: 20px; }
.row-arrows { display: flex; gap: 8px; }
.row-arrows[hidden] { display: none; }
.row-arrows button { width: 44px; height: 44px; border: 1.5px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); font-size: 18px; cursor: pointer; }
.row-arrows button:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.row-arrows button:disabled { opacity: 0.35; cursor: default; }
/* Pictures always fill their frame, whatever their own proportions */
.card-img { position: relative; }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; }
@media (max-width: 1080px) { .cards.row > .card { flex-basis: calc((100% - 32px) / 2); } }
@media (max-width: 640px) { .cards.row { gap: 16px; } .cards.row > .card { flex-basis: 78%; } .row-arrows { display: none; } }

/* "Ara al museu" with one or two exhibitions (classes n-1 / n-2 from the block): a wide feature, or two cards with the
   picture beside the text, so the row never looks half empty. Phones keep the normal cards. */
.card-excerpt { display: none; margin: 14px 0 0; color: var(--ink-2); font-size: 16px; line-height: 1.55; }
.cards.row.n-1 > .card { flex-basis: 100%; }
@media (min-width: 641px) {
  .cards.row.n-1 .card a { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
  .cards.row.n-1 .card-img { margin: 0; }
  .cards.row.n-1 h3 { font-size: clamp(32px, 3.6vw, 46px); margin-bottom: 12px; }
  .cards.row.n-1 .dates { font-size: 17px; }
  .cards.row.n-1 .card-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; max-width: 34em; font-size: 18px; }
}
@media (min-width: 1081px) {
  .cards.row.n-2 > .card { flex-basis: calc((100% - 32px) / 2); }
  .cards.row.n-2 .card a { display: grid; grid-template-columns: minmax(0, 9fr) minmax(0, 11fr); gap: 28px; align-items: center; }
  .cards.row.n-2 .card-img { margin: 0; }
  .cards.row.n-2 .card-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
}

/* Agenda page */
.mab-activities h1 { margin: 0 0 24px; }
.when i { font-style: normal; font-size: 13px; color: var(--ink-3); margin-top: 4px; }

/* Lightbox for photos in page and post text (assets/js/lightbox.js) */
.lb-open { overflow: hidden; }
.mab-lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 56px 72px; background: #0e0e0e; }
.mab-lightbox[hidden] { display: none; }
/* Logged in: start below the WordPress admin bar (32 px, 46 px on small screens), which sits above everything. */
.admin-bar .mab-lightbox { top: 32px; }
@media (max-width: 782px) { .admin-bar .mab-lightbox { top: 46px; } }
.mab-lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 100%; max-height: 100%; }
.mab-lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 160px); object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.mab-lightbox figcaption { margin-top: 14px; max-width: 60em; color: rgba(255, 255, 255, 0.85); font-size: 15px; line-height: 1.45; text-align: center; }
.mab-lightbox button { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #fff; font: 22px/1 var(--wp--preset--font-family--hanken); cursor: pointer; padding: 0; }
.mab-lightbox button svg { display: block; }
.mab-lightbox button:hover, .mab-lightbox button:focus-visible { background: var(--red); }
.mab-lightbox button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mab-lightbox button[hidden] { display: none; }
.mab-lightbox .lb-close { top: 24px; right: 24px; }
.mab-lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.mab-lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.mab-lightbox .lb-count { position: absolute; top: 38px; left: 28px; margin: 0; color: rgba(255, 255, 255, 0.7); font-size: 14px; }
@media (max-width: 640px) {
  .mab-lightbox { padding: 64px 12px 72px; }
  .mab-lightbox .lb-prev, .mab-lightbox .lb-next { top: auto; bottom: 16px; transform: none; }
  .mab-lightbox .lb-prev { left: calc(50% - 60px); }
  .mab-lightbox .lb-next { right: calc(50% - 60px); }
}

/* Page titles on phones: a step above section headings like "Ara al museu" (33 px), not the hero size (the home hero keeps its own). */
@media (max-width: 640px) {
  h1:not(.mab-hero h1), main.page h1.wp-block-post-title { font-size: 38px; line-height: 1.1; }
}

/* Subtle reveals on load and scroll (assets/js/site.js). Only with html.anim, which is set when motion is allowed. */
.anim :is(.mab-hero-text, .mab-hero-img, .block-head, .sec-title, .cards > .card, .soon, .agenda > li, .spaces > *, .visit .wp-block-column, .artist .wp-block-column, .newsletter, .visit-sec, .news-hero, .mab-exhibition-header, .product-card, main.page > h1.wp-block-post-title) {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay, 0ms), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay, 0ms);
}
.anim :is(.mab-hero-text, .mab-hero-img, .block-head, .sec-title, .cards > .card, .soon, .agenda > li, .spaces > *, .visit .wp-block-column, .artist .wp-block-column, .newsletter, .visit-sec, .news-hero, .mab-exhibition-header, .product-card, main.page > h1.wp-block-post-title).in { opacity: 1; transform: none; }
/* The hero picture settles from a slight zoom instead of rising. */
.anim .mab-hero-img { transform: none; overflow: hidden; }
.anim .mab-hero-img img { transform: scale(1.04); transition: transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.anim .mab-hero-img.in img { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .anim * { transition: none !important; }
}

