/* The flower, its fixed palette of soft pastels, the Garden (ticket 05),
   and the Coordinator's list of Posts. Loaded by garden.js, posting.js and admin-posts.js. */

.flower {
  display: block;
  width: 100%;
  height: auto;
}

.flower-petals {
  fill: var(--petal, #efb8c0);
  stroke: rgba(106, 76, 70, 0.28);
  stroke-width: 1;
}

.flower--rose { --petal: #efb8c0; }
.flower--peach { --petal: #f5c9a8; }
.flower--butter { --petal: #f3dc9a; }
.flower--mint { --petal: #b5d6bc; }
.flower--sky { --petal: #afcfe6; }
.flower--lilac { --petal: #cdbbe3; }

/* The Garden (ticket 05): counters, search, Group filter, the meadow with one
   zone of 9 flowers, previous and next, and the card a flower opens. */
.garden {
  width: 100%;
  margin-top: 1.5rem;
  padding: 1.25rem 0.75rem 1rem;
  border: 1px solid var(--stone);
  border-radius: 1.25rem;
  background: #fffdf9;
  text-align: center;
}

.garden [hidden] {
  display: none !important;
}

.garden h2 {
  margin-bottom: 0.75rem;
}

/* The 4 counters */
.garden-counters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
}

.garden-counters li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0.4rem 0.15rem 0.5rem;
  border: 1px solid var(--stone);
  border-radius: 0.9rem;
  background: var(--ivory);
}

.garden-count {
  color: var(--cocoa);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.4;
}

.garden-count-label {
  font-size: 0.8rem; /* 13.6px */
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* Search and filter (they need the script, so they show only with it) */
.garden-find,
.garden-zones {
  display: none;
}

.js .garden-find {
  display: block;
  margin-bottom: 0.9rem;
}

.garden-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.garden-search {
  position: relative;
}

.garden-search input {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.4rem 1.1rem;
  padding-inline-end: 3.4rem;
  border: 1.5px solid var(--stone);
  border-radius: 999px;
  background: #fff;
  color: var(--espresso);
  font: inherit;
  font-size: 1rem; /* 17px: phones do not zoom in on focus */
}

.garden-search input::placeholder {
  color: #7b6b65;
  opacity: 1;
}

.garden-search input:focus-visible {
  outline: 3px solid var(--sand);
  outline-offset: 2px;
}

.garden-search-go {
  position: absolute;
  inset-block: 0.25rem;
  inset-inline-end: 0.25rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 999px;
}

.garden-search-go svg {
  width: 1.3rem;
  height: 1.3rem;
}

/* 5 choices in two tidy rows: 3 above, 2 below */
.garden-filter {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.garden-pill {
  grid-column: span 2;
  width: 100%;
  min-height: 2.6rem; /* 44px */
  margin: 0;
  padding: 0.2rem 0.85rem;
  border: 1.5px solid var(--stone);
  border-radius: 999px;
  background: #fffdf9;
  color: var(--cocoa);
  font-size: 0.9rem;
}

.garden-pill:nth-child(n + 4) {
  grid-column: span 3;
}

.garden-pill[aria-pressed="true"] {
  border-color: var(--cocoa);
  background: var(--cocoa);
  color: #fffdf9;
}

/* The meadow: drawn with gradients until the owner's image is in public/img/ */
.garden-meadow {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 16rem;
  padding: 2.6rem 0.45rem 1rem;
  border-radius: 1rem;
  background:
    radial-gradient(circle at 84% 1.9rem, rgba(255, 244, 214, 0.95) 0, rgba(255, 244, 214, 0.95) 1.05rem, rgba(255, 244, 214, 0) 2.6rem),
    linear-gradient(180deg, rgba(220, 232, 208, 0) 0, rgba(220, 232, 208, 0) 4.4rem, #dce8d0 4.4rem, #cfe0c2 100%),
    radial-gradient(ellipse 62% 2.6rem at 22% 4.5rem, #dce8d0 0, #dce8d0 99%, rgba(220, 232, 208, 0) 100%),
    radial-gradient(ellipse 70% 3.3rem at 82% 4.7rem, #e6eedb 0, #e6eedb 99%, rgba(230, 238, 219, 0) 100%),
    linear-gradient(180deg, #fbf7ee 0%, #f3efdf 100%);
}

.garden-meadow--photo {
  background-color: #dce8d0;
  background-position: center bottom;
  background-size: cover;
}

.garden-empty {
  align-self: center;
  max-width: 17rem;
  margin: 1.5rem 0 0;
  padding: 0.6rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 253, 249, 0.9);
  color: var(--cocoa);
}

/* Ticket 24: every message open under its flower. Two columns of cards on a phone,
   three on a wide screen; each column fills from the top, so long and short messages
   pack without gaps, and the meadow grows with them. */
.garden-flowers {
  column-count: 2;
  column-gap: 0.5rem;
  margin: 0;
  padding: 0 0.1rem;
  list-style: none;
}

@media (min-width: 40rem) {
  .garden-flowers {
    column-count: 3;
  }
}

.garden-post {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 0.75rem;
  break-inside: avoid;
}

.garden-post .flower {
  width: 2.3rem;
  margin-bottom: -0.35rem; /* the stem meets the card */
}

.garden-note {
  position: relative;
  width: 100%;
  padding: 0.5rem 0.6rem 0.6rem;
  border: 1px solid rgba(106, 76, 70, 0.18);
  border-top: 3px solid var(--petal, #efb8c0);
  border-radius: 0.8rem;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 1px 3px rgba(42, 35, 33, 0.08);
  text-align: start;
}

.garden-post .garden-name {
  margin: 0;
  color: var(--cocoa);
  font-size: 0.9rem; /* 15px on a 375px phone */
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.garden-message {
  margin: 0.2rem 0 0;
  color: var(--espresso);
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Previous and next */
.js .garden-zones {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.garden-zone-button {
  width: auto;
  min-width: 5.5rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.3rem 1rem;
  border: 1.5px solid var(--cocoa);
  background: #fffdf9;
  color: var(--cocoa);
}

.garden-zone-button:disabled {
  border-color: var(--stone);
  opacity: 0.55;
}

.garden-zone-now {
  color: var(--cocoa);
  font-weight: 600;
}

/* The Coordinator's Posts */
.post-count {
  display: inline-block;
  min-width: 1.9rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--ivory);
  border: 1px solid var(--stone);
  font-size: 0.95rem;
  text-align: center;
}

.post-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.post-item {
  margin-bottom: 0.85rem;
  padding: 1rem 1.1rem 1.1rem;
  background: #fffdf9;
  border: 1px solid var(--stone);
  border-radius: 1.25rem;
}

.post-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-head .flower {
  flex: none;
  width: 2.6rem;
}

.post-head div {
  min-width: 0;
}

.post-name {
  margin: 0;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.post-writer {
  margin: 0;
  font-size: 0.85rem;
  color: var(--cocoa);
}

.post-message {
  margin: 0.6rem 0 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.post-item button {
  margin-top: 0.85rem;
}
