/* ==========================================================================
   components.css — reusable UI components (nav, buttons, cards, gallery,
   footer, WhatsApp button, chat widget, forms)
   ========================================================================== */

/* ---- Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  min-height: 48px; /* adequate touch target, brief §9 */
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--color-berry);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-berry-dark);
}

.btn-secondary {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}

.section--dark .btn-secondary,
.section--ink .btn-secondary {
  border-color: var(--color-text-light);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--color-berry);
  padding-inline: 0.4rem;
}

.btn-ghost:hover {
  color: var(--color-berry-dark);
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---- Announcement bar (slim, sits above the main nav) ------------------ */
.announcement-bar {
  background: var(--color-berry);
  text-align: center;
  font-size: 0.8rem;
  padding: 0.4rem var(--space-sm);
}

.announcement-bar a {
  color: #fff;
}

.announcement-bar strong {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- Site header / nav ------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(43, 22, 37, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-dark);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand-wordmark {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-light);
  letter-spacing: -0.01em;
}

.brand-wordmark span {
  color: var(--color-lilac);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-sm);
  color: var(--color-text-light);
  cursor: pointer;
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.main-nav ul {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.main-nav a {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--color-text-light);
  padding: 0.4rem 0.2rem;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  border-bottom-color: var(--color-berry);
  color: var(--color-lilac);
}

.main-nav .btn {
  padding: 0.6rem 1.2rem;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-aubergine);
    border-bottom: 1px solid var(--color-border-dark);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-sm) var(--space-md) var(--space-md);
    gap: var(--space-sm);
    display: none;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
  }

  .main-nav a {
    display: block;
    width: 100%;
    padding: 0.7rem 0.2rem;
  }

  .main-nav .btn {
    width: 100%;
    margin-top: var(--space-xs);
  }
}

@media (min-width: 861px) {
  .nav-toggle {
    display: none;
  }
}

/* ---- Hero --------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--color-aubergine);
  color: var(--color-text-light);
  overflow: hidden;
  padding-block: var(--space-2xl) var(--space-xl);
}

.hero .container {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .hero .container {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.hero-copy h1 {
  margin-bottom: var(--space-md);
}

.hero-copy p {
  font-size: 1.1rem;
  max-width: 48ch;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.hero-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  aspect-ratio: 4 / 3;
  background: var(--color-plum-ink);
}

.hero-media video,
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Service cards (section 02) -------------------------------------- */
.service-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

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

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

.service-card {
  background: var(--color-aubergine-light);
  color: var(--color-text-light);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border-dark);
  transition: transform var(--transition-base);
}

.service-card:hover {
  transform: translateY(-4px);
}

.service-card .service-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--color-berry);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
  color: #fff;
}

.service-card h3 {
  margin-bottom: 0.5rem;
}

.service-card p {
  color: var(--color-text-muted-light);
  margin-bottom: 0;
}

.service-card,
.service-detail-block {
  scroll-margin-top: 140px; /* keeps anchored cards clear of the sticky header */
}

/* ---- Services page: sample work + process subsections ---------------- */
.service-subsection {
  margin-bottom: var(--space-xl);
}

.service-subsection h3 {
  margin-bottom: var(--space-md);
}

.process-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

@media (min-width: 700px) {
  .process-steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

.process-step {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.process-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-berry);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.process-step strong {
  font-family: var(--font-heading);
  font-size: 1rem;
}

.process-step span {
  font-size: 0.88rem;
  color: var(--color-text-muted-dark);
}

.section--lilac .process-step {
  background: var(--color-ivory);
}

.service-detail-list {
  margin: var(--space-sm) 0 0;
  padding-left: 1.1rem;
  list-style: disc;
}

.service-detail-list li {
  color: var(--color-text-muted-light);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.service-card .btn-ghost {
  display: inline-block;
  margin-top: var(--space-sm);
  color: var(--color-lilac);
  font-size: 0.9rem;
}

/* ---- Split service cards (icon/text + real work image side-by-side) --- */
.service-grid--split {
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .service-grid--split {
    grid-template-columns: repeat(2, 1fr);
  }

  /* With 5 cards, let the odd one out take the full final row rather than
     leaving an empty gap beside it. */
  .service-grid--split .service-card--split:nth-child(5):last-child {
    grid-column: 1 / -1;
  }

  .service-grid--split .service-card--split:nth-child(5):last-child .service-card-text {
    flex: 1 1 40%;
  }
}

.service-card--split {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

@media (min-width: 540px) {
  .service-card--split {
    flex-direction: row;
    align-items: stretch;
  }
}

.service-card-text {
  padding: var(--space-lg) var(--space-md);
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
}

.service-media {
  flex: 1 1 45%;
  min-height: 180px;
  background: var(--color-plum-ink);
}

.service-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 180px;
}

.service-media--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--color-plum-ink), var(--color-aubergine-light));
  color: var(--color-lilac);
}

.service-media--fallback svg {
  width: 64px;
  height: 64px;
  opacity: 0.6;
}

/* Visually distinguish each of the 4 cards (brief §4: "visually distinct") */
.service-card:nth-child(1) .service-icon { background: var(--color-berry); }
.service-card:nth-child(2) .service-icon { background: var(--color-blue); }
.service-card:nth-child(3) .service-icon { background: var(--color-lilac); color: var(--color-aubergine); }
.service-card:nth-child(4) .service-icon { background: #e7b65f; color: var(--color-aubergine); }
.service-card:nth-child(5) .service-icon { background: #c97b4a; }

/* ---- Horizontal scrolling gallery (section 03 — Selected Work) ------- */
.gallery-wrap {
  position: relative;
}

.gallery {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-block: var(--space-xs) var(--space-md);
  padding-inline: var(--space-md);
  margin-inline: calc(var(--space-md) * -1);
  scrollbar-width: thin;
  scrollbar-color: var(--color-berry) transparent;
  -webkit-overflow-scrolling: touch;
}

.gallery::-webkit-scrollbar {
  height: 8px;
}

.gallery::-webkit-scrollbar-thumb {
  background: var(--color-berry);
  border-radius: var(--radius-pill);
}

.gallery-card {
  flex: 0 0 auto;
  width: min(300px, 78vw);
  scroll-snap-align: start;
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border-light);
}

.gallery-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--color-plum-ink);
  overflow: hidden;
}

.gallery-media img,
.gallery-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 14, 22, 0.25);
  border: none;
  cursor: pointer;
  color: #fff;
}

.gallery-play .play-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-aubergine);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.gallery-play:hover .play-circle {
  transform: scale(1.08);
}

.gallery-info {
  padding: var(--space-sm) var(--space-md) var(--space-md);
}

.gallery-category {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-berry);
  display: block;
  margin-bottom: 0.3rem;
}

.gallery-info h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.gallery-info p {
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}

.gallery-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-berry);
}

.gallery-controls {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: var(--space-sm);
}

.gallery-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border-light);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gallery-arrow:hover {
  background: var(--color-lilac-soft);
}

/* ---- Pathway cards (section 04 — Choose Your Next Step) -------------- */
.pathway-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

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

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

.pathway-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.pathway-card h3 {
  margin-bottom: 0;
}

/* ---- Teaser banners (Learn / Skills→Income / Shop) -------------------- */
.teaser {
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  display: grid;
  gap: var(--space-lg);
  align-items: center;
}

@media (min-width: 760px) {
  .teaser {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.teaser-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  margin-bottom: var(--space-sm);
}

/* ---- Ecosystem cards (section 08) ------------------------------------ */
.ecosystem-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

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

.ecosystem-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 260px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: linear-gradient(160deg, var(--color-aubergine), var(--color-plum-ink));
  box-shadow: var(--shadow-card);
}

.ecosystem-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.ecosystem-card-body {
  position: relative;
  padding: var(--space-lg);
}

.ecosystem-card-body p {
  color: var(--color-text-muted-light);
}

/* ---- Footer --------------------------------------------------------- */
.site-footer {
  background: var(--color-plum-ink);
  color: var(--color-text-muted-light);
  padding-block: var(--space-xl) var(--space-lg);
}

.footer-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
  margin-bottom: var(--space-lg);
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-grid h4 {
  color: var(--color-text-light);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.footer-grid a {
  display: block;
  padding-block: 0.3rem;
  color: var(--color-text-muted-light);
  transition: color var(--transition-fast);
}

.footer-grid a:hover {
  color: var(--color-lilac);
}

.footer-bottom {
  border-top: 1px solid var(--color-border-dark);
  padding-top: var(--space-md);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: space-between;
}

/* ---- WhatsApp floating button (sitewide) ------------------------------ */
.whatsapp-float {
  position: fixed;
  right: var(--space-md);
  bottom: var(--space-md);
  z-index: 600;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  color: #fff;
  transition: transform var(--transition-fast);
}

.whatsapp-float:hover {
  transform: scale(1.06);
}

.whatsapp-float svg {
  width: 30px;
  height: 30px;
}

@media (max-width: 480px) {
  .whatsapp-float {
    width: 52px;
    height: 52px;
    right: var(--space-sm);
    bottom: var(--space-sm);
  }
}

/* ---- Lightweight chat widget ------------------------------------------ */
.chat-launcher {
  position: fixed;
  right: var(--space-md);
  bottom: calc(var(--space-md) * 2 + 60px);
  z-index: 600;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-berry);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-fast);
}

.chat-launcher:hover {
  transform: scale(1.06);
}

.chat-launcher svg {
  width: 26px;
  height: 26px;
}

@media (max-width: 480px) {
  .chat-launcher {
    width: 52px;
    height: 52px;
    right: var(--space-sm);
    bottom: calc(var(--space-sm) * 2 + 52px);
  }
}

.chat-panel {
  position: fixed;
  right: var(--space-md);
  bottom: calc(var(--space-md) * 3 + 120px);
  z-index: 601;
  width: min(340px, calc(100vw - 2 * var(--space-md)));
  max-height: min(480px, 70vh);
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border-light);
}

.chat-panel.is-open {
  display: flex;
}

.chat-panel-header {
  background: var(--color-aubergine);
  color: var(--color-text-light);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-panel-header h4 {
  margin: 0;
  font-size: 1rem;
}

.chat-close {
  background: transparent;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.2rem;
}

.chat-body {
  padding: var(--space-md);
  overflow-y: auto;
  flex: 1;
}

.chat-greeting {
  font-size: 0.92rem;
  color: var(--color-text-muted-dark);
  margin-bottom: var(--space-sm);
}

.chat-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-faq-btn {
  text-align: left;
  background: var(--color-lilac-soft);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--color-text-dark);
  font-family: var(--font-body);
}

.chat-faq-btn:hover {
  background: #fff;
  border-color: var(--color-berry);
}

.chat-answer {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.chat-panel-footer {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  justify-content: center;
}

.chat-panel-footer .btn {
  width: 100%;
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
}

/* ---- Forms (Work With Us / Contact) ----------------------------------- */
.form-field {
  margin-bottom: var(--space-md);
}

.form-field label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border-light);
  font-family: var(--font-body);
  font-size: 1rem;
  background: #fff;
  color: var(--color-text-dark);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--color-berry);
}

.form-note {
  font-size: 0.85rem;
  color: var(--color-text-muted-dark);
}

.form-success {
  display: none;
  background: var(--color-lilac-soft);
  border: 1px solid var(--color-lilac);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-top: var(--space-md);
}

.form-success.is-visible {
  display: block;
}
