/*
Theme Name: Reel Home Loans
Theme URI: https://reelhomeloans.com
Description: Custom child theme for Reel Home Loans — "Confidence. Through Strategy." A conversion-oriented, block-based (Gutenberg/FSE) child of Twenty Twenty-Five. Forest-green + gold brand system, Outfit + Barlow typography. Fully editable in the WordPress editor.
Author: Agency Next
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 8.0
Text Domain: reel-home-loans
*/

/* ==========================================================================
   Reel Home Loans — custom design layer
   Brand tokens are defined in theme.json (--wp--preset--color--*).
   These classes are applied to core Gutenberg blocks via "Additional CSS class".
   ========================================================================== */

:root {
  --rhl-shadow-card: 0 12px 40px -18px rgba(9, 52, 32, 0.35);
  --rhl-shadow-lift: 0 24px 60px -24px rgba(9, 52, 32, 0.45);
  --rhl-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Section vertical rhythm — match reference py-20 (mobile) / py-28 (desktop). */
:root { --wp--preset--spacing--60: 5rem; }
@media (min-width: 782px) { :root { --wp--preset--spacing--60: 7rem; } }

/* ---------- Typography niceties ---------- */
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.wp-site-blocks { overflow-x: clip; }

/* Eyebrow label (uppercase, gold) */
.eyebrow, .rhl-eyebrow {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in oklab, var(--wp--preset--color--forest) 72%, transparent);
}
.rhl-on-dark .eyebrow,
.rhl-on-dark .rhl-eyebrow,
.surface-forest .eyebrow,
.surface-forest .rhl-eyebrow { color: var(--wp--preset--color--gold); }

/* Gold rule divider */
.rule-gold::before,
.rhl-rule::before {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3px;
  margin-bottom: 1.1rem;
  border-radius: 2px;
  background-image: linear-gradient(90deg, var(--wp--preset--color--gold), rgba(242, 174, 42, 0.1));
}
.has-text-align-center.rhl-rule::before { margin-left: auto; margin-right: auto; }
/* Reference uses plain eyebrows on section headings (rule only in the hero). */
.rhl-rule::before { content: none; }

/* Gold gradient text (for hero accent line) */
.text-gold-gradient {
  background-image: linear-gradient(100deg, #F2AE2A, #F8D89A);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Surfaces ---------- */
/* Forest gradient surface + light text */
.surface-forest, .rhl-on-dark {
  background-image: linear-gradient(160deg, #093420, #154D31);
  color: #ffffff;
}
.surface-forest :where(h1,h2,h3,h4,p,li,figcaption,cite,blockquote),
.rhl-on-dark :where(h1,h2,h3,h4,p,li,figcaption,cite,blockquote) { color: #ffffff; }
.surface-forest p, .rhl-on-dark p { color: rgba(255,255,255,0.82); }

/* Grain / glow accents on dark CTA */
.rhl-grain { position: relative; isolation: isolate; }
.rhl-grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1; opacity: 0.6;
  background-image:
    radial-gradient(circle at 18% 20%, rgba(242,174,42,0.14), transparent 45%),
    radial-gradient(circle at 85% 78%, rgba(242,174,42,0.10), transparent 50%);
}

/* ---------- Cards ---------- */
.rhl-card {
  background: #ffffff;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 12px;
  box-shadow: var(--rhl-shadow-card);
  height: 100%;
}
.rhl-card.is-style-plain { box-shadow: none; }

/* Card on dark surface */
.rhl-card-dark {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  height: 100%;
}

/* Lift-on-hover interaction */
.lift, .rhl-lift {
  transition: transform 0.35s var(--rhl-ease), box-shadow 0.35s var(--rhl-ease), border-color 0.35s ease;
  will-change: transform;
}
@media (hover: hover) {
  .lift:hover, .rhl-lift:hover { transform: translateY(-4px); box-shadow: var(--rhl-shadow-lift); }
  .rhl-card.rhl-lift:hover { border-color: rgba(242,174,42,0.6); }
  .rhl-card-dark.rhl-lift:hover { border-color: rgba(242,174,42,0.55); background: rgba(255,255,255,0.08); }
}

/* Step number badge */
.rhl-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.6rem; height: 2.6rem; border-radius: 999px;
  background: var(--wp--preset--color--forest); color: #fff;
  font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 1.05rem;
}
.surface-forest .rhl-step-num { background: var(--wp--preset--color--gold); color: var(--wp--preset--color--gold-ink); }

/* Comparison list (before -> after) */
.rhl-compare li { list-style: none; }
.rhl-compare .rhl-before { color: var(--wp--preset--color--muted-ink); text-decoration: line-through; font-size: 0.9rem; }
.rhl-compare .rhl-after { color: var(--wp--preset--color--forest); font-weight: 600; font-family: var(--wp--preset--font-family--display); font-size: 1.15rem; }

/* Left gold-bar trust points */
.rhl-trust-item { border-left: 3px solid var(--wp--preset--color--gold); padding-left: 1.25rem; }

/* Icon check bullet for offer/point lists */
.rhl-checklist ul { list-style: none; margin: 0; padding: 0; }
.rhl-checklist li {
  position: relative; padding-left: 1.9rem; margin-bottom: 0.9rem; line-height: 1.5; font-weight: 500;
}
.rhl-checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.15em; width: 1.15rem; height: 1.15rem;
  background: var(--wp--preset--color--gold);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
}

/* ---------- Hero ---------- */
.rhl-hero { position: relative; isolation: isolate; }
.rhl-hero.wp-block-cover { min-height: 92vh; }
/* Photo sits at the very back; WP's built-in dim span is unused. */
.rhl-hero .wp-block-cover__image-background { z-index: 0; }
.rhl-hero > .wp-block-cover__background { display: none; }
/* Angled forest wash + bottom fade, layered ABOVE the photo (matches reference). */
.rhl-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(to top, #093420, rgba(9,52,32,0) 224px),
    linear-gradient(102deg, #093420 16%, color-mix(in oklab, #093420 82%, transparent) 46%, color-mix(in oklab, #093420 28%, transparent) 100%);
}
.rhl-hero .wp-block-cover__inner-container { position: relative; z-index: 2; width: 100%; max-width: 1280px; margin-inline: auto; }
.rhl-hero h1 { color: #fff; }
.rhl-hero p { color: rgba(255,255,255,0.86); }
@media (max-width: 781px) { .rhl-hero.wp-block-cover { min-height: 78vh; } }

/* Ken-burns for hero image */
.rhl-hero .wp-block-cover__image-background,
.rhl-hero img.wp-block-cover__image-background { animation: rhl-ken-burns 18s var(--rhl-ease) forwards; }
@keyframes rhl-ken-burns { from { transform: scale(1.08); } to { transform: scale(1); } }

/* Glass stat strip — dark forest glass panel (matches reference .glass-forest) */
.rhl-stat-strip {
  background: rgba(9,52,32,0.55);
  border: 1px solid rgba(255,255,255,0.14);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-radius: 12px;
  overflow: hidden;
  gap: 1px !important;
  padding: 0 !important;
}
.rhl-stat-strip > .wp-block-column {
  padding: 1.5rem !important;
  flex-basis: 0; min-width: 0;
}
.rhl-stat-strip .rhl-stat-num {
  font-family: var(--wp--preset--font-family--display); font-weight: 700; color: #fff; line-height: 1.1;
}
.rhl-stat-strip .rhl-stat-label { color: rgba(255,255,255,0.7); font-size: 0.875rem; }

/* Big brand stat tile (light) */
.rhl-stat-tile { background: var(--wp--preset--color--forest-soft); border-radius: 14px; text-align: center; }
.rhl-stat-tile .rhl-stat-num { font-family: var(--wp--preset--font-family--display); font-weight: 800; color: var(--wp--preset--color--forest); }

/* ---------- Buttons: secondary variants via classes ---------- */
/* Forest solid button */
.wp-block-button.is-style-forest .wp-block-button__link {
  background: var(--wp--preset--color--forest); color: #fff;
}
.wp-block-button.is-style-forest .wp-block-button__link:hover { background: var(--wp--preset--color--forest-deep); }
/* Outline on dark */
.wp-block-button.is-style-outline-light .wp-block-button__link {
  background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.55);
}
.wp-block-button.is-style-outline-light .wp-block-button__link:hover { background: rgba(255,255,255,0.12); border-color:#fff; }
/* Outline forest (light bg) */
.wp-block-button.is-style-outline-forest .wp-block-button__link {
  background: transparent; color: var(--wp--preset--color--forest); border: 1.5px solid var(--wp--preset--color--forest);
}
.wp-block-button.is-style-outline-forest .wp-block-button__link:hover { background: var(--wp--preset--color--forest); color:#fff; }

/* ---------- Trust badges row ---------- */
.rhl-badges img { height: 68px; width: auto; object-fit: contain; }
.rhl-badges figure { margin: 0; }

/* ---------- Header (transparent over hero, solid on scroll) ---------- */
:root { --rhl-header-h: 84px; }
header.rhl-header {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  background-color: rgba(9,52,32,0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}
header.rhl-header.is-scrolled {
  background-image: linear-gradient(160deg, #093420, #154D31);
  box-shadow: var(--rhl-shadow-lift);
  padding-top: 0.55rem !important; padding-bottom: 0.55rem !important;
}
.rhl-header a { color: #fff; }
.rhl-header .wp-block-navigation { font-family: var(--wp--preset--font-family--display); font-weight: 500; }
.rhl-header .wp-block-navigation a { letter-spacing: 0.01em; }
.rhl-header .wp-block-navigation a:hover { color: var(--wp--preset--color--gold); }
.rhl-header .wp-block-site-logo img { height: 52px; width: auto; transition: height 0.4s ease; }
.rhl-header.is-scrolled .wp-block-site-logo img { height: 44px; }
/* Pull the first section of every page up under the transparent header */
main .wp-block-post-content > .rhl-hero:first-child,
main .wp-block-post-content > .surface-forest:first-child {
  margin-top: calc(-1 * var(--rhl-header-h));
}
.rhl-header .wp-block-navigation .wp-block-navigation-submenu > .wp-block-navigation__submenu-container {
  background: #0c3b25; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 0.35rem;
}
.rhl-header .wp-block-navigation__submenu-container a:hover { background: rgba(255,255,255,0.08); border-radius: 6px; }

/* ---------- Footer ---------- */
.rhl-footer a:hover { color: var(--wp--preset--color--gold); }
.rhl-footer .wp-block-site-logo img { height: 42px; width: auto; }
.rhl-footer .rhl-legal { font-size: 0.78rem; color: rgba(255,255,255,0.6); }

/* ---------- Contact form ---------- */
.rhl-form .wp-block-column { min-width: 0; }
.rhl-form input, .rhl-form textarea, .rhl-form select {
  width: 100%; padding: 0.85rem 1rem; border: 1px solid var(--wp--preset--color--border);
  border-radius: 9px; font: inherit; background: #fff; color: var(--wp--preset--color--ink);
}
.rhl-form input:focus, .rhl-form textarea:focus {
  outline: none; border-color: var(--wp--preset--color--forest); box-shadow: 0 0 0 3px rgba(21,77,49,0.15);
}
.rhl-form label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 0.4rem; font-family: var(--wp--preset--font-family--display); }
.rhl-form button[type="submit"] {
  background: var(--wp--preset--color--gold); color: var(--wp--preset--color--gold-ink);
  border: none; border-radius: 9px; padding: 0.95rem 1.8rem; font-weight: 700; cursor: pointer;
  font-family: var(--wp--preset--font-family--display); transition: background 0.25s ease, color 0.25s ease;
}
.rhl-form button[type="submit"]:hover { background: var(--wp--preset--color--gold-ink); color: var(--wp--preset--color--gold); }

/* ---------- Reveal-on-scroll (progressive enhancement) ---------- */
.rhl-reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--rhl-ease), transform 0.7s var(--rhl-ease); }
.rhl-reveal.is-visible { opacity: 1; transform: none; }
.no-js .rhl-reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .rhl-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .rhl-hero .wp-block-cover__image-background { animation: none !important; }
  .lift, .rhl-lift { transition: none !important; }
}

/* ---------- Lucide-style icons (inline SVG in wp:html blocks) ---------- */
.rhl-ico { display: block; width: 1.75rem; height: 1.75rem; color: var(--wp--preset--color--forest); }
.rhl-ico.is-gold { color: var(--wp--preset--color--gold); }
.rhl-ico.is-lg { width: 2rem; height: 2rem; }
.surface-forest .rhl-ico, .rhl-card-dark .rhl-ico, .rhl-on-dark .rhl-ico { color: var(--wp--preset--color--gold); }
/* Icon sitting inline before stat text */
.rhl-stat-ico { display: flex; align-items: center; gap: 0.75rem; }
.rhl-stat-ico .rhl-ico { flex: 0 0 auto; width: 1.5rem; height: 1.5rem; color: var(--wp--preset--color--gold); }

/* Hero eyebrow with inline gold rule (matches reference) */
.rhl-hero-eyebrow { display: flex; align-items: center; gap: 0.85rem; }
.rhl-hero-eyebrow::before {
  content: ""; display: inline-block; width: 2.4rem; height: 2px; flex: 0 0 auto;
  background-image: linear-gradient(90deg, var(--wp--preset--color--gold), rgba(242,174,42,0.1));
}

/* Icon card (offer points / realtor items) */
/* Offer / feature grid — tight 2-up like the reference (sm:grid-cols-2 gap-3). */
.rhl-offer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 600px) { .rhl-offer-grid { grid-template-columns: 1fr; } }
.rhl-icon-card {
  display: flex; align-items: flex-start; gap: 0.75rem;
  background: #fff; border: 1px solid var(--wp--preset--color--border);
  border-radius: 8px; padding: 1.25rem; box-shadow: var(--rhl-shadow-card);
  font-weight: 500; font-size: 0.875rem; line-height: 1.5;
}
.rhl-icon-card p { margin: 0; font-size: 0.875rem; }
.rhl-icon-card .rhl-ico { flex: 0 0 auto; width: 1rem; height: 1rem; margin-top: 0.15rem; color: var(--wp--preset--color--gold); }
.rhl-icon-card-dark {
  display: flex; flex-direction: column; gap: 0.75rem;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px; padding: 1.25rem; height: 100%;
}
.rhl-icon-card-dark .rhl-ico { width: 1.35rem; height: 1.35rem; color: var(--wp--preset--color--gold); }
.rhl-icon-card-dark p { color: #fff; font-weight: 500; margin: 0; }

/* Strategy-in-action interactive switcher */
.rhl-stories-feature { min-height: 15rem; }
.rhl-story-panel { display: none; }
.rhl-story-panel.is-active { display: block; animation: rhl-fade 0.5s var(--rhl-ease); }
@keyframes rhl-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rhl-story-tab {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%;
  text-align: left; cursor: pointer; border: 1px solid var(--wp--preset--color--border);
  background: #fff; border-radius: 10px; padding: 0.85rem 1.1rem; font: inherit; font-weight: 500;
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.rhl-story-tab:hover { border-color: rgba(21,77,49,0.4); }
.rhl-story-tab.is-active { border-color: var(--wp--preset--color--forest); background: var(--wp--preset--color--forest-soft); color: var(--wp--preset--color--forest); }
.rhl-story-dots { display: flex; gap: 0.5rem; margin-top: 1.5rem; }
.rhl-story-dots button { height: 6px; width: 24px; border: 0; border-radius: 999px; background: var(--wp--preset--color--border); cursor: pointer; padding: 0; transition: background 0.25s ease, width 0.25s ease; }
.rhl-story-dots button.is-active { background: var(--wp--preset--color--forest); width: 40px; }

@media (prefers-reduced-motion: reduce) { .rhl-story-panel.is-active { animation: none; } }

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
  .rhl-header .wp-block-site-logo img { height: 42px; }
  .rhl-badges img { height: 54px; }
}
