/* ---------- Reusable ---------- */
.page-location {
  margin-bottom: 0 !important;
}

/* ---------- Author page layout ---------- */
.author-page {
  padding-top: 32px;
  padding-bottom: 100px;
}
.author-content {
  display: flex;
  flex-direction: column;
  gap: 100px;
  min-width: 0;
}

/* Profile card */
.author-profile {
  width: 100vw;
  max-width: 100vw;
  margin-inline: calc(var(--container-pad-mobile, 20px) * -1);
  padding: 20px;
  background-color: var(--theme-surface-bg, #0E0C0C);
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.author-profile > section {
  min-width: 0;
}
.author-profile__lead p {
  color: var(--theme-text-soft);
  font-weight: var(--fw-regular);
  font-size: inherit;
  margin: 0;
}
.author-profile__title,
.author-profile__subtitle,
.author-profile__lead,
.author-profile__section {
  width: 100%;
  max-width: calc(100vw - (var(--container-pad-mobile, 20px) * 2));
  overflow-wrap: break-word;
}
.author-profile__title {
  color: var(--theme-text-main);
}
.author-profile__subtitle {
  color: var(--theme-text-muted);
}
.author-profile__image-wrapper {
  width: min(335px, calc(100vw - (var(--container-pad-mobile, 20px) * 2)));
  aspect-ratio: 1 / 1;
  align-self: flex-start;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  outline: 1px solid var(--theme-accent, #E13122);
  outline-offset: -1px;
}
.author-profile__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.author-profile__subtitle {
  color: var(--theme-text-muted, rgba(255,255,255,0.4));
}
.author-profile__lead {
  margin-top: 40px;
  font-family: 'Roboto', sans-serif;
  color: var(--theme-text-soft, rgba(255,255,255,0.6));
}
.author-profile__section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.author-profile__section-title {
  color: var(--theme-text-main, #fff);
}
.author-profile__section-text {
  font-family: 'Roboto', sans-serif;
  color: var(--theme-text-soft, rgba(255,255,255,0.6));
}
.author-profile__lead,
.author-profile__section-text,
.author-profile__fact-value {
  word-break: break-word;
}
.author-profile__facts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}
.author-profile__fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.author-profile__fact-term {
  font-family: 'Roboto', sans-serif;
  color: var(--theme-text-soft, rgba(255,255,255,0.6));
}
.author-profile__fact-value {
  font-family: 'Roboto', sans-serif;
  color: var(--theme-text-main, #fff);
}

/* Works */
.author-works {
  min-width: 0;
  max-width: 335px;
}
.author-works__title {
  margin-bottom: 32px;
}
.author-works__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 16px;
  justify-content: start;
  list-style: none;
  padding: 0;
  margin: 0;
}
.author-works__item {
  min-width: 0;
}
.author-works__link {
  display: block;
  width: 100%;
  max-width: 213px;
  color: inherit;
  text-decoration: none;
}
.author-works__image-wrapper {
  position: relative;
  width: 100%;
  max-width: 213px;
  aspect-ratio: 213 / 323;
  overflow: hidden;
}
.author-works__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.author-works__name {
  margin-top: 16px;
}
.author-works__price {
  color: var(--theme-text-soft, rgba(255,255,255,0.6));
}

/* Back link */
.author-page__back-link {
  display: flex;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  margin-top: 32px;
}

/* ===== Product card (sync with catalog) ===== */
.product-card {
  position: relative;
  container: product-card / inline-size;
  --product-card-media-height: 151.643cqw;
  --product-card-action-height: clamp(58px, 30.5cqw, 65px);
  --product-card-action-padding-x: 10px;
  --product-card-action-padding-y: 10px;
  --product-card-action-gap: clamp(12px, 9.4cqw, 20px);
  --product-card-action-bottom: var(--product-card-panel-line);
  --product-card-favorite-size: 45px;
  --product-card-icon-size: 29px;
  --product-card-cart-height: 45px;
  --product-card-cart-padding-x: clamp(12px, 6.5cqw, 20px);
  --product-card-cart-font-size: 21px;
  --product-card-line-gap: 2px;
  --product-card-line-split: 66.666%;
  --product-card-panel-bg: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.3) 50%,
    rgba(0, 0, 0, 0) 100%
  );
  --product-card-panel-hover-bg: rgba(255, 255, 255, 0.14);
  --product-card-panel-line: 4px;
  --product-card-line-fill: 0%;
}

.product-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.product-card__media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.product-card__image {
  display: block;
}

.product-card__content {
  padding-top: 16px;
}

.product-card__hover-panel {
  position: absolute;
  top: calc(
    var(--product-card-media-height) - var(--product-card-action-bottom) -
      var(--product-card-action-height)
  );
  right: 0;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--product-card-action-gap);
  height: var(--product-card-action-height);
  padding: var(--product-card-action-padding-y)
    var(--product-card-action-padding-x);
  overflow: hidden;
  background: var(--product-card-panel-bg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.product-card__line {
  position: absolute;
  top: calc(var(--product-card-media-height) - var(--product-card-panel-line));
  z-index: 4;
  height: var(--product-card-panel-line);
  overflow: hidden;
  background: var(--theme-text-main);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.product-card__line::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--product-card-line-fill);
  background: var(--theme-accent);
  transition: width 260ms ease;
}

.product-card__line--favorite {
  left: 0;
  width: calc(var(--product-card-line-split) - var(--product-card-line-gap));
}

.product-card__line--cart {
  right: 0;
  width: calc(100% - var(--product-card-line-split));
}

.product-card.is-favorite .product-card__line--favorite::before {
  width: 100%;
}

.product-card.is-in-cart .product-card__line--cart::before {
  width: 100%;
}

.product-card__favorite {
  appearance: none;
  border: 0;
  flex: 0 0 var(--product-card-favorite-size);
  flex-shrink: 0;
  width: var(--product-card-favorite-size);
  min-width: var(--product-card-favorite-size);
  height: var(--product-card-favorite-size);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-text-main);
  background: rgba(0, 0, 0, 0);
  cursor: pointer;
  font: inherit;
  transition: background-color 180ms ease;
}

.product-card__favorite-icon {
  flex: 0 0 var(--product-card-icon-size);
  width: var(--product-card-icon-size);
  height: var(--product-card-icon-size);
  background: url("/images/icon-heart-outline.svg") center / contain no-repeat;
}

.product-card__favorite.is-active,
.product-card.is-favorite .product-card__favorite,
.product-card--favorite .product-card__favorite {
  color: var(--theme-accent);
}

.product-card__favorite.is-active .product-card__favorite-icon,
.product-card.is-favorite .product-card__favorite-icon,
.product-card--favorite .product-card__favorite-icon {
  background-image: url("/images/icon-heart-filled.svg");
}

.product-card__cart {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: var(--product-card-cart-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px var(--product-card-cart-padding-x);
  font-size: var(--product-card-cart-font-size);
  white-space: nowrap;
}

/* Price styles */
.author-works__price ins { text-decoration: none; color: #fff; }
.author-works__price del { color: rgba(255,255,255,0.4); margin-right: 8px; }

@media screen and (min-width: 1025px) {
  .product-card {
    --product-card-action-height: clamp(65px, 30.5cqw, 76px);
    --product-card-favorite-size: 45px;
    --product-card-icon-size: clamp(29px, 10.3cqw, 34px);
    --product-card-cart-height: clamp(45px, 16.4cqw, 54px);
  }

  .product-card__cart {
    padding-inline: var(--product-card-cart-padding-x);
  }
}

@media (hover: hover) and (pointer: fine) {
  .product-card:not(.is-favorite):hover .product-card__line--favorite::before,
  .product-card:not(.is-favorite)
    .product-card__media:hover
    .product-card__line--favorite::before {
    width: 50%;
  }

  .product-card:hover .product-card__line {
    opacity: 1;
  }

  .product-card:hover .product-card__hover-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .product-card.is-favorite:hover .product-card__line--favorite::before {
    width: 100%;
  }

  .product-card.is-in-cart:hover .product-card__line--cart::before {
    width: 100%;
  }

  .product-card__favorite:hover,
  .product-card__favorite:focus-visible {
    background-color: var(--product-card-panel-hover-bg);
  }
}

@container product-card (min-width: 280px) {
  .product-card__hover-panel {
    --product-card-action-height: 85px;
    --product-card-action-padding-x: 20px;
    --product-card-action-padding-y: 10px;
    --product-card-action-gap: 20px;
    --product-card-action-bottom: 14px;
    --product-card-favorite-size: 45px;
    --product-card-icon-size: 34px;
    --product-card-cart-height: 45px;
    --product-card-cart-padding-x: 20px;
  }
}

/* Override: hover only on favorite icon, not the full square button */
@media (hover: hover) and (pointer: fine) {
  .product-card__favorite:hover,
  .product-card__favorite:focus-visible {
    background-color: transparent !important;
  }
  .product-card__favorite:hover .product-card__favorite-icon,
  .product-card__favorite:focus-visible .product-card__favorite-icon {
    opacity: 1;
    transform: scale(1.15);
    transition: opacity 180ms ease, transform 180ms ease;
  }
}



/* Toast fallback */
.vtheme-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  background: #191919;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 14px 22px;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  transform: translateY(-20px);
  opacity: 0;
  visibility: hidden;
  transition: transform .3s ease, opacity .3s ease, visibility .3s;
  pointer-events: none;
}
.vtheme-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* ---------- Responsive ---------- */
@media screen and (min-width: 640px) and (max-width: 767px) {
  .author-works {
    max-width: none;
  }
  .author-works__list {
    grid-template-columns: repeat(3, minmax(0, 213px));
  }
}

@media screen and (min-width: 768px) {
  .author-page {
    padding-top: 40px;
    padding-bottom: 140px;
  }
  .author-profile {
    width: auto;
    max-width: none;
    margin-inline: 0;
    padding: 30px;
  }
  .author-profile__image-wrapper {
    width: min(366px, 100%);
    max-width: 366px;
    padding: 30px;
  }
  .author-profile__lead {
    margin-top: 40px;
  }
  .author-profile__title,
  .author-profile__subtitle,
  .author-profile__lead,
  .author-profile__section {
    max-width: none;
  }
  .author-profile__section {
    gap: 20px;
  }
  .author-profile__facts-list {
    gap: 20px;
  }
  .author-works__title {
    margin-bottom: 40px;
  }
  .author-works {
    max-width: none;
  }
  .author-works__list {
    gap: 32px 20px;
    grid-template-columns: repeat(auto-fit, minmax(157px, 213px));
    justify-content: start;
  }
  .author-works__name {
    margin-top: 20px;
  }
}

@media screen and (min-width: 1025px) {
  .author-page {
    padding-top: 60px;
    padding-bottom: 180px;
  }
  .author-content {
    display: grid;
    grid-template-columns: minmax(320px, 640px) minmax(466px, 1fr);
    align-items: start;
    gap: 60px;
  }
  .author-profile {
    gap: 40px;
    max-width: 640px;
    padding: 40px;
  }
  .author-profile__image-wrapper {
    width: 364px;
    max-width: 100%;
    align-self: flex-start;
    padding: 40px;
  }
  .author-works__list {
    grid-template-columns: repeat(2, 213px);
    gap: 32px 40px;
  }
  .author-page__back-link {
    margin-top: 40px;
  }
}

@media screen and (min-width: 1400px) {
  .author-page {
    padding-top: 80px;
    padding-bottom: 220px;
  }
  .author-content {
    gap: 80px;
  }
  .author-works__list {
    gap: 40px;
    grid-template-columns: repeat(2, minmax(0, 213px));
  }
}

@media screen and (min-width: 1600px) {
  .author-content {
    grid-template-columns: minmax(320px, 640px) 719px;
  }
  .author-works__list {
    grid-template-columns: repeat(3, 213px);
  }
}
