/*
Theme Name:   Elunara Child
Theme URI:    https://elunara.nl
Description:  Elunara child theme for Kadence. Wires the Elunara design system
              (colors_and_type.css) into WordPress + WooCommerce templates.
Author:       Peter Fuhren
Author URI:   https://elunara.nl
Template:     kadence
Version:      0.1.0
Text Domain:  elunara-child
*/

/* ============================================================
   IMPORTS
   ------------------------------------------------------------
   Note: the design tokens live in /assets/css/colors_and_type.css.
   Upload that file into the child theme via SFTP or the
   WordPress file manager:
     wp-content/themes/elunara-child/assets/css/colors_and_type.css
   It is enqueued in functions.php (separate file).
   ============================================================ */

/* Google Fonts loaded via wp_enqueue_style in functions.php, not @import
   (faster, GDPR-friendlier, avoids render-blocking). */

/* ============================================================
   GLOBAL TWEAKS
   Kadence Customizer covers ~85% of the design. This file fills
   the gaps — focus rings, WooCommerce templates, the audio
   player, cookie banner, and accessibility details.
   ============================================================ */

:root {
  /* Re-declare core tokens here in case colors_and_type.css fails to load.
     These match the spec exactly. */
  --elu-navy:       #0D1B2A;
  --elu-cream:      #F5F0E8;
  --elu-cream-deep: #EDE5D4;
  --elu-blue-grey:  #8A9BAD;
  --elu-gold:       #C9A84C;
  --elu-lavender:   #D5CDE8;
  --elu-navy-85:    #1A2638;
  --elu-gold-85:    #B5942F;
  --elu-gold-15:    rgba(201, 168, 76, 0.15);
}

/* ============================================================
   ACCESSIBILITY — Focus rings
   Kadence has weak default focus indicators. Replace globally.
   ============================================================ */

*:focus { outline: none; }

*:focus-visible {
  outline: 2px solid var(--elu-gold);
  outline-offset: 2px;
}

/* Buttons and links get the same treatment. Inputs handle focus
   via border-color (see below). */

.wp-block-button__link:focus-visible,
.kb-button:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--elu-gold);
  outline-offset: 2px;
}

/* ============================================================
   TYPOGRAPHY — fine-tuning Kadence Customizer can't reach
   ============================================================ */

/* Optical kerning + proper smoothing across all browsers */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Cormorant looks much better with a touch of negative tracking on
   large display sizes. Kadence sets global tracking; this overrides
   for big headings only. */
h1, .kb-heading-1, .elu-display {
  letter-spacing: -0.01em;
}

/* Body text in Jost 300 can look thin on Windows/older monitors.
   Bump weight to 400 at small sizes only. */
.elu-small,
small,
.wp-block-button__link,
.kb-button {
  font-weight: 400;
}

/* Eyebrow / caps labels — used for category labels, pretitles */
.elu-eyebrow,
.kadence-heading-eyebrow {
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--elu-gold);
  display: inline-block;
  margin-bottom: 16px;
}

/* ============================================================
   BUTTONS — extra states Kadence doesn't expose
   ============================================================ */

/* Disabled state (used on the checkout button during processing) */
.wp-block-button__link:disabled,
.kb-button:disabled,
.button:disabled,
button[disabled],
.elu-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--elu-blue-grey) !important;
  color: var(--elu-cream) !important;
}

/* Loading state — add class via JS during checkout submit */
.elu-btn.is-loading,
.kb-button.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.elu-btn.is-loading::after,
.kb-button.is-loading::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--elu-cream);
  border-top-color: transparent;
  border-radius: 50%;
  animation: elu-spin 720ms linear infinite;
}

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

/* ============================================================
   WOOCOMMERCE — strip generic styling, apply Elunara look
   ============================================================ */

/* Remove Woo's default purple button color, force Elunara gold */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce .button,
.woocommerce-page button[type="submit"] {
  background: var(--elu-gold) !important;
  color: var(--elu-navy) !important;
  border-radius: 6px;
  font-family: "Jost", sans-serif;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 14px 28px;
  border: 1px solid transparent;
  transition: background 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce .button:hover {
  background: var(--elu-gold-85) !important;
}

/* Form inputs in checkout, account, contact */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.wc-block-components-text-input input {
  border: 1px solid rgba(138, 155, 173, 0.5);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: "Jost", sans-serif;
  font-weight: 300;
  font-size: 16px;
  background: transparent;
  transition: border-color 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.wc-block-components-text-input input:focus {
  border-color: var(--elu-gold);
  outline: none;
}

/* Notices — error/success/info messages */
.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
  border-radius: 6px;
  border-top: none;
  border-left: 3px solid var(--elu-gold);
  padding: 16px 20px;
  font-family: "Jost", sans-serif;
  font-weight: 300;
  background: var(--elu-cream);
  color: var(--elu-navy);
}

.woocommerce-error::before,
.woocommerce-message::before,
.woocommerce-info::before {
  color: var(--elu-gold);
}

/* My Account navigation tabs */
.woocommerce-MyAccount-navigation ul {
  list-style: none;
  padding: 0;
  border-right: 1px solid rgba(138, 155, 173, 0.28);
}

.woocommerce-MyAccount-navigation ul li {
  border-bottom: 1px solid rgba(138, 155, 173, 0.12);
}

.woocommerce-MyAccount-navigation ul li a {
  display: block;
  padding: 14px 20px;
  font-family: "Jost", sans-serif;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: inherit;
  text-decoration: none;
  transition: color 240ms ease;
}

.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li a:hover {
  color: var(--elu-gold);
}

/* ============================================================
   CHECKOUT — Trust elements + herroepingsrecht checkbox
   ============================================================ */

.woocommerce-checkout .elu-trust-note {
  background: var(--elu-cream-deep);
  border-left: 3px solid var(--elu-gold);
  padding: 16px 20px;
  margin: 24px 0;
  font-family: "Jost", sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.6;
  color: var(--elu-navy);
  border-radius: 4px;
}

/* Herroepingsrecht checkbox — must stand out at checkout */
.elu-herroepingsrecht {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  margin: 16px 0;
  background: var(--elu-cream);
  border: 1px solid rgba(13, 27, 42, 0.12);
  border-radius: 6px;
}

.elu-herroepingsrecht input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--elu-gold);
}

.elu-herroepingsrecht label {
  font-family: "Jost", sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.6;
  color: var(--elu-navy);
}

/* ============================================================
   AUDIO PLAYER — overrides for the chosen plugin
   We're using CP Media Player or similar. These selectors target
   common audio player markup; adjust once you've installed the
   actual plugin and inspected its DOM.
   ============================================================ */

/* Generic audio element fallback */
audio {
  width: 100%;
  border-radius: 6px;
  filter: sepia(15%) saturate(80%);
}

/* CP Media Player wrapper (placeholder selector — verify after install) */
.cp-mediaplayer,
.elu-audio-player {
  background: var(--elu-navy-85);
  border: 1px solid var(--elu-gold);
  border-radius: 8px;
  padding: 24px;
  color: var(--elu-cream);
}

.cp-mediaplayer .cp-play-button,
.elu-audio-player__play {
  background: var(--elu-gold);
  color: var(--elu-navy);
  border: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 240ms ease;
}

.cp-mediaplayer .cp-play-button:hover,
.elu-audio-player__play:hover {
  background: var(--elu-gold-85);
}

/* Gated state — when user isn't a subscriber */
.elu-audio-player.is-locked {
  position: relative;
  filter: blur(2px);
  pointer-events: none;
}

.elu-audio-player.is-locked::after {
  content: "Word lid om te luisteren";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 27, 42, 0.85);
  color: var(--elu-cream);
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  font-size: 22px;
  border-radius: 8px;
  filter: blur(0);
}

/* ============================================================
   COOKIE BANNER — Complianz override
   Complianz inserts a banner; restyle to Elunara.
   Add to Complianz settings: enable "use custom CSS"
   ============================================================ */

#cmplz-cookiebanner-container .cmplz-cookiebanner {
  background: var(--elu-navy) !important;
  color: var(--elu-cream) !important;
  border-top: 1px solid var(--elu-gold) !important;
  font-family: "Jost", sans-serif !important;
  font-weight: 300 !important;
  padding: 24px !important;
  border-radius: 0 !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner h1,
#cmplz-cookiebanner-container .cmplz-cookiebanner h2 {
  font-family: "Cormorant Garamond", serif !important;
  font-weight: 300 !important;
  color: var(--elu-cream) !important;
}

#cmplz-cookiebanner-container .cmplz-btn {
  background: var(--elu-gold) !important;
  color: var(--elu-navy) !important;
  border-radius: 6px !important;
  padding: 12px 24px !important;
  font-family: "Jost", sans-serif !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em !important;
  text-transform: none !important;
}

#cmplz-cookiebanner-container .cmplz-btn.cmplz-deny {
  background: transparent !important;
  color: var(--elu-cream) !important;
  border: 1px solid rgba(245, 240, 232, 0.4) !important;
}

/* ============================================================
   UTILITY CLASSES — drop into Kadence Custom CSS slots per block
   ============================================================ */

/* Apply to a Kadence Row block to set Soft mode for that section only */
.elu-soft-section {
  background: var(--elu-cream);
  color: var(--elu-navy);
}

.elu-soft-section h1,
.elu-soft-section h2,
.elu-soft-section h3,
.elu-soft-section h4 {
  color: var(--elu-navy);
}

/* Hairline divider with gold dot — for section separators */
.elu-hairline {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 64px 0;
}

.elu-hairline::before,
.elu-hairline::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(138, 155, 173, 0.28);
}

.elu-hairline::before { margin-right: 16px; }
.elu-hairline::after  { margin-left: 16px; }

.elu-hairline__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--elu-gold);
}

/* ============================================================
   RESPONSIVE — fine-tune mobile
   Kadence handles most breakpoints; this is just edge cases.
   ============================================================ */

@media (max-width: 767px) {
  /* Tighten button padding on mobile so they don't dominate */
  .wp-block-button__link,
  .kb-button,
  .elu-btn {
    padding: 12px 20px;
    font-size: 15px;
  }

  /* Hairline dividers — less margin on mobile */
  .elu-hairline {
    margin: 40px 0;
  }
}

/* ============================================================
   END
   Last updated: 16 May 2026
   Maintainer: Peter
   ============================================================ */
