/* Forage v2 two-sided card layout. Layers on top of plant-cards.css —
   keeps the v1 card class working for the legacy single-sided render
   while adding new selectors for the v2 back + front. */

.sheet-v2 {
  /* Print two cards per row for double-sided print test sheets. */
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6mm;
  padding: 6mm;
}

.card-pair-page {
  align-items: center;
}

.card-pair {
  display: flex;
  gap: 8mm;
}

.border-options-page {
  align-items: center;
}

.border-options {
  display: flex;
  gap: 8mm;
  padding: 8mm;
}

.border-option {
  display: grid;
  gap: 3mm;
  justify-items: center;
}

.border-option h2 {
  color: #4a3d2c;
  font-size: 11pt;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.card-v2 {
  width: 63mm;
  height: 88mm;
  box-sizing: border-box;
  position: relative;
  background: #fdfaf3;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* v2 cards also carry the legacy .card class from plant-cards.css — reset
   v1 height/padding/grid so the 88×63mm plate layout is not clipped. */
.card.card-v2 {
  border: none;
  border-radius: 0;
  display: block;
  grid-template-rows: unset;
  height: 88mm;
  overflow: hidden;
  padding: 0;
}

/* ===== BACK ===== */

.card-v2-back {
  padding: 0;
  overflow: hidden;
}

.card-back-border {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.8mm;
}

.card-back-border--botanical-plate {
  background:
    linear-gradient(90deg, rgba(84, 68, 46, 0.05), transparent 18%, transparent 82%, rgba(84, 68, 46, 0.05)),
    #fffaf0;
  border: 0.7mm solid #4a3d2c;
  box-shadow:
    inset 0 0 0 1.2mm #f7efd9,
    inset 0 0 0 1.45mm rgba(74, 61, 44, 0.72),
    inset 0 0 0 2.35mm #fffaf0,
    inset 0 0 0 2.55mm var(--biome-accent, #c9b88a),
    inset 0 0 18mm rgba(120, 93, 56, 0.1);
}

.card-back-border--image-herbarium {
  background: #fff;
  border: 0.5mm solid #4a3d2c;
  box-shadow: inset 0 0 18mm rgba(120, 93, 56, 0.08);
  padding: 10mm 11mm;
}

.card-back-border--image-antique-plate {
  background: #fff;
  border: 0;
  box-shadow: none;
  padding: 7.5mm 8.5mm;
}

/* Front plate: slightly tighter inset so notes + yield row fit inside 88mm. */
.card-v2-plate-front .card-back-border--image-antique-plate {
  padding: 5.75mm 7.25mm;
}

.card-back-border--image-antique-plate::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/borders/antique-plate-frame.png") center / 100% 100% no-repeat;
  pointer-events: none;
  z-index: 3;
}

.card-back-border--image-antique-plate .plate-crop {
  display: none;
}

.card-back-border--image-antique-plate .card-back-art {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.card-back-border--image-antique-plate .card-back-content {
  height: 100%;
  position: relative;
  width: 100%;
  z-index: 1;
}

.card-back-content--art-only {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-v2-plate-front {
  background: #fff;
  overflow: hidden;
  padding: 0;
}

.card-face-content {
  display: grid;
  gap: 1.6mm;
  grid-template-rows: 8.5mm 30.5mm minmax(0, 1fr) minmax(12mm, auto);
  height: 100%;
  position: relative;
  width: 100%;
  z-index: 1;
}

.card-face-title {
  align-items: center;
  color: #30261b;
  display: flex;
  flex-direction: column;
  font-family: "EB Garamond", Georgia, serif;
  justify-content: center;
  min-width: 0;
  text-align: center;
  width: 100%;
}

.card-face-title h2 {
  display: block;
  font-size: 10.8pt;
  line-height: 1.05;
  margin: 0;
  overflow-wrap: anywhere;
  width: 100%;
}

.card-face-title p {
  color: #6a5c48;
  display: block;
  font-size: 7.4pt;
  line-height: 1.1;
  margin: 0.55mm 0 0;
  overflow-wrap: anywhere;
  width: 100%;
}

.card-face-top {
  display: grid;
  gap: 2mm;
  grid-template-columns: minmax(0, 1.12fr) minmax(18mm, 0.88fr);
  min-height: 0;
}

.card-face-art {
  border: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.card-face-art img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-face-info {
  align-self: center;
  color: #30261b;
  font-family: "EB Garamond", Georgia, serif;
  min-width: 0;
}

.card-face-info dl {
  display: grid;
  gap: 1mm;
  margin: 0;
}

.card-face-info dl div {
  border-top: 0.25mm solid rgba(74, 61, 44, 0.28);
  padding-top: 0.8mm;
}

.card-face-info dt {
  color: #7c6b4d;
  font-size: 5.7pt;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.card-face-info dd {
  font-size: 7.8pt;
  font-weight: 700;
  line-height: 1.08;
  margin: 0.35mm 0 0;
}

.card-face-notes {
  align-self: start;
  color: #33291d;
  font-family: "EB Garamond", Georgia, serif;
  font-size: 6.2pt;
  line-height: 1.18;
  min-height: 0;
  overflow: hidden;
}

.card-face-notes p {
  border-bottom: 0.25mm solid rgba(74, 61, 44, 0.24);
  margin: 0 0 1mm;
  padding-bottom: 0.8mm;
}

.card-face-notes ul {
  display: grid;
  gap: 0.65mm;
  list-style: none;
  margin: 0;
  padding: 0;
}

.card-face-notes li::before {
  content: "• ";
}

.card-face-yields {
  align-self: end;
  border-top: 0.3mm solid rgba(74, 61, 44, 0.45);
  color: #3a2d1e;
  display: grid;
  flex-shrink: 0;
  font-family: "EB Garamond", Georgia, serif;
  gap: 0.8mm;
  grid-template-columns: repeat(4, 1fr);
  padding-top: 0.9mm;
  text-align: center;
}

.season-resource-cell {
  display: grid;
  gap: 0.45mm;
  justify-items: center;
  min-width: 0;
}

.card-face-yields strong {
  color: #7c6b4d;
  font-size: 5.8pt;
  letter-spacing: 0.02em;
  line-height: 1;
}

.resource-icons {
  align-content: start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45mm;
  justify-content: center;
  min-height: 4.2mm;
}

.resource-icon {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  display: inline-block;
  flex: 0 0 auto;
  height: 2.25mm;
  width: 2.25mm;
}

.resource-icon--cal {
  background-image: url("assets/resource-icons/png/calories-flame-128.png");
}

.resource-icon--bot {
  background-image: url("assets/resource-icons/png/botanicals-tincture-flower-128.png");
}

.resource-icon--seed {
  background-image: url("assets/resource-icons/png/seed-128.png");
}

.resource-dormant {
  color: #9b8b6c;
  font-size: 5.4pt;
  font-style: italic;
  line-height: 1;
}

.season-harvest-part {
  color: #8a7a5c;
  font-size: 4.8pt;
  font-style: italic;
  line-height: 1;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.card-back-border--image-herbarium::before {
  content: "";
  position: absolute;
  inset: 1mm;
  background: url("assets/borders/herbarium-frame.png") center / 100% 100% no-repeat;
  pointer-events: none;
  z-index: 3;
}

.card-back-border--image-herbarium .plate-crop {
  display: none;
}

.card-back-border--image-herbarium .card-back-art {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.card-back-border--herbarium-corners {
  background:
    radial-gradient(circle at 12% 12%, rgba(90, 122, 58, 0.13), transparent 17%),
    radial-gradient(circle at 88% 12%, rgba(90, 122, 58, 0.1), transparent 17%),
    radial-gradient(circle at 12% 88%, rgba(90, 122, 58, 0.1), transparent 17%),
    radial-gradient(circle at 88% 88%, rgba(90, 122, 58, 0.13), transparent 17%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(244, 236, 216, 0.4)),
    #fff8ea;
  border: 0.65mm solid #3d3325;
  box-shadow:
    inset 0 0 0 1.1mm #fff8ea,
    inset 0 0 0 1.45mm rgba(61, 51, 37, 0.72),
    inset 0 0 0 4.8mm rgba(244, 235, 210, 0.86),
    inset 0 0 0 5.1mm var(--biome-accent, #7a934a),
    inset 0 0 22mm rgba(96, 72, 38, 0.14);
}

.card-back-border--specimen-label {
  background: #fffaf0;
  border: 0.6mm solid #594b38;
  box-shadow:
    inset 0 0 0 2mm #f7efd9,
    inset 0 0 0 2.25mm rgba(89, 75, 56, 0.6);
}

.card-back-border--plain-hairline {
  background: #fffdf8;
  border: 0.35mm solid #4a3d2c;
  box-shadow:
    inset 0 0 0 1.5mm #fffdf8,
    inset 0 0 0 1.75mm #9a8a68;
}

.plate-crop {
  display: none;
}

.card-back-border--botanical-plate .plate-crop {
  display: block;
  position: absolute;
  width: 6mm;
  height: 6mm;
  opacity: 0.7;
}

.card-back-border--botanical-plate .plate-crop::before,
.card-back-border--botanical-plate .plate-crop::after {
  content: "";
  position: absolute;
  background: #4a3d2c;
}

.card-back-border--botanical-plate .plate-crop::before {
  width: 4.5mm;
  height: 0.25mm;
}

.card-back-border--botanical-plate .plate-crop::after {
  width: 0.25mm;
  height: 4.5mm;
}

.plate-crop-tl {
  top: 3mm;
  left: 3mm;
}

.plate-crop-tr {
  top: 3mm;
  right: 3mm;
  transform: rotate(90deg);
}

.plate-crop-bl {
  bottom: 3mm;
  left: 3mm;
  transform: rotate(-90deg);
}

.plate-crop-br {
  right: 3mm;
  bottom: 3mm;
  transform: rotate(180deg);
}

.card-back-border--herbarium-corners .plate-crop {
  display: block;
  position: absolute;
  width: 18mm;
  height: 18mm;
  opacity: 0.85;
}

.card-back-border--herbarium-corners .plate-crop::before,
.card-back-border--herbarium-corners .plate-crop::after {
  content: "";
  position: absolute;
  border-color: var(--biome-accent, #7a934a);
  opacity: 0.92;
}

.card-back-border--herbarium-corners .plate-crop::before {
  border-top: 0.35mm solid;
  border-left: 0.35mm solid;
  border-radius: 9mm 0 0 0;
  inset: 0;
}

.card-back-border--herbarium-corners .plate-crop::after {
  width: 10mm;
  height: 10mm;
  border-top: 0.25mm solid;
  border-left: 0.25mm solid;
  border-radius: 8mm 0 0 0;
  left: 4mm;
  top: 4mm;
}

.card-back-border--herbarium-corners .plate-crop-tl {
  top: 4mm;
  left: 4mm;
}

.card-back-border--herbarium-corners .plate-crop-tr {
  top: 4mm;
  right: 4mm;
  transform: rotate(90deg);
}

.card-back-border--herbarium-corners .plate-crop-bl {
  bottom: 4mm;
  left: 4mm;
  transform: rotate(-90deg);
}

.card-back-border--herbarium-corners .plate-crop-br {
  right: 4mm;
  bottom: 4mm;
  transform: rotate(180deg);
}

.card-back-art {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0.35mm solid rgba(74, 61, 44, 0.42);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1mm rgba(255, 250, 240, 0.82);
  padding: 2.5mm;
  position: relative;
  z-index: 1;
}

.card-back-art img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* No labels, no text — illustration only. */
}

/* Small mycelium glyph in the corner: the one non-text signal that
   distinguishes mushroom cards from plants when face-down. */
.card-back-glyph {
  position: absolute;
  top: 5mm;
  right: 5mm;
  color: #4a3d2c;
  opacity: 0.65;
}

/* Biome accents on the back border — subtle color cues only, no labels. */
.biome-forest      .card-back-border { --biome-accent: #5a7a3a; }
.biome-forest-edge .card-back-border { --biome-accent: #7a934a; }
.biome-meadow      .card-back-border { --biome-accent: #c2a64a; }
.biome-wetland     .card-back-border { --biome-accent: #4a7a8a; }
.biome-disturbed   .card-back-border { --biome-accent: #8a6a5a; }
.biome-mountain    .card-back-border { --biome-accent: #6a7a8a; }

/* ===== FRONT ===== */

.card-v2-front {
  padding: 3mm;
  display: grid;
  grid-template-rows: auto 28mm auto auto 1fr auto;
  gap: 1.5mm;
  font-family: "EB Garamond", Georgia, serif;
  color: #2c241a;
}

/* Plate-front layout (canonical): one border wrapper, no extra outer padding. */
.card-v2-front.card-v2-plate-front {
  display: block;
  padding: 0;
}

.v2-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2mm;
}

.v2-header h2 {
  margin: 0;
  font-size: 11pt;
  line-height: 1.15;
  font-weight: 700;
}

.v2-header p {
  margin: 0;
  font-size: 7.5pt;
  font-style: italic;
  color: #6a5c48;
}

.v2-header .biome {
  display: flex;
  align-items: center;
  gap: 1mm;
  font-size: 7pt;
  color: #4a3d2c;
}

.v2-header .biome-name {
  font-weight: 600;
}

.v2-art {
  height: 28mm;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 250, 235, 0.4);
  border: 0.5mm solid #c9b88a;
  border-radius: 1.5mm;
  overflow: hidden;
}

.v2-art img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.v2-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 7.5pt;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4a3d2c;
  border-top: 0.5mm solid #c9b88a;
  border-bottom: 0.5mm solid #c9b88a;
  padding: 0.8mm 0;
}

.v2-yields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1mm;
  font-size: 7.5pt;
}

.v2-yields .yield-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1mm 0;
  background: #f4ecd8;
  border-radius: 1mm;
  text-align: center;
}

.v2-yields .season-name {
  font-size: 6.5pt;
  font-weight: 600;
  color: #6a5c48;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.v2-yields .yield-cal  { color: #8a4a2a; font-weight: 600; }
.v2-yields .yield-bot  { color: #2a5a4a; font-weight: 600; }
.v2-yields .yield-seed { color: #4a3a8a; font-weight: 600; }
.v2-yields .yield-dash { color: #c9b88a; }

.tidbits {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 7pt;
  line-height: 1.25;
  color: #3a3225;
  overflow: hidden;
}

.tidbits li {
  padding: 0.4mm 0;
  border-bottom: 0.2mm dotted #d8cdb0;
}

.tidbits li:last-child {
  border-bottom: none;
}

.v2-footer {
  font-size: 6.5pt;
  color: #4a3d2c;
  border-top: 0.5mm solid #c9b88a;
  padding-top: 0.8mm;
}

.v2-footer p {
  margin: 0;
}
