/* maldonahue.com: white page, black type, handwritten wordmark and nav,
   pictures do the talking. */

@font-face {
  font-family: "Caveat";
  src: url("/static/fonts/Caveat.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --ink: #111;
  --muted: #666;
  --rule: #e6e6e6;
  --paper: #fff;
  --well: #f2f2f2;
  --scrim: rgba(255, 255, 255, 0.96);
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  --sans: system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sidebar: 15rem;
  --gutter: clamp(1rem, 3vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ececec;
    --muted: #9a9a9a;
    --rule: #2a2a2a;
    --paper: #121212;
    --well: #1e1e1e;
    --scrim: rgba(18, 18, 18, 0.96);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -100vw; top: 0.5rem; background: var(--ink); color: var(--paper);
  padding: 0.5rem 1rem; z-index: 100;
}
.skip:focus { left: 0.5rem; }

/* Layout: sidebar on the left, content on the right. */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  padding: var(--gutter);
  display: flex; flex-direction: column; gap: 1.5rem;
  background: var(--paper);
  z-index: 20;
}
.main {
  margin-left: var(--sidebar);
  padding: var(--gutter);
  min-height: 100vh;
}

.wordmark { display: block; width: max-content; }
.logo { display: block; width: 8.8rem; height: 8.8rem; }
.logo svg { display: block; width: 100%; height: 100%; }
.nav { display: flex; flex-direction: column; gap: 0.25rem; }
.nav a {
  font-family: var(--hand);
  font-size: 1.9rem;
  line-height: 1.15;
  text-decoration: none;
  width: max-content;
  position: relative;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.15em; height: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 160ms ease-out;
}
.nav a:hover::after, .nav a:focus-visible::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.menu-toggle { display: none; }

/* Type */
.page-title {
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1;
  margin: 0 0 1.5rem;
}
.group-title, .cv-section h2 {
  font-family: var(--hand);
  font-weight: 500;
  font-size: 2rem;
  margin: 2.5rem 0 1rem;
}
.lede { font-size: 1.1rem; max-width: 42rem; }
.crumbs { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* Home slideshow */
.hero {
  position: relative;
  height: calc(100vh - 2 * var(--gutter));
  min-height: 24rem;
  margin: 0;
}
.hero-track { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 700ms ease;
  display: flex; align-items: center; justify-content: center;
}
.hero-slide.is-active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: contain; }
.hero-caption {
  position: absolute; left: 0; bottom: 0; margin: 0;
  font-family: var(--hand); font-size: 1.4rem; background: var(--paper); padding: 0.25rem 0.75rem;
}
.hero-arrow {
  position: absolute; top: 0; bottom: 0; width: 50%;
  background: none; border: 0; cursor: pointer; opacity: 0; transition: opacity 200ms;
}
.hero-arrow::before {
  content: ""; position: absolute; top: 50%; width: 1rem; height: 1rem;
  border-top: 2px solid var(--ink); border-right: 2px solid var(--ink);
  background: var(--paper); padding: 0.4rem; box-shadow: 0 0 0 0.4rem var(--paper);
}
.hero-prev { left: 0; }
.hero-prev::before { left: 0.75rem; transform: translateY(-50%) rotate(-135deg); }
.hero-next { right: 0; }
.hero-next::before { right: 0.75rem; transform: translateY(-50%) rotate(45deg); }
.hero:hover .hero-arrow, .hero-arrow:focus-visible, .lightbox .hero-arrow { opacity: 1; }
.hero-dots {
  position: absolute; left: 0; right: 0; bottom: 0.25rem;
  display: flex; justify-content: center; gap: 0.5rem; list-style: none; margin: 0; padding: 0;
}
.hero-dots button {
  width: 0.6rem; height: 0.6rem; border-radius: 50%; border: 1px solid var(--ink);
  background: var(--paper); padding: 0; cursor: pointer;
}
.hero-dots button[aria-current="true"] { background: var(--ink); }

/* Collection cards and product cards */
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.5rem;
}
.card a { text-decoration: none; display: block; }
.card img, .card-placeholder {
  aspect-ratio: 4 / 5; width: 100%; object-fit: cover; background: var(--well);
  transition: opacity 200ms;
}
.card a:hover img { opacity: 0.85; }
.card-title { display: block; font-family: var(--hand); font-size: 1.7rem; margin-top: 0.5rem; line-height: 1.1; }
.card-count { display: block; color: var(--muted); font-size: 0.85rem; }

/* Gallery: uncropped images on a grid; landscapes take two cells. */
.gallery {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 2rem 1.5rem;
  align-items: end;
}
.work { margin: 0; }
.work img { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; object-position: bottom; }
@media (min-width: 1000px) {
  .work.landscape { grid-column: span 2; }
  .work.landscape img { aspect-ratio: 8 / 5; }
}
.work-button { display: block; width: 100%; border: 0; padding: 0; background: none; cursor: zoom-in; }
.work-title { margin: 0.4rem 0 0; font-size: 0.9rem; }
.work-detail { color: var(--muted); display: block; font-size: 0.8rem; }

.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: var(--scrim);
  display: flex; align-items: center; justify-content: center;
}
.lightbox-figure { margin: 0; max-width: 92vw; max-height: 94vh; text-align: center; }
.lightbox-figure img { max-height: 88vh; width: auto; margin: 0 auto; object-fit: contain; }
.lightbox-figure figcaption { font-family: var(--hand); font-size: 1.4rem; margin-top: 0.5rem; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1rem; width: 2.5rem; height: 2.5rem;
  border: 0; background: none; cursor: pointer;
  z-index: 1; /* above the full-height arrow strips */
}
.lightbox-close::before, .lightbox-close::after {
  content: ""; position: absolute; top: 50%; left: 20%; width: 60%; height: 2px; background: var(--ink);
}
.lightbox-close::before { transform: rotate(45deg); }
.lightbox-close::after { transform: rotate(-45deg); }

/* Product */
.product { display: grid; grid-template-columns: minmax(0, 3fr) minmax(18rem, 2fr); gap: 2.5rem; align-items: start; }
.product-media img { width: 100%; }
.price { font-size: 1.4rem; margin: 0 0 1rem; }
.badge {
  font-family: var(--hand); font-size: 1.2rem; margin-left: 0.5rem; padding: 0 0.5rem;
  border: 1px solid var(--ink); border-radius: 999px; vertical-align: middle;
}
.variant-form, .checkout-form { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; margin-bottom: 1rem; }
.variant-form label, .checkout-form label { color: var(--muted); font-size: 0.9rem; }
select, input[type="number"] { font: inherit; padding: 0.4rem 0.6rem; border: 1px solid var(--ink); background: var(--paper); }
input[type="number"] { width: 4.5rem; }
.button {
  font-family: var(--hand); font-size: 1.5rem; line-height: 1;
  padding: 0.5rem 1.25rem; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer;
}
.button:hover { background: var(--paper); color: var(--ink); }
.note { color: var(--muted); font-size: 0.9rem; }
.product-description { max-width: 40rem; }

/* CV and contact */
.cv-list { padding-left: 1.2rem; max-width: 42rem; }
.cv-list li { margin-bottom: 0.35rem; }
.contact { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; max-width: 36rem; }
.contact dt { font-family: var(--hand); font-size: 1.5rem; line-height: 1.2; }
.contact dd { margin: 0; align-self: center; }

/* Small screens: top bar with a menu button. */
@media (max-width: 800px) {
  .sidebar {
    position: sticky; top: 0; width: auto; inset: auto;
    flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap;
    padding: 0.75rem var(--gutter); gap: 0.5rem;
    border-bottom: 1px solid var(--rule);
  }
  .logo { width: 5rem; height: 5rem; }
  .menu-toggle {
    display: block; width: 2.75rem; height: 2.75rem; border: 0; background: none; position: relative; cursor: pointer;
  }
  .bars, .bars::before, .bars::after {
    content: ""; position: absolute; left: 25%; width: 50%; height: 2px; background: var(--ink); transition: transform 200ms, opacity 200ms;
  }
  .bars { top: 50%; }
  .bars::before { top: -0.5rem; left: 0; width: 100%; }
  .bars::after { top: 0.5rem; left: 0; width: 100%; }
  .menu-open .bars { background: transparent; }
  .menu-open .bars::before { transform: translateY(0.5rem) rotate(45deg); }
  .menu-open .bars::after { transform: translateY(-0.5rem) rotate(-45deg); }
  .nav { display: none; flex-basis: 100%; padding: 0.5rem 0 0.75rem; }
  .menu-open .nav { display: flex; }
  .main { margin-left: 0; }
  .hero { height: calc(100vh - 7rem - 2 * var(--gutter)); }
  .hero-arrow { opacity: 1; }
  .product { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide, .nav a::after, .card img { transition: none; }
}
