/* ==========================================================================
   Shared components: buttons, chips, breadcrumb, page hero, cards, pagination.
   LAYOUT FILE. Values follow the design rules on the handover board.
   ========================================================================== */

/* ---------- Buttons: weight 700, radius 14, no shadow ---------- */

.ah-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--ah-btn-m);
  padding: 0 26px;
  border: 0;
  border-radius: var(--ah-radius-button);
  font-family: var(--ah-font);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
}

.ah-btn--s {
  height: var(--ah-btn-s);
  padding: 0 22px;
  font-size: 15px;
}

.ah-btn--l {
  height: var(--ah-btn-l);
  padding: 0 30px;
  font-size: 17px;
}

.ah-btn--primary {
  background: var(--ah-orange);
  color: var(--ah-white);
}

.ah-btn--primary:hover {
  background: #E95600;
}

/* Secondary: white, 2 px orange border, text orange. Same height as primary. */
.ah-btn--secondary {
  background: var(--ah-white);
  border: 2px solid var(--ah-orange);
  color: var(--ah-orange-text);
}

.ah-btn--secondary:hover {
  background: var(--ah-peach);
}

.ah-btn--block {
  display: flex;
  width: 100%;
}

/* Everything on mobile is size M, except the hero button (L). */
@media (max-width: 900px) {
  .ah-btn--s {
    height: var(--ah-btn-m);
    font-size: 16px;
  }
}

/* ---------- Chips and filters: active = white, 2 px orange border ---------- */

.ah-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ah-line);
  border-radius: var(--ah-radius-pill);
  background: var(--ah-white);
  color: var(--ah-grey);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.ah-chip.is-active {
  border: 2px solid var(--ah-orange);
  color: var(--ah-orange-text);
}

/* ---------- Breadcrumb ---------- */

.ah-breadcrumb {
  font-size: 14px;
  font-weight: 700;
  color: var(--ah-grey);
}

.ah-breadcrumb a {
  color: var(--ah-grey);
  text-decoration: none;
}

.ah-breadcrumb a:hover {
  color: var(--ah-orange-text);
}

.ah-breadcrumb__sep {
  margin: 0 6px;
  color: var(--ah-muted);
}

.ah-breadcrumb__current {
  color: var(--ah-orange-text);
}

@media (max-width: 900px) {
  .ah-breadcrumb {
    font-size: 13px;
  }
}

/* ---------- Page hero: beige band with breadcrumb, H1, intro ---------- */

.ah-page-hero {
  background: var(--ah-beige);
}

.ah-page-hero__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 60px;
  padding-bottom: 48px;
}

.ah-page-hero__intro {
  max-width: 1050px;
  color: var(--ah-grey);
  font-size: 18px;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .ah-page-hero__inner {
    gap: 12px;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .ah-page-hero__intro {
    font-size: 16px;
  }
}

/* ---------- Cards ---------- */

.ah-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--ah-line);
  border-radius: var(--ah-radius-card);
  background: var(--ah-white);
}

.ah-card__label {
  color: var(--ah-orange-text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ah-card__title {
  font-size: 20px;
  line-height: 1.3;
}

.ah-card__title a {
  color: var(--ah-text);
  text-decoration: none;
}

.ah-card__title a:hover {
  color: var(--ah-orange-text);
}

.ah-card__text {
  color: var(--ah-grey);
  font-size: 15px;
  line-height: 1.6;
}

.ah-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 900px) {
  .ah-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ---------- Pagination: active page uses the active filter style ---------- */

.ah-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.ah-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--ah-radius-pill);
  color: var(--ah-grey);
  font-weight: 700;
  text-decoration: none;
}

.ah-pagination .page-numbers.current {
  border: 2px solid var(--ah-orange);
  background: var(--ah-white);
  color: var(--ah-orange-text);
}

/* ---------- Search form ---------- */

.ah-search {
  display: flex;
  gap: 10px;
  max-width: 640px;
}

.ah-search__input {
  flex: 1;
  min-width: 0;
  height: var(--ah-btn-m);
  padding: 0 18px;
  border: 2px solid var(--ah-input-border);
  border-radius: var(--ah-radius-input);
  background: var(--ah-white);
  font-size: 16px;
  font-weight: 600;
}

.ah-search__input:focus {
  border-color: var(--ah-orange);
  outline: none;
}

.ah-search__field {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
}

.ah-search__field svg {
  position: absolute;
  top: 50%;
  left: 18px;
  color: var(--ah-grey);
  transform: translateY(-50%);
  pointer-events: none;
}

.ah-search__field .ah-search__input {
  padding-left: 48px;
}

/* Large field in the search and error hero (boards T13, T14). */
.ah-search--l {
  gap: 12px;
  max-width: none;
}

.ah-search--l .ah-search__input,
.ah-search--l .ah-btn {
  height: 56px;
}

.ah-search--l .ah-search__input {
  font-weight: 500;
}

.ah-search--l .ah-btn {
  padding: 0 26px;
  font-size: 17px;
}

.ah-search-wrap {
  margin-bottom: 32px;
}

/* ---------- Error pages (404, 410) ---------- */

.ah-error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-width: 760px;
}

.ah-error__kicker {
  color: var(--ah-orange-text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ah-error__text {
  color: var(--ah-grey);
  font-size: 18px;
}

/* ---------- Small shared pieces: kicker, text link, check list, badge ---------- */

/* Orange label above section headings. */
.ah-kicker {
  margin: 0;
  color: var(--ah-orange-text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.4;
}

/* Underlined orange text link (board "vd-link"). */
.ah-link {
  color: var(--ah-orange-text);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ah-link:hover {
  color: var(--ah-orange);
}

/* Bold link with an arrow, no underline. */
.ah-arrowlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ah-orange-text);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.ah-arrowlink:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ah-arrowlink svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.ah-checks {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 1.6;
}

.ah-checks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ah-checks svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--ah-orange-text);
}

.ah-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--ah-radius-pill);
  background: var(--ah-peach);
  color: var(--ah-orange-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  vertical-align: middle;
}

/* ---------- Carousel controls (assets/js/site.js, data-ah-carousel) ---------- */

.ah-roundbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--ah-input-border);
  border-radius: var(--ah-radius-pill);
  background: var(--ah-white);
  color: var(--ah-text);
  cursor: pointer;
}

.ah-roundbtn:hover {
  border-color: var(--ah-orange);
  color: var(--ah-orange-text);
}

.ah-roundbtn:disabled {
  opacity: 0.45;
  cursor: default;
  border-color: var(--ah-input-border);
  color: var(--ah-text);
}

.ah-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ah-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: var(--ah-radius-pill);
  background: var(--ah-input-border);
  cursor: pointer;
  transition: width 0.2s;
}

.ah-dots button.is-active {
  width: 24px;
  background: var(--ah-orange);
}

/* Scroll track: items snap, scrollbar hidden. */
[data-ah-carousel-track] {
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

/* Everything fits: no arrows. */
.is-static [data-ah-carousel-prev],
.is-static [data-ah-carousel-next] {
  display: none;
}

[data-ah-carousel-track]::-webkit-scrollbar {
  display: none;
}

[data-ah-carousel-track] > * {
  scroll-snap-align: start;
}

/* ---------- Tabs: chips as tab buttons (assets/js/site.js, data-ah-tabs) ---------- */

.ah-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ah-tabs__list .ah-chip {
  min-height: 46px;
  padding: 0 20px;
  border-width: 2px;
  font-family: var(--ah-font);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.ah-tabs__list .ah-chip:not(.is-active):hover {
  border-color: var(--ah-muted);
  color: var(--ah-text);
}

/* ---------- Link rows with arrow (calculator list, city list) ---------- */

.ah-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ah-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--ah-line);
  color: var(--ah-text);
  text-decoration: none;
}

.ah-row svg {
  flex-shrink: 0;
  color: var(--ah-orange-text);
}

a.ah-row:hover strong {
  color: var(--ah-orange-text);
}

.ah-row__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ah-row__text strong {
  font-size: 18px;
  line-height: 1.35;
}

.ah-row__text span {
  color: var(--ah-grey);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Desktop / mobile only (900 px, content breakpoint) ---------- */

@media (max-width: 900px) {
  .ah-only-desktop {
    display: none !important;
  }

  .ah-tabs__list {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-right: calc(-1 * var(--ah-page-margin-mobile));
    padding-right: var(--ah-page-margin-mobile);
    scrollbar-width: none;
  }

  .ah-tabs__list::-webkit-scrollbar {
    display: none;
  }

  .ah-tabs__list .ah-chip {
    flex-shrink: 0;
    min-height: 40px;
    padding: 0 14px;
    font-size: 15px;
  }

  .ah-row {
    padding: 14px 0;
  }

  .ah-row__text strong {
    font-size: 16px;
  }

  .ah-row__text span {
    font-size: 14px;
  }
}

@media (min-width: 901px) {
  .ah-only-mobile {
    display: none !important;
  }
}

/* ---------- Table of contents (articles, legal pages) ---------- */

.ah-toc__title {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 800;
}

.ah-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ah-toc__link {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--ah-line);
  color: var(--ah-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.ah-toc__link:hover,
.ah-toc__link.is-active {
  color: var(--ah-orange-text);
}

.ah-toc__link.is-active {
  font-weight: 800;
}

.ah-toc--sidebar {
  padding: 22px 24px;
  border: 1px solid var(--ah-line);
  border-radius: var(--ah-radius-card);
}

.ah-toc--sidebar li:last-child .ah-toc__link {
  border-bottom: 0;
}

/* ---------- Accordion (FAQ), native <details> ---------- */

.ah-accordion__item {
  border-top: 1px solid var(--ah-line);
}

.ah-accordion__item:last-child {
  border-bottom: 1px solid var(--ah-line);
}

.ah-accordion__item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

.ah-accordion__item summary::-webkit-details-marker {
  display: none;
}

.ah-accordion__item summary svg {
  flex-shrink: 0;
  color: var(--ah-orange-text);
  transition: transform 0.2s;
}

.ah-accordion__item[open] summary svg {
  transform: rotate(45deg);
}

.ah-accordion__item summary:hover {
  color: var(--ah-orange-text);
}

.ah-accordion__answer {
  max-width: 760px;
  padding-bottom: 22px;
  color: var(--ah-grey);
  font-size: 16px;
  line-height: 1.65;
}

@media (max-width: 900px) {
  .ah-accordion__item summary {
    padding: 18px 0;
    font-size: 16px;
  }

  .ah-accordion__answer {
    padding-bottom: 18px;
    font-size: 15px;
  }
}

/* ---------- Author box (articles, calculator pages) ---------- */

.ah-author-box {
  display: flex;
  gap: 22px;
  margin-top: 20px;
  padding: 30px;
  border: 1px solid var(--ah-line);
  border-radius: 22px;
}

/* Square crop whatever the upload; img rules of plugins must not stretch it. */
.ah-author-box img.ah-author-box__photo {
  width: 96px;
  height: 96px;
  max-width: none;
  aspect-ratio: 1 / 1;
  border-radius: var(--ah-radius-pill);
  object-fit: cover;
  object-position: center top;
  background: #F2ECE6;
  flex-shrink: 0;
}

.ah-author-box__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ah-author-box__name {
  font-size: 22px;
  font-weight: 800;
}

.ah-author-box__role {
  color: var(--ah-orange-text);
  font-size: 15px;
  font-weight: 700;
}

.ah-author-box__bio {
  color: var(--ah-grey);
  font-size: 16px;
  line-height: 1.6;
}

.ah-author-box__link {
  color: var(--ah-orange-text);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 900px) {
  .ah-author-box {
    gap: 14px;
    margin-top: 0;
    padding: 20px 0 0;
    border: 0;
    border-top: 1px solid var(--ah-line);
    border-radius: 0;
  }

  .ah-author-box img.ah-author-box__photo {
    width: 72px;
    height: 72px;
  }

  .ah-author-box__name {
    font-size: 19px;
  }

  .ah-author-box__role {
    font-size: 14px;
  }

  .ah-author-box__bio {
    font-size: 15px;
    line-height: 1.7;
  }
}
