/**
 * Appily Fortyseven — Atelier Help Hub
 * Layout: split masthead + bento tiles + sidebar nav + accordion main + footer strip
 */

.page-help-atelier {
  --help-plum: #2a1830;
  --help-ink: #1e1520;
  --help-muted: #7a6e7d;
  --help-gold: #c9a86c;
  --help-blush: #f4e8ec;
  --help-cream: #faf7f4;
  --help-border: rgba(42, 24, 48, 0.1);
  --help-ease: cubic-bezier(0.22, 1, 0.36, 1);
  background: var(--help-cream);
}

.page-help-atelier .page-main {
  padding-top: 0;
}

.a47-help-hub {
  padding-bottom: 0;
}

/* ── Masthead ── */
.a47-help-mast {
  position: relative;
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 clamp(2rem, 4vw, 2.75rem);
  overflow: hidden;
}

.a47-help-mast-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 80% at 0% 50%, rgba(201, 168, 108, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 40% 60% at 100% 20%, rgba(232, 180, 188, 0.22) 0%, transparent 50%),
    linear-gradient(180deg, #fff 0%, var(--help-cream) 100%);
  pointer-events: none;
}

.a47-help-mast-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(300px, 420px);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.a47-help-eyebrow {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--help-gold);
  margin-bottom: 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--help-gold);
}

.a47-help-intro h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  line-height: 1.12;
  color: var(--help-ink);
}

.a47-help-intro h1 em {
  font-style: italic;
  color: var(--help-plum);
}

.a47-help-lede {
  margin: 0 0 1.25rem;
  max-width: 42ch;
  color: var(--help-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.a47-help-stats {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.a47-help-stats li {
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.9rem;
  border-left: 3px solid var(--help-gold);
  background: rgba(255, 255, 255, 0.7);
}

.a47-help-stats strong {
  font-family: var(--a47-font-serif);
  font-size: 1.35rem;
  color: var(--help-plum);
  line-height: 1.1;
}

.a47-help-stats span {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--help-muted);
}

/* Search panel */
.a47-help-search-panel {
  padding: 1.5rem;
  background: var(--help-plum);
  color: #fff;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
  box-shadow: 0 24px 56px rgba(42, 24, 48, 0.22);
}

.a47-help-search-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.65rem;
}

.a47-help-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  margin-bottom: 0.85rem;
  transition: border-color 0.3s, background 0.3s;
}

.a47-help-search:focus-within {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--help-gold);
}

.a47-help-search-icon {
  opacity: 0.65;
  font-size: 1rem;
}

.a47-help-search input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.92rem;
  color: #fff;
  outline: none;
}

.a47-help-search input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.a47-help-search-clear {
  width: 26px;
  height: 26px;
  border: none;
  background: var(--help-gold);
  color: var(--help-ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s;
}

.a47-help-search-clear:hover {
  transform: scale(1.08);
}

.a47-help-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.a47-help-tag {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.25s var(--help-ease);
}

.a47-help-tag:hover,
.a47-help-tag.is-active {
  background: var(--help-gold);
  border-color: var(--help-gold);
  color: var(--help-ink);
  transform: translateY(-1px);
}

.a47-help-search-note {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
}

.a47-help-search-note a {
  color: var(--help-gold);
  font-weight: 600;
}

/* ── Bento quick actions ── */
.a47-help-bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 0.75rem;
  padding: 0 0 2.5rem;
}

.a47-help-tile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  background: #fff;
  border: 1px solid var(--help-border);
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--help-ease), box-shadow 0.35s, border-color 0.35s;
}

.a47-help-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(201, 168, 108, 0.08) 100%);
  opacity: 0;
  transition: opacity 0.35s;
}

.a47-help-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(42, 24, 48, 0.1);
  border-color: rgba(201, 168, 108, 0.4);
}

.a47-help-tile:hover::before {
  opacity: 1;
}

.a47-help-tile--wide {
  grid-column: span 2;
}

.a47-help-tile--tall {
  grid-row: span 2;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.a47-help-tile-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--help-blush);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.a47-help-tile-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}

.a47-help-tile-body strong {
  font-size: 0.88rem;
  color: var(--help-plum);
}

.a47-help-tile-body small {
  font-size: 0.72rem;
  color: var(--help-muted);
}

.a47-help-tile-arrow {
  font-size: 1.1rem;
  color: var(--help-gold);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s, transform 0.3s var(--help-ease);
}

.a47-help-tile:hover .a47-help-tile-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── Body: sidebar + main ── */
.a47-help-body {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 2rem;
  padding-bottom: 3rem;
  align-items: start;
}

.a47-help-sidebar {
  position: sticky;
  top: 88px;
}

.a47-help-sidebar-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--help-muted);
  margin: 0 0 0.75rem;
}

.a47-help-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.a47-help-nav-btn {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  position: relative;
  transition: background 0.3s, border-color 0.3s, transform 0.3s var(--help-ease);
}

.a47-help-nav-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--help-border);
}

.a47-help-nav-btn.is-active {
  background: #fff;
  border-color: var(--help-border);
  box-shadow: 0 8px 24px rgba(42, 24, 48, 0.07);
}

.a47-help-nav-num {
  font-family: var(--a47-font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--help-gold);
  line-height: 1;
  min-width: 1.75rem;
}

.a47-help-nav-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}

.a47-help-nav-copy strong {
  font-size: 0.82rem;
  color: var(--help-ink);
}

.a47-help-nav-copy small {
  font-size: 0.68rem;
  color: var(--help-muted);
}

.a47-help-nav-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--help-gold);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s var(--help-ease);
}

.a47-help-nav-btn.is-active .a47-help-nav-bar {
  transform: scaleY(1);
}

.a47-help-nav-btn.accent-peony.is-active .a47-help-nav-bar { background: #c9a0a8; }
.a47-help-nav-btn.accent-hydrangea.is-active .a47-help-nav-bar { background: #8b9daf; }
.a47-help-nav-btn.accent-rose.is-active .a47-help-nav-bar { background: #b88b9e; }
.a47-help-nav-btn.accent-tulip.is-active .a47-help-nav-bar { background: #c9a86c; }

.a47-help-sidebar-card {
  padding: 1.15rem;
  background: var(--help-plum);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
  line-height: 1.55;
}

.a47-help-sidebar-card strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  color: #fff;
}

.a47-help-sidebar-card p {
  margin: 0 0 0.5rem;
  opacity: 0.75;
  font-size: 0.78rem;
}

.a47-help-sidebar-card a {
  display: block;
  color: var(--help-gold);
  font-weight: 600;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.a47-help-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7dcea0;
  margin-right: 0.35rem;
  box-shadow: 0 0 8px rgba(125, 206, 160, 0.7);
  animation: a47HelpPulse 2.2s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes a47HelpPulse {
  50% { opacity: 0.45; transform: scale(0.8); }
}

/* ── Main chapter content ── */
.a47-help-chapter {
  animation: a47HelpFade 0.4s var(--help-ease);
}

.a47-help-chapter[hidden] {
  display: none;
}

@keyframes a47HelpFade {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}

.a47-help-chapter-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--help-border);
}

.a47-help-chapter-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: var(--help-blush);
  flex-shrink: 0;
}

.accent-peony .a47-help-chapter-icon { background: #f4e0e4; }
.accent-hydrangea .a47-help-chapter-icon { background: #e4eaf0; }
.accent-rose .a47-help-chapter-icon { background: #f0e4ea; }
.accent-tulip .a47-help-chapter-icon { background: #f5eed8; }

.a47-help-chapter-stage {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--help-gold);
  margin-bottom: 0.25rem;
}

.a47-help-chapter-head h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  color: var(--help-ink);
}

.a47-help-chapter-head p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--help-muted);
  max-width: 52ch;
}

/* Accordion */
.a47-help-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.a47-help-faq {
  background: #fff;
  border: 1px solid var(--help-border);
  overflow: hidden;
  transition: box-shadow 0.35s var(--help-ease), border-color 0.35s;
}

.a47-help-faq[hidden] {
  display: none;
}

.a47-help-faq[open] {
  border-color: rgba(201, 168, 108, 0.45);
  box-shadow: 0 12px 32px rgba(42, 24, 48, 0.08);
}

.a47-help-faq summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  cursor: pointer;
  list-style: none;
}

.a47-help-faq summary::-webkit-details-marker {
  display: none;
}

.a47-help-faq-num {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--help-gold);
  min-width: 2rem;
}

.a47-help-faq-q {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--help-ink);
  line-height: 1.4;
}

.a47-help-faq-toggle {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 1px solid var(--help-border);
  position: relative;
  transition: background 0.3s, border-color 0.3s, transform 0.3s var(--help-ease);
}

.a47-help-faq-toggle::before,
.a47-help-faq-toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--help-plum);
  transition: transform 0.3s var(--help-ease), background 0.3s;
}

.a47-help-faq-toggle::before {
  width: 10px;
  height: 2px;
  transform: translate(-50%, -50%);
}

.a47-help-faq-toggle::after {
  width: 2px;
  height: 10px;
  transform: translate(-50%, -50%);
}

.a47-help-faq[open] .a47-help-faq-toggle {
  background: var(--help-plum);
  border-color: var(--help-plum);
  transform: rotate(90deg);
}

.a47-help-faq[open] .a47-help-faq-toggle::before,
.a47-help-faq[open] .a47-help-faq-toggle::after {
  background: #fff;
}

.a47-help-faq[open] .a47-help-faq-toggle::after {
  transform: translate(-50%, -50%) scaleY(0);
}

.a47-help-faq-a {
  padding: 0 1.15rem 1.15rem 3.5rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--help-muted);
}

.a47-help-faq-a a {
  color: var(--help-plum);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Footer strip ── */
.a47-help-footer-strip {
  background: var(--help-plum);
  color: rgba(255, 255, 255, 0.85);
  padding: 1.35rem 0;
}

.a47-help-footer-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
}

.a47-help-footer-block {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}

.a47-help-footer-block strong {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--help-gold);
  margin-right: 0.25rem;
}

.a47-help-footer-block a,
.a47-help-footer-block span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.8);
}

.a47-help-footer-block a:hover {
  color: #fff;
}

.a47-help-footer-block--pay {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.a47-help-footer-block--pay strong {
  margin-bottom: 0.15rem;
}

.a47-help-footer-cta {
  margin-left: auto;
  padding: 0.65rem 1.35rem;
  background: var(--help-gold);
  color: var(--help-ink) !important;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.25s var(--help-ease), box-shadow 0.25s;
}

.a47-help-footer-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ── Scroll reveal ── */
.a47-help-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s var(--help-ease), transform 0.65s var(--help-ease);
  transition-delay: calc(var(--a47-delay, 0) * 60ms);
}

.a47-help-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .a47-help-mast-grid {
    grid-template-columns: 1fr;
  }

  .a47-help-bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .a47-help-tile--wide {
    grid-column: span 2;
  }

  .a47-help-tile--tall {
    grid-row: span 1;
    flex-direction: row;
  }

  .a47-help-body {
    grid-template-columns: 1fr;
  }

  .a47-help-sidebar {
    position: static;
  }

  .a47-help-nav {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.35rem;
  }

  .a47-help-nav::-webkit-scrollbar {
    display: none;
  }

  .a47-help-nav-btn {
    flex: 0 0 auto;
    min-width: 180px;
  }

  .a47-help-nav-bar {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    height: 3px;
    transform: scaleX(0);
    transform-origin: left;
  }

  .a47-help-nav-btn.is-active .a47-help-nav-bar {
    transform: scaleX(1);
  }

  .a47-help-sidebar-card {
    display: none;
  }

  .a47-help-footer-cta {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .a47-help-bento {
    grid-template-columns: 1fr;
  }

  .a47-help-tile--wide {
    grid-column: span 1;
  }

  .a47-help-stats {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .a47-help-live-dot {
    animation: none;
  }

  .a47-help-reveal,
  .a47-help-chapter {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }

  .a47-help-tile:hover,
  .a47-help-footer-cta:hover {
    transform: none;
  }
}
