/* ============================================================
   Doorbin — wisdom index (light ground)
   ============================================================ */

.wisdom-page {
  min-height: 100vh;
  background: #f4f2ed;
  color: #16150f;
}

/* ---------------- hero ----------------
   The title is driven by these four values — change them here and
   nothing else needs touching. */
.wisdom-page {
  --hero-size:      clamp(44px, 7.2vw, 104px);
  --hero-weight:    200;
  --hero-tracking:  0.05em;
  --hero-case:      lowercase;
}

.wisdom-hero { padding: 148px var(--gutter) 0; }
.wisdom-hero__title {
  margin: 0;
  font-weight: var(--hero-weight);
  font-size: var(--hero-size);
  line-height: 1.14;
  letter-spacing: var(--hero-tracking);
  text-transform: var(--hero-case);
  text-wrap: pretty;
}
.wisdom-hero__lede {
  max-width: 700px;
  margin: 52px 0 0;
  font-weight: 300;
  font-size: 22px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: #3d3a31;
  text-wrap: pretty;
}

/* ---------------- filters ---------------- */
.library { padding: 62px var(--gutter) 110px; }

.filters {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 0 44px;
}
.filters__tabs { display: flex; align-items: center; gap: 8px; margin-right: 20px; }
.tab {
  padding: 9px 24px;
  border: 0;
  border-radius: 999px;
  background: #e8e6e1;
  color: #16150f;
  cursor: pointer;
  font: inherit;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  transition: background 0.3s ease, color 0.3s ease;
}
.tab[aria-selected="true"] { background: #0b0b09; color: #ffffff; }

.dropdown { position: relative; }
.dropdown__toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px 9px 20px;
  border: 1px solid rgba(22, 21, 15, 0.2);
  border-radius: 999px;
  background: none;
  color: #16150f;
  cursor: pointer;
  font: inherit;
  font-weight: 300;
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: border-color 0.3s ease;
}
.dropdown__toggle:hover { border-color: #16150f; }
.dropdown__toggle svg { width: 10px; height: 7px; display: block; }
.dropdown__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  min-width: 190px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid rgba(22, 21, 15, 0.14);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(22, 21, 15, 0.12);
}
.dropdown.is-open .dropdown__panel { display: flex; }
.dropdown__option {
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #16150f;
  cursor: pointer;
  font: inherit;
  font-weight: 300;
  font-size: 15px;
}
.dropdown__option:hover { background: #f2f0eb; }

.filters__clear {
  padding: 9px 4px;
  border: 0;
  background: none;
  cursor: pointer;
  color: #8b857a;
  font: inherit;
  font-weight: 300;
  font-size: 14px;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.filters__clear.is-shown { opacity: 1; pointer-events: auto; }
.filters__clear:hover { color: #16150f; }
.filters__spacer { flex: 1 1 auto; }

.stepper { display: flex; align-items: center; gap: 8px; flex: none; }
.stepper__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  padding: 0;
  border: 1px solid rgba(22, 21, 15, 0.26);
  border-radius: 50%;
  background: none;
  color: #16150f;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.stepper__button:hover { background: #0b0b09; color: #ffffff; border-color: #0b0b09; }
.stepper__button svg { width: 15px; height: 11px; display: block; }

.library__empty {
  display: none;
  padding: 10px 0 90px;
  font-weight: 300;
  font-size: 17px;
  color: #8b857a;
}
.library__empty.is-shown { display: block; }

/* ---------------- entry rails ---------------- */
.entries {
  display: flex;
  gap: 34px;
  align-items: start;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter) 20px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-left: var(--gutter);
  scrollbar-width: none;
}
.entries::-webkit-scrollbar { width: 0; height: 0; }
.entries[hidden] { display: none; }

.entry { scroll-snap-align: start; flex: 0 0 auto; width: clamp(320px, calc((min(100vw, 1640px) - 152px) / 2.15), 740px); }
.entry[hidden] { display: none; }
.entry__link { display: block; color: inherit; text-align: left; }
.entry__link:hover { color: inherit; }
.entry__link > * { display: block; }

.entry__frame {
  display: block;
  position: relative;
  overflow: hidden;
  background: #dedad1;
  aspect-ratio: 16 / 11;
}
.entry__image {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.1s var(--ease);
}
.entry__link:hover .entry__image { transform: scale(1.04); }

.entry__frame--video {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e5e2db;
  box-shadow: inset 0 0 0 1px rgba(22, 21, 15, 0.1);
}
.entry__frame--video svg { width: 56px; height: 56px; display: block; opacity: 0.26; }

.entry__tag,
.entry__mins {
  position: absolute;
  bottom: 15px;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(11, 11, 9, 0.8);
  backdrop-filter: blur(7px);
  color: #ffffff;
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
}
.entry__tag { left: 15px; }
.entry__mins { right: 15px; }

.entry__title {
  margin: 20px 0 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.16;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.entry__standfirst {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.6;
  color: #56524a;
  text-wrap: pretty;
}

/* ---------------- subscribe mark ---------------- */
.subscribe { max-width: var(--measure); margin: 0 auto; padding: 0 16px 24px; }
.subscribe__mark {
  position: relative;
  transform-origin: 50% 50%;
  will-change: transform;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  aspect-ratio: 83 / 47;
  container-type: inline-size;
}
.subscribe__svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.subscribe__photo { opacity: 0; transition: opacity 0.5s cubic-bezier(0.2, 0.9, 0.25, 1); }
.subscribe__outline {
  fill: #0b0b09;
  fill-opacity: 0;
  stroke: rgba(22, 21, 15, 0.26);
  stroke-width: 1.3;
  vector-effect: non-scaling-stroke;
  transition: fill-opacity 0.5s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.subscribe__mark.is-lit .subscribe__photo { opacity: 1; }
.subscribe__mark.is-lit .subscribe__outline { fill-opacity: 0.32; }

.subscribe__copy {
  position: absolute;
  left: 50%; top: 50%;
  width: 52%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.subscribe__title {
  margin: 0;
  font-weight: 200;
  font-size: clamp(22px, 3.1cqw, 42px);
  line-height: 1.16;
  letter-spacing: 0.01em;
  color: #16150f;
  text-wrap: pretty;
  transition: color 0.5s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.subscribe__body {
  margin: 1.35em 0 0;
  max-width: 66ch;
  font-weight: 300;
  font-size: clamp(14px, 1.39cqw, 16px);
  line-height: 1.66;
  color: #56524a;
  text-wrap: pretty;
  transition: color 0.5s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.subscribe__cta {
  margin: 2.7em 0 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 1.05em 2.2em;
  border-radius: 999px;
  background: #0b0b09;
  color: #ffffff;
  font-weight: 300;
  font-size: clamp(14px, 1.39cqw, 16px);
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: background 0.5s cubic-bezier(0.2, 0.9, 0.25, 1), color 0.5s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.subscribe__mark.is-lit .subscribe__title,
.subscribe__mark.is-lit .subscribe__body { color: #f4f2ed; }
.subscribe__mark.is-lit .subscribe__cta { background: #f4f2ed; color: #0b0b09; }

/* ---------------- explore craft ---------------- */
.explore__head {
  padding: 72px var(--gutter) 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.explore__title {
  margin: 0;
  font-weight: 200;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.explore__controls { display: flex; align-items: center; gap: 7px; }
.explore__gap { width: 14px; }

.explore__filter {
  padding: 8px 22px;
  border: 1px solid rgba(22, 21, 15, 0.3);
  border-radius: 999px;
  background: none;
  color: #16150f;
  cursor: pointer;
  font: inherit;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.2;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.explore__filter:hover { background: #dcd9d2; }
.explore__filter[aria-pressed="true"] { background: #0b0b09; border-color: #0b0b09; color: #ffffff; }

.explore__rail {
  display: flex;
  gap: 34px;
  margin: 0;
  padding: 44px var(--gutter) 130px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-left: var(--gutter);
  scrollbar-width: none;
}
.explore__rail::-webkit-scrollbar { width: 0; height: 0; }

.craft-card { scroll-snap-align: start; flex: 0 0 auto; width: clamp(320px, calc((min(100vw, 1640px) - 152px) / 2.15), 740px); }
.craft-card[hidden] { display: none; }
.craft-card__link { display: block; color: inherit; }
.craft-card__link:hover { color: inherit; }
.craft-card__link > * { display: block; }
.craft-card__frame { display: block; overflow: hidden; background: #dedad1; aspect-ratio: 16 / 11; }
.craft-card__image {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.1s var(--ease);
}
.craft-card__link:hover .craft-card__image { transform: scale(1.04); }
.craft-card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 0;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #8b857a;
}
.craft-card__title {
  margin: 14px 0 0;
  font-weight: 300;
  font-size: 25px;
  line-height: 1.24;
  letter-spacing: 0.01em;
  text-wrap: pretty;
}

/* On narrow screens the oo is too letterboxed to hold text — the mark
   becomes a band and the copy sits under it in normal flow. */
@media (max-width: 900px) {
  .subscribe { padding: 0 var(--gutter-sm) 24px; }
  .subscribe__mark { aspect-ratio: auto; container-type: normal; transform: none !important; }
  .subscribe__svg { position: relative; inset: auto; aspect-ratio: 83 / 47; height: auto; }
  .subscribe__copy {
    position: static;
    transform: none;
    width: 100%;
    padding: 30px 0 0;
  }
  .subscribe__title { font-size: 26px; }
  .subscribe__body { margin-top: 16px; font-size: 15px; }
  .subscribe__cta { margin-top: 26px; padding: 15px 30px; font-size: 15px; }
  .subscribe__mark.is-lit .subscribe__title { color: #16150f; }
  .subscribe__mark.is-lit .subscribe__body { color: #56524a; }
  .subscribe__mark.is-lit .subscribe__cta { background: #0b0b09; color: #ffffff; }
}

@media (max-width: 1024px) {
  .wisdom-hero { padding: 108px var(--gutter-sm) 0; }
  .wisdom-hero__lede { margin-top: 34px; font-size: 19px; }
  .library { padding: 48px var(--gutter-sm) 80px; }
  .filters { gap: 8px; padding-bottom: 32px; }
  .filters__tabs { margin-right: 8px; }
  .stepper { display: none; }
  .entries {
    margin: 0 calc(var(--gutter-sm) * -1);
    padding: 0 var(--gutter-sm) 20px;
    scroll-padding-left: var(--gutter-sm);
    gap: var(--gutter-sm);
  }
  .entry { width: 78vw; }
  .entry__title { font-size: 25px; }
  .explore__head { padding: 56px var(--gutter-sm) 0; }
  .explore__rail {
    gap: var(--gutter-sm);
    padding: 34px var(--gutter-sm) 96px;
    scroll-padding-left: var(--gutter-sm);
  }
  .craft-card { width: 78vw; }
  .craft-card__frame { aspect-ratio: 3 / 4; }
  .craft-card__title { font-size: 21px; }
}
@media (max-width: 480px) {
  .entry, .craft-card { width: 82vw; }
  .craft-card__title { font-size: 19px; }
}

/* ============================================================
   desktop: the whole opening — title, lede, filters and a full row of
   entries with their titles — fits one screen
   ============================================================ */
@media (min-width: 1025px) {
  .wisdom-page { --lib-frame-h: clamp(220px, calc(100svh - 470px), 520px); }

  .wisdom-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 520px);
    align-items: end;
    justify-content: space-between;
    gap: 24px 64px;
    padding: 112px var(--gutter) 0;
  }
  .wisdom-hero__title { font-size: clamp(52px, 5.4vw, 100px); line-height: 1; }
  .wisdom-hero__lede {
    max-width: 520px;
    margin: 0 0 0.4em;
    font-size: 17px;
    line-height: 1.55;
  }

  .library { padding: 36px var(--gutter) 90px; }
  .filters { padding-bottom: 22px; }

  /* the row is sized by the height left on screen, so it always lands whole */
  .entry { width: clamp(300px, calc(var(--lib-frame-h) * 16 / 11), 740px); }
  .entry__title { margin-top: 16px; font-size: 24px; }
  .entry__standfirst {
    margin-top: 8px;
    font-size: 13.5px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* videos: coming soon */
.library__soon {
  margin: 0;
  padding: 80px 0 120px;
  font-weight: 200;
  font-size: clamp(28px, 3.2vw, 48px);
  letter-spacing: 0.01em;
  color: inherit;
}
.library__soon[hidden], .dropdown[hidden], .stepper__button[hidden] { display: none; }
@media (max-width: 1024px) { .library__soon { padding: 40px 0 80px; font-size: 26px; } }

/* desktop: the wheel drives the article row, so snapping must not fight it */
@media (min-width: 1025px) {
  [data-entries] { scroll-snap-type: none !important; scroll-behavior: auto !important; }
  [data-entries] .entry { scroll-snap-align: none; }
}

/* ============================================================
   desktop, revised: title, then the lede beneath it, then three
   entries across — all in the first screen
   ============================================================ */
@media (min-width: 1025px) {
  .wisdom-page {
    --lib-gap: 28px;
    --lib-w: calc((min(100vw, 1640px) - 2 * var(--gutter) - 2 * var(--lib-gap)) / 3);
  }
  .wisdom-hero {
    display: block;
    max-width: 1640px;
    margin: 0 auto;
    padding: 124px var(--gutter) 0;
  }
  .wisdom-hero__title { font-size: clamp(44px, 4.3vw, 80px); line-height: 1; }
  .wisdom-hero__lede {
    max-width: 600px;
    margin: 22px 0 0;
    font-size: 17px;
    line-height: 1.6;
  }

  .library { max-width: 1640px; margin: 0 auto; padding: 46px var(--gutter) 100px; }
  .filters { padding-bottom: 26px; }

  [data-entries] { gap: var(--lib-gap); }
  /* three across; on a short screen the row gives way to height instead */
  .entry { width: min(var(--lib-w), calc(clamp(200px, 100svh - 520px, 460px) * 16 / 11)); }
  .entry__title { margin-top: 18px; font-size: 23px; line-height: 1.2; }
  .entry__standfirst { margin-top: 8px; font-size: 13.5px; line-height: 1.55; }
}

/* desktop: the article row keeps its left edge and runs right until it ends
   exactly under the right edge of connect */
@media (min-width: 1025px) {
  [data-entries] {
    margin-right: calc(-1 * var(--lib-bleed, var(--gutter)));
    padding-right: var(--gutter);
    scroll-padding-right: var(--gutter);
  }
  [data-entries] .entry {
    width: calc((100% - 2 * var(--lib-gap)) / 3);
    flex: 0 0 calc((100% - 2 * var(--lib-gap)) / 3);
  }
}

/* desktop: the filters sit closer under the description */
@media (min-width: 1025px) {
  .library { padding-top: 24px; }
}

/* desktop: the title sits closer under the nav */
@media (min-width: 1025px) {
  .wisdom-hero { padding-top: 96px; }
}

/* desktop at any width: the page body starts under the logo, never centred in a narrower column */
@media (min-width: 1025px) {
  .wisdom-hero,
  .library { max-width: none; margin-left: 0; margin-right: 0; }
}

/* the founder's line in the oo, where the newsletter pitch used to be */
.subscribe__quote { margin-left: auto; margin-right: auto; font-style: italic; }
.subscribe__by {
  margin: 1.1em 0 0;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.7;
}
.subscribe__mark.is-lit .subscribe__by { color: #f4f2ed; }
@media (max-width: 900px) {
  .subscribe__by { font-size: 10px; }
  .subscribe__mark.is-lit .subscribe__by { color: #16150f; }
}
