/*
 * eBooks page.
 *
 * Hero and contact-cta reuse the SHARED .a3-hero / .a3-contact-cta classes from
 * service.css, exactly as page-csr.php does, so nothing for those is repeated
 * here. Only the download grid is new.
 *
 * The live page runs these cards in a Swiper carousel; this is a plain grid.
 * With one eBook a carousel is all chrome and no content, and a grid needs no
 * JavaScript to wrap when more are added.
 */

.a3-ebk {
  padding: 88px 0;
  background: #fff;
}

.a3-ebk__header {
  max-width: 760px;
  margin: 0 0 40px;
}

.a3-ebk__heading {
  margin: 0 0 12px;

  font-family: Inter, sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.8px;
  color: #18181B;
}

.a3-ebk__description {
  margin: 0;

  font-family: Inter, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #52525B;
}

/* auto-fit rather than a fixed column count: one eBook sits at its natural
   width instead of stretching across the row, and more simply wrap. */
.a3-ebk__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 420px));
  gap: 32px;
}

.a3-ebk__card {
  display: flex;
  flex-direction: column;
  overflow: hidden;

  background: #fff;
  border: 1px solid #E4E4E7;
  border-radius: 16px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.a3-ebk__card:hover {
  border-color: #FF6900;
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .18);
  transform: translateY(-2px);
}

.a3-ebk__media {
  aspect-ratio: 680 / 537;   /* the cover artwork's own ratio */
  overflow: hidden;
  background: #FAFAFA;
}

.a3-ebk__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.a3-ebk__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 28px;
}

.a3-ebk__category {
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: #FF6900;
}

.a3-ebk__title {
  margin: 0;

  font-family: Inter, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  color: #18181B;
}

/* margin-top:auto pins the button to the bottom, so cards of differing title
   length still line their buttons up across the row. */
.a3-ebk__download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px 22px;

  background: #FF6900;
  border-radius: 999px;
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease;
}

.a3-ebk__download:hover,
.a3-ebk__download:focus {
  background: #E25F00;
  color: #fff;
}

.a3-ebk__download:focus-visible {
  outline: 2px solid #18181B;
  outline-offset: 2px;
}

/* ---- hero mark ---------------------------------------------------------- */

.a3-ebk-hero__icon {
  display: block;
  width: auto;
  max-width: 155px;
  height: auto;
  margin: 0 0 20px;
}

@media (max-width: 767px) {
  .a3-ebk { padding: 56px 0; }
  .a3-ebk__heading { font-size: 28px; }
  .a3-ebk__grid { grid-template-columns: 1fr; gap: 24px; }
  .a3-ebk__body { padding: 22px; }
}

/* ---- recent posts slider ------------------------------------------------ *
 *
 * The cards themselves are the site-wide .a3-ba-resource ones styled by
 * blog-article.css, which this template enqueues. Only the Slick track needs
 * anything, and it is the same treatment the contact page's office slider
 * gets - grid gives way to a block, the gutter moves to the slide, and the
 * list is pulled out by that gutter so the first and last cards sit flush.
 * ------------------------------------------------------------------------- */

.a3-ebk-posts__slider.slick-initialized {
  display: block;
}

.a3-ebk-posts__slider.slick-initialized .slick-track {
  display: flex;
  align-items: stretch;
}

.a3-ebk-posts__slider.slick-initialized .slick-slide {
  height: auto;
  display: flex;
  flex-direction: column;
  margin: 0 16px;
}

.a3-ebk-posts__slider.slick-initialized .slick-list {
  margin: 0 -16px;
}

.a3-ebk-posts__slider.slick-initialized .slick-prev,
.a3-ebk-posts__slider.slick-initialized .slick-next {
  width: 44px;
  height: 44px;
  top: auto;
  bottom: 0;
  transform: none;
  z-index: 2;

  background: #fff;
  border: 1px solid #E4E4E7;
  border-radius: 50%;
}

.a3-ebk-posts__slider.slick-initialized .slick-prev { left: auto; right: 60px; }
.a3-ebk-posts__slider.slick-initialized .slick-next { right: 0; }

.a3-ebk-posts__slider.slick-initialized .slick-prev::before,
.a3-ebk-posts__slider.slick-initialized .slick-next::before {
  font-family: inherit;
  font-size: 20px;
  line-height: 1;
  color: #FF6900;
  opacity: 1;
}

.a3-ebk-posts__slider.slick-initialized .slick-prev::before { content: "\2039"; }
.a3-ebk-posts__slider.slick-initialized .slick-next::before { content: "\203A"; }

.a3-ebk-posts__slider.slick-initialized .slick-prev.slick-disabled,
.a3-ebk-posts__slider.slick-initialized .slick-next.slick-disabled {
  opacity: .45;
  cursor: default;
}

.a3-ebk-posts__slider.slick-initialized .slick-dots {
  position: static;
  margin: 30px 0 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.a3-ebk-posts__slider.slick-initialized .slick-dots li,
.a3-ebk-posts__slider.slick-initialized .slick-dots li button {
  width: 10px;
  height: 10px;
  padding: 0;
}

.a3-ebk-posts__slider.slick-initialized .slick-dots li button::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #D4D4D8;
  opacity: 1;
}

.a3-ebk-posts__slider.slick-initialized .slick-dots li.slick-active button::before {
  background: #FF6900;
}

.a3-ebk-posts__actions {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}
