/*
Theme Name: Heyfontlab
Description: Editorial font foundry block theme based on the Heyfontlab Pen design.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: heyfontlab
*/

html.hf-scroll-active { scroll-behavior: auto !important; }

/* The editor keeps its neutral border when clicked. */
.hf-product-workspace #hf-product-preview:focus,
.hf-product-workspace #hf-product-preview:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border-color: #afa79b !important;
}

/* License labels are pill controls with identical geometry in every state. */
.hf-product-page .hf-license-radio-heading,
.hf-product-page .hf-product-license > label,
.hf-product-page .hf-license-tier-trigger {
  border-radius: 999px !important;
  box-sizing: border-box;
  min-height: 44px;
  padding-inline: 18px !important;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.hf-product-page .hf-license-radio-heading {
  display: flex;
  align-items: center;
  height: auto;
  width: 100%;
  line-height: 1.4;
  padding-block: 10px;
}
.hf-product-page .hf-license-tier-menu {
  border-radius: 28px !important;
  outline: none !important;
  border: 1px solid #beb5a5;
  padding: 5px;
  margin: 4px 0 8px;
}
body:not(.wp-admin) .hf-product-page .hf-license-tier-menu button {
  border-radius: 22px !important;
  border-bottom: 0;
  transition: background-color 180ms ease, color 180ms ease;
}
.hf-product-page .hf-license-option-check {
  display: block;
  visibility: hidden;
}
.hf-product-page .hf-license-tier-menu button[aria-selected="true"] .hf-license-option-check {
  visibility: visible;
}
@media (prefers-reduced-motion: reduce) {
  .hf-product-page :is(.hf-license-radio-heading, .hf-license-tier-trigger, .hf-license-tier-menu button) {
    transition: none;
  }
}

/* Glyph tabs use a complete oval outline instead of an underline. */
.hf-product-page .hf-glyph-tabs {
  gap: 8px;
  flex-wrap: wrap;
}
.hf-product-page .hf-glyph-tabs button {
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  padding: 8px 14px;
  min-height: 36px;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: none;
  transition: border-color 180ms ease, color 180ms ease;
}
.hf-product-page .hf-glyph-tabs button::before,
.hf-product-page .hf-glyph-tabs button::after {
  content: none !important;
}
.hf-product-page .hf-glyph-tabs button:hover,
.hf-product-page .hf-glyph-tabs button:focus-visible,
.hf-product-page .hf-glyph-tabs button[aria-selected="true"] {
  border-color: #c62b6d !important;
  color: #0b0d0f;
}
@media (prefers-reduced-motion: reduce) {
  .hf-product-page .hf-glyph-tabs button { transition: none; }
}

/* Round the tester's outer frame, including its tabs and editable preview. */
.hf-product-workspace {
  outline: none !important;
  border: 1px solid #beb5a5;
  border-radius: 31px !important;
}
.hf-product-workspace .hf-product-tabs {
  margin: 8px 8px 0;
  width: auto;
  height: 44px;
  gap: 6px;
  border-radius: 999px;
  box-sizing: border-box;
}
.hf-product-workspace .hf-product-tabs button {
  min-width: 0;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}
.hf-product-workspace [role="tabpanel"] {
  border-radius: 0 0 30px 30px;
}
.hf-product-workspace #hf-product-preview {
  border-radius: 0 0 12px 12px !important;
  scrollbar-width: thin;
  scrollbar-color: #8b827466 transparent;
  scrollbar-gutter: stable;
}
.hf-product-workspace .hf-product-edit-hint {
  border-radius: 12px 12px 0 0 !important;
}
.hf-product-workspace #hf-product-preview::-webkit-scrollbar {
  width: 5px;
  height: 5px;
  background: transparent;
}
.hf-product-workspace #hf-product-preview::-webkit-scrollbar-track,
.hf-product-workspace #hf-product-preview::-webkit-scrollbar-corner {
  background: transparent;
}
.hf-product-workspace #hf-product-preview::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #8b827466;
}
.hf-product-workspace #hf-product-preview::-webkit-scrollbar-thumb:hover {
  background: #8b8274aa;
}
.hf-product-workspace #hf-product-preview::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

/* Rounded navigation dropdowns and their highlighted items. */
.hf-header .wp-block-navigation .wp-block-navigation__submenu-container,
.hf-header .hf-navigation .sub-menu {
  border-radius: 14px !important;
}
.hf-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content,
.hf-header .hf-navigation .sub-menu a {
  border-radius: 8px !important;
}

/* Composite controls and purchase links that do not use button markup. */
.hf-tester-controls .hf-home-font-static,
.hf-tester-controls > label,
.hf-tester-sidebar > a,
.hf-newsletter-form {
  border-radius: 999px !important;
}
.hf-tester-controls .hf-select-menu {
  border-radius: 12px !important;
}

/* Consistent rounded surfaces across the storefront. */
:root {
  --hf-radius-surface: 16px;
  --hf-radius-control: 10px;
}
body:not(.wp-admin) :is(
  .hf-featured-card, .hf-catalog-card, .hf-related-card, .hf-card,
  .hf-blog-card, .hf-article-related-card, .hf-license-panel,
  .hf-home-tester-panel, .hf-tester-preview, .hf-tester-controls,
  .hf-poster, .hf-contact-message-panel, .hf-full-cart-summary,
  .hf-checkout-order, .hf-checkout-order-preview, .hf-delivery-order,
  .hf-product-license-summary, .hf-product-summary, .hf-wc-summary,
  .hf-catalog-search, .hf-blog-search,
  dialog, .hf-search-dialog, .hf-specimen-dialog,
  .hf-licensing-dialog, .hf-cart-dialog,
  .woocommerce-message, .woocommerce-info, .woocommerce-error,
  .hf-cart-live-notice, .hf-reset-link-notice,
  .wc-block-components-notice-banner,
  .woocommerce table.shop_table, .hf-account-orders-table
) {
  border-radius: var(--hf-radius-surface) !important;
}
body:not(.wp-admin) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
  select, textarea,
  .wc-block-components-text-input input,
  .wc-block-components-combobox-control input
) {
  border-radius: var(--hf-radius-control) !important;
}
body:not(.wp-admin) input[type="checkbox"] { border-radius: 4px; }
body:not(.wp-admin) :is(
  .wp-block-image img, .hf-product-main-image, .hf-product-main-image img,
  .hf-font-detail-artwork, .hf-specimen-artwork,
  .hf-full-cart-image, .hf-full-cart-image img,
  .hf-account-font-image, .hf-freebies-product-image,
  .hf-type-tile-image, .hf-wc-gallery .woocommerce-product-gallery__wrapper
) {
  border-radius: var(--hf-radius-control) !important;
}
/* Clip artwork to its containing card rather than rounding each inner edge. */
:is(.hf-featured-card, .hf-catalog-card, .hf-related-card, .hf-card,
  .hf-blog-card, .hf-article-related-card, .hf-poster,
  .hf-font-detail-artwork, .hf-specimen-artwork) {
  overflow: hidden;
}

/* A shared pill shape for storefront actions, including WooCommerce controls. */
body:not(.wp-admin) :is(
  button:not(.hf-featured-preview):not(.hf-catalog-preview):not(.hf-related-art):not(:has(img)),
  input[type="submit"], input[type="button"], input[type="reset"],
  a.button, a.btn, a[role="button"], .wp-element-button,
  .wp-block-button__link, .wc-block-components-button,
  .hf-icon-button, .hf-card-hover-link, .hf-specimen-product-link,
  .hf-catalog-price, .hf-cart-checkout, .hf-full-cart-checkout,
  .hf-account-large-button, .hf-account-pink-link, .hf-delivery-button,
  .hf-freebies-button, .hf-freebies-product-link, .hf-license-pink-button,
  .hf-catalog-filters a, .hf-blog-filters a,
  .hf-catalog-pagination > a, .hf-catalog-pagination > span,
  .hf-catalog-page-numbers > a, .hf-catalog-page-numbers > span,
  .hf-account-pagination a, .hf-featured-mobile-link a
) {
  border-radius: 999px !important;
}

/* Inset the sliding purchase pill so its rounded ends remain visible. */
.hf-featured-card { padding-bottom: 48px; }
.hf-featured-card .hf-card-hover-link {
  inset: auto 10px 6px;
  min-height: 36px;
  border-top: 0;
}
@media (hover: none), (pointer: coarse) {
  .hf-featured-card { padding-bottom: 0; }
  .hf-featured-card .hf-card-hover-link {
    inset: auto;
    margin: 0 10px 8px;
  }
}

/* One thin frame around catalog and homepage product cards. */
.hf-catalog .hf-featured-card,
.hf-collection .hf-featured-card {
  border: 1px solid #afa79b !important;
  outline: none !important;
}

.hf-catalog .hf-featured-preview,
.hf-collection .hf-featured-preview {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

.hf-catalog .hf-featured-preview::before,
.hf-catalog .hf-featured-preview::after,
.hf-collection .hf-featured-preview::before,
.hf-collection .hf-featured-preview::after,
.hf-catalog .hf-featured-card::after,
.hf-collection .hf-featured-card::after {
  content: none !important;
}

.hf-catalog .hf-featured-card-info,
.hf-collection .hf-featured-card-info {
  border-top: 1px solid #afa79b !important;
}

.hf-has-pink-cursor:not(:has(dialog:modal)),
.hf-has-pink-cursor:not(:has(dialog:modal)) * {
  cursor: none !important;
}

body:has(dialog:modal) > .hf-cursor-trail {
  display: none;
}

.hf-cursor-trail {
  --hf-pointer-scale: 0.82;
  position: fixed;
  z-index: 100000;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  pointer-events: none;
}

.hf-pink-pointer {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 1;
  width: 34px;
  height: 34px;
  scale: var(--hf-pointer-scale);
  transform-origin: 3px 3px;
  filter: drop-shadow(1px 0 0 #000) drop-shadow(-1px 0 0 #000)
    drop-shadow(0 1px 0 #000) drop-shadow(0 -1px 0 #000);
}

.hf-pink-pointer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #FF4F9A;
  clip-path: path("M7 2 L30 8 C34 9 34 14 30 15.5 L19.5 20 L15 30.5 C13.5 34 8.5 34 7.5 30 L2 7 C1 4 4 1 7 2 Z");
}

.hf-pink-pointer.is-shining::before {
  background-image: linear-gradient(115deg, transparent 35%, #fff9 50%, transparent 65%);
  background-size: 300% 100%;
  background-repeat: no-repeat;
  animation: hf-pointer-shine 1050ms ease-out infinite;
}

@keyframes hf-pointer-shine {
  from { background-position: 100% 0; }
  55%, to { background-position: 0 0; }
}

.hf-cursor-trail span {
  position: absolute;
  /* Keep the letter centered on the same interior point as the pointer shrinks. */
  translate: calc(11px * var(--hf-pointer-scale) - 50%) calc(11px * var(--hf-pointer-scale) - 50%);
  color: #000;
  font: 700 14px/1 "Space Grotesk", sans-serif;
  text-shadow: 0 1px 2px #0b0d0f80;
  animation: hf-cursor-letter-fall 650ms ease-in forwards;
}

@keyframes hf-cursor-letter-fall {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: translate(var(--hf-trail-drift), 48px) rotate(var(--hf-trail-turn)) scale(.55); }
}
