.howto {
  margin: 2.5rem 0;
}

.howto-header h2 {
  margin: 0 0 0.25rem 0;
}

.howto-header p {
  margin: 0 0 1.25rem 0;
  opacity: 0.85;
}

.howto-header {
  text-align: center;
}

.howto-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  border-bottom: 1px solid #ae9142;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
}

.howto-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #0c2340;
  border-radius: 0;
  padding: 0.35rem 0.9rem 0.7rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  position: relative;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.howto-tab + .howto-tab {
  border-left: 1px solid #ae9142;
}

.howto-tab::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 3px;
  width: 100%;
  background: #ae9142;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.howto-tab:hover {
  border-bottom-color: #ae9142;
  background: transparent;
}

.howto-tab:focus-visible {
  outline: 2px solid #2271b1; /* WP blue */
  outline-offset: 2px;
}

.howto-tab.is-active,
.howto-tab[aria-selected="true"] {
  color: #ae9142;
  font-weight: 600;
  border-bottom-color: #ae9142;
  background: transparent;
}

.howto-tab.is-active::after,
.howto-tab[aria-selected="true"]::after {
  transform: scaleX(1);
}

.howto-tab:hover::after {
  transform: scaleX(1);
}

.howto-panels {
  display: block;
}

.howto-panel[hidden] {
  display: none !important;
}

.howto-step {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.howto-step:last-child {
  border-bottom: none;
}

/* Alternate rows: flip media/text on even steps */
.howto-panel .howto-step:nth-child(even) {
  flex-direction: row-reverse;
}

.howto-media,
.howto-copy {
  flex: 1 1 0;
  min-width: 0;
}

.howto-media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #f2f2f2;
}

.howto-copy h3 {
  margin: 0 0 0.5rem 0;
}

.howto-copy p {
  margin: 0;
  opacity: 0.9;
}

/* Mobile: stack */
@media (max-width: 782px) {
  .howto-step,
  .howto-panel .howto-step:nth-child(even) {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Mobile: remove button-like styling from tabs */
@media (max-width: 921px) {
  .howto-tabs {
    gap: 0;
  }

  .howto-tab {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    font-weight: 500;
  }

  .howto-tab:not(:last-child) {
    border-right: 1px solid #ae9142;
  }

  .howto-tab::after {
    background: #ae9142;
  }

  .howto-tab.is-active,
  .howto-tab[aria-selected="true"] {
    color: #ae9142;
  }
}
