/* ==========================================================================
   Pruning Calendar
   ========================================================================== */

.prune-tool {
  margin-bottom: 2.5rem;
}

/* --- Search & picker ---------------------------------------------------- */

.prune-tool__picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 560px;
  margin-bottom: 2rem;
}

.prune-tool__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.prune-tool__search-wrap {
  position: relative;
}

.prune-tool__search,
.prune-tool__select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.prune-tool__search:focus-visible,
.prune-tool__select:focus-visible {
  border-color: var(--color-accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.prune-search-results {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.375rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.prune-search-results__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-family: inherit;
  text-align: left;
  color: var(--color-text);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.prune-search-results__item:hover,
.prune-search-results__item:focus-visible {
  background: var(--color-accent-light);
  outline: none;
}

.prune-search-results__name {
  font-weight: 600;
}

.prune-search-results__meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.prune-search-results__empty {
  padding: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* --- Empty state -------------------------------------------------------- */

.prune-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

.prune-empty__icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.prune-empty__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.prune-empty__text {
  max-width: 36rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.prune-empty-inline {
  color: var(--color-text-muted);
}

/* --- Detail panel ------------------------------------------------------- */

.prune-detail-panel {
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.prune-detail-panel.is-updating {
  opacity: 0.55;
  transform: translateY(6px);
}

.prune-detail {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

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

.prune-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.prune-hero__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-bg);
}

.prune-hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prune-hero__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, var(--color-accent-light), var(--color-bg));
}

.prune-hero__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1.25rem 1.25rem;
}

.prune-hero__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.prune-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.prune-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 999px;
}

.prune-badge--month {
  color: var(--color-accent);
  background: var(--color-accent-light);
}

.prune-badge--season {
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.prune-difficulty {
  text-transform: capitalize;
}

.prune-difficulty--easy {
  color: #15803d;
  background: #dcfce7;
}

.prune-difficulty--moderate {
  color: #b45309;
  background: #fef3c7;
}

.prune-difficulty--hard {
  color: #b42318;
  background: #fee2e2;
}

.prune-hero__link {
  align-self: flex-start;
}

/* --- Content blocks ----------------------------------------------------- */

.prune-detail__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.prune-block {
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.prune-block__title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.875rem;
  letter-spacing: -0.01em;
}

.prune-block__text {
  color: var(--color-text-muted);
  line-height: 1.7;
}

.prune-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: prune-step;
}

.prune-steps li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.prune-steps__num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-accent);
  background: var(--color-accent-light);
  border-radius: 999px;
}

.prune-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding-left: 1.125rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.prune-list--mistakes li::marker {
  color: #b42318;
}

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

.prune-section {
  margin-bottom: 2.5rem;
}

.prune-section__title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.prune-section__intro {
  max-width: 42rem;
  margin-bottom: 1.25rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* --- Recommended tools -------------------------------------------------- */

.prune-tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.prune-tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.prune-tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.prune-tool-card__icon {
  font-size: 1.75rem;
}

.prune-tool-card__name {
  font-size: 1rem;
  font-weight: 700;
}

.prune-tool-card__desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* --- FAQ ---------------------------------------------------------------- */

.prune-faq {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.prune-faq__item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.prune-faq__question {
  padding: 1rem 1.125rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.prune-faq__question::-webkit-details-marker {
  display: none;
}

.prune-faq__answer {
  padding: 0 1.125rem 1rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* --- Related plants ----------------------------------------------------- */

.prune-related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

/* --- Monthly calendar --------------------------------------------------- */

.prune-month-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0 1rem;
  margin-bottom: 1rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.prune-month-btn {
  flex: 0 0 auto;
  scroll-snap-align: start;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition:
    color var(--transition-fast),
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
  white-space: nowrap;
}

.prune-month-btn:hover {
  color: var(--color-text);
  border-color: rgba(45, 106, 79, 0.25);
  transform: translateY(-1px);
}

.prune-month-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.prune-month-btn.is-active {
  color: #fff;
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.prune-month-btn__short {
  display: none;
}

.prune-month-heading {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.prune-month-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.prune-month-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name difficulty"
    "season difficulty";
  gap: 0.25rem 1rem;
  align-items: center;
  width: 100%;
  padding: 1rem 1.125rem;
  font-family: inherit;
  text-align: left;
  color: inherit;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-fast);
}

.prune-month-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(45, 106, 79, 0.25);
}

.prune-month-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.prune-month-card__name {
  grid-area: name;
  font-weight: 700;
}

.prune-month-card__season {
  grid-area: season;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.prune-month-card__difficulty {
  grid-area: difficulty;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
}

.prune-month-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

/* --- Scroll animations -------------------------------------------------- */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .prune-detail-panel,
  .prune-tool-card,
  .prune-month-card,
  .prune-month-btn,
  .animate-on-scroll {
    transition: none;
    transform: none;
    opacity: 1;
  }
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 639px) {
  .prune-month-btn__full {
    display: none;
  }

  .prune-month-btn__short {
    display: inline;
  }

  .prune-month-btn {
    min-width: 3.25rem;
    padding-inline: 0.875rem;
  }
}

@media (min-width: 640px) {
  .prune-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .prune-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .prune-month-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .prune-hero {
    grid-template-columns: 1.2fr 1fr;
    align-items: stretch;
  }

  .prune-hero__body {
    justify-content: center;
    padding: 1.5rem;
  }

  .prune-detail__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .prune-block:first-child,
  .prune-block:nth-child(2) {
    grid-column: span 1;
  }
}

@media (min-width: 900px) {
  .prune-tools-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .prune-related-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .prune-detail__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .prune-block:first-child {
    grid-column: span 2;
  }

  .prune-block:nth-child(2) {
    grid-column: span 1;
  }
}
