/*
  Everleaf Law styles

  All custom styles live here. We use BEM naming for
  maintainability and CSS variables for colours and spacing.
*/

/* CSS variables for colour palette */
:root {
  --color-forest: #0e3b2e; /* deep forest */
  --color-slate: #263238;  /* slate grey */
  --color-slate-deep: #0e1417; /* near-black slate, higher contrast */
  --color-ivory: #f6f4ef;  /* warm ivory */
  --color-moss: #5c7a72;   /* moss green */
  --color-copper: #b56e46; /* copper accent */
  --color-light-slate: #394a51;
  --color-muted: #8a8f91;

  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --font-brand: 'Stardos Stencil', serif; /* dedicated brand word-mark face */

  --max-width: 1120px;
  --gutter: 1rem;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-slate);
  line-height: 1.6;
  background-color: var(--color-ivory);
}

img { max-width: 100%; display: block; height: auto; }

/* Accessibility: visually hidden text */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Container utility */
.container {
  width: 100%;
  max-width: var(--max-width);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  margin-left: auto;
  margin-right: auto;
}

/* Skip link styling */
.skip-link {
  position: absolute;
  top: -40px; left: 0;
  background: var(--color-copper);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 10000;
  transition: top 0.3s ease;
}
.skip-link:focus { top: 0; }

/* Demo back button – provided CSS values must not change */
.demo-back {
  position: fixed;
  top: 20px; left: 20px;
  z-index: 2147483647;
  display: inline-flex; align-items: center; justify-content: center;
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(17,17,17,0.65);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 2px solid rgba(255,255,255,0.4);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  text-decoration: none;
}
.demo-back:hover { background: rgba(17,17,17,0.85); transform: scale(1.05); }
.demo-back img { width: 48px; height: 48px; display: block; }
@media (max-width: 640px) {
  .demo-back { width: 56px; height: 56px; top: 64px; left: 12px; }
  .demo-back img { width: 32px; height: 32px; }
}

/* =================
   Header (centered)
   ================= */
.header {
  position: sticky; top: 0; width: 100%; z-index: 1000;
  background-color: rgba(246,244,239,0.9);
  backdrop-filter: blur(4px);
  transition: border-bottom 0.2s ease, box-shadow 0.2s ease;
}
.header--scrolled {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.header__inner{
  display: flex;
  align-items: center;
  justify-content: center;      /* center the whole group (logo + links) */
  gap: 1.75rem;                 /* consistent gap between logo and first link */
  padding: 0.75rem 0;
}

/* logo wrapper (link/div) */
.header__logo{
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;           /* match link vertical rhythm */
}

/* size the actual graphic (img/svg or class directly on img/svg) */
.header__logo > img,
.header__logo > svg,
img.header__logo,
svg.header__logo {
  height: 48px;                 /* adjust if needed */
  width: auto;
  display: block;
}

@media (max-width: 640px){
  .header__logo > img,
  .header__logo > svg,
  img.header__logo,
  svg.header__logo { height: 36px; }
}

.nav { position: relative; }

.nav__list{
  display: flex;
  align-items: center;
  gap: 1.75rem;                 /* matches logo/link gap */
  list-style: none;
  margin: 0; padding: 0;
}

.nav__link {
  color: var(--color-forest);
  font-weight: 500;
  text-decoration: none;
  position: relative;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}
.nav__link:hover,
.nav__link:focus { color: var(--color-copper); }

/* underline slide */
.nav__link::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px;
  background-color: var(--color-copper);
  transition: width 0.3s ease;
}
.nav__link:hover::after,
.nav__link:focus::after { width: 100%; }

.nav__link--cta {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-copper);
  border-radius: 4px;
}
.nav__link--cta:hover,
.nav__link--cta:focus { background-color: var(--color-copper); color: var(--color-ivory); }

/* Mobile nav */
.nav__toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav__burger,
.nav__burger::before,
.nav__burger::after {
  display: block; width: 24px; height: 2px; background-color: var(--color-forest);
  position: relative; transition: transform 0.3s ease;
}
.nav__burger::before,
.nav__burger::after { content: ""; position: absolute; left: 0; }
.nav__burger::before { top: -7px; } .nav__burger::after { top: 7px; }

.nav__toggle[aria-expanded="true"] .nav__burger { background-color: transparent; }
.nav__toggle[aria-expanded="true"] .nav__burger::before { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__burger::after  { transform: translateY(-7px) rotate(-45deg); }

.nav--open .nav__list {
  position: fixed; top: 0; right: 0; height: 100vh; width: 80%; max-width: 320px;
  background-color: var(--color-ivory);
  flex-direction: column; padding: 4rem 1.5rem; gap: 1rem;
  box-shadow: -4px 0 10px rgba(0,0,0,0.1);
  transform: translateX(100%); transition: transform 0.3s ease;
}
.nav--open .nav__list.open { transform: translateX(0); }

@media (max-width: 768px) {
  .nav__list { display: none; }
  .nav--open .nav__list { display: flex; }
  .nav__toggle { display: block; }
  .nav__link::after { display: none; }
  .header__inner { justify-content: space-between; gap: 1rem; } /* logo left, burger right on mobile */
  .nav__list { gap: 1.25rem; }
}




/* === Mobile menu close button (top-right of drawer) === */
.nav__close{
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--color-forest);
  cursor: pointer;
  display: none;
}
@media (max-width: 768px){
  .nav--open .nav__close{ display: block; }
}

/* Trust list: center items and allow icon as a list item */
.trust__list{
  align-items: center;
}
.trust__item--leaf .trust__leaf{
  width: 32px;
  height: 32px;
  display: inline-block;
}
@media (max-width: 640px){
  .trust__inner{ align-items: center; }
  .trust__list{ align-items: center; }
}
/* ============
   Hero section
   ============ */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-ivory); overflow: hidden;
}
.hero__background {
  position: absolute; inset: 0;
  background-image: url('../images/hero.jpg');
  background-size: cover; background-position: center;
  filter: brightness(0.6); transform: scale(1.05);
}
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,59,46,0.75) 0%, rgba(14,59,46,0.9) 100%);
  pointer-events: none;
}
.hero__content {
  position: relative; z-index: 1;
  max-width: 700px; text-align: center; padding: 2rem;
}
.hero__title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin: 0 0 1rem; color: var(--color-ivory);
}
.hero__tagline {
  font-family: var(--font-display);
  font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--color-copper);
}
.hero__subhead { margin-bottom: 1.5rem; font-size: 1rem; color: var(--color-ivory); }
.hero__actions {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem;
}
.hero__bullets {
  display: flex; justify-content: center; gap: 1.5rem; list-style: none; padding: 0; margin: 0;
  font-size: 0.875rem; color: var(--color-ivory);
}

/* =========================
   Brand word-mark (hero)
   ========================= */
.brand-wordmark {
  display: inline-block;
  font-family: var(--font-brand, var(--font-display));
  font-weight: 700; letter-spacing: 0.04em; line-height: 1;
  position: relative; white-space: nowrap;

  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-image: linear-gradient(180deg, #fdfcf9 0%, #f1eee7 35%, #ddd7cc 60%, var(--color-ivory) 100%);
  text-shadow: 0 1px 0 rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.20);
}
.brand-wordmark::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.08em; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(181,110,70,0.35) 10%, rgba(181,110,70,0.90) 50%, rgba(181,110,70,0.35) 90%, transparent 100%);
  transform: translateZ(0);
}
.brand-wordmark--hero {
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  margin-bottom: 0.25rem;
  -webkit-text-stroke: 0.4px rgba(14,59,46,0.20);
  text-shadow: 0 1px 0 rgba(246,244,239,0.35), 0 2px 10px rgba(0,0,0,0.25);
}
.brand-wordmark { -webkit-text-fill-color: transparent; }
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-wordmark { color: var(--color-ivory); background: none; }
}
@media (forced-colors: active) {
  .brand-wordmark { -webkit-text-fill-color: ButtonText; color: ButtonText; background: none; text-shadow: none; }
}
@media (max-width: 640px) {
  .brand-wordmark--hero { font-size: clamp(1.75rem, 8vw, 3rem); }
}

/* Buttons */
.btn {
  display: inline-block; font-family: var(--font-body); font-weight: 600;
  padding: 0.75rem 1.5rem; border-radius: 4px; text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:focus { outline: 2px solid var(--color-copper); outline-offset: 2px; }
.btn--primary {
  background-color: var(--color-copper); color: var(--color-ivory);
  border: 2px solid var(--color-copper);
}
.btn--primary:hover, .btn--primary:focus { box-shadow: 0 4px 8px rgba(0,0,0,0.2); transform: scale(1.02); }
.btn--secondary {
  background-color: transparent; color: var(--color-copper); border: 2px solid var(--color-copper);
}
.btn--secondary:hover, .btn--secondary:focus { background-color: var(--color-copper); color: var(--color-ivory); box-shadow: 0 4px 8px rgba(0,0,0,0.1); transform: scale(1.02); }

/* Sections */
.section { padding: 4rem 0; }
.section__title {
  font-family: var(--font-display); font-size: 2rem; margin-bottom: 2rem; text-align: center; color: var(--color-forest);
}

/* About */
.about__text {
  max-width: 800px; margin: 0 auto;
  font-size: 1.125rem; color: var(--color-light-slate); line-height: 1.7;
}

/* Trust strip */
.trust { 
  background-color: var(--color-ivory); 
  border-top: 1px solid rgba(0,0,0,0.05); 
  border-bottom: 1px solid rgba(0,0,0,0.05); 
}

/* Center the only child (the UL) horizontally */
.trust__inner { 
  display: flex; 
  align-items: center; 
  justify-content: center;         /* was space-between */
  gap: 1rem; 
  padding: 0.75rem 0; 
}

/* Center items inside the list */
.trust__list { 
  display: flex; 
  gap: 2rem; 
  list-style: none; 
  margin: 0; 
  padding: 0; 
  font-size: 0.875rem; 
  color: var(--color-light-slate);
  justify-content: center;         /* ensure centered on desktop row */
}

.trust__leaf { width: 32px; height: 32px; }

@media (max-width: 640px) {
  .trust__inner { 
    flex-direction: column; 
    align-items: center;           /* was flex-start */
  }
  .trust__list { 
    flex-direction: column; 
    gap: 0.5rem; 
    align-items: center;           /* center each li on mobile */
  }
}


/* Practice area cards */
.practice__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.card--practice {
  background-color: #fff; border: 1px solid rgba(0,0,0,0.05); border-radius: 8px;
  padding: 2rem 1.5rem; transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex; flex-direction: column; height: 100%;
}
.card--practice:hover, .card--practice:focus-within { box-shadow: 0 8px 16px rgba(0,0,0,0.05); transform: translateY(-4px); }
.card__icon { width: 40px; height: 40px; margin-bottom: 1rem; }
.card__title { font-family: var(--font-display); font-size: 1.25rem; margin: 0 0 0.5rem; color: var(--color-forest); }
.card__text { flex-grow: 1; font-size: 0.95rem; color: var(--color-light-slate); margin-bottom: 1rem; }
.card__list { list-style: none; padding: 0; margin: 0; }
.card__list li {
  position: relative; padding-left: 1.25rem; margin-bottom: 0.5rem; font-size: 0.875rem; color: var(--color-slate);
}
.card__list li::before {
  content: ""; position: absolute; left: 0; top: 0.4rem; width: 6px; height: 6px; border-radius: 50%; background-color: var(--color-moss);
}

/* Process & FAQ accordion */
.accordion__item { border-bottom: 1px solid rgba(0,0,0,0.1); }
.accordion__toggle {
  width: 100%; text-align: left; padding: 1rem 0; background: none; border: none;
  font-family: var(--font-display); font-size: 1.2rem; color: var(--color-forest);
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
}
.accordion__toggle:focus { outline: 2px solid var(--color-copper); outline-offset: 2px; }
.accordion__panel { padding-bottom: 1rem; font-size: 0.95rem; color: var(--color-light-slate); }
.checklist { list-style: none; padding-left: 1rem; margin: 0.5rem 0 0; }
.checklist li { position: relative; padding-left: 1.25rem; margin-bottom: 0.5rem; }
.checklist li::before { content: "✔"; position: absolute; left: 0; top: 0; color: var(--color-moss); }

/* Results */
.results__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.result {
  background-color: #fff; border: 1px solid rgba(0,0,0,0.05); border-radius: 8px; padding: 2rem; height: 100%;
}
.result__case-title { font-family: var(--font-display); font-size: 1.25rem; margin-top: 0; margin-bottom: 0.5rem; color: var(--color-forest); }
.result__case-text { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--color-light-slate); }
.result__case-footnote { font-size: 0.75rem; color: var(--color-muted); margin-top: 1rem; }

/* Testimonials */
.testimonial { background-color: #fff; border-left: 4px solid var(--color-moss); padding: 1.5rem; margin-bottom: 1rem; border-radius: 4px; }
.testimonial__quote { margin: 0 0 0.5rem; font-style: italic; color: var(--color-slate); }
.testimonial__author { margin: 0; font-size: 0.875rem; color: var(--color-muted); text-align: right; }

/* Team */
.team__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.team-card {
  background-color: #fff; border: 1px solid rgba(0,0,0,0.05); border-radius: 8px; overflow: hidden;
  display: flex; flex-direction: column; height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.team-card:hover, .team-card:focus-within { transform: translateY(-4px); box-shadow: 0 6px 12px rgba(0,0,0,0.05); }
/* Team headshots: same visual size */
.team-card__photo {
  display: block;          /* removes inline-gap */
  width: 100%;
  aspect-ratio: 4 / 5;     /* consistent portrait shape */
  object-fit: cover;       /* crop edges to fill the box */
  border-radius: 8px;      /* keep your rounded look (match existing radius if different) */
}

/* Fallback for older browsers without aspect-ratio support */
@supports not (aspect-ratio: 1) {
  .team-card__photo {
    height: 420px;         /* pick a value you like; it will scale responsively via object-fit */
  }
}

.team-card__content { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.team-card__name { margin: 0; font-family: var(--font-display); font-size: 1.25rem; color: var(--color-forest); }
.team-card__role { margin: 0.25rem 0 0.5rem; font-size: 0.875rem; color: var(--color-moss); }
.team-card__bio { font-size: 0.875rem; color: var(--color-light-slate); flex-grow: 1; margin-bottom: 0.5rem; }
.team-card__approach { font-size: 0.75rem; color: var(--color-muted); margin-bottom: 1rem; }
.team-card__contact {
  align-self: flex-start; font-size: 0.875rem; color: var(--color-copper); text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 0.25rem; transition: color 0.2s ease;
}
.team-card__contact:hover, .team-card__contact:focus { color: var(--color-forest); }

/* FAQ refinements */
.faq .accordion__toggle { font-family: var(--font-body); font-size: 1rem; font-weight: 600; color: var(--color-forest); }
.faq .accordion__panel { font-size: 0.9rem; color: var(--color-light-slate); }

/* Contact */
.contact__columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; align-items: start; }
.contact__form { display: flex; flex-direction: column; }
.form__field { margin-bottom: 1rem; display: flex; flex-direction: column; }
.form__label { margin-bottom: 0.25rem; font-size: 0.875rem; font-weight: 600; color: var(--color-forest); }
/* Base: inputs, selects, textareas aligned & same width */
.form__input,
.form__select,
.form__textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 4px;
  font: 0.875rem/1.4 var(--font-body);
  color: var(--color-slate);
  background-color: #fff;
  box-sizing: border-box;
  display: block;
}

/* Consistent touch-friendly height for single-line controls */
.form__input,
.form__select {
  min-height: 2.75rem; /* ~44px */
}

/* Textarea: fixed size, no drag handle */
.form__textarea {
  resize: none;
  height: 8rem;
  min-height: 8rem;
  max-height: 8rem;
  overflow: auto;
}

.form__input:focus, .form__select:focus, .form__textarea:focus { outline: 2px solid var(--color-copper); outline-offset: 2px; }
.form__checkbox-field { display: flex; align-items: flex-start; gap: 0.5rem; }
.form__checkbox { margin-top: 0.3rem; }
.form__checkbox-label { font-size: 0.75rem; color: var(--color-light-slate); }
.form__error { color: #c0392b; font-size: 0.75rem; height: 0; margin-top: 0.25rem; }
.form__submit { margin-top: 1rem; width: fit-content; }
.contact__details { font-size: 0.9rem; color: var(--color-light-slate); }
.contact__details a { color: var(--color-copper); text-decoration: none; }
.contact__details a:hover, .contact__details a:focus { text-decoration: underline; }
.contact__disclaimer { margin-top: 1rem; font-size: 0.75rem; color: var(--color-muted); }

/* =========
   Footer
   ========= */
.footer {
  background-color: var(--color-slate-deep);
  color: var(--color-ivory);
  padding: 2rem 0;
  font-size: 0.875rem;
}

/* Center the whole group (brand + nav + social) like the header */
.footer__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1.5rem 0;
  text-align: center;
}

.footer__brand { flex: 0 0 auto; }
.footer__logo {
  width: 120px; height: auto; margin-bottom: 0.5rem; display: block;
}
.footer__tagline { margin: 0; font-size: 0.9rem; color: var(--color-muted); }

/* footer nav links */
.footer__nav { flex: 0 0 auto; }
.footer__list {
  display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center;
  list-style: none; padding: 0; margin: 0;
}
.footer__link { color: var(--color-ivory); text-decoration: none; display: block; font-size: 0.9rem; }
.footer__link:hover, .footer__link:focus { color: var(--color-copper); }

/* social */
.footer__social { flex: 0 0 auto; display: flex; gap: 0.75rem; justify-content: center; }
.footer__social-link {
  color: var(--color-ivory); display: inline-flex; align-items: center; justify-content: center;
}
.footer__social-link:hover, .footer__social-link:focus { color: var(--color-copper); }
.footer__social-link svg { width: 24px; height: 24px; display: block; }

/* bottom strip */
.footer__bottom {
  margin-top: 2rem; text-align: center; font-size: 0.75rem; color: var(--color-muted);
  padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.08);
}
.footer__legal {
  display: flex; justify-content: center; gap: 1rem;
  list-style: none; padding: 0; margin: 0.5rem 0 0;
}
.footer__legal-link { color: var(--color-ivory); text-decoration: none; font-size: 0.75rem; }
.footer__legal-link:hover, .footer__legal-link:focus { color: var(--color-copper); }

/* Mobile footer: keep centered grouping; stack vertically */
@media (max-width: 640px) {
  .footer__inner { flex-direction: column; text-align: center; }
  .footer__list, .footer__social { justify-content: center; }
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .hero__title { font-size: 1.75rem; }
  .section__title { font-size: 1.5rem; }
  .hero__tagline { font-size: 1.125rem; }
  .hero__bullets { flex-direction: column; gap: 0.75rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .btn, .card--practice, .team-card { transition: none; }
  .nav__burger, .nav__burger::before, .nav__burger::after { transition: none; }
  .nav__link::after { transition: none; }
}

/* Engraved/plaque variant */
.brand-wordmark--plaque {
  background: none; background-image: none;
  -webkit-background-clip: initial; background-clip: initial; -webkit-text-fill-color: initial;

  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
  color: #e8e3d8;

  text-shadow:
    0 -1px 0 rgba(0,0,0,0.20),
    0  1px 0 rgba(255,255,255,0.25),
    0  2px 6px rgba(0,0,0,0.22);

  -webkit-text-stroke: 0.4px rgba(14,59,46,0.25);
}
