/* Design Tokens for WPAK Premium Blocks */

:root {
  /* Global Brand Colors (Non-Theme Specific) */
  --wpak-color-gold: #c5a059;
  --wpak-color-gold-hover: #b48e47;
  --wpak-color-gold-light: rgba(197, 160, 89, 0.15);
  --wpak-color-gold-glow: rgba(197, 160, 89, 0.4);
  --wpak-color-white: #ffffff;
  --wpak-color-black: #000000;

  /* Typography */
  --wpak-font-arabic: "IBM Plex Sans Arabic", "Inter", "Satoshi", system-ui, -apple-system, sans-serif;
  --wpak-font-display: "Playfair Display", "IBM Plex Sans Arabic", Georgia, serif;
  --wpak-font-body: "Inter", "IBM Plex Sans Arabic", "Satoshi", system-ui, -apple-system, sans-serif;
  --wpak-font-heading: var(--wpak-font-display);
  --wpak-font-sans: var(--wpak-font-body);
  --wpak-font-serif: var(--wpak-font-display);
  --wpak-font-mono: "JetBrains Mono", SFMono-Regular, Consolas, monospace;

  /* Font Sizes - Responsive clamp where useful */
  --wpak-font-size-xs: clamp(0.75rem, 0.7vw, 0.8125rem);
  --wpak-font-size-sm: clamp(0.875rem, 0.85vw, 0.9375rem);
  --wpak-font-size-base: clamp(1rem, 1vw, 1.0625rem);
  --wpak-font-size-lg: clamp(1.125rem, 1.15vw, 1.25rem);
  --wpak-font-size-xl: clamp(1.25rem, 1.3vw, 1.5rem);
  --wpak-font-size-2xl: clamp(1.5rem, 1.8vw, 2rem);
  --wpak-font-size-3xl: clamp(2rem, 2.5vw, 2.75rem);
  --wpak-font-size-display: clamp(2.25rem, 3.5vw, 4rem);

  /* Semantic type roles: blocks consume these instead of inventing scales. */
  --wpak-type-display-hero: clamp(2.75rem, 5vw, 4.875rem);
  --wpak-type-display-section: clamp(2.375rem, 4.2vw, 4rem);
  --wpak-type-display-card: clamp(1.5625rem, 2.4vw, 2.375rem);
  --wpak-type-lead: clamp(1rem, 1.3vw, 1.25rem);
  --wpak-type-display-mobile: clamp(2.125rem, 10vw, 2.75rem);

  /* Spacing - Fluid sizing based on clamp */
  --wpak-space-xxs: max(4px, 0.25rem);
  --wpak-space-xs: clamp(8px, 0.6vw, 12px);
  --wpak-space-sm: clamp(12px, 1.1vw, 18px);
  --wpak-space-md: clamp(18px, 1.8vw, 28px);
  --wpak-space-lg: clamp(28px, 2.8vw, 44px);
  --wpak-space-xl: clamp(44px, 4.5vw, 68px);
  --wpak-space-section: clamp(72px, 8vw, 132px);
  --wpak-space-gutter: clamp(20px, 5vw, 80px);

  /* Borders & Radius */
  --wpak-radius-button: 4px;
  --wpak-radius-card: 16px;
  --wpak-radius-pill: 9999px;
  --wpak-border-width: 1px;

  /* Shadows */
  --wpak-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --wpak-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --wpak-shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.12);
  --wpak-shadow-glow: 0 0 15px var(--wpak-color-gold-glow);

  /* Transitions */
  --wpak-transition-fast: 0.15s ease;
  --wpak-transition-base: 0.25s ease;
  --wpak-transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  /* Core UI - Default Theme Mode Settings (Light Mode defaults, but let's define theme overrides) */
  --wpak-surface: #f9f8f6;
  --wpak-surface-card: #ffffff;
  --wpak-surface-input: #f4f2ef;
  --wpak-text: #1a1918;
  --wpak-text-muted: #6e665c;
  --wpak-border: #e6e3df;
  --wpak-border-focus: #c5a059;
}

/* Light & Dark Theme Variable Overrides */
[data-theme="light"] {
  --wpak-surface: #fdfcfb;
  --wpak-surface-card: #f9f8f6;
  --wpak-surface-input: #f0edea;
  --wpak-text: #1a1918;
  --wpak-text-muted: #6e665c;
  --wpak-border: #e6e3df;
  --wpak-border-focus: var(--wpak-color-gold);
}

[data-theme="dark"] {
  --wpak-surface: #0a0a0a;
  --wpak-surface-card: #121110;
  --wpak-surface-input: #1b1a19;
  --wpak-text: #fdfcfb;
  --wpak-text-muted: #a69f96;
  --wpak-border: #262422;
  --wpak-border-focus: var(--wpak-color-gold);
}

/* Global focus styling for accessibility */
*:focus,
*:focus-visible {
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
}

/* Reduced Motion Settings */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* Global Primitive Base Styling */


/* Base Resets and Architectural Honesty */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--wpak-font-body);
  background-color: var(--wpak-surface);
  color: var(--wpak-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--wpak-transition-base), color var(--wpak-transition-base);
}

/* Scrollbar styling for customized luxury feel */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--wpak-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--wpak-border);
  border-radius: var(--wpak-radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--wpak-color-gold);
}

/* Logical CSS rules for RTL block layouts */
[dir="rtl"] {
  text-align: right;
}

[dir="ltr"] {
  text-align: left;
}

/* Image styles to prevent layout shifts and assure responsive performance */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Icon fonts or SVG setup helper */
.wpak-svg-icon {
  width: 1.25em;
  height: 1.25em;
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
}

.wpak-sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@supports (content-visibility: auto) {
  .entry-content > section:not(:first-child),
  .wp-site-blocks > section:not(:first-of-type),
  footer.wpak-footer-block {
    contain-intrinsic-block-size: auto 720px;
    content-visibility: auto;
  }
}

/* ==========================================================================
   Typography Primitives
   ========================================================================== */

.wpak-heading-1, .wpak-heading-2, .wpak-heading-3, .wpak-heading-4, .wpak-heading-5, .wpak-heading-6 {
  font-family: var(--wpak-font-display);
  font-weight: 600;
  color: var(--wpak-color-gold);
  line-height: 1.1;
  margin-bottom: var(--wpak-space-sm);
}

.wpak-heading-1 { font-size: var(--wpak-font-size-display); letter-spacing: -0.02em; }
.wpak-heading-2 { font-size: var(--wpak-font-size-3xl); letter-spacing: -0.01em; }
.wpak-heading-3 { font-size: var(--wpak-font-size-2xl); }
.wpak-heading-4 { font-size: var(--wpak-font-size-xl); font-family: var(--wpak-font-body); text-transform: uppercase; letter-spacing: 0.05em; }

.wpak-text-body {
  font-size: var(--wpak-font-size-base);
  color: var(--wpak-text);
  line-height: 1.6;
}

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

.wpak-text-lg {
  font-size: var(--wpak-font-size-lg);
  line-height: 1.5;
}

/* ==========================================================================
   Link Primitives
   ========================================================================== */

.wpak-link {
  color: var(--wpak-text);
  text-decoration: none;
  transition: color var(--wpak-transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wpak-link:hover, .wpak-link:focus-visible {
  color: var(--wpak-color-gold);
}

.wpak-link--gold {
  color: var(--wpak-color-gold);
}

.wpak-link--gold:hover, .wpak-link--gold:focus-visible {
  color: var(--wpak-color-gold-hover);
}

/* ==========================================================================
   Utility Classes (Margin, Padding, Alignment)
   Using Logical Properties for RTL Support
   ========================================================================== */

.wpak-text-center { text-align: center; }
.wpak-text-start { text-align: start; }
.wpak-text-end { text-align: end; }

.wpak-mt-0 { margin-top: 0 !important; }
.wpak-mb-0 { margin-bottom: 0 !important; }
.wpak-mt-sm { margin-top: var(--wpak-space-sm); }
.wpak-mb-sm { margin-bottom: var(--wpak-space-sm); }
.wpak-mt-md { margin-top: var(--wpak-space-md); }
.wpak-mb-md { margin-bottom: var(--wpak-space-md); }
.wpak-mt-lg { margin-top: var(--wpak-space-lg); }
.wpak-mb-lg { margin-bottom: var(--wpak-space-lg); }
.wpak-mt-xl { margin-top: var(--wpak-space-xl); }
.wpak-mb-xl { margin-bottom: var(--wpak-space-xl); }

.wpak-d-flex { display: flex; }
.wpak-flex-col { flex-direction: column; }
.wpak-align-center { align-items: center; }
.wpak-justify-center { justify-content: center; }
.wpak-justify-between { justify-content: space-between; }
.wpak-gap-sm { gap: var(--wpak-space-sm); }
.wpak-gap-md { gap: var(--wpak-space-md); }
.wpak-gap-lg { gap: var(--wpak-space-lg); }


:root {
  --wpak-type-display-hero: clamp(2.75rem, 5vw, 4.875rem);
  --wpak-type-display-section: clamp(2.375rem, 4.2vw, 4rem);
  --wpak-type-display-card: clamp(1.5625rem, 2.4vw, 2.375rem);
  --wpak-type-lead: clamp(1rem, 1.3vw, 1.25rem);
  --wpak-type-display-mobile: clamp(2.125rem, 10vw, 2.75rem);
}

[dir="rtl"] [data-rtl-flip-background] {
  scale: -1 1;
  transform-origin: center;
}

.wpak-section-shell.wpak-section-shell {
  box-sizing: border-box;
  width: calc(100% - (2 * clamp(18px, 5vw, 72px))) !important;
  max-width: 1320px !important;
  margin-inline: auto !important;
}

.wpak-page-section {
  padding-inline: 0 !important;
}

.wpak-page-section:not(.wpak-hero-block) {
  padding-block: clamp(64px, 7vw, 104px) !important;
}

@supports (content-visibility: auto) {
  .entry-content > .wpak-page-section:not(:first-child),
  footer.wpak-footer-block {
    contain-intrinsic-block-size: auto 720px;
    content-visibility: auto;
  }
}

.wpak-section-header {
  margin-bottom: clamp(34px, 4.5vw, 58px) !important;
}

.wpak-page-section-title {
  font-family: var(--wpak-font-display) !important;
  font-size: var(--wpak-type-display-section) !important;
  font-weight: 700 !important;
  letter-spacing: -.02em;
  line-height: 1.04 !important;
  margin: 0 !important;
}

.wpak-page-section-intro {
  font-size: clamp(16px, 1.25vw, 19px) !important;
  line-height: 1.7 !important;
}

[dir="rtl"] .wpak-button__label { order: 1; }
[dir="rtl"] .wpak-button__icon-wrapper,
[dir="rtl"] .wpak-hero-button-arrow,
[dir="rtl"] .wpak-catalog-cta-action__icon { order: 2; }

.wpak-section-eyebrow {
  align-items: center;
  color: var(--wpak-color-gold, #c5a059) !important;
  display: flex !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  gap: 14px;
  grid-column: 1 / -1;
  letter-spacing: .14em !important;
  line-height: 1.2;
  margin: 0 0 18px !important;
  text-transform: uppercase;
}

.wpak-section-eyebrow::before {
  background: currentColor;
  content: "";
  flex: 0 0 38px;
  height: 1px;
  opacity: .48;
}

.wpak-page-section .wpak-button {
  border-radius: var(--wpak-radius-button, 4px) !important;
  font-size: 13px;
  font-weight: 700;
  gap: 12px !important;
  min-height: 52px;
  padding: 0 22px;
}

.wpak-page-section .wpak-button__label {
  font-size: 12px !important;
  font-weight: 700;
  letter-spacing: .08em !important;
}

.wpak-page-section .wpak-button--outline:hover,
.wpak-page-section .wpak-button--outline:focus-visible {
  background: var(--wpak-color-gold, #c5a059);
  border-color: var(--wpak-color-gold, #c5a059);
  color: #17130e;
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .wpak-page-section:not(.wpak-hero-block) {
    padding-block: 52px !important;
  }
}

.wpak-button {
  @apply inline-flex items-center justify-center gap-3 min-h-12 px-6 py-3 text-base font-medium no-underline transition-transform duration-300;
  font-family: var(--wpak-font-sans, "Satoshi", "Geist", system-ui, sans-serif);
}

.wpak-button:hover {
  transform: translateY(-1px);
}

.wpak-button--solid {
  @apply shadow-[0_18px_36px_-18px_rgba(122,75,28,0.45)];
}

.wpak-button--outline {
  @apply bg-transparent shadow-none;
}

.wpak-button--text {
  @apply bg-transparent px-0 shadow-none;
}

a.wpak-button[href*="wa.me"]:hover,
a.wpak-button[href*="wa.me"]:focus-visible,
a.wpak-catalog-cta-action[href*="wa.me"]:hover,
a.wpak-catalog-cta-action[href*="wa.me"]:focus-visible,
a.wpak-product-sample-cta-action[href*="wa.me"]:hover,
a.wpak-product-sample-cta-action[href*="wa.me"]:focus-visible,
a.wpak-build-cta-action[href*="wa.me"]:hover,
a.wpak-build-cta-action[href*="wa.me"]:focus-visible {
  background: var(--wpak-color-gold-hover, #b48e47) !important;
  border-color: var(--wpak-color-gold-hover, #b48e47) !important;
  box-shadow: var(--wpak-shadow-glow, 0 0 15px rgba(197, 160, 89, 0.4)) !important;
  color: #1a1918 !important;
  transform: translateY(-1px);
}

a.wpak-product-sample-cta-action[href*="wa.me"]:hover::before,
a.wpak-product-sample-cta-action[href*="wa.me"]:focus-visible::before {
  opacity: 0;
}

a[href*="wa.me"]:hover .wpak-button__icon-wrapper,
a[href*="wa.me"]:focus-visible .wpak-button__icon-wrapper {
  background: rgba(26, 25, 24, 0.1) !important;
  color: #1a1918 !important;
}

.wpak-card {
  @apply relative overflow-hidden border transition-transform duration-300;
  border-color: color-mix(in srgb, var(--wpak-accent, #A87333) 20%, transparent);
}

.wpak-card:hover {
  transform: translateY(-2px);
}

.wpak-card--basic {
  @apply rounded-lg bg-white/80 shadow-[0_20px_46px_-34px_rgba(70,45,24,0.45)];
}

.wpak-card--media {
  @apply rounded-lg bg-white/75 shadow-[0_24px_54px_-38px_rgba(70,45,24,0.42)];
}

.wpak-card--dark {
  @apply rounded-none bg-transparent text-white;
}

.wpak-media-frame {
  @apply relative m-0 overflow-hidden rounded-lg;
}

.wpak-media-frame img {
  @apply block h-full w-full object-cover;
}

.wpak-section-kicker {
  @apply m-0 text-sm font-semibold uppercase tracking-[0.18em];
  color: var(--wpak-accent, #A87333);
}

.wpak-section-title {
  @apply m-0 text-5xl font-normal leading-tight;
  font-family: var(--wpak-font-display, "Playfair Display", Georgia, serif);
  color: var(--wpak-ink, #27221D);
}

.wpak-section-copy {
  @apply m-0 text-lg leading-8;
  color: var(--wpak-muted, #6F675D);
}


/* Button Primitive CSS */

.wpak-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--wpak-space-sm);
  padding: var(--wpak-space-sm) var(--wpak-space-md);
  font-family: var(--wpak-font-body);
  font-size: var(--wpak-font-size-sm);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--wpak-radius-button);
  transition: background-color var(--wpak-transition-base), 
              color var(--wpak-transition-base), 
              border-color var(--wpak-transition-base), 
              box-shadow var(--wpak-transition-base),
              transform var(--wpak-transition-fast);
  cursor: pointer;
  border: var(--wpak-border-width) solid transparent;
  user-select: none;
  position: relative;
  overflow: hidden;
}

/* Button Variants */

/* 1. Solid Gold Button */
.wpak-button--solid {
  background-color: var(--wpak-color-gold);
  color: #1a1918; /* Dark ink text for robust contrast on gold */
}

.wpak-button--solid:hover {
  background-color: var(--wpak-color-gold-hover);
  transform: translateY(-1px);
  box-shadow: var(--wpak-shadow-glow);
}

.wpak-button--solid:active {
  transform: translateY(0);
}

/* 2. Outline Gold Button */
.wpak-button--outline {
  background-color: transparent;
  border-color: var(--wpak-color-gold);
  color: var(--wpak-color-gold);
}

.wpak-button--outline:hover {
  background-color: var(--wpak-color-gold-light);
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.2);
}

.wpak-button--outline:active {
  transform: translateY(0);
}

/* 3. Ghost Button */
.wpak-button--ghost {
  background-color: transparent;
  color: var(--wpak-text-muted);
}

.wpak-button--ghost:hover {
  background-color: var(--wpak-surface-input);
  color: var(--wpak-text);
}

/* Button Sub-elements */
.wpak-button__label {
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 600;
}

.wpak-button__icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.wpak-button__arrow {
  font-size: 1.1rem;
  transition: transform var(--wpak-transition-base);
  display: inline-block;
  line-height: 1;
}

.wpak-button:hover .wpak-button__arrow {
  transform: translateX(4px);
}

/* RTL Arrow Support */
[dir="rtl"] .wpak-button__arrow {
  transform: scaleX(-1);
}

[dir="rtl"] .wpak-button:hover .wpak-button__arrow {
  transform: scaleX(-1) translateX(4px);
}


/* Card Primitive CSS */

.wpak-card {
  background-color: var(--wpak-surface-card);
  border: var(--wpak-border-width) solid var(--wpak-border);
  border-radius: var(--wpak-radius-card);
  padding: var(--wpak-space-md) var(--wpak-space-md);
  box-shadow: var(--wpak-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--wpak-space-sm);
  transition: border-color var(--wpak-transition-base),
              background-color var(--wpak-transition-base),
              box-shadow var(--wpak-transition-base),
              transform var(--wpak-transition-slow);
  position: relative;
  overflow: hidden;
}

/* Card Variants */

/* Default Slate and Gold Accent frame */
.wpak-card--default {
  border-color: var(--wpak-border);
}

/* Luxury Framed Accent Option */
.wpak-card--elevated {
  border-color: rgba(197, 160, 89, 0.35); /* Elegant gold transparent border */
  box-shadow: var(--wpak-shadow-md);
}

/* Ghost Card */
.wpak-card--ghost {
  background-color: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 0;
}

/* Hover Interaction Styles */
.wpak-card--hover:hover {
  transform: translateY(-4px);
  border-color: var(--wpak-color-gold);
  box-shadow: var(--wpak-shadow-lg), 0 0 15px rgba(197, 160, 89, 0.15);
}

/* Structure elements */
.wpak-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wpak-space-sm);
}

.wpak-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--wpak-space-xs);
}

.wpak-card__footer {
  border-top: var(--wpak-border-width) solid var(--wpak-border);
  padding-top: var(--wpak-space-sm);
  margin-top: var(--wpak-space-xs);
}

.wpak-card--hover:hover .wpak-card__footer {
  border-top-color: rgba(197, 160, 89, 0.25);
}


/* Icon Primitive CSS */

.wpak-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Sizing Modifiers */
.wpak-icon--xs .wpak-svg-icon {
  width: 14px;
  height: 14px;
}

.wpak-icon--sm .wpak-svg-icon {
  width: 18px;
  height: 18px;
}

.wpak-icon--md .wpak-svg-icon {
  width: 24px;
  height: 24px;
}

.wpak-icon--lg .wpak-svg-icon {
  width: 32px;
  height: 32px;
}

.wpak-icon--xl .wpak-svg-icon {
  width: 44px;
  height: 44px;
}

/* Color Modifiers */
.wpak-icon--gold .wpak-svg-icon {
  color: var(--wpak-color-gold);
  fill: none;
  stroke: var(--wpak-color-gold);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wpak-icon--muted .wpak-svg-icon {
  color: var(--wpak-text-muted);
  fill: none;
  stroke: var(--wpak-text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wpak-icon--tinted {
  background-color: var(--wpak-color-gold-light);
  border-radius: var(--wpak-radius-button);
  padding: var(--wpak-space-xs);
  color: var(--wpak-color-gold);
}

.wpak-icon--tinted .wpak-svg-icon {
  color: var(--wpak-color-gold);
  fill: none;
  stroke: var(--wpak-color-gold);
  stroke-width: 2;
}

.wpak-icon--circle {
  background-color: var(--wpak-color-gold-light);
  border-radius: var(--wpak-radius-pill);
  padding: var(--wpak-space-sm);
  color: var(--wpak-color-gold);
  border: 1px solid rgba(197, 160, 89, 0.25);
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.1);
}

.wpak-icon--circle .wpak-svg-icon {
  color: var(--wpak-color-gold);
  fill: none;
  stroke: var(--wpak-color-gold);
  stroke-width: 2;
}


.wpak-svg-sprite,
.wpak-icon-sprite {
  display: none;
}

.wpak-svg-icon {
  display: inline-block;
  fill: currentColor;
  height: 1.25em;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  width: 1.25em;
}