/**
 * Appily Forty — Orchard Catalog Hub
 * Layout: hero + bento category cards + shop CTA
 */

.page-catalog-forty.a40-catalog-forty {
  background: var(--a40-warm);
}
.page-catalog-forty .page-main { padding-top: 0; }

.a40-cat { padding-bottom: 3.5rem; }

/* Reveal */
.a40-cat-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.a40-cat-reveal.is-visible { opacity: 1; transform: none; }

/* Hero */
.a40-cat-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 4vw, 2.75rem) 0 1.75rem;
  background: var(--a40-hero-gradient);
  margin-bottom: 1.75rem;
}
.a40-cat-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.a40-cat-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.45;
  animation: a40-cat-blob 14s ease-in-out infinite;
}
.a40-cat-blob--1 { width: 300px; height: 300px; top: -12%; right: 8%; background: var(--a40-blob-warm); }
.a40-cat-blob--2 { width: 240px; height: 240px; bottom: -15%; left: 0; background: var(--a40-blob-cool); animation-delay: -5s; }
.a40-cat-ring {
  position: absolute;
  top: 50%;
  right: 10%;
  width: min(200px, 26vw);
  aspect-ratio: 1;
  border: 2px dashed rgba(45, 106, 79, 0.14);
  border-radius: 50%;
  transform: translateY(-50%);
  animation: a40-cat-spin 24s linear infinite;
}
@keyframes a40-cat-blob {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10px, -8px); }
}
@keyframes a40-cat-spin { to { transform: translateY(-50%) rotate(360deg); } }

.a40-cat-hero-top {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
}

.a40-cat-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  color: var(--a40-muted);
}
.a40-cat-crumb a {
  color: var(--a40-muted);
  text-decoration: none !important;
  font-weight: 600;
}
.a40-cat-crumb a:hover { color: var(--a40-orange); }
.a40-cat-crumb [aria-current="page"] { color: var(--a40-ink); font-weight: 700; }

.a40-cat-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--a40-orange);
}
.a40-cat-hero h1 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--a40-ink);
}
.a40-cat-hero h1 span {
  color: var(--a40-orange); -webkit-text-fill-color: var(--a40-orange); background: none;
}
.a40-cat-lede {
  margin: 0;
  max-width: 46ch;
  font-size: 0.92rem;
  color: var(--a40-muted);
  line-height: 1.6;
}

.a40-cat-totals {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.15rem;
  background: var(--a40-surface);
  border: 2px solid var(--a40-border);
  border-radius: 16px;
  box-shadow: 0 10px 32px rgba(33, 37, 41, 0.08);
  flex-shrink: 0;
}
.a40-cat-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.a40-cat-total strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--a40-green-dark);
  line-height: 1;
}
.a40-cat-total span {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--a40-muted);
  margin-top: 0.15rem;
}
.a40-cat-total-ref {
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--a40-border);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--a40-muted);
  width: 100%;
  text-align: center;
}

/* Toolbar */
.a40-cat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.a40-cat-toolbar h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--a40-ink);
}

/* Category grid — bento cards */
.a40-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.15rem;
  margin-bottom: 2rem;
}

.a40-cat-card {
  display: flex;
  flex-direction: column;
  background: var(--a40-surface);
  border: 1px solid var(--a40-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(33, 37, 41, 0.06);
  animation: a40-cat-card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--cat-i, 0) * 0.06s);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.a40-cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(33, 37, 41, 0.1);
  border-color: rgba(64, 145, 108, 0.3);
}
@keyframes a40-cat-card-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.a40-cat-card-img {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  padding: 0.85rem 1rem;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--a40-photo-bg);
}
.a40-cat-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.a40-cat-card:hover .a40-cat-card-img img { transform: scale(1.03); }
.a40-cat-card-count {
  position: absolute;
  bottom: 0.65rem;
  right: 0.65rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(26, 61, 46, 0.85);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.a40-cat-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1.15rem 1.1rem;
}
.a40-cat-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.a40-cat-card-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--a40-orange), var(--a40-gold));
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}
.a40-cat-card-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
}
.a40-cat-card-head h3 a {
  color: var(--a40-ink);
  text-decoration: none !important;
}
.a40-cat-card-head h3 a:hover { color: var(--a40-orange); }

.a40-cat-card-list {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  flex: 1;
}
.a40-cat-card-list li {
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--a40-border);
  font-size: 0.8rem;
}
.a40-cat-card-list li:last-child { border-bottom: 0; }
.a40-cat-card-list a {
  color: var(--a40-muted);
  text-decoration: none !important;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}
.a40-cat-card-list a:hover { color: var(--a40-orange); }
.a40-cat-card-more {
  font-size: 0.72rem !important;
  font-weight: 700;
  color: var(--a40-mint) !important;
  border-bottom: 0 !important;
}

.a40-cat-card-foot { margin-top: auto; }
.a40-cat-card-cta {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--a40-green-dark);
  text-decoration: none !important;
  transition: color 0.2s, transform 0.2s;
}
.a40-cat-card-cta:hover {
  color: var(--a40-orange);
  transform: translateX(4px);
}

/* Footer CTA */
.a40-cat-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  background: linear-gradient(135deg, rgba(64, 145, 108, 0.1), rgba(224, 122, 47, 0.08));
  border: 1px solid rgba(64, 145, 108, 0.2);
  border-radius: 16px;
}
.a40-cat-foot-copy strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--a40-ink);
  margin-bottom: 0.25rem;
}
.a40-cat-foot-copy p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--a40-muted);
}

/* Buttons */
.a40-cat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.15rem;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.a40-cat-btn--primary {
  background: var(--a40-ink);
  color: #fff !important;
}
.a40-cat-btn--primary:hover {
  background: var(--a40-green-dark);
  transform: translateY(-2px);
}
.a40-cat-btn--sm { padding: 0.45rem 0.9rem; font-size: 0.78rem; }

/* Responsive */
@media (max-width: 900px) {
  .a40-cat-hero-top { grid-template-columns: 1fr; }
  .a40-cat-totals {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: fit-content;
  }
  .a40-cat-total-ref {
    width: auto;
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
    flex-basis: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .a40-cat-reveal, .a40-cat-card { animation: none !important; transition: none; opacity: 1; transform: none; }
  .a40-cat-blob, .a40-cat-ring { animation: none !important; }
}
