/*
Theme Name: Lamp for Feet
Theme URI: https://lampforfeet.com
Author: Michael
Description: A custom WordPress theme for lampforfeet.com — a Bible study and devotional site rooted in the original languages of Scripture. Built with a scholarly yet warm aesthetic, featuring Roboto Flex for display and Roboto Serif for body text, with a navy-forward color palette inspired by the quiet authority of lamplight in darkness.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lampforfeet
Tags: bible-study, devotional, custom-colors, block-patterns, full-site-editing
*/

/* ==========================================================================
   DESIGN TOKENS
   These are the single source of truth for the entire site's visual language.
   Previously defined per-page in scoped <style> blocks — now global.
   ========================================================================== */

:root {
  /* ── Color Palette ─────────────────────────────────────────────────────── */
  /* Primary: Navy spectrum — the backbone of the site */
  --lff-navy-950: #060e1a;
  --lff-navy-900: #0a1628;
  --lff-navy-800: #111f38;
  --lff-navy-700: #1a2d4a;
  --lff-navy-600: #243c5e;
  --lff-navy-500: #2f4d75;
  --lff-navy-400: #3d6390;
  --lff-navy-300: #5a83af;
  --lff-navy-200: #8aa8ca;
  --lff-navy-100: #bfd0e4;
  --lff-navy-50:  #e4ecf4;

  /* Accent: Gold — warmth, lamplight, revelation */
  --lff-gold-600: #9a7a2e;
  --lff-gold-500: #b8923a;
  --lff-gold-400: #c9a84c;
  --lff-gold-300: #d9bf6e;
  --lff-gold-200: #e6d49a;
  --lff-gold-100: #f2e8c4;

  /* Accent: Warm whites and parchment tones */
  --lff-parchment-100: #faf7f0;
  --lff-parchment-200: #f0ebe0;
  --lff-parchment-300: #e2dace;

  /* Semantic colors */
  --lff-text-primary:   var(--lff-navy-900);
  --lff-text-secondary: var(--lff-navy-600);
  --lff-text-muted:     var(--lff-navy-400);
  --lff-text-on-dark:   var(--lff-parchment-100);
  --lff-text-on-dark-muted: var(--lff-navy-200);
  --lff-surface:        #ffffff;
  --lff-surface-warm:   var(--lff-parchment-100);
  --lff-surface-dark:   var(--lff-navy-900);
  --lff-border:         var(--lff-navy-100);
  --lff-border-dark:    var(--lff-navy-700);
  --lff-accent:         var(--lff-gold-400);
  --lff-accent-hover:   var(--lff-gold-500);
  --lff-link:           var(--lff-navy-500);
  --lff-link-hover:     var(--lff-gold-500);

  /* "Put Off / Put On" thematic colors (Colossians 3 and similar) */
  --lff-put-off-bg:     #1a1520;
  --lff-put-off-accent: #8b5e6b;
  --lff-put-on-bg:      #f5f0e8;
  --lff-put-on-accent:  #5a7a5e;

  /* ── Typography ────────────────────────────────────────────────────────── */
  --lff-font-display: 'Roboto Flex', sans-serif;
  --lff-font-body:    'Roboto Serif', serif;
  --lff-font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Fluid type scale using clamp() */
  --lff-text-xs:   clamp(0.75rem,  0.7rem  + 0.2vw,  0.875rem);
  --lff-text-sm:   clamp(0.875rem, 0.8rem  + 0.25vw, 1rem);
  --lff-text-base: clamp(1rem,     0.9rem  + 0.35vw, 1.15rem);
  --lff-text-lg:   clamp(1.125rem, 1rem    + 0.45vw, 1.35rem);
  --lff-text-xl:   clamp(1.25rem,  1.1rem  + 0.55vw, 1.6rem);
  --lff-text-2xl:  clamp(1.5rem,   1.25rem + 0.75vw, 2rem);
  --lff-text-3xl:  clamp(1.875rem, 1.5rem  + 1vw,    2.5rem);
  --lff-text-4xl:  clamp(2.25rem,  1.75rem + 1.5vw,  3.25rem);
  --lff-text-5xl:  clamp(3rem,     2rem    + 2.5vw,  4.5rem);

  /* Line heights */
  --lff-leading-tight:  1.2;
  --lff-leading-snug:   1.35;
  --lff-leading-normal: 1.6;
  --lff-leading-relaxed: 1.75;

  /* Font weights (Roboto Flex variable axis) */
  --lff-weight-light:    300;
  --lff-weight-regular:  400;
  --lff-weight-medium:   500;
  --lff-weight-semibold: 600;
  --lff-weight-bold:     700;

  /* Letter spacing */
  --lff-tracking-tight:   -0.02em;
  --lff-tracking-normal:   0;
  --lff-tracking-wide:     0.04em;
  --lff-tracking-wider:    0.08em;
  --lff-tracking-widest:   0.14em;

  /* ── Spacing Scale ─────────────────────────────────────────────────────── */
  --lff-space-xs:   clamp(0.25rem, 0.2rem + 0.15vw, 0.5rem);
  --lff-space-sm:   clamp(0.5rem,  0.4rem + 0.25vw, 0.75rem);
  --lff-space-md:   clamp(1rem,    0.8rem + 0.5vw,  1.5rem);
  --lff-space-lg:   clamp(1.5rem,  1.2rem + 0.75vw, 2.5rem);
  --lff-space-xl:   clamp(2rem,    1.5rem + 1.25vw, 3.5rem);
  --lff-space-2xl:  clamp(3rem,    2rem   + 2vw,    5rem);
  --lff-space-3xl:  clamp(4rem,    3rem   + 2.5vw,  7rem);

  /* ── Layout ────────────────────────────────────────────────────────────── */
  --lff-content-width:  54rem;   /* ~864px — wider for site layout */
  --lff-wide-width:     80rem;   /* ~1280px — for wide layouts */
  --lff-full-width:     90rem;   /* ~1440px — max site width */
  --lff-gutter:         clamp(1rem, 0.5rem + 2vw, 2.5rem);

  /* ── Borders & Radii ───────────────────────────────────────────────────── */
  --lff-radius-sm:  0.25rem;
  --lff-radius-md:  0.5rem;
  --lff-radius-lg:  0.75rem;
  --lff-radius-xl:  1rem;

  /* ── Shadows ───────────────────────────────────────────────────────────── */
  --lff-shadow-sm:   0 1px 2px  rgba(10, 22, 40, 0.06);
  --lff-shadow-md:   0 4px 12px rgba(10, 22, 40, 0.08);
  --lff-shadow-lg:   0 8px 24px rgba(10, 22, 40, 0.12);
  --lff-shadow-glow: 0 0 20px   rgba(201, 168, 76, 0.15);

  /* ── Transitions ───────────────────────────────────────────────────────── */
  --lff-ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --lff-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --lff-duration-fast:   150ms;
  --lff-duration-normal: 300ms;
  --lff-duration-slow:   500ms;
}


/* ==========================================================================
   BASE STYLES
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--lff-font-body);
  font-size: var(--lff-text-base);
  line-height: var(--lff-leading-normal);
  color: var(--lff-text-primary);
  background-color: var(--lff-surface);
}


/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--lff-font-display);
  font-weight: var(--lff-weight-semibold);
  line-height: var(--lff-leading-tight);
  color: var(--lff-navy-900);
  margin-top: 0;
}

h1 { font-size: var(--lff-text-4xl); letter-spacing: var(--lff-tracking-tight); }
h2 { font-size: var(--lff-text-3xl); letter-spacing: var(--lff-tracking-tight); }
h3 { font-size: var(--lff-text-2xl); }
h4 { font-size: var(--lff-text-xl); }
h5 { font-size: var(--lff-text-lg); }
h6 { font-size: var(--lff-text-base); font-weight: var(--lff-weight-bold); text-transform: uppercase; letter-spacing: var(--lff-tracking-wider); }

p {
  margin-top: 0;
  margin-bottom: var(--lff-space-md);
}

a {
  color: var(--lff-link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color var(--lff-duration-fast) var(--lff-ease-out);
}

a:hover,
a:focus-visible {
  color: var(--lff-link-hover);
}

blockquote {
  margin: var(--lff-space-lg) 0;
  padding: var(--lff-space-md) var(--lff-space-lg);
  border-left: 3px solid var(--lff-gold-400);
  background: var(--lff-surface-warm);
  font-family: var(--lff-font-body);
  font-style: italic;
  font-size: var(--lff-text-lg);
  line-height: var(--lff-leading-relaxed);
  color: var(--lff-navy-700);
  border-radius: 0 var(--lff-radius-sm) var(--lff-radius-sm) 0;
}

blockquote cite {
  display: block;
  margin-top: var(--lff-space-sm);
  font-style: normal;
  font-size: var(--lff-text-sm);
  font-weight: var(--lff-weight-medium);
  color: var(--lff-text-muted);
  letter-spacing: var(--lff-tracking-wide);
}

/* Scripture reference styling */
.lff-scripture-ref {
  font-family: var(--lff-font-display);
  font-weight: var(--lff-weight-medium);
  font-size: var(--lff-text-sm);
  color: var(--lff-gold-600);
  letter-spacing: var(--lff-tracking-wide);
  text-transform: uppercase;
}

/* Hebrew / Greek term styling */
.lff-original-lang {
  font-style: italic;
  color: var(--lff-navy-600);
  border-bottom: 1px dotted var(--lff-navy-300);
  cursor: help;
}

/* Section label — "The Hagah", "Book Study", etc. */
.lff-section-label {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-xs);
  font-weight: var(--lff-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--lff-tracking-widest);
  color: var(--lff-gold-500);
}


/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */

.lff-container {
  width: 100%;
  max-width: var(--lff-full-width);
  margin-inline: auto;
  padding-inline: var(--lff-gutter);
}

.lff-container--content {
  max-width: var(--lff-content-width);
}

.lff-container--wide {
  max-width: var(--lff-wide-width);
}

.lff-section {
  padding-block: var(--lff-space-2xl);
}

/* Dark section (navy background) */
.lff-section--dark {
  background-color: var(--lff-surface-dark);
  color: var(--lff-text-on-dark);
}

.lff-section--dark h1,
.lff-section--dark h2,
.lff-section--dark h3,
.lff-section--dark h4 {
  color: var(--lff-parchment-100);
}

.lff-section--dark p {
  color: var(--lff-text-on-dark-muted);
}

/* Warm section (parchment background) */
.lff-section--warm {
  background-color: var(--lff-surface-warm);
}


/* ==========================================================================
   BLANK CANVAS TEMPLATE — strip WordPress wrapper spacing
   These rules target the content-level wrappers without affecting the footer.
   ========================================================================== */

/* Zero out the WP site-blocks gap (the outermost wrapper) */
.wp-site-blocks > .wp-block-post-content,
.wp-site-blocks > .wp-block-post-content > .wp-block-html {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Remove WordPress content-width constraint on Blank Canvas pages */
.wp-block-post-content {
  --wp--style--global--content-size: 100% !important;
  --wp--style--global--wide-size: 100% !important;
}

/* Block gap between post-content and footer */
.wp-site-blocks {
  gap: 0 !important;
}

.wp-site-blocks > * + * {
  margin-block-start: 0 !important;
}

/* Ensure no ancestor breaks position:sticky on the slim header */
.wp-site-blocks,
.wp-site-blocks > .wp-block-group,
.wp-site-blocks > header,
body,
html {
  overflow: visible !important;
  overflow-x: clip !important;
}


/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* ── Site Header ─────────────────────────────────────────────────────────── */
.lff-site-header {
  position: relative;
}

/* Slim header — sticky nav bar for non-homepage pages */
.lff-site-header--slim {
  position: sticky !important;
  top: 0 !important;
  z-index: 999;
}

.lff-header-brand {
  text-align: center;
}

/* Navigation bar */
.lff-header-nav {
  position: relative;
}

/* Main navigation styling — !important needed to override WP inline styles */
.lff-main-nav .wp-block-navigation-item a,
.lff-main-nav .wp-block-navigation-item a:visited,
.lff-header-nav .wp-block-navigation-item a,
.lff-header-nav a.wp-block-navigation-item__content {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-sm);
  font-weight: var(--lff-weight-medium);
  letter-spacing: var(--lff-tracking-wide);
  text-transform: uppercase;
  color: #e4ecf4 !important;
  text-decoration: none;
  padding: 0.5em 0.75em;
  position: relative;
  transition: color var(--lff-duration-fast) var(--lff-ease-out);
}

.lff-main-nav .wp-block-navigation-item a:hover,
.lff-header-nav .wp-block-navigation-item a:hover,
.lff-header-nav a.wp-block-navigation-item__content:hover {
  color: #c9a84c !important;
}

/* Uniform blue underline on all nav items */
.lff-nav-item > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--lff-navy-300);
  transition: width var(--lff-duration-normal) var(--lff-ease-out);
}

.lff-nav-item > a:hover::after {
  width: 80%;
}

/* Mobile overlay nav */
.wp-block-navigation__responsive-container.is-menu-open {
  background: var(--lff-navy-900) !important;
}

/* Disable hover styles only when mobile nav popup is open */
.wp-block-navigation__responsive-container.is-menu-open a:hover,
.wp-block-navigation__responsive-container.is-menu-open .lff-header-nav a.wp-block-navigation-item__content:hover {
  color: inherit !important;
}

.wp-block-navigation__responsive-container.is-menu-open .lff-nav-item  > a::after {
  height: 0px !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item a {
  color: var(--lff-navy-100);
  font-size: var(--lff-text-lg);
  padding: 0.75em 1em;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item a:hover {
  color: var(--lff-parchment-100);
}

/* Mobile hamburger button */
.wp-block-navigation__responsive-container-open {
  color: var(--lff-gold-400) !important;
}

.wp-block-navigation__responsive-container-close {
  color: var(--lff-gold-400) !important;
}


/* ── Verse Card ──────────────────────────────────────────────────────────── */
.lff-verse-card {
  background: var(--lff-surface);
  border: 1px solid var(--lff-border);
  border-radius: var(--lff-radius-lg);
  padding: var(--lff-space-lg);
  box-shadow: var(--lff-shadow-sm);
  transition: box-shadow var(--lff-duration-normal) var(--lff-ease-out),
              transform var(--lff-duration-normal) var(--lff-ease-out);
}

.lff-verse-card:hover {
  box-shadow: var(--lff-shadow-md);
  transform: translateY(-2px);
}

.lff-verse-card__reference {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-sm);
  font-weight: var(--lff-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--lff-tracking-wider);
  color: var(--lff-gold-500);
  margin-bottom: var(--lff-space-sm);
}

.lff-verse-card__text {
  font-family: var(--lff-font-body);
  font-size: var(--lff-text-lg);
  line-height: var(--lff-leading-relaxed);
  color: var(--lff-navy-800);
  font-style: italic;
}

/* ── Book Study Hero ─────────────────────────────────────────────────────── */
.lff-book-hero {
  background: var(--lff-navy-900);
  color: var(--lff-text-on-dark);
  padding: var(--lff-space-3xl) var(--lff-gutter);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.lff-book-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 120%,
    rgba(201, 168, 76, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.lff-book-hero__label {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-xs);
  font-weight: var(--lff-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--lff-tracking-widest);
  color: var(--lff-gold-400);
  margin-bottom: var(--lff-space-sm);
}

.lff-book-hero__title {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-5xl);
  font-weight: var(--lff-weight-bold);
  color: var(--lff-parchment-100);
  margin-bottom: var(--lff-space-md);
}

.lff-book-hero__subtitle {
  font-family: var(--lff-font-body);
  font-size: var(--lff-text-xl);
  color: var(--lff-navy-200);
  max-width: var(--lff-content-width);
  margin-inline: auto;
  line-height: var(--lff-leading-relaxed);
}

/* ── Hagah Post Sections ─────────────────────────────────────────────────── */
.lff-hagah-section {
  padding-block: var(--lff-space-xl);
  border-bottom: 1px solid var(--lff-border);
}

.lff-hagah-section:last-child {
  border-bottom: none;
}

.lff-hagah-section__label {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-sm);
  font-weight: var(--lff-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--lff-tracking-widest);
  color: var(--lff-gold-500);
  margin-bottom: var(--lff-space-xs);
}

.lff-hagah-section__title {
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-2xl);
  color: var(--lff-navy-800);
  margin-bottom: var(--lff-space-md);
}

/* ── Cross-Reference Chip ────────────────────────────────────────────────── */
.lff-xref {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-family: var(--lff-font-display);
  font-size: var(--lff-text-xs);
  font-weight: var(--lff-weight-medium);
  color: var(--lff-navy-500);
  background: var(--lff-navy-50);
  padding: 0.2em 0.6em;
  border-radius: var(--lff-radius-sm);
  border: 1px solid var(--lff-navy-100);
  text-decoration: none;
  transition: all var(--lff-duration-fast) var(--lff-ease-out);
}

.lff-xref:hover {
  background: var(--lff-navy-100);
  color: var(--lff-navy-700);
  text-decoration: none;
}


/* ── Site Footer ─────────────────────────────────────────────────────────── */
.lff-site-footer {
  border-top: 1px solid var(--lff-navy-800);
}

.lff-site-footer a {
  text-decoration: none;
  transition: color var(--lff-duration-fast) var(--lff-ease-out);
}

.lff-site-footer a:hover {
  color: var(--lff-parchment-100) !important;
}


/* ==========================================================================
   SCROLL ANIMATIONS (progressive enhancement)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .lff-fade-in {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity var(--lff-duration-slow) var(--lff-ease-out),
                transform var(--lff-duration-slow) var(--lff-ease-out);
  }

  .lff-fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
  :root {
    --lff-text-base: 11pt;
  }

  body {
    color: #000;
    background: #fff;
  }

  .lff-book-hero {
    background: none;
    color: #000;
    padding: 1cm 0;
  }

  .lff-book-hero__title {
    color: #000;
  }

  .lff-verse-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
