/* ==================================================
   Buttons
   ================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 180ms var(--ease-out), color 180ms var(--ease-out),
    border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out),
    transform 180ms var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* Primary — solid ink. Trust-first, consultancy-standard. */
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  color: var(--paper);
  background: var(--ink-soft);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-soft);
}

/* Ghost — ink outline */
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

/* Ghost on dark background */
.btn-ghost-light {
  background: transparent;
  color: var(--paper);
  border-color: color-mix(in srgb, var(--paper) 40%, transparent);
}

.btn-ghost-light:hover,
.btn-ghost-light:focus-visible {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

/* Small, used in nav */
.btn-sm {
  font-size: 14px;
  padding: 0.55rem 1rem;
}

/* ==================================================
   Badges
   ================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
}

.badge-amber-outline {
  color: var(--amber);
  border: 1px solid var(--amber);
  background: transparent;
}

.badge-amber-solid {
  color: var(--paper);
  background: var(--amber);
}

/* ==================================================
   Cards
   ================================================== */

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: 1.75rem;
  box-shadow: var(--shadow-inner-light);
  transition: border-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.card-deep {
  background: var(--paper-deep);
}

.card-ink {
  background: var(--ink);
  color: var(--paper);
  border-color: color-mix(in srgb, var(--amber) 30%, transparent);
}

.card-interactive {
  transition: border-color 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}

.card-interactive:hover {
  border-color: var(--ink-muted);
  box-shadow: var(--shadow-soft);
}

/* ==================================================
   Chips (filter toggles)
   ================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1rem;
  min-height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 180ms var(--ease-out), color 180ms var(--ease-out),
    border-color 180ms var(--ease-out);
}

.chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ==================================================
   Accordion (native <details>)
   ================================================== */

.accordion-item {
  border-top: 1px solid var(--rule);
}

.accordion-item:last-child {
  border-bottom: 1px solid var(--rule);
}

.accordion-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 1.25rem 0;
  font-family: var(--font-display);
  font-weight: 450;
  font-size: 20px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.accordion-item > summary::-webkit-details-marker {
  display: none;
}

.accordion-item > summary::after {
  content: "";
  width: 12px;
  height: 12px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 220ms var(--ease-out);
  flex-shrink: 0;
}

.accordion-item[open] > summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.accordion-item > .accordion-body {
  padding: 0 0 1.25rem;
  font-size: 15px;
  color: var(--ink-muted);
  max-width: 72ch;
  /* Animation hooks — see bindFaqAnimation in js/main.js. height + box-sizing
     allow JS to transition between 0 and the measured scrollHeight without
     leaving stub padding visible at the closed state. */
  overflow: hidden;
  box-sizing: border-box;
  transition: height 280ms var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .accordion-item > .accordion-body {
    transition: none;
  }
}

/* ==================================================
   Dialog (native <dialog>)
   ================================================== */

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  max-width: 100vw;
  max-height: 100vh;
}

dialog::backdrop {
  background: rgba(11, 18, 32, 0.55);
  backdrop-filter: blur(4px);
}

dialog[open] {
  animation: dialog-in 220ms var(--ease-out);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Contact dialog shell */
.contact-dialog {
  background: var(--paper);
  border-radius: var(--radius-card);
  padding: 2rem;
  margin: auto;
  width: min(560px, 100% - 2rem);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(11, 18, 32, 0.25);
}

/* Nav sheet (mobile) */
.nav-sheet {
  background: var(--paper);
  width: 100%;
  max-width: 100%;
  height: 100vh;
  max-height: 100vh;
  padding: 1.5rem;
  margin: 0;
}

.dialog-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--ink);
}

.dialog-close:hover {
  background: var(--paper-deep);
}

.dialog-close svg {
  width: 20px;
  height: 20px;
}

/* ==================================================
   Toast
   ================================================== */

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: var(--paper);
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-card);
  font-size: 14px;
  max-width: calc(100% - 2rem);
  box-shadow: 0 12px 32px rgba(11, 18, 32, 0.35);
  opacity: 0;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
  z-index: 1000;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==================================================
   Form
   ================================================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.input,
.select,
.textarea {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-btn);
  padding: 0.75rem 0.9rem;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 180ms var(--ease-out);
  box-shadow: var(--shadow-inner-light);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.textarea {
  resize: vertical;
  min-height: 88px;
}

.phone-group {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem;
}

.field-error {
  color: #991b1b;
  font-size: 12px;
  margin-top: 0.2rem;
  min-height: 1em;
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: #991b1b;
}

/* ==================================================
   Link with arrow
   ================================================== */

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--amber);
  font-size: 14px;
}

.link-arrow svg {
  width: 14px;
  height: 14px;
  transition: transform 180ms var(--ease-out);
}

.link-arrow:hover svg {
  transform: translateX(3px);
}

/* ==================================================
   Icon
   ================================================== */

.icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.icon-sm {
  width: 18px;
  height: 18px;
}

.icon-lg {
  width: 32px;
  height: 32px;
}

.icon-amber {
  color: var(--amber);
}

/* ==================================================
   Media placeholders — designed empty states for
   images & video that the operator will replace
   with real assets. The aspect ratio is locked so
   the surrounding layout doesn't reflow on swap-in.
   ================================================== */

.media-ph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--paper-deep);
  border: 1px dashed color-mix(in srgb, var(--ink-muted) 60%, transparent);
  border-radius: 0.75rem;
  color: var(--ink-muted);
  overflow: hidden;
  isolation: isolate;
}

.media-ph::before {
  content: "";
  display: block;
  padding-bottom: var(--media-ph-aspect, 56.25%); /* default 16:9 */
}

.media-ph[data-aspect="1/1"] { --media-ph-aspect: 100%; }
.media-ph[data-aspect="4/3"] { --media-ph-aspect: 75%; }
.media-ph[data-aspect="3/2"] { --media-ph-aspect: 66.66%; }
.media-ph[data-aspect="16/9"] { --media-ph-aspect: 56.25%; }
.media-ph[data-aspect="3/4"] { --media-ph-aspect: 133.33%; }

.media-ph-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  text-align: center;
}

.media-ph svg {
  width: 28px;
  height: 28px;
  opacity: 0.7;
  flex-shrink: 0;
}

.media-ph--video svg {
  width: 44px;
  height: 44px;
  color: var(--amber);
  opacity: 0.85;
}

.media-ph-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
  max-width: 28ch;
}

.media-ph-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--ink-muted) 70%, transparent);
}

/* Avatar variant — small circular placeholder for headshots */
.media-ph--avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
}

.media-ph--avatar::before {
  display: none;
}

.media-ph--avatar svg {
  position: absolute;
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

/* When a real image is dropped in (operator replaces .media-ph with .media)
   the same wrapper retains aspect-locking but loses the dashed empty state. */
.media {
  position: relative;
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--paper-deep);
}

.media::before {
  content: "";
  display: block;
  padding-bottom: var(--media-aspect, 56.25%);
}

.media[data-aspect="1/1"] { --media-aspect: 100%; }
.media[data-aspect="4/3"] { --media-aspect: 75%; }
.media[data-aspect="3/2"] { --media-aspect: 66.66%; }
.media[data-aspect="16/9"] { --media-aspect: 56.25%; }
.media[data-aspect="3/4"] { --media-aspect: 133.33%; }

.media > img,
.media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==================================================
   WhatsApp floating action button — fixed bottom-right.
   Brand green (#25D366) is intentionally outside our
   cream/ink/amber palette: WhatsApp's visual recognition
   depends on it, and breaking that convention costs more
   in usability than it saves in palette purity.
   ================================================== */

.whatsapp-fab {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem 0.75rem 0.9rem;
  background: #25d366;
  color: #fff;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 8px 24px -8px rgba(37, 211, 102, 0.55), 0 2px 4px rgba(17, 24, 39, 0.18);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out),
    background 200ms var(--ease-out);
}

.whatsapp-fab:hover,
.whatsapp-fab:focus-visible {
  background: #1ebe5a;
  color: #fff;
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(37, 211, 102, 0.6), 0 3px 6px rgba(17, 24, 39, 0.22);
}

.whatsapp-fab:active {
  transform: translateY(0);
}

.whatsapp-fab-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  /* Collapse to icon-only on phones to save real estate. */
  .whatsapp-fab {
    padding: 0.85rem;
  }
  .whatsapp-fab-label {
    display: none;
  }
}
