/* Design system of the marsa-encheres.com rewrite (app/src/styles/common.js and component styles),
   with the gallery's palette: brown replaces navy, the old site's gold, same red accent. */
@font-face { font-family: 'Work Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/worksans-400.woff2') format('woff2'); }
@font-face { font-family: 'Work Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/worksans-600.woff2') format('woff2'); }
@font-face { font-family: 'Work Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/worksans-700.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --color-fg: #3d1f12;
  --color-fg-muted: #7a6359;
  --color-bg: #ffffff;
  --color-surface: #f4f0eb;
  --color-accent: #bd0926;
  --color-accent-dark: #97071e;
  --color-accent-contrast: #ffffff;
  --color-gold: #c99a3b;
  --color-line: #e8e1da;
  --radius: 5px;
  --shadow-sm: 0 1px 3px rgba(61,31,18,.10), 0 1px 2px rgba(61,31,18,.06);
  --shadow-md: 0 8px 24px rgba(61,31,18,.12), 0 2px 6px rgba(61,31,18,.08);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 48px;
  --font-sans: 'Work Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: var(--font-sans); line-height: 1.5; background: var(--color-bg); color: var(--color-fg); }
#outlet { flex: 1 0 auto; }
img { max-width: 100%; }
h1, h2, h3 { font-weight: 700; line-height: 1.25; }
a { color: var(--color-accent); }
.muted { color: var(--color-fg-muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78em; font-weight: 600; color: var(--color-gold); margin: 0; }
.text-center { text-align: center; }

/* buttons */
button, .btn { font-family: inherit; cursor: pointer; border-radius: var(--radius); padding: var(--space-2) var(--space-4); border: 1px solid var(--color-accent); background: var(--color-accent); color: var(--color-accent-contrast); text-transform: uppercase; font-size: .85em; letter-spacing: .04em; font-weight: 600; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); }
.btn.secondary { background: transparent; color: var(--color-accent); text-transform: none; letter-spacing: normal; font-weight: 500; }
.btn.secondary:hover { background: var(--color-accent); color: #fff; }

/* ---------- header (siteHeader.js) ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--color-bg); transition: box-shadow .2s ease; }
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.top-bar { background: var(--color-fg); color: #fff; }
.top-bar .row { display: flex; justify-content: flex-end; align-items: center; padding: 3px var(--space-5); gap: var(--space-3); }
.top-bar a, .top-bar span { color: inherit; text-decoration: none; font-size: .75rem; font-weight: 600; letter-spacing: .02em; }
.top-bar a:hover { color: var(--color-gold); }
.top-bar .links { display: flex; align-items: center; gap: var(--space-2); }
.top-bar .sep { opacity: .4; }
.masthead { display: flex; justify-content: space-between; align-items: center; padding: var(--space-3) var(--space-5); gap: var(--space-3); }
img.logo { height: 48px; width: auto; display: block; }
nav.primary ul { display: flex; gap: var(--space-4); flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; }
.top-link { color: var(--color-fg); text-decoration: none; font-size: .82em; font-weight: 600; letter-spacing: .03em; padding-bottom: 2px; border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 4px; }
.top-link:hover { color: var(--color-accent); }
.top-link[aria-current="true"] { border-bottom-color: var(--color-gold); }
.caret { font-size: .7em; opacity: .6; }
.dropdown { display: none; position: absolute; top: 100%; left: 0; background: var(--color-bg); border: 1px solid var(--color-line); border-radius: var(--radius); min-width: 240px; padding: var(--space-2) 0; box-shadow: var(--shadow-md); z-index: 20; }
.nav-item:hover .dropdown, .nav-item:focus-within .dropdown { display: block; }
.dropdown a { display: block; padding: var(--space-2) var(--space-3); color: var(--color-fg); text-decoration: none; font-size: .9em; }
.dropdown a:hover { background: var(--color-surface); }
.site-header hr { border: none; border-bottom: 1px solid var(--color-line); margin: 0; }
.menu-toggle { display: none; position: relative; width: 40px; height: 40px; padding: 0; background: none; border: 1px solid var(--color-line); border-radius: var(--radius); flex: none; }
.menu-toggle .bar { position: absolute; left: 10px; right: 10px; height: 2px; border-radius: 1px; background: var(--color-fg); transition: transform .2s ease, opacity .15s ease, top .2s ease; }
.menu-toggle .bar:nth-child(1) { top: 13px; }
.menu-toggle .bar:nth-child(2) { top: 19px; }
.menu-toggle .bar:nth-child(3) { top: 25px; }
.menu-toggle[aria-expanded="true"] .bar:nth-child(1) { top: 19px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .bar:nth-child(3) { top: 19px; transform: rotate(-45deg); }
@media (max-width: 860px) {
  .top-bar .row, .masthead { padding-inline: var(--space-4); }
  .masthead { flex-wrap: wrap; }
  .menu-toggle { display: block; }
  nav.primary { display: none; order: 3; width: 100%; }
  .site-header.open nav.primary { display: block; }
  nav.primary ul { flex-direction: column; gap: 0; }
  .nav-item { border-bottom: 1px solid var(--color-line); }
  .top-link { display: flex; padding: var(--space-3) 0; font-size: .92em; border: 0; }
  .top-link .caret { display: none; }
  .dropdown { display: block; position: static; border: 0; box-shadow: none; border-radius: 0; background: var(--color-surface); padding: 0; min-width: 0; }
  .dropdown a { padding-left: var(--space-4); font-size: .85em; }
}

/* ---------- page shell + header bar (pageHeader.render.js) ---------- */
.page { padding: var(--space-4) var(--space-5); max-width: 1600px; margin: 0 auto; width: 100%; }
@media (max-width: 720px) { .page { padding: var(--space-3); } }
.page-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-2); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); background: var(--color-surface); border-radius: var(--radius); }
.page-header h1 { margin: 0; font-size: 1.6em; }
.breadcrumb { font-size: .85em; color: var(--color-fg-muted); }
.breadcrumb .here { text-transform: uppercase; letter-spacing: .03em; font-size: .9em; margin-right: var(--space-1); }
.breadcrumb a { color: var(--color-fg-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-accent); text-decoration: underline; }
.breadcrumb .sep { margin-inline: 4px; opacity: .5; }
.breadcrumb .current { color: var(--color-fg); font-weight: 600; }
.body-content { padding-inline: var(--space-4); }
.static-content { margin-bottom: var(--space-4); line-height: 1.6; }

/* ---------- cards (common.js .grid / .card / .artwork-card) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 300px)); justify-content: center; gap: var(--space-4); }
@media (max-width: 640px) { .grid { grid-template-columns: minmax(200px, 300px); } }
.card { display: block; color: inherit; text-decoration: none; border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, transform .15s ease; overflow: hidden; background: var(--color-bg); }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.artwork-card { display: flex; flex-direction: column; }
.artwork-card .media { display: block; aspect-ratio: 1; flex-shrink: 0; background: var(--color-surface); }
.artwork-card .media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.artwork-card .body-link { display: block; color: inherit; text-decoration: none; flex: 1; }
.artwork-card .body { padding: var(--space-3) var(--space-3) 0; }
.artwork-card .artist { font-weight: 700; font-size: 1em; margin: 0; }
.artwork-card .title { font-weight: 400; font-size: .9em; margin: 2px 0 0; }
.artwork-card .dims { font-size: .8em; margin: 2px 0 0; }
.artwork-card .cta { display: block; margin-top: var(--space-3); padding-block: var(--space-2); background: var(--color-accent); color: var(--color-accent-contrast); text-align: center; text-transform: uppercase; font-size: .85em; line-height: 1.3; letter-spacing: .04em; font-weight: 600; text-decoration: none; transition: background .15s ease; }
.artwork-card:hover .cta { background: var(--color-accent-dark); }

/* ---------- list rows (artistList.js / eventList.js) ---------- */
.list { display: flex; flex-direction: column; gap: var(--space-4); }
.row-card { display: grid; grid-template-columns: 240px 1fr; gap: var(--space-4); text-decoration: none; color: inherit; background: var(--color-bg); border-radius: var(--radius); padding: var(--space-3); box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, transform .15s ease; }
.row-card.artist-row { grid-template-columns: 160px 1fr; }
.row-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.row-media { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--color-surface); }
.row-media.square { aspect-ratio: 1; }
.row-media.wide { aspect-ratio: 16 / 10; }
.row-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-card h2 { margin: 0 0 var(--space-1); font-size: 1.15em; }
.row-card p { margin: 0; font-size: .9em; }
.status { display: inline-block; margin-top: var(--space-2); font-size: .78em; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; padding: 2px 10px; border-radius: 99px; }
.status.live { background: var(--color-accent); color: #fff; }
.status.gold { background: var(--color-gold); color: var(--color-fg); }
.status.ended { background: var(--color-surface); color: var(--color-fg-muted); }
.cta-link { display: block; margin-top: var(--space-2); color: var(--color-accent); font-size: .85em; font-weight: 600; }
@media (max-width: 720px) { .row-card, .row-card.artist-row { grid-template-columns: 1fr; } }

/* ---------- artist detail ---------- */
.artist-header { display: flex; gap: var(--space-4); align-items: center; margin-bottom: var(--space-4); padding-inline: var(--space-4); }
.artist-header img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; background: var(--color-surface); flex: none; }
.artist-header h2 { margin: var(--space-1) 0; }
.artist-header p { margin: 0; }
.bio { margin-bottom: var(--space-4); line-height: 1.6; white-space: pre-line; }

/* ---------- artwork detail (artworkDetail.js) ---------- */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: start; }
.gallery-slot { position: sticky; top: 140px; }
.detail h1 { margin: var(--space-1) 0 var(--space-3); }
.artist-link { color: inherit; text-decoration: none; }
.artist-link:hover { text-decoration: underline; }
.specs { list-style: none; padding: 0; margin: var(--space-3) 0; display: flex; flex-direction: column; gap: var(--space-2); }
.specs strong { font-weight: 600; }
.bio-section { margin-top: var(--space-4); border-top: 1px solid var(--color-line); padding-top: var(--space-3); }
.bio-section summary { cursor: pointer; font-weight: 700; font-size: 1.1em; }
.bio-section .static-content { margin-top: var(--space-2); white-space: pre-line; }
.visibility-section { margin-top: var(--space-4); border-top: 1px solid var(--color-line); padding-top: var(--space-3); }
.visibility-section h2 { font-size: 1.1em; margin: 0 0 var(--space-2); }
.visibility-section ul { padding-left: var(--space-4); margin: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.exhibition-link { color: var(--color-accent); text-decoration: underline; font-weight: 600; }
.gallery .hero-btn { display: block; border-radius: var(--radius); overflow: hidden; background: var(--color-surface); cursor: zoom-in; }
.gallery .hero { display: block; width: 100%; max-height: 75vh; object-fit: contain; }
.thumbs { display: flex; gap: var(--space-2); margin-top: var(--space-2); flex-wrap: wrap; }
.thumb { width: 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: var(--radius); background: var(--color-surface); overflow: hidden; }
.thumb[aria-current="true"] { border-color: var(--color-accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related { margin-top: var(--space-5); }
.related h2 { text-align: center; margin-bottom: var(--space-4); }
@media (max-width: 720px) { .detail { grid-template-columns: 1fr; } .gallery-slot { position: static; order: -1; } }

/* ---------- event detail (eventDetail.js) ---------- */
.event-header { display: flex; gap: var(--space-4); align-items: flex-start; padding-inline: var(--space-4); margin-bottom: var(--space-4); }
.event-media { position: relative; flex-shrink: 0; width: 280px; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--radius); background: var(--color-surface); display: block; }
.event-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.header-info { min-width: 0; max-width: 820px; }
.header-info .dates { color: var(--color-fg-muted); margin: var(--space-1) 0 var(--space-3); font-weight: 600; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-2); }
.photo-grid a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--color-surface); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.photo-grid a:hover img { transform: scale(1.04); }
@media (max-width: 720px) { .event-header { flex-direction: column; padding-inline: 0; } .event-media { width: 100%; } .body-content, .artist-header { padding-inline: 0; } }

/* ---------- text pages ---------- */
.prose { max-width: 820px; }
.prose h2 { font-size: 1.25em; margin-top: 1.6em; }
.prose h6 { font-size: .8em; text-transform: uppercase; letter-spacing: .08em; color: var(--color-gold); margin: 1.6em 0 .4em; }
.prose img { display: block; border-radius: var(--radius); margin: var(--space-4) 0; background: var(--color-surface); }
.prose > .eyebrow { margin-bottom: var(--space-3); }
.page-contact ul { list-style: none; padding: 0; margin: 0 0 var(--space-4); }
.page-contact li b { display: block; margin-top: var(--space-3); }
.page-inauguration img { display: inline-block; width: calc(50% - 8px); aspect-ratio: 4 / 3; object-fit: cover; margin: 0 8px 8px 0; vertical-align: top; }

/* ---------- home (homePage.js) ---------- */
.home section { padding: calc(var(--space-5) * 1.4) var(--space-5); }
section.hero-3col, .secondary-hero, .services, .press { padding: calc(var(--space-5) * 1.4) var(--space-5); }
section + section { margin-top: var(--space-2); }
.secondary-hero h2, .services h2, .press h2 { text-align: center; margin: 0 0 var(--space-4); }
section.hero-3col { display: grid; grid-template-columns: 1fr 2fr 1fr; grid-template-areas: "left center right"; gap: var(--space-2); padding: var(--space-2); min-height: 480px; }
.hero-side { grid-area: left; min-height: 280px; }
.hero-side.hero-right { grid-area: right; }
.hero-center { grid-area: center; min-height: 480px; display: flex; }
.hero-center > * { flex: 1; }
.banner-slide { position: relative; display: block; height: 100%; min-height: 280px; background: var(--color-surface); color: #fff; text-decoration: none; overflow: hidden; border-radius: var(--radius); }
.banner-media, .banner-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-slide:hover .banner-media img { transform: scale(1.03); }
.banner-media img { transition: transform .6s ease; }
.banner-slide::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(40,18,8,.78), rgba(40,18,8,.1) 60%); z-index: 1; }
.banner-content { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-4); z-index: 2; }
.banner-content h3 { margin: 0 0 var(--space-1); color: #fff; font-size: 1.3em; }
.hero-center .banner-content h3 { font-size: 2em; }
.banner-content p { margin: 0 0 var(--space-2); font-size: .9em; opacity: .9; }
.cta { display: inline-block; padding: var(--space-1) var(--space-3); border-radius: var(--radius); font-size: .8em; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.cta.cta-gold { background: var(--color-gold); color: var(--color-fg); }
.cta.cta-red { background: var(--color-accent); color: #fff; }
.secondary-hero, .press { background: var(--color-surface); }
.secondary-hero .text-center, .press .text-center { margin-top: var(--space-4); }
.carousel { position: relative; }
.carousel .viewport { position: relative; overflow: hidden; }
.carousel .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.carousel .track::-webkit-scrollbar { display: none; }
.featured-carousel .track > * { flex: 0 0 240px; scroll-snap-align: start; }
.carousel-bar { position: absolute; top: 0; bottom: 0; width: 44px; padding: 0; border: none; border-radius: 0; color: var(--color-fg); font-size: 1.6em; text-transform: none; letter-spacing: normal; font-weight: 400; line-height: 1; z-index: 1; opacity: .85; transition: opacity .15s ease, background .15s ease, color .15s ease; }
.carousel-bar:hover { opacity: 1; color: #fff; }
.carousel-bar.prev { left: 0; background: linear-gradient(to right, rgba(244,240,235,.9), transparent); }
.carousel-bar.next { right: 0; background: linear-gradient(to left, rgba(244,240,235,.9), transparent); }
.carousel-bar.prev:hover { background: linear-gradient(to right, rgba(61,31,18,.45), transparent); }
.carousel-bar.next:hover { background: linear-gradient(to left, rgba(61,31,18,.45), transparent); }
.featured-slide { display: block; text-decoration: none; color: inherit; padding: 0 var(--space-2); }
.featured-slide .image { aspect-ratio: 1; background: var(--color-bg); border-radius: var(--radius); overflow: hidden; margin-bottom: var(--space-2); box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, transform .15s ease; }
.featured-slide:hover .image { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.featured-slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.featured-slide .artist { color: var(--color-fg-muted); font-size: .85em; margin: 0; }
.featured-slide .title { font-weight: 600; margin: 2px 0; }
.featured-slide .description { color: var(--color-fg-muted); font-size: .85em; margin: var(--space-1) 0 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.4; min-height: calc(1.4em * 2); }
.services .cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); max-width: 1100px; margin: 0 auto; }
.services h3 { color: var(--color-accent); }
.services p { line-height: 1.6; }
.press-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.press-item { display: block; text-decoration: none; color: inherit; background: var(--color-bg); padding: var(--space-3); border: 1px solid var(--color-line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, transform .15s ease; }
.press-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.press-item .date { color: var(--color-fg-muted); font-size: .8em; margin: 0 0 var(--space-1); }
.press-item h5 { margin: 0 0 var(--space-1); font-size: 1em; }
.press-item .source { color: var(--color-gold); font-size: .85em; margin: 0; text-transform: uppercase; letter-spacing: .03em; }
@media (max-width: 860px) {
  section.hero-3col { grid-template-columns: 1fr 1fr; grid-template-areas: "center center" "left right"; min-height: 0; }
  .hero-center { min-height: 380px; }
  .secondary-hero, .services, .press { padding: var(--space-5) var(--space-3); }
  .services .cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { section.hero-3col { grid-template-columns: 1fr; grid-template-areas: "center" "left" "right"; } }

/* ---------- lightbox (galleryLightbox.js) ---------- */
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(30,14,7,.94); display: flex; align-items: center; justify-content: center; padding: var(--space-4); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- footer (siteFooter.js) ---------- */
.site-footer { background: var(--color-fg); color: #fff; padding: var(--space-4) var(--space-5) var(--space-3); margin-top: var(--space-5); }
.site-footer .cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); max-width: 1200px; margin: 0 auto; align-items: start; }
.site-footer h3 { font-size: .8em; text-transform: uppercase; letter-spacing: .06em; margin: var(--space-3) 0 var(--space-2); color: var(--color-gold); }
.site-footer a { display: block; color: var(--color-surface); text-decoration: none; margin-bottom: var(--space-1); font-size: .9em; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer p { margin: 0 0 var(--space-2); font-size: .9em; color: var(--color-surface); }
.site-footer p a { display: inline; margin: 0; color: inherit; }
.site-footer .muted { color: #bda99f; }
.site-footer .social { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.site-footer .social a { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.08); margin: 0; }
.site-footer .social a:hover { background: var(--color-gold); color: var(--color-fg); }
.site-footer .partner strong { display: block; font-size: 1.15em; letter-spacing: .04em; text-transform: uppercase; color: #fff; }
.site-footer .partner span { font-size: .85em; color: #bda99f; }
.site-footer .copyright { text-align: center; margin: var(--space-3) 0 0; padding-top: var(--space-2); border-top: 1px solid rgba(244,240,235,.35); font-size: .72em; }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr; } .site-footer { padding: var(--space-4); } }
