/* Shared styles for every page of michelinemorgan.com
   Type system: one quiet sans for everything (headlines kept small so the paintings lead),
   typewriter mono for captions. White ground, wide margins. */
:root {
  --page: #ffffff;
  --ink: #1b1b1d;
  --muted: #5e5f63;
  --line: #e3e2dd;
  --wash: #f1f1ee;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --gutter: 56px;   /* page margin on large screens; steps down on smaller ones */
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 1680px; margin: 0 auto; padding: 0 var(--gutter); }

/* Small uppercase labels, used for the menu, section names and links */
.label, nav a, .dropdown > button, .collection-link {
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.label { color: var(--muted); margin: 0; }

/* Header: logo left, menu right */
header { display: flex; justify-content: space-between; align-items: center; padding: 28px 0 40px; position: relative; z-index: 20; }
.name { margin: 0; font-weight: 400; line-height: 0; }
.name a { text-decoration: none; display: inline-block; }
.logo { display: block; width: 60px; height: auto; }
nav { display: flex; gap: 28px; align-items: center; }
nav a, .dropdown > button {
  font-size: 13px; font-weight: 400; letter-spacing: 0.08em;
  text-decoration: none; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer;
}
nav a:hover, .dropdown > button:hover, nav a:focus-visible, .dropdown > button:focus-visible { text-decoration: underline; text-underline-offset: 5px; }
.dropdown { position: relative; }
.dropdown > button::after { content: " ▾"; font-size: 10px; }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 12px); left: -20px;
  background: var(--page); border: 1px solid var(--line); padding: 8px 0; min-width: 230px;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 10px 20px; white-space: nowrap; }
.dropdown-menu a:hover, .dropdown-menu a[aria-current="page"] { background: var(--wash); text-decoration: none; }

footer {
  display: flex; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line); margin-top: 140px; padding: 20px 0 40px;
  font-size: 13px; color: var(--muted);
}

/* Section header: label on a thin rule */
.bar { display: flex; justify-content: space-between; align-items: baseline;
       border-top: 1px solid var(--line); padding: 14px 0 32px; }

/* Landing: one collection per row, image and text alternating sides */
/* rows sit flush, so the images meet corner to corner in a zigzag */
.collections { display: flex; flex-direction: column; gap: 0; margin: 8px 0 140px; }
.collection {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; align-items: center;
  text-decoration: none; color: inherit; --text-gap: 64px;
}
.collection:nth-child(even) img, .collection:nth-child(even) > .cardshow, .collection:nth-child(even) > .slideshow { order: 2; }
/* text sits the same distance from its image on both rows */
.collection .collection-text { margin-left: var(--text-gap); }
.collection:nth-child(even) .collection-text { justify-self: end; width: 100%; margin: 0 var(--text-gap) 0 0; }
.collection img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: opacity .3s ease; }
.collection:hover img { opacity: 0.92; }
.collection:focus-visible { outline: 1px solid var(--ink); outline-offset: 6px; }
.collection-text { display: flex; flex-direction: column; max-width: 26em; }
/* Figure page header: works fade one into the next on the same light grey as the wall images */
.slideshow { position: relative; aspect-ratio: 4 / 3; background: #f1f1ef; overflow: hidden; }
.slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
         opacity: 0; transition: opacity 1.4s ease; }
.slide.on { opacity: 1; }
.slide img { width: auto; height: auto; aspect-ratio: auto; max-width: 64%; max-height: 76%; }

/* Top of the collection pages: same layout as the landing page's first row, image at its own shape */
.page-intro { margin: 8px 0 96px; }
.page-intro img { aspect-ratio: auto; height: auto; }
.page-intro:hover img { opacity: 1; }
.page-intro .page-title { margin-top: 6px; }
/* Mail for Mi header: three cards in a row on the same grey; one fades to a new card at a time */
.cardshow { aspect-ratio: 4 / 3; background: #f1f1ef; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 4%; padding: 0 5%; align-items: center; }
.slot { position: relative; aspect-ratio: 1; }
.cardshow .slot img { position: absolute; inset: 0; margin: auto; width: auto; height: auto; aspect-ratio: auto;
                      max-width: 100%; max-height: 100%; opacity: 0; transition: opacity 1.2s ease; }
.cardshow .slot img.on { opacity: 1; }
.collection-title { font-weight: 500; font-size: clamp(20px, 1.7vw, 24px); letter-spacing: -0.01em; line-height: 1.25; margin: 6px 0 8px; }
.collection-desc { color: var(--muted); margin: 0 0 18px; }
.collection-link { color: var(--ink); }
.collection-link::after { content: " →"; }
.collection:hover .collection-link { text-decoration: underline; text-underline-offset: 5px; }

/* Paintings grid: 3 across, each at its own shape */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 88px 48px; align-items: start; }
.work { margin: 0; }
.tile { all: unset; cursor: zoom-in; display: block; width: 100%; }
.tile:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.tile img { display: block; width: 100%; height: auto; transition: opacity .3s ease; }
.tile:hover img { opacity: 0.92; }
figcaption { margin-top: 14px; font-family: var(--mono); font-size: 12px; line-height: 1.75; }
figcaption .t { display: block; color: var(--ink); }
figcaption .m { display: block; color: var(--muted); }

/* About: label on the left, statement on the right */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 40px;
         border-top: 1px solid var(--line); margin: 140px 0; padding-top: 14px; }
.statement { font-weight: 400; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; margin: 0; max-width: 36em; }
.enquiries { margin: 28px 0 0; display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.enquiries a { text-underline-offset: 4px; overflow-wrap: anywhere; }

/* Mail for Mi */
.page-title { font-weight: 500; font-size: clamp(22px, 2vw, 26px); letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 10px; }
.page-lede { color: var(--muted); max-width: 32em; margin: 0; }
/* Postcards: 6 across, each at its own shape (edges already cropped in the files) */
.cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 48px 24px; align-items: start; }
.pc { margin: 0; }
.pc figcaption { margin-top: 10px; }
.card { all: unset; cursor: zoom-in; display: block; background: var(--wash); }
.card:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.card img { display: block; width: 100%; height: auto; transition: opacity .3s ease; }
.card:hover img { opacity: 0.92; }

/* Enlarged view (paintings and postcards) */
dialog {
  border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
  background: rgba(255, 255, 255, 0.98); color: var(--ink);
}
dialog::backdrop { background: rgba(255, 255, 255, 0.98); }
.lb { height: 100%; display: grid; grid-template-rows: 1fr auto; padding: 56px 72px 28px; }
.lb-img { display: flex; align-items: center; justify-content: center; min-height: 0; }
.lb-img img { max-width: 100%; max-height: 100%; }
.lb-cap { text-align: center; padding-top: 18px; font-family: var(--mono); font-size: 12px; line-height: 1.75; }
.lb-cap .m { color: var(--muted); }
.lb button {
  position: absolute; background: none; border: 0; cursor: pointer; color: var(--muted); padding: 12px;
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
}
.lb button:hover, .lb button:focus-visible { color: var(--ink); }
.close { top: 12px; right: 16px; }
.prev, .next { top: 50%; transform: translateY(-50%); font-size: 26px !important; letter-spacing: 0 !important; }
.prev { left: 8px; }
.next { right: 8px; }

@media (max-width: 1100px) {
  :root { --gutter: 32px; }
  .grid { gap: 72px 32px; }
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 20px; }
}
@media (max-width: 900px) {
  :root { --gutter: 24px; }
  .grid { gap: 56px 20px; }
  .about { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .collection { --text-gap: 32px; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  header { padding: 20px 0 24px; }
  .logo { width: 46px; }
  nav { gap: 16px; }
  nav a, .dropdown > button { font-size: 12px; }
  .dropdown-menu { left: auto; right: -12px; }
  .collections { gap: 56px; margin: 0 0 72px; }
  .cardshow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8%; padding: 0 10%; }
  .cardshow .slot:nth-child(3) { display: none; }
  .collection, .collection:nth-child(even) { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .collection:nth-child(even) img, .collection:nth-child(even) > .cardshow { order: 0; }
  .collection .collection-text, .collection:nth-child(even) .collection-text { justify-self: start; margin: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 16px; }
  figcaption { font-size: 11px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; }
  .about { margin: 96px 0; }
  footer { margin-top: 96px; flex-direction: column; gap: 4px; }
  .lb { padding: 56px 16px 24px; }
  .prev, .next { top: auto; bottom: 12px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile img, .card img, .collection img { transition: none; }
}
