/**
 * Horizon Theme — Components
 * Buttons, cards, badges, platform links, social icons, tiles.
 */

/* ==========================================================================
   Buttons
   ========================================================================== */

.hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--hp-r-sm);
  font-family: var(--hp-font-body);
  font-size: var(--hp-text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background var(--hp-dur) var(--hp-ease),
              color var(--hp-dur) var(--hp-ease),
              transform var(--hp-dur) var(--hp-ease),
              box-shadow var(--hp-dur) var(--hp-ease);
  white-space: nowrap;
}

.hp-btn:disabled,
.hp-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — gold fill */
.hp-btn--primary {
  background: var(--hp-gold);
  color: #0a0a0a;
}

.hp-btn--primary:hover {
  background: var(--hp-gold-light);
  color: #0a0a0a;
  transform: translateY(-1px);
  box-shadow: var(--hp-shadow-gold);
}

.hp-btn--primary:active {
  background: var(--hp-gold-dark);
  transform: translateY(0);
}

/* Secondary — outlined */
.hp-btn--secondary {
  background: transparent;
  color: var(--hp-gold);
  border: 1px solid var(--hp-border-strong);
}

.hp-btn--secondary:hover {
  background: var(--hp-gold-muted);
  color: var(--hp-gold-light);
  border-color: var(--hp-gold);
}

/* Ghost — text only */
.hp-btn--ghost {
  background: transparent;
  color: var(--hp-gold);
  padding: 0;
  height: auto;
}

.hp-btn--ghost:hover {
  color: var(--hp-gold-light);
}

/* Size variants */
.hp-btn--sm {
  height: 36px;
  padding: 0 1rem;
  font-size: var(--hp-text-xs);
}

.hp-btn--lg {
  height: 56px;
  padding: 0 2rem;
  font-size: var(--hp-text-base);
}

/* Loading state */
.hp-btn--loading {
  pointer-events: none;
  opacity: 0.7;
}

.hp-btn--loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: hp-spin 0.7s linear infinite;
  margin-left: 0.5rem;
}

@keyframes hp-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Cards
   ========================================================================== */

.hp-card {
  background: var(--hp-bg-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-r-md);
  box-shadow: var(--hp-shadow-card);
  transition: border-color var(--hp-dur) var(--hp-ease),
              box-shadow var(--hp-dur) var(--hp-ease),
              transform var(--hp-dur) var(--hp-ease);
}

.hp-card:hover {
  border-color: var(--hp-border-strong);
  box-shadow: var(--hp-shadow-raised);
  transform: translateY(-2px);
}

/* ==========================================================================
   Badges / Pills
   ========================================================================== */

.hp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 24px;
  padding: 0 0.625rem;
  border-radius: var(--hp-r-full);
  font-family: var(--hp-font-body);
  font-size: var(--hp-text-xs);
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.hp-badge--gold {
  background: var(--hp-gold-muted);
  color: var(--hp-gold);
  border: 1px solid var(--hp-border);
}

.hp-badge--unlocked {
  background: rgba(110, 184, 122, 0.15);
  color: var(--hp-success);
  border: 1px solid rgba(110, 184, 122, 0.3);
}

.hp-badge--locked {
  background: rgba(201, 169, 110, 0.1);
  color: var(--hp-gold);
  border: 1px solid var(--hp-border);
}

.hp-badge--live {
  background: rgba(201, 110, 110, 0.15);
  color: var(--hp-error);
  border: 1px solid rgba(201, 110, 110, 0.3);
}

.hp-badge--live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hp-error);
  animation: hp-pulse 1.5s ease-in-out infinite;
}

@keyframes hp-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ==========================================================================
   Platform Links
   ========================================================================== */

.hp-platform-bar {
  background: var(--hp-bg);
  border-top: 1px solid var(--hp-border);
  border-bottom: 1px solid var(--hp-border);
  padding: var(--hp-sp-6) 0;
}

.hp-platform-bar__inner {
  display: flex;
  align-items: center;
  gap: var(--hp-sp-8);
  overflow-x: auto;
  padding: var(--hp-sp-2) var(--hp-content-pad);
  max-width: var(--hp-content-max);
  margin: 0 auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hp-platform-bar__inner::-webkit-scrollbar { display: none; }

.hp-platform-bar__label {
  flex-shrink: 0;
  font-size: var(--hp-text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hp-text-muted);
}

.hp-platform-links {
  display: flex;
  gap: var(--hp-sp-3);
  flex-shrink: 0;
}

.hp-platform-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--hp-sp-1);
  padding: var(--hp-sp-3);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-r-md);
  background: var(--hp-bg-surface);
  text-decoration: none;
  transition: border-color var(--hp-dur) var(--hp-ease),
              box-shadow var(--hp-dur) var(--hp-ease);
  min-width: 80px;
}

.hp-platform-link:hover {
  border-color: var(--hp-border-strong);
  box-shadow: var(--hp-shadow-gold);
}

.hp-platform-link__icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0.8);
  transition: filter var(--hp-dur) var(--hp-ease);
}

.hp-platform-link svg {
  width: 28px;
  height: 28px;
  fill: var(--hp-text-muted);
  transition: fill var(--hp-dur) var(--hp-ease);
}

.hp-platform-link:hover .hp-platform-link__icon,
.hp-platform-link:hover svg {
  filter: brightness(1);
  fill: var(--hp-text);
}

.hp-platform-link__name {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hp-text-muted);
}

/* ==========================================================================
   Social Links
   ========================================================================== */

.hp-social-links {
  display: flex;
  gap: var(--hp-sp-3);
  flex-wrap: wrap;
}

.hp-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--hp-border);
  background: transparent;
  color: var(--hp-text-muted);
  transition: border-color var(--hp-dur) var(--hp-ease),
              color var(--hp-dur) var(--hp-ease);
}

.hp-social-link:hover {
  border-color: var(--hp-border-strong);
  color: var(--hp-gold);
}

.hp-social-link svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Subscribe Tier Cards
   ========================================================================== */

.hp-tiers {
  display: flex;
  gap: var(--hp-sp-6);
  justify-content: center;
  flex-wrap: wrap;
}

.hp-tier-card {
  background: var(--hp-bg-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-r-lg);
  padding: var(--hp-sp-8);
  flex: 1;
  min-width: 280px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: var(--hp-sp-6);
  transition: border-color var(--hp-dur) var(--hp-ease),
              box-shadow var(--hp-dur) var(--hp-ease);
}

.hp-tier-card--featured {
  border-color: var(--hp-border-strong);
  box-shadow: var(--hp-shadow-gold);
  transform: scale(1.02);
  position: relative;
}

.hp-tier-card__featured-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--hp-gold);
  color: #0a0a0a;
  font-size: var(--hp-text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 1rem;
  border-radius: var(--hp-r-full);
  white-space: nowrap;
}

.hp-tier-card__name {
  font-family: var(--hp-font-body);
  font-size: var(--hp-text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hp-gold);
  margin-bottom: 0;
}

.hp-tier-card__price-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.hp-tier-card__price {
  font-family: var(--hp-font-display);
  font-size: var(--hp-text-4xl);
  font-weight: 600;
  color: var(--hp-text);
  line-height: 1;
}

.hp-tier-card__period {
  font-size: var(--hp-text-sm);
  color: var(--hp-text-muted);
}

.hp-tier-card__benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--hp-sp-3);
  flex: 1;
}

.hp-tier-card__benefits li {
  display: flex;
  align-items: flex-start;
  gap: var(--hp-sp-3);
  font-size: var(--hp-text-sm);
  color: var(--hp-text-muted);
}

.hp-tier-card__benefits li::before {
  content: '';
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23c9a96e' d='M13.5 3.5 6 11 2.5 7.5l-1 1 4.5 4.5 8.5-8.5z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.hp-tier-card__cta {
  width: 100%;
  justify-content: center;
}

.hp-tier-card__trust {
  font-size: var(--hp-text-xs);
  color: var(--hp-text-disabled);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

/* ==========================================================================
   Email Signup
   ========================================================================== */

.hp-email-signup {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

.hp-email-signup h2 {
  margin-bottom: var(--hp-sp-3);
}

.hp-email-signup__body {
  color: var(--hp-text-muted);
  margin-bottom: var(--hp-sp-6);
}

.hp-email-signup__form {
  display: flex;
  gap: var(--hp-sp-3);
}

.hp-email-signup__input {
  flex: 1;
  background: var(--hp-bg-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-r-sm);
  color: var(--hp-text);
  font-family: var(--hp-font-body);
  font-size: var(--hp-text-sm);
  padding: 0 1rem;
  height: 48px;
  transition: border-color var(--hp-dur) var(--hp-ease);
}

.hp-email-signup__input:focus {
  outline: none;
  border-color: var(--hp-border-strong);
}

.hp-email-signup__privacy {
  font-size: var(--hp-text-xs);
  color: var(--hp-text-disabled);
  margin-top: var(--hp-sp-3);
}

/* ==========================================================================
   Toast notification
   ========================================================================== */

.hp-toast {
  position: fixed;
  bottom: var(--hp-sp-6);
  right: var(--hp-sp-6);
  z-index: 9999;
  width: 340px;
  background: var(--hp-bg-raised);
  border: 1px solid var(--hp-border-strong);
  border-radius: var(--hp-r-md);
  box-shadow: var(--hp-shadow-raised);
  padding: var(--hp-sp-4) var(--hp-sp-6);
  display: flex;
  gap: var(--hp-sp-4);
  align-items: flex-start;
  transform: translateX(calc(100% + 2rem));
  opacity: 0;
  transition: transform 0.4s var(--hp-ease), opacity 0.4s var(--hp-ease);
  border-left: 4px solid var(--hp-gold);
}

.hp-toast.hp-toast--visible {
  transform: translateX(0);
  opacity: 1;
}

.hp-toast__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--hp-gold-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hp-gold);
}

.hp-toast__content { flex: 1; }

.hp-toast__title {
  font-weight: 600;
  font-size: var(--hp-text-sm);
  color: var(--hp-text);
  margin-bottom: var(--hp-sp-1);
}

.hp-toast__body {
  font-size: var(--hp-text-sm);
  color: var(--hp-text-muted);
}

.hp-toast__dismiss {
  background: none;
  border: none;
  color: var(--hp-text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.hp-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--hp-gold);
  border-radius: 0 0 0 var(--hp-r-md);
  animation: hp-toast-progress 6s linear forwards;
}

@keyframes hp-toast-progress {
  from { width: 100%; }
  to   { width: 0; }
}

/* ==========================================================================
   Subscribe CTA banner (inline)
   ========================================================================== */

.hp-subscribe-cta {
  background: var(--hp-bg);
  padding: var(--hp-sp-24) 0;
  position: relative;
  overflow: hidden;
}

.hp-subscribe-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 70% 50%, rgba(201,169,110,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hp-subscribe-cta__inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--hp-sp-16);
  align-items: center;
}

.hp-subscribe-cta__photo {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--hp-r-lg);
  box-shadow: var(--hp-shadow-raised), 0 0 60px rgba(201,169,110,0.15);
}

.hp-subscribe-cta__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.9) saturate(0.9) sepia(0.1);
}

.hp-subscribe-cta__content { position: relative; z-index: 1; }

.hp-subscribe-cta__tier-pill {
  display: inline-block;
  margin-bottom: var(--hp-sp-4);
}

.hp-subscribe-cta__price {
  font-family: var(--hp-font-body);
  font-size: var(--hp-text-4xl);
  font-weight: 600;
  color: var(--hp-gold);
  line-height: 1;
  margin-bottom: var(--hp-sp-2);
}

.hp-subscribe-cta__price-period {
  font-size: var(--hp-text-lg);
  color: var(--hp-text-muted);
}

.hp-subscribe-cta__benefits {
  list-style: none;
  margin: var(--hp-sp-6) 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--hp-sp-3);
}

.hp-subscribe-cta__benefits li {
  display: flex;
  align-items: center;
  gap: var(--hp-sp-3);
  font-size: var(--hp-text-sm);
  color: var(--hp-text-muted);
}

.hp-subscribe-cta__benefits li::before {
  content: '';
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23c9a96e' d='M13.5 3.5 6 11 2.5 7.5l-1 1 4.5 4.5 8.5-8.5z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.hp-subscribe-cta__actions {
  display: flex;
  align-items: center;
  gap: var(--hp-sp-4);
  flex-wrap: wrap;
  margin-top: var(--hp-sp-6);
}

.hp-subscribe-cta__trust {
  font-size: var(--hp-text-xs);
  color: var(--hp-text-disabled);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: var(--hp-sp-4);
}

/* Subscribe sticky footer bar */
.hp-subscribe-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--hp-bg-raised);
  border-top: 1px solid var(--hp-border);
  height: 64px;
  display: flex;
  align-items: center;
  transform: translateY(100%);
  transition: transform 0.35s var(--hp-ease);
}

.hp-subscribe-bar.hp-subscribe-bar--visible {
  transform: translateY(0);
}

.hp-subscribe-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hp-sp-4);
  width: 100%;
}

.hp-subscribe-bar__text {
  font-size: var(--hp-text-sm);
  color: var(--hp-text-muted);
}

/* ==========================================================================
   Icon SVG helper class
   ========================================================================== */

.hp-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .hp-subscribe-cta__inner {
    grid-template-columns: 1fr;
  }

  .hp-subscribe-cta__photo {
    max-height: 360px;
  }

  .hp-email-signup__form {
    flex-direction: column;
  }

  .hp-tiers {
    flex-direction: column;
    align-items: center;
  }

  .hp-tier-card--featured {
    transform: none;
  }

  .hp-toast {
    width: calc(100vw - 2rem);
    right: 1rem;
    bottom: 1rem;
  }
}
