/* Resources page: sections are lily pads, items float on the pond.
   Loaded only by resources.html, on top of styles.css. To add an item,
   copy a <li class="pad-card"> into the right section's grid. */

:root {
  --water-top: #dcebe5;
  --water-bottom: #c3dcd5;
  --ripple: rgba(255, 255, 255, 0.7);
  --pad: #8fb866;
  --pad-edge: #6f9a4f;
  --pad-glyph: var(--reed);
  --coin: var(--sun);
  --coin-side: #c3973c;
  --sprout: var(--frog);
  --float-shadow: 0 16px 32px -20px rgba(20, 43, 40, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --water-top: #1f433e;
    --water-bottom: #17332f;
    --ripple: rgba(185, 213, 140, 0.2);
    --pad: #6f9a4f;
    --pad-edge: #527d3d;
    --pad-glyph: var(--night-pond);
    --coin-side: #a87f2e;
    --sprout: var(--lily);
    --float-shadow: 0 16px 32px -18px rgba(0, 0, 0, 0.7);
  }
}

:root[data-theme='dark'] {
  --water-top: #1f433e;
  --water-bottom: #17332f;
  --ripple: rgba(185, 213, 140, 0.2);
  --pad: #6f9a4f;
  --pad-edge: #527d3d;
  --pad-glyph: var(--night-pond);
  --coin-side: #a87f2e;
  --sprout: var(--lily);
  --float-shadow: 0 16px 32px -18px rgba(0, 0, 0, 0.7);
}

/* Water with two ripple rings, shared by the hero art and the card pictures */
.pond-hero-art,
.pad-thumb {
  background:
    radial-gradient(ellipse 34% 20% at 50% 66%, transparent 86%, var(--ripple) 89% 93%, transparent 96%),
    radial-gradient(ellipse 52% 31% at 50% 66%, transparent 90%, var(--ripple) 92% 94.5%, transparent 97%),
    linear-gradient(180deg, var(--water-top), var(--water-bottom));
}

/* ---- Hero ---- */

.resources-page {
  padding-top: 8px;
}

.pond-hero {
  padding: 16px 0 24px;
}

.pond-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  align-items: center;
  gap: 48px;
}

main.page.resources-page h1 {
  font-size: clamp(2rem, 5vw, 2.875rem);
  line-height: 1.12;
  letter-spacing: -0.6px;
  margin: 0 0 14px;
}

.pond-hero .lead {
  color: var(--text-muted);
  font-size: 1.1875rem;
  line-height: 1.6;
  max-width: 520px;
  margin: 0 0 24px;
}

.pond-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pond-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
}

.pond-jump a:hover {
  border-color: var(--pad-edge);
  opacity: 1;
}

.pond-hero-art {
  aspect-ratio: 1 / 0.8;
  border-radius: 50% 50% 46% 54% / 56% 50% 50% 44%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pond-hero-art img {
  width: 74%;
  height: auto;
  margin-top: 4%;
}

/* ---- Sections ---- */

.pond-section {
  scroll-margin-top: 16px;
  padding-top: 48px;
}

/* A wavy waterline between sections */
.pond-section + .pond-section::before {
  content: '';
  display: block;
  height: 12px;
  margin-bottom: 44px;
  background: var(--border);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12'%3E%3Cpath d='M0 6q12-8 24 0t24 0' fill='none' stroke='black' stroke-width='2.5'/%3E%3C/svg%3E") repeat-x center / 48px 12px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12'%3E%3Cpath d='M0 6q12-8 24 0t24 0' fill='none' stroke='black' stroke-width='2.5'/%3E%3C/svg%3E") repeat-x center / 48px 12px;
}

.pond-section + .pond-section {
  padding-top: 44px;
}

.pond-section-head {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 24px;
}

/* A lily pad on a little circle of water, with ripples around it */
.pad-badge {
  flex: 0 0 auto;
  display: inline-flex;
  width: 60px;
  height: 60px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--water-top);
  box-shadow:
    0 0 0 5px var(--bg),
    0 0 0 7px var(--water-top),
    0 0 0 12px var(--bg),
    0 0 0 13.5px var(--border);
  margin: 8px;
}

.pad-badge svg {
  width: 48px;
  height: 48px;
}

.pad-leaf {
  fill: var(--pad);
  stroke: var(--pad-edge);
  stroke-width: 1.5;
}

.pad-glyph {
  fill: none;
  stroke: var(--pad-glyph);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main.page.resources-page h2 {
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 4px;
}

.pond-section-head p {
  color: var(--text-muted);
  margin: 0;
}

/* ---- Cards ---- */

main.page .pad-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 24px;
}

.pad-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
}

.pad-card:hover,
.pad-card:focus-within {
  box-shadow: var(--float-shadow);
}

@media (prefers-reduced-motion: no-preference) {
  .pad-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }

  .pad-card:hover,
  .pad-card:focus-within {
    transform: translateY(-4px);
  }

  .pond-hero-art img {
    animation: frog-bob 5s ease-in-out infinite;
  }

  @keyframes frog-bob {
    50% {
      transform: translateY(-6px) rotate(-1deg);
    }
  }
}

.pad-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

/* Printables float on the water like paper */
.pad-thumb .paper {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 10px 20px -12px rgba(20, 43, 40, 0.6);
  transform: translate(-50%, -50%) rotate(-2.5deg);
}

/* Tall pages sit upright, cropped by the water's edge */
.pad-thumb .paper.portrait {
  width: 40%;
  top: 56%;
  transform: translate(-50%, -50%) rotate(2deg);
}

.pond-scene {
  display: block;
  width: 100%;
  height: 100%;
}

.pond-scene .lily {
  fill: var(--pad);
  stroke: var(--pad-edge);
  stroke-width: 2;
}

.pond-scene .lily.small {
  opacity: 0.75;
}

.pond-scene .vein {
  fill: none;
  stroke: var(--pad-edge);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.6;
}

.pond-scene .coin {
  fill: var(--coin);
  stroke: var(--coin-side);
  stroke-width: 1.5;
}

.pond-scene .coin-side {
  fill: var(--coin-side);
}

.pond-scene .stem {
  fill: none;
  stroke: var(--sprout);
  stroke-width: 4;
  stroke-linecap: round;
}

.pond-scene .leaf {
  fill: var(--sprout);
}

.pad-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px 24px 22px;
}

.pad-chip {
  display: inline-block;
  background: var(--surface-muted);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 3px 12px;
  margin-bottom: 12px;
}

main.page.resources-page h3 {
  font-size: 1.1875rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 8px;
}

.pad-card h3 a {
  color: var(--text);
  text-decoration: none;
}

/* The heading link covers the whole card */
.pad-card h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
}

.pad-card h3 a:hover {
  opacity: 1;
}

.pad-card h3 a:focus-visible {
  outline: none;
}

.pad-card:has(h3 a:focus-visible) {
  outline: 3px solid var(--action);
  outline-offset: 3px;
}

.pad-card p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 16px;
}

.pad-go {
  margin-top: auto;
  color: var(--link);
  font-weight: 800;
  font-size: 0.9375rem;
}

.pad-go::after {
  content: '\2192';
  display: inline-block;
  margin-left: 6px;
}

@media (prefers-reduced-motion: no-preference) {
  .pad-go::after {
    transition: transform 0.2s ease;
  }

  .pad-card:hover .pad-go::after {
    transform: translateX(4px);
  }
}

@media (max-width: 760px) {
  .pond-hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .pond-hero-art {
    width: min(100%, 300px);
    margin: 0 auto;
    order: -1;
  }
}

@media (max-width: 520px) {
  .pond-hero-art {
    display: none;
  }

  .pond-section-head {
    align-items: flex-start;
    gap: 18px;
  }
}
