/* ==========================================================================
   What to Do

   The page is now a grid built from page_items rather than hand-written
   markup, so this file replaces the Bootstrap column layout it used to rely
   on. Same design language as the rest of the site: sandy beige ground,
   Amatic SC headings in brand purple, Open Sans body.

   The old layout alternated one col-lg-6 lead image with col-lg-3 cards.
   That is reproduced by the item's own size - 'feature' spans two columns,
   'small' takes one - which means an editor can change the rhythm without
   anyone touching CSS.
   ========================================================================== */

.wtd {
  --wtd-purple: #7f3f98;
  --wtd-ink:    #2b2530;
  --wtd-soft:   #6d6577;
  --wtd-line:   #e7e2ec;
  --wtd-sand:   #faf7f2;

  background-color: var(--wtd-sand);
  padding-bottom: 72px;
  color: var(--wtd-ink);
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

.wtd-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ----------------------------------------------------------------- head -- */

.wtd-head h1 {
  margin: 0;
  padding: 72px 0 24px;
  font-family: "Amatic SC", cursive;
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.02;
  color: var(--wtd-purple);
  text-align: center;
}

/* The opening passage. Centred and on a reading measure, as it was. */
.wtd-why {
  max-width: 780px;
  margin: 0 auto 20px;
  text-align: center;
}
.wtd-why h2 {
  margin: 0 0 10px;
  font-family: "Amatic SC", cursive;
  font-size: clamp(2rem, 3.8vw, 2.9rem);
  font-weight: 700;
  color: var(--wtd-purple);
}
.wtd-why p {
  margin: 0;
  color: var(--wtd-soft);
  font-size: 1.0625rem;
  line-height: 1.75;
}

/* ------------------------------------------------------------- sections -- */

.wtd-section {
  max-width: 780px;
  margin: 46px auto 22px;
  text-align: center;
}
.wtd-section h2 {
  margin: 0 0 10px;
  font-family: "Amatic SC", cursive;
  font-size: clamp(2.1rem, 4.2vw, 3.1rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--wtd-purple);
}
.wtd-note {
  margin: 0;
  color: var(--wtd-soft);
  font-size: 1.0625rem;
  line-height: 1.75;
}

/* ----------------------------------------------------------------- grid -- */

.wtd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  align-items: start;
}

/* The lead image: two columns wide and taller, as the old col-lg-6 was. */
.wtd-card.is-feature { grid-column: span 2; grid-row: span 2; }
.wtd-card.is-wide    { grid-column: span 2; }

.wtd-card {
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
}
.wtd-card:hover { text-decoration: none; color: inherit; }

/* ---------------------------------------------------------------- media -- */

.wtd-media {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #efe9f2;
  aspect-ratio: 4 / 3;
  box-shadow: 0 1px 2px rgba(43, 37, 48, .04), 0 8px 20px rgba(43, 37, 48, .05);
}
.wtd-card.is-feature .wtd-media { aspect-ratio: auto; height: 100%; min-height: 320px; }

.wtd-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.wtd-card:hover .wtd-media img { transform: scale(1.04); }

.wtd-media-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--wtd-soft);
  font-size: .8125rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* The name on the large image. These three carried no text at all before, so
   where they led was a guess until you clicked. The gradient keeps white type
   readable over whatever photo sits behind it. */
.wtd-feat-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 52px 22px 18px;
  background: linear-gradient(to top,
              rgba(23, 18, 28, .88),
              rgba(23, 18, 28, .3) 55%,
              transparent);
  color: #fff;
  font-family: "Amatic SC", cursive;
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  font-weight: 700;
  line-height: 1.05;
}

/* ----------------------------------------------------------------- body -- */

.wtd-body { padding: 14px 2px 0; }

.wtd-name {
  margin: 0 0 7px;
  font-family: "Amatic SC", cursive;
  font-size: clamp(1.65rem, 2.5vw, 2.15rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--wtd-purple);
}

.wtd-desc {
  margin: 0;
  color: var(--wtd-soft);
  font-size: .9375rem;
  line-height: 1.7;
}

.wtd-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--wtd-soft);
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 1024px) {
  .wtd-grid { grid-template-columns: repeat(3, 1fr); }
  .wtd-card.is-feature { grid-column: span 3; grid-row: auto; }
  .wtd-card.is-feature .wtd-media { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
}

@media (max-width: 720px) {
  .wtd-inner { padding: 0 16px; }
  .wtd-head h1 { padding-top: 44px; }
  .wtd-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .wtd-card.is-feature,
  .wtd-card.is-wide { grid-column: span 2; }
}

@media (max-width: 460px) {
  .wtd-grid { grid-template-columns: 1fr; }
  .wtd-card.is-feature,
  .wtd-card.is-wide { grid-column: span 1; }
}

@media (prefers-reduced-motion: reduce) {
  .wtd-media img,
  .wtd-card:hover .wtd-media img { transition: none; transform: none; }
}

/* ---------------------------------------------------------------- admin -- */

/* Controls only appear for a logged-in editor; cms-inline.css supplies the
   shared chrome, these are the placements specific to this grid. */

.wtd-del {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 18, 28, .62);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, background-color .15s ease;
}
.wtd-card:hover .wtd-del { opacity: 1; }
.wtd-del:hover { background: #b3261e; }

.wtd-size {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(23, 18, 28, .62);
  opacity: 0;
  transition: opacity .15s ease;
}
.wtd-card:hover .wtd-size { opacity: 1; }

.wtd-size button {
  width: 24px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: .6875rem;
  font-weight: 700;
  cursor: pointer;
}
.wtd-size button[aria-pressed="true"] { background: #fff; color: var(--wtd-ink); }

.wtd-add {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  border: 2px dashed var(--wtd-line);
  border-radius: 16px;
  background: transparent;
  color: var(--wtd-soft);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.wtd-add:hover { border-color: var(--wtd-purple); color: var(--wtd-purple); }

/* Clearing a photo. Clicking the picture replaces it; this takes it away and
   puts the "No photo yet" placeholder back. Editors could previously only ever
   swap one photo for another, so a wrong picture had to stay. */
.wtd-img-del {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 4;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 18, 28, .62);
  color: #fff;
  font-family: inherit;
  font-size: .6875rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, background-color .15s ease;
}
.wtd-card:hover .wtd-img-del { opacity: 1; }
.wtd-img-del:hover { background: #b3261e; }
