/* "What's in the box": one card per trader in a Splide carousel (vendor/splide, set up at the end of index.html).
   Product first: the product photo (full colour), "In the box", the item and the owners' words, then the trader, smaller, underneath.
   Until a product photo arrives the card shows the trader's own photo, in sepia (brand rule). Logos stay in their own colours.
   Before (or without) Splide the list is a plain horizontal scroll-snap row with the same card widths, so nothing jumps. */
.traders-carousel { visibility: visible; max-width: 70rem; margin: 0 auto; --tc-pad: 1rem; --tc-peek: 3.75rem; --tc-per: 1; }
@media (min-width: 540px) { .traders-carousel { --tc-peek: 3rem; --tc-per: 2; } }
@media (min-width: 720px) { .traders-carousel { --tc-pad: 2rem; --tc-peek: 2rem; --tc-per: 3; } }
@media (min-width: 1280px) { .traders-carousel { --tc-per: 4; } }
.traders-carousel .splide__track { padding: .25rem var(--tc-peek) .5rem var(--tc-pad); }
.traders-carousel .splide__slide { width: calc((100% + 1rem) / var(--tc-per) - 1rem); margin-right: 1rem; display: flex; }
.traders-carousel:not(.is-initialized) .splide__track { overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--tc-pad); scrollbar-width: thin; }
.traders-carousel:not(.is-initialized) .splide__slide { scroll-snap-align: start; }
/* Leave room for the arrows-and-dots row while the script loads, so the page below doesn't shift. */
@media (scripting: enabled) { .traders-carousel:not(.is-initialized) { padding-bottom: 3.6rem; } }

/* Controls row under the cards: prev arrow, dots, play/pause, next arrow. */
.traders-carousel.is-initialized { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; column-gap: .75rem;
  padding-inline: var(--tc-pad); padding-bottom: .25rem; }
.traders-carousel.is-initialized .splide__track { grid-column: 1 / -1; grid-row: 1; margin-inline: calc(-1 * var(--tc-pad)); }
.traders-carousel .splide__arrows { display: contents; }
.traders-carousel .splide__arrow { grid-row: 2; margin-top: 1rem; width: 2.5rem; height: 2.5rem; padding: 0; display: grid; place-items: center;
  border-radius: 50%; border: 2px solid var(--dhh-navy); background: var(--dhh-white); color: var(--dhh-navy); cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.traders-carousel .splide__arrow--prev { grid-column: 1; } .traders-carousel .splide__arrow--next { grid-column: 4; }
.traders-carousel .splide__arrow svg { width: 1rem; height: 1rem; fill: currentColor; }
.traders-carousel .splide__arrow--prev svg { transform: scaleX(-1); }
@media (hover: hover) { .traders-carousel .splide__arrow:hover:not(:disabled) { background: var(--dhh-pink); border-color: var(--dhh-pink); color: var(--dhh-white); } }
.traders-carousel .splide__arrow:disabled { opacity: .3; cursor: default; }
.traders-carousel .splide__pagination { grid-row: 2; grid-column: 2; margin-top: 1rem; gap: .3rem .45rem; padding: 0; }
@media (max-width: 539px) { .traders-carousel .splide__pagination { gap: .3rem; } }
/* Narrow carousel (320px, or big text): dots get their own row under the arrows instead of a squeezed column. */
.traders-carousel.is-initialized { container-type: inline-size; }
@container (max-width: 20rem) {
  .traders-carousel .splide__pagination { grid-row: 3; grid-column: 1 / -1; justify-content: center; margin-top: .75rem; }
  .traders-carousel .splide__toggle { grid-column: 2; justify-self: center; }
}
.traders-carousel .splide__pagination__page { position: relative; display: block; width: .5rem; height: .5rem; padding: 0; border-radius: 50%; border: 2px solid var(--dhh-navy);
  background: transparent; cursor: pointer; transition: background-color .15s ease, transform .15s ease; }
/* Invisible hit areas: 40px tall, and as wide as the gap to the next dot allows (15 dots share one row on a phone). */
.traders-carousel .splide__pagination__page::before { content: ""; position: absolute; left: calc(-.225rem - 2px); right: calc(-.225rem - 2px); top: calc(50% - 20px); bottom: calc(50% - 20px); }
@media (max-width: 539px) { .traders-carousel .splide__pagination__page::before { left: calc(-.15rem - 2px); right: calc(-.15rem - 2px); } }
@media (hover: hover) { .traders-carousel .splide__pagination__page:hover { background: var(--dhh-pink); border-color: var(--dhh-pink); } }
.traders-carousel .splide__pagination__page.is-active { background: var(--dhh-pink); border-color: var(--dhh-pink); transform: scale(1.25); }
/* Play/pause for the auto-rotation: small, navy outline, sits just after the dots. Hidden until Splide is running. */
.traders-carousel .splide__toggle { position: relative; grid-row: 2; grid-column: 3; margin-top: 1rem; width: 2rem; height: 2rem; padding: 0; display: grid; place-items: center;
  border-radius: 50%; border: 2px solid var(--dhh-navy); background: var(--dhh-white); color: var(--dhh-navy); cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.traders-carousel .splide__toggle::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; } /* 44px hit area, same 32px look */
.traders-carousel:not(.is-initialized) .splide__toggle { display: none; }
.traders-carousel .splide__toggle svg { width: .75rem; height: .75rem; fill: currentColor; }
.traders-carousel .splide__toggle__play { margin-left: 2px; }
@media (hover: hover) { .traders-carousel .splide__toggle:hover { background: var(--dhh-pink); border-color: var(--dhh-pink); color: var(--dhh-white); } }
.traders-carousel .splide__toggle:focus-visible,
.traders-carousel .splide__arrow:focus-visible, .traders-carousel .splide__pagination__page:focus-visible,
.traders-carousel .splide__track:focus-visible, .traders-carousel .splide__slide:focus-visible { outline: 3px solid var(--dhh-pink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .traders-carousel .splide__arrow, .traders-carousel .splide__toggle, .traders-carousel .splide__pagination__page { transition: none; } }

/* The card. Cards share the tallest one's height and the trader block sits at the bottom of each. Nothing is clamped. */
.trader { flex: 1; margin: 0; min-width: 0; background: var(--dhh-white); border: 2px solid var(--dhh-navy); border-radius: 3px; display: flex; flex-direction: column; overflow: hidden; }
.trader .shot { position: relative; aspect-ratio: 4 / 3; background: #d9d4cc; flex: none; border-bottom: 2px solid var(--dhh-navy); overflow: hidden; }
.trader .shot img.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  filter: grayscale(1) sepia(.75) contrast(1.05) brightness(1.02) saturate(.9); }
/* Product photos (landing/products/) are shown as they are: full colour, no sepia. */
.trader .shot img.photo.product { filter: none; }
.trader .shot.logo-only { display: grid; place-items: center; background: var(--dhh-chalk); }
.trader .shot.logo-only img { width: 46%; height: auto; border-radius: 50%; }
.trader figcaption { padding: 1rem 1rem 1.1rem; display: flex; flex-direction: column; align-items: flex-start; flex: 1; }
.trader .in-box { font: 600 .72rem/1.3 var(--dhh-font-label); letter-spacing: .16em; text-transform: uppercase; color: var(--dhh-pink-deep); }
.trader .in-box::before { content: "\2693\FE0E"; margin-right: .35rem; }
.trader .item { margin: .3rem 0 .5rem; font: 400 1.75rem/1 var(--dhh-font-display); letter-spacing: .02em; text-transform: uppercase; color: var(--dhh-navy); text-wrap: balance; }
.trader .desc { margin: 0 0 1rem; font-size: 1rem; line-height: 1.5; }
/* Who puts it in: logo, name, address, Instagram. Smaller, under a dashed tear line, at the bottom of the card. */
.trader .who { margin-top: auto; align-self: stretch; display: flex; gap: .7rem; align-items: center; padding-top: .85rem; border-top: 2px dashed rgb(26 34 56 / .3); }
.trader .who > div { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; }
.trader .badge { flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 2px solid var(--dhh-white); background: var(--dhh-white);
  overflow: hidden; box-shadow: 0 1px 6px rgb(26 34 56 / .22); }
.trader .badge img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trader h3 { margin: 0; font: 400 1.2rem/1 var(--dhh-font-display); letter-spacing: .02em; text-transform: uppercase; }
.trader .where { font: 600 .62rem/1.4 var(--dhh-font-label); letter-spacing: .13em; text-transform: uppercase; color: var(--dhh-pink-deep); }
.trader a { color: var(--dhh-navy); font-size: .85rem; line-height: 1.5; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trader a:hover { color: var(--dhh-pink-deep); }

/* No photo yet: a kraft card with the trader's name stamped on, until the owners have a photo the trader is happy with. */
.trader .shot.placeholder { display: grid; place-items: center; border-bottom: 2px solid var(--dhh-navy); overflow: hidden;
  background: var(--dhh-kraft) radial-gradient(circle at 78% 22%, rgb(255 255 255 / .18) 0 18%, transparent 19%); }
.trader .ph-stamp { display: grid; gap: .3rem; justify-items: center; max-width: 82%; padding: .5rem .7rem .4rem; border: 2px solid var(--dhh-navy);
  color: var(--dhh-navy); text-align: center; transform: rotate(-4deg); }
.trader .ph-stamp b { font: 400 1.4rem/.95 var(--dhh-font-display); letter-spacing: .03em; text-transform: uppercase; }
.trader .ph-stamp small { font: 600 .55rem/1 var(--dhh-font-label); letter-spacing: .18em; text-transform: uppercase; }
.trader .ph-stamp small::before { content: "\2693\FE0E"; margin-right: .35rem; }

/* "Supporting": the two Deptford charities */
.charities { padding-block: 1rem 4rem; }
.charities-inner { max-width: 70rem; margin: 0 auto; padding: 0 1rem; box-sizing: border-box; }
@media (min-width: 720px) { .charities-inner { padding-inline: 2rem; } }
.charities h2 { margin: .4rem 0 .3rem; font: 400 clamp(2.2rem, 6vw, 3.4rem)/1 var(--dhh-font-display); letter-spacing: .02em; text-transform: uppercase; }
.charities-inner > p { margin: 0 0 1.5rem; max-width: 34rem; }
.charity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.charity { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; padding: 1.1rem; background: var(--dhh-white);
  border: 2px solid var(--dhh-navy); border-radius: 3px; }
.charity > div { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.charity img { flex: none; width: 5.5rem; height: 5.5rem; object-fit: contain; border-radius: 50%; background: var(--dhh-white); border: 2px solid var(--dhh-chalk); box-sizing: border-box; }
.charity h3 { margin: 0 0 .3rem; font: 400 1.6rem/1 var(--dhh-font-display); letter-spacing: .02em; text-transform: uppercase; }
.charity p { margin: 0 0 .4rem; font-size: .98rem; }
.charity .where { display: block; margin-bottom: .4rem; font: 600 .68rem/1.4 var(--dhh-font-label); letter-spacing: .14em; text-transform: uppercase; color: var(--dhh-pink-deep); }
.charity a { color: var(--dhh-navy); font-size: .9rem; }
.charity a:hover { color: var(--dhh-pink-deep); }

/* phones: 18 dots wrap onto two rows, so rely on the arrows and swipe */
@media (max-width: 719px) { .traders-carousel .splide__pagination { display: none; } }
