/* Resource page */
.resource-page {
  position: relative;
  background-color: #fff;
}

.resource-banner {
  position: relative;
  width: 100%;
  height: 460px;
  overflow: hidden;
  background-color: var(--color-gray-light);
}

.resource-banner__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.resource-banner__img--mobile {
  display: none;
}

.resource-body {
  padding: 48px 0 56px;
}

.resource-section-title {
  margin: 0;
  font-size: 36px;
  font-weight: var(--font-weight-body);
  line-height: 1.2;
  color: var(--color-primary);
}

/* Layout */
.resource-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto auto;
  column-gap: var(--layout-gap);
  row-gap: 32px;
  align-items: start;
}

.resource-layout > .resource-sidebar,
.resource-layout > .resource-main {
  display: contents;
}

.resource-sidebar__title {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

.resource-sidebar__nav {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.resource-sidebar__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.resource-sidebar__group-title {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  color: #333;
  margin-bottom: 20px;
}

.resource-sidebar__group-title--sub {
  font-size: 14px;
  margin-bottom: 6px;
  color: #333;
}

.resource-sidebar__group-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  margin-bottom: 20px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.3s;
}

.resource-sidebar__group--collapsible .resource-sidebar__group-title {
  margin-bottom: 0;
}

.resource-sidebar__group-head:hover .resource-sidebar__group-title,
.resource-sidebar__group-head:hover .resource-sidebar__toggle {
  color: var(--color-primary);
}

.resource-sidebar__toggle {
  flex-shrink: 0;
  width: auto;
  height: auto;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  color: #333;
  pointer-events: none;
  transition: color 0.3s;
}

.resource-sidebar__group--collapsible:not(.is-open) .resource-sidebar__group-items {
  display: none;
}

.resource-sidebar__group-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.resource-sidebar__group:not(:has(.resource-sidebar__group-title)) > a:first-of-type {
  font-weight: 400;
  color: #333;
}

.resource-sidebar__group a {
  font-size: 14px;
  font-weight: var(--font-weight-body);
  line-height: 1.5;
  color: var(--color-text);
  transition: color 0.3s;
  text-decoration: none;
}

.resource-sidebar__item {
  font-size: 14px;
  font-weight: var(--font-weight-body);
  line-height: 1.5;
  color: var(--color-text);
}

.resource-sidebar__item.is-active {
  color: var(--color-primary);
}

.resource-sidebar__group a:hover,
.resource-sidebar__group a.is-active {
  color: var(--color-primary);
  font-weight: 400;
}

.resource-sidebar__ellipsis {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
}

.resource-sidebar__more {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: var(--font-weight-body);
  line-height: 1.5;
  color: var(--color-text);
  transition: color 0.3s;
  text-decoration: none;
}

.resource-sidebar__more:hover {
  color: var(--color-primary);
}

.resource-head {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

.resource-head__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-black);
  margin-bottom: 12px;
}

.resource-head__label {
  margin: 0;
  font-size: 14px;
  font-weight: var(--font-weight-body);
  line-height: 1.5;
  color: var(--color-black);
}

.resource-head__intro {
  margin: 0;
  font-size: 14px;
  font-weight: var(--font-weight-body);
  line-height: 1.8;
  color: var(--color-text);
}

.resource-head__back {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: var(--font-weight-body);
  line-height: 1.5;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s;
}

.resource-head__back:hover {
  color: var(--color-primary);
}

.resource-main__content {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  min-width: 0;
}

/* Promo banner */
.resource-promo {
  display: grid;
  grid-template-columns: minmax(0, 340px) 1fr;
  gap: 0;
  margin-bottom: 32px;
  background-color: var(--color-gray-light);
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s;
}

a.resource-promo:hover {
  opacity: 0.92;
}

.resource-promo__media {
  overflow: hidden;
  background-color: var(--color-gray-light);
}

.resource-promo__media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 160px;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.resource-promo__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 32px;
  text-align: center;
}

.resource-promo__text {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: var(--font-weight-body);
  line-height: 1.8;
  color: var(--color-black);
}

.resource-promo__more {
  font-size: 14px;
  font-weight: var(--font-weight-body);
  line-height: 1.5;
  color: var(--color-black);
  transition: color 0.3s;
}

.resource-promo__more:hover {
  color: var(--color-primary);
}

/* Grid */
.resource-grid__title {
  margin: 0 0 20px;
  font-size: 16px;
  font-weight: var(--font-weight-title);
  line-height: 1.5;
  color: var(--color-black);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--layout-gap);
}

.resource-card__link {
  display: block;
  color: inherit;
}

.resource-card__image {
  position: relative;
  aspect-ratio: 523 / 361;
  overflow: hidden;
  background-color: var(--color-gray-light);
}

.resource-card__zoom {
  position: absolute;
  inset: 0;
  display: block;
  transform: translateZ(0) scale(1);
  transition: transform 0.45s ease;
  backface-visibility: hidden;
  transform-origin: center center;
}

.resource-card:hover .resource-card__zoom {
  transform: translateZ(0) scale(1.03);
}

.resource-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.resource-card__name {
  margin-top: 12px;
  font-size: 13px;
  font-weight: var(--font-weight-body);
  line-height: 1.5;
  color: var(--color-text);
  text-align: left;
}

/* Pager */
.resource-pager {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
}

.resource-pager__btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background-color: #737373;
  cursor: pointer;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-pager__btn::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto;
  background: url("../images/arrow-right.svg") no-repeat center;
  background-size: contain;
}

.resource-pager__btn--prev::after {
  transform: scaleX(-1);
}

.resource-pager__btn:hover:not(.is-disabled) {
  background-color: #404040;
}

/* Highlights */
.resource-highlights {
  padding: 0 0 80px;
}

.resource-highlights__title {
  position: relative;
  display: inline-block;
  margin-bottom: 32px;
  padding-bottom: 6px;
}

.resource-highlights__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: -1;
  width: 100%;
  height: 12px;
  background-color: rgba(215, 102, 71, 0.15);
}

.resource-highlights__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--layout-gap);
}

.resource-highlight__image {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 523 / 361;
  background-color: var(--color-gray-light);
}

.resource-highlight__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #000;
  opacity: 0.3;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.resource-highlight:hover .resource-highlight__image::after {
  opacity: 0;
}

.resource-highlight__image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.resource-highlight__name {
  margin-top: 16px;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: var(--font-weight-title);
  line-height: 1.5;
  color: var(--color-black);
}

.resource-highlight__desc {
  font-size: 14px;
  font-weight: var(--font-weight-body);
  line-height: 1.8;
  color: var(--color-text);
}

.resource-float {
  position: fixed;
  right: 24px;
  bottom: 32px;
  z-index: 100;
  display: block;
  width: 48px;
  height: 48px;
  transition: transform 0.3s;
}

.resource-float img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
}

.resource-float:hover {
  transform: scale(1.05);
}

/* Mobile toolbar */
.resource-mobile {
  display: none;
}

.resource-mobile__categories {
  margin-bottom: 12px;
}

.resource-mobile__tab {
  display: inline-block;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  font-size: 14px;
  font-weight: var(--font-weight-body);
  line-height: 1.5;
  color: var(--color-text);
  text-decoration: none;
}

.resource-mobile__tab:hover {
  color: var(--color-primary);
}

.resource-mobile__group-label {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: var(--font-weight-body);
  line-height: 1.5;
  color: var(--color-text);
}

.resource-mobile__group-label.is-active {
  color: var(--color-primary);
}

@media (min-width: 1024px) and (max-width: 1100px) {
  .resource-body > .container,
  .resource-highlights > .container {
    padding: 0 20px;
    box-sizing: border-box;
  }
}

/* Tablet */
@media (max-width: 1023px) {
  .resource-banner {
    height: 380px;
  }

  .resource-body > .container,
  .resource-highlights > .container {
    padding: 0 20px;
    box-sizing: border-box;
  }

  .resource-body {
    padding: 40px 0 48px;
  }

  .resource-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    row-gap: 24px;
  }

  .resource-sidebar__title,
  .resource-sidebar__nav,
  .resource-head,
  .resource-main__content {
    grid-column: 1;
    grid-row: auto;
  }

  .resource-desktop-only {
    display: none !important;
  }

  .resource-mobile {
    display: block;
    margin-bottom: 24px;
  }

  .resource-mobile__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }

  .resource-mobile__back {
    font-size: 14px;
    color: var(--color-text);
    text-decoration: none;
  }

  .resource-mobile__back:hover {
    color: var(--color-primary);
  }

  .resource-mobile__label {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: var(--font-weight-body);
    color: var(--color-black);
  }

  .resource-mobile__intro {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--color-text);
  }

  .resource-mobile__nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .resource-mobile__nav::-webkit-scrollbar {
    display: none;
  }

  .resource-mobile__chip {
    flex-shrink: 0;
    padding: 6px 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 16px;
    background: #fff;
    font-size: 12px;
    color: var(--color-text);
    cursor: pointer;
    transition: color 0.3s, border-color 0.3s;
    text-decoration: none;
  }

  .resource-mobile__chip:hover {
    color: var(--color-primary);
  }

  .resource-promo {
    grid-template-columns: 1fr;
  }

  .resource-promo__media img {
    min-height: 200px;
  }

  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .resource-highlights__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 767px) {
  .resource-banner {
    height: 300px;
  }

  .resource-banner__img--desktop {
    display: none;
  }

  .resource-banner__img--mobile {
    display: block;
  }

  .resource-body > .container,
  .resource-highlights > .container {
    padding: 0 16px;
  }

  .resource-section-title {
    font-size: 28px;
  }

  .resource-body {
    padding: 32px 0 40px;
  }

  .resource-mobile__nav {
    margin: 0 -16px 20px;
    padding: 0 16px 4px;
  }

  .resource-promo__body {
    padding: 20px 16px;
  }

  .resource-grid,
  .resource-highlights__grid {
    grid-template-columns: 1fr;
  }

  .resource-highlights {
    padding-bottom: 56px;
  }

  .resource-float {
    right: 16px;
    bottom: 24px;
    width: 42px;
    height: 42px;
  }
}

/* Resource detail page */
.resource-page--detail .resource-layout--detail {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto auto;
  column-gap: 48px;
  row-gap: 32px;
}

.resource-page--detail .resource-layout--detail > .resource-sidebar,
.resource-page--detail .resource-layout--detail > .resource-main {
  display: contents;
}

.resource-page--detail .resource-sidebar__title {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

.resource-detail__desc {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  max-width: 200px;
  min-height: 100%;
}

.resource-page--detail .resource-detail__desc {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
}

.resource-detail__text {
  flex: 1;
}

.resource-detail__para {
  margin: 0;
  font-size: 14px;
  font-weight: var(--font-weight-body);
  line-height: 1.8;
  color: var(--color-text);
}

.resource-detail__para + .resource-detail__para {
  margin-top: 28px;
}

.resource-detail__download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding: 10px 0;
  border-top: 1px solid #333;
  border-bottom: 1px solid #333;
  font-size: 14px;
  font-weight: var(--font-weight-body);
  line-height: 1.5;
  color: #333;
  transition: color 0.3s;
}

.resource-detail__download:hover {
  color: var(--color-primary);
}

.resource-detail__download-icon {
  position: relative;
  flex-shrink: 0;
  width: 12px;
  height: 14px;
}

.resource-detail__download-icon::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}

.resource-detail__download-icon::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: currentColor;
}

.resource-page--detail .resource-head--detail {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

.resource-page--detail .resource-detail__content {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.resource-mobile-desc {
  display: none;
}

.resource-mobile--detail {
  display: none;
}

/* Resource download page */
.resource-download-grid {
  margin-top: 0;
}

.resource-download-card.is-hidden {
  display: none;
}

.resource-download__trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.resource-download__trigger--image {
  position: absolute;
  inset: 0;
  height: 100%;
}

.resource-download__trigger--image .resource-card__zoom {
  position: absolute;
  inset: 0;
}

.resource-download__trigger.resource-card__name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  transition: color 0.3s;
  font-size: 13px;
  font-weight: var(--font-weight-body);
  line-height: 1.5;
  color: var(--color-text);
  text-align: left;
}

.resource-download__icon {
  position: relative;
  flex-shrink: 0;
  width: 12px;
  height: 14px;
}

.resource-download__icon::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}

.resource-download__icon::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: currentColor;
}

.resource-download-card:hover .resource-download__trigger.resource-card__name,
.resource-download__trigger.resource-card__name:hover {
  color: var(--color-primary);
}


@media (max-width: 1023px) {
  .resource-page--detail .resource-mobile--detail {
    display: block;
    margin-bottom: 20px;
  }

  .resource-page--detail .resource-mobile-desc {
    display: block;
    margin-bottom: 20px;
  }

  .resource-page--detail .resource-mobile-desc .resource-detail__desc {
    max-width: none;
  }

  .resource-page--detail .resource-layout--detail {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    row-gap: 24px;
  }

  .resource-page--detail .resource-sidebar__title,
  .resource-page--detail .resource-detail__desc,
  .resource-page--detail .resource-head--detail,
  .resource-page--detail .resource-detail__content {
    grid-column: 1;
    grid-row: auto;
  }
}
