:root {
  --cream: #f3ecde;
  --ivory: #fbf8f1;
  --ink: #251d17;
  --muted: #5d5145;
  --gold: #a9822f;
  --gold-light: #cbb47c;
  --brown: #2b2119;
  --font-display: 'Cormorant Garamond', 'EB Garamond', Garamond, Georgia, serif;
  --font-body: 'EB Garamond', Garamond, Georgia, serif;
  --font-label: 'Barlow Condensed', Arial, sans-serif;
  --max: 1360px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.gallery-page { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
.gallery-page img { display: block; max-width: 100%; }
.gallery-page a { color: inherit; text-decoration: none; }
.gallery-page :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Header — follows the approved final Gallery design rather than the reverted dark gallery chrome. */
.gallery-header { background: rgba(251,248,241,.98); border-bottom: 1px solid rgba(65,47,33,.12); position: relative; z-index: 50; }
.gallery-header__inner { width: min(100% - 42px, 1500px); margin: 0 auto; min-height: 104px; display: flex; align-items: center; gap: 26px; }
.gallery-brand { display: flex; align-items: center; gap: 15px; flex: 0 0 auto; }
.gallery-brand__seal { width: 76px; height: 76px; object-fit: contain; }
.gallery-brand__text { display: flex; flex-direction: column; line-height: .9; }
.gallery-brand__name { font-family: var(--font-display); text-transform: uppercase; font-size: 2.05rem; font-weight: 600; letter-spacing: .08em; }
.gallery-brand__tagline { font-family: var(--font-label); text-transform: uppercase; font-size: .7rem; letter-spacing: .28em; margin-top: 8px; }
.gallery-header__nav { margin-left: auto; }
.gallery-header__nav ul { list-style: none; display: flex; align-items: center; gap: 22px; margin: 0; padding: 0; }
.gallery-header__nav a { font-family: var(--font-label); text-transform: uppercase; font-size: .78rem; letter-spacing: .07em; white-space: nowrap; padding: 8px 0 7px; border-bottom: 1px solid transparent; }
.gallery-header__nav a:hover, .gallery-header__nav .is-active a { color: var(--gold); border-bottom-color: var(--gold); }
.gallery-header__cta { flex: 0 0 auto; font-family: var(--font-label); text-transform: uppercase; letter-spacing: .07em; font-size: .8rem; color: var(--gold); border: 1px solid var(--gold); padding: 13px 16px; }
.gallery-header__menu-toggle { display: none; margin-left: auto; width: 44px; height: 40px; border: 1px solid var(--ink); background: transparent; padding: 0; align-items: center; justify-content: center; flex-direction: column; gap: 5px; }
.gallery-header__menu-toggle span { width: 20px; height: 1.5px; background: var(--ink); }
.gallery-header__mobile-nav { display: none; border-top: 1px solid rgba(65,47,33,.12); background: var(--ivory); }
.gallery-header__mobile-nav.is-open { display: block; }
.gallery-header__mobile-nav ul { list-style: none; margin: 0; padding: 10px 24px 24px; }
.gallery-header__mobile-nav a { display: block; padding: 11px 0; border-bottom: 1px solid rgba(65,47,33,.08); font-family: var(--font-label); text-transform: uppercase; letter-spacing: .07em; font-size: .9rem; }
.gallery-header__mobile-nav .is-active a { color: var(--gold); }

/* Hero */
.gallery-hero { min-height: 405px; position: relative; overflow: hidden; background: var(--ivory); display: grid; place-items: center; }
.gallery-hero__art { position: absolute; inset: 0 auto 0 0; width: 48%; background: url('../images/gallery-landing/hero-pastiche.jpg') left center / cover no-repeat; opacity: .98; }
.gallery-hero__art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 0 55%, rgba(251,248,241,.22) 68%, var(--ivory) 100%); }
.gallery-hero__copy { position: relative; z-index: 2; text-align: center; max-width: 700px; margin-left: 25%; padding: 48px 20px 36px; }
.gallery-hero h1 { margin: 0; font-family: var(--font-display); font-size: clamp(3.8rem, 6vw, 5.5rem); font-weight: 500; line-height: .95; }
.gallery-hero__lead { margin: 20px auto 0; font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.35; color: #8b6527; }
.gold-rule { width: 144px; height: 18px; display: block; position: relative; margin: 18px auto 0; color: var(--gold); }
.gold-rule::before, .gold-rule::after { content: ''; position: absolute; top: 8px; width: 56px; height: 1px; background: currentColor; opacity: .75; }
.gold-rule::before { left: 0; } .gold-rule::after { right: 0; }
.gold-rule span { position: absolute; left: 50%; top: 3px; width: 10px; height: 10px; border: 1px solid currentColor; transform: translateX(-50%) rotate(45deg); }
.gold-rule span::after { content: ''; position: absolute; width: 3px; height: 3px; border-radius: 50%; background: currentColor; left: 2.5px; top: 2.5px; }

/* Approved six-card category layout */
.gallery-categories { padding: 10px 34px 24px; background: var(--ivory); }
.gallery-categories__grid { max-width: 1360px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px 10px; }
.gallery-card { background: var(--brown); color: #f7f1e7; min-width: 0; }
.gallery-card__media { aspect-ratio: 1.34 / 1; overflow: hidden; background: #c7b79f; }
.gallery-card__media img { width: 100%; height: 100%; object-fit: cover; }
.gallery-card__body { text-align: center; background: linear-gradient(rgba(35,27,20,.96), rgba(30,22,16,.98)); min-height: 178px; padding: 10px 16px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gallery-card h2 { margin: 0 0 3px; font-family: var(--font-display); font-size: 2rem; font-weight: 500; line-height: 1; }
.gallery-card p { margin: 3px 0 14px; font-size: 1.08rem; line-height: 1.18; }
.gallery-card__button { display: inline-flex; align-items: center; justify-content: center; min-width: 150px; min-height: 38px; border: 1px solid var(--gold); color: #dfc37e; font-family: var(--font-label); font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; padding: 8px 14px; transition: background .2s ease, color .2s ease; }
.gallery-card__button:hover { background: var(--gold); color: #fff; }

/* Collections — only displayed when selected; default page remains the approved landing composition. */
.gallery-collection { display: none; background: #efe6d6; border-top: 1px solid #d8c7a4; border-bottom: 1px solid #d8c7a4; padding: 42px 28px 54px; scroll-margin-top: 110px; }
.gallery-collection:target { display: block; }
.gallery-collection__inner { max-width: 1240px; margin: 0 auto; }
.gallery-collection__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.gallery-collection__heading h2 { margin: 0; font-family: var(--font-display); font-size: 3rem; font-weight: 500; }
.gallery-collection__heading a { font-family: var(--font-label); color: var(--gold); text-transform: uppercase; letter-spacing: .07em; font-size: .85rem; border-bottom: 1px solid var(--gold); }
.gallery-collection__grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; align-items: stretch; }
.gallery-collection__grid img { width: 100%; height: 360px; object-fit: cover; background: #ddd0bb; }
.gallery-collection--children {
  padding-left: 14px;
  padding-right: 14px;
}
.gallery-collection--children .gallery-collection__inner {
  max-width: none;
  width: 100%;
}
.gallery-collection__grid--children {
  grid-template-columns: 1.05fr .73fr .68fr 2.05fr;
  gap: 14px;
  align-items: start;
}
.gallery-collection__grid--children img {
  height: clamp(300px, 24.5vw, 500px);
  object-fit: cover;
}
/* The first three cells are deliberately narrower than their source aspect ratios,
   so the crop comes off the left/right edges while preserving the full vertical composition. */
.gallery-collection__grid--children img:nth-child(1) { object-position: 58% center; }
.gallery-collection__grid--children img:nth-child(2) { object-position: 51% center; }
.gallery-collection__grid--children img:nth-child(3) { object-position: 52% center; }
/* The girl-and-dog painting gets a near-native landscape aspect ratio so almost the entire dog is visible. */
.gallery-collection__grid--children img:nth-child(4) { object-position: 54% center; }
.gallery-collection__grid--single { grid-template-columns: minmax(260px, 480px); justify-content: center; }
.gallery-collection__grid--single img { height: auto; max-height: 520px; object-fit: contain; }
.gallery-collection__grid--stories { align-items: start; }
.gallery-story-card { display: flex; flex-direction: column; gap: 14px; }
.gallery-story-card img { display: block; }
.gallery-story-card__meta { display: flex; justify-content: center; }
.gallery-story-card__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #8c8467;
  color: #5e5642;
  background: #f7f1e6;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .78rem;
  font-family: var(--font-label);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.gallery-story-card__button:hover,
.gallery-story-card__button:focus-visible {
  background: #8c8467;
  color: #fffaf1;
  border-color: #8c8467;
}

.gallery-quote { max-width: 1360px; margin: 10px auto 0; min-height: 190px; border: 1px solid #d9c9a8; padding: 25px 90px 20px; display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; text-align: center; position: relative; background: rgba(255,255,255,.18); }
.gallery-quote__mark { color: var(--gold); font-family: Georgia, serif; font-size: 5rem; line-height: .8; }
.gallery-quote p { margin: 0; font-size: 1.7rem; line-height: 1.25; }
.gallery-quote p em { font-size: 1.5rem; }
.gallery-quote .gold-rule { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); }
.gold-rule--small { width: 116px; }
.gold-rule--small::before, .gold-rule--small::after { width: 43px; }

.gallery-cta { margin-top: 12px; min-height: 285px; display: grid; grid-template-columns: 45% 55%; background: var(--ivory); overflow: hidden; border-top: 1px solid rgba(65,47,33,.08); }
.gallery-cta__art { background: url('../images/gallery-landing/cta-still-life.jpg') center / cover no-repeat; position: relative; }
.gallery-cta__art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 55%, rgba(251,248,241,.1) 75%, rgba(251,248,241,.86) 100%); }
.gallery-cta__copy { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 42px 60px; }
.gallery-cta h2 { margin: 0; font-family: var(--font-display); font-size: clamp(2.1rem,3.2vw,3.1rem); font-weight: 500; line-height: 1.05; }
.gallery-cta p { font-size: 1.23rem; line-height: 1.35; margin: 15px 0 20px; }
.gold-rule--left { margin: 14px 0 0; width: 116px; }
.gold-rule--left::before, .gold-rule--left::after { width: 43px; }
.gallery-cta__button { border: 1px solid var(--gold); color: var(--gold); font-family: var(--font-label); text-transform: uppercase; letter-spacing: .07em; font-size: .9rem; padding: 12px 18px; }
.gallery-cta__button:hover { background: var(--gold); color: #fff; }

.gallery-footer { background: #f8f3e9; border-top: 1px solid #d9c9a8; color: #3f3328; }
.gallery-footer__inner { max-width: 1360px; margin: 0 auto; padding: 34px 40px 26px; display: grid; grid-template-columns: 1.45fr 1fr .8fr 1.3fr; gap: 50px; }
.gallery-footer__brandline { display: flex; align-items: center; gap: 14px; }
.gallery-footer__brandline img { width: 68px; height: 68px; }
.gallery-footer__brandline div { display: flex; flex-direction: column; }
.gallery-footer__brandline strong { font-family: var(--font-display); font-size: 2rem; text-transform: uppercase; letter-spacing: .06em; line-height: .9; }
.gallery-footer__brandline span { font-family: var(--font-label); text-transform: uppercase; letter-spacing: .2em; font-size: .68rem; margin-top: 6px; }
.gallery-footer__brand p, .gallery-footer__studio p { color: #8b6527; font-style: italic; line-height: 1.35; }
.gallery-footer__links { display: flex; flex-direction: column; gap: 4px; font-size: .98rem; }
.gallery-footer__links strong, .gallery-footer__studio strong { font-family: var(--font-label); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 5px; }
.gallery-footer__links a:hover { color: var(--gold); }
.gallery-footer__bottom { border-top: 1px solid #dfd2ba; text-align: center; padding: 12px 20px 18px; font-size: .86rem; color: #6b5a49; }

@media (max-width: 1900px) {
  .gallery-header__nav, .gallery-header__cta { display: none; }
  .gallery-header__menu-toggle { display: flex; }
}

@media (max-width: 980px) {
  .gallery-hero { min-height: 360px; }
  .gallery-hero__art { width: 58%; opacity: .72; }
  .gallery-hero__copy { margin-left: 15%; }
  .gallery-categories__grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .gallery-collection__grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .gallery-collection--children { padding-left: 18px; padding-right: 18px; }
  .gallery-collection__grid--children { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .gallery-collection__grid--children img { height: 420px; }
  .gallery-quote { grid-template-columns: 50px 1fr 50px; padding-left: 35px; padding-right: 35px; }
  .gallery-cta { grid-template-columns: 42% 58%; }
  .gallery-cta__copy { padding: 36px; }
  .gallery-footer__inner { grid-template-columns: repeat(2, 1fr); gap: 30px 50px; }
}

@media (max-width: 640px) {
  .gallery-header__inner { width: calc(100% - 26px); min-height: 78px; gap: 10px; }
  .gallery-brand__seal { width: 50px; height: 50px; }
  .gallery-brand__name { font-size: 1.45rem; }
  .gallery-brand__tagline { font-size: .55rem; letter-spacing: .2em; margin-top: 5px; }
  .gallery-hero { min-height: 350px; align-items: end; }
  .gallery-hero__art { width: 100%; height: 56%; top: 0; bottom: auto; background-position: left center; }
  .gallery-hero__art::after { background: linear-gradient(180deg, rgba(251,248,241,.02), rgba(251,248,241,.12) 55%, var(--ivory) 100%); }
  .gallery-hero__copy { margin-left: 0; padding: 155px 18px 28px; }
  .gallery-hero h1 { font-size: 3.6rem; }
  .gallery-hero__lead { font-size: 1.08rem; }
  .gallery-categories { padding: 6px 14px 20px; }
  .gallery-categories__grid { grid-template-columns: 1fr; gap: 12px; }
  .gallery-card__media { aspect-ratio: 1.55/1; }
  .gallery-card__body { min-height: 145px; }
  .gallery-card h2 { font-size: 1.85rem; }
  .gallery-card p { font-size: 1rem; }
  .gallery-collection { padding: 32px 14px 40px; scroll-margin-top: 82px; }
  .gallery-collection__heading { align-items: center; }
  .gallery-collection__heading h2 { font-size: 2.35rem; }
  .gallery-collection__grid { grid-template-columns: 1fr; }
  .gallery-collection--children { padding-left: 14px; padding-right: 14px; }
  .gallery-collection__grid--children { grid-template-columns: 1fr; }
  .gallery-collection__grid img { height: auto; max-height: 540px; object-fit: contain; }
  .gallery-collection__grid--children img { height: auto; max-height: none; object-fit: contain; }
  .gallery-quote { margin: 8px 14px 0; min-height: 210px; grid-template-columns: 30px 1fr 30px; padding: 24px 18px 32px; }
  .gallery-quote__mark { font-size: 3.2rem; }
  .gallery-quote p { font-size: 1.3rem; }
  .gallery-quote p em { font-size: 1.18rem; }
  .gallery-cta { grid-template-columns: 1fr; }
  .gallery-cta__art { min-height: 185px; }
  .gallery-cta__art::after { background: linear-gradient(180deg, transparent 60%, var(--ivory) 100%); }
  .gallery-cta__copy { padding: 26px 22px 34px; align-items: center; text-align: center; }
  .gallery-cta__copy .gold-rule { margin-left: auto; margin-right: auto; }
  .gallery-cta p br { display: none; }
  .gallery-footer__inner { grid-template-columns: 1fr; padding: 30px 22px; gap: 24px; }
}

@media (max-width: 380px) {
  .gallery-brand__seal { width: 44px; height: 44px; }
  .gallery-brand__name { font-size: 1.25rem; }
}


/* Full-painting lightbox — opens the uncropped gallery source, not the cropped tile. */
.gallery-collection img[role="button"] { cursor: zoom-in; }
body.gallery-lightbox-open { overflow: hidden; }
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 42px 64px;
  background: rgba(18, 14, 10, .94);
}
.gallery-lightbox.is-open { display: flex; }
.gallery-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 94vw;
  max-height: 90vh;
  object-fit: contain;
  background: #efe6d6;
  box-shadow: 0 18px 60px rgba(0,0,0,.48);
}
.gallery-lightbox__close {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 10001;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 50%;
  background: rgba(25,19,14,.72);
  color: #fffaf1;
  font: 300 38px/42px Georgia, serif;
  text-align: center;
  cursor: pointer;
}
.gallery-lightbox__close:hover,
.gallery-lightbox__close:focus-visible {
  background: #fffaf1;
  color: #2a2018;
  outline: none;
}
.gallery-lightbox__hint {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  color: rgba(255,250,241,.72);
  font-family: var(--font-label);
  font-size: .7rem;
  letter-spacing: .16em;
}
@media (max-width: 700px) {
  .gallery-lightbox { padding: 58px 14px 42px; }
  .gallery-lightbox__image { max-width: 96vw; max-height: 82vh; }
  .gallery-lightbox__close { top: 10px; right: 10px; }
}
