/*
Theme Name: ERJ Law
Theme URI: https://erjohnslaw.com
Author: The Law Office of EmilyRose Johns
Author URI: https://erjohnslaw.com
Description: Custom theme for The Law Office of EmilyRose Johns — A Civil Rights Law Firm in Oakland, CA.
Version: 1.0
License: Private
Text Domain: erjohnslaw
*/

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --navy:     rgb(0, 0, 53);
  --navy-deep: rgb(0, 0, 35);
  --charcoal: rgb(54, 69, 79);
  --taupe:    rgb(186, 166, 142);
  --rose:     rgb(222, 161, 147);
  --warm:     rgb(222, 200, 148);
  --cream:    #f8f4ef;
  --white:    #ffffff;
  --serif:    'Cormorant Garamond', Georgia, serif;
  --sans:     'Lato', sans-serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; background: var(--navy); }

body {
  font-family: var(--sans);
  background: var(--white);
  color: var(--charcoal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; }
ul { list-style: none; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.1;
  color: var(--navy);
}

p { line-height: 1.85; margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

em { font-style: italic; }

/* WordPress admin bar pushes fixed elements — desktop: 32px */
.admin-bar #site-header { top: 32px; }
.admin-bar #primary-nav { top: 104px; }

/* ============================================================
   NAVIGATION
   ============================================================ */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--navy);
  border-bottom: 2px solid var(--rose);
  box-shadow: 0 -100px 0 100px var(--navy);
  padding: 0 3.5rem;
  height: 72px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#site-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  text-decoration: none;
  transition: opacity 0.2s;
}

#site-logo:hover { opacity: 0.85; }

.logo-mark {
  height: 60px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.logo-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-firm {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.logo-apc { color: var(--warm); }

.logo-sub {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rose);
  margin-top: 0.1rem;
}

#primary-nav ul {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  flex-wrap: nowrap;
}

#primary-nav li { flex-shrink: 0; }

#primary-nav a {
  color: rgba(248, 244, 239, 0.7);
  font-size: 0.73rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.2s;
  white-space: nowrap;
}

#primary-nav a:hover { color: var(--warm); }

#primary-nav .nav-cta {
  border: 1px solid var(--rose);
  color: var(--rose) !important;
  padding: 0.45rem 1.2rem;
  transition: all 0.2s !important;
  white-space: nowrap;
}

#primary-nav .nav-cta:hover {
  background: var(--rose) !important;
  color: var(--navy) !important;
}

/* Mobile nav toggle */
#nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  flex-direction: column;
  gap: 5px;
}

#nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--cream);
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
#hero {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  padding: 8rem 3.5rem 6rem;
  position: relative;
  overflow: hidden;
}

#hero::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 38%;
  background: linear-gradient(135deg,
    rgba(186,166,142,0.06) 0%,
    rgba(222,161,147,0.10) 100%);
  border-left: 1px solid rgba(222,161,147,0.15);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 2; max-width: 660px; }

.hero-emblem {
  height: 150px;
  width: auto;
  margin-bottom: 2rem;
  filter: drop-shadow(0 4px 24px rgba(222,160,148,0.18));
}

.eyebrow {
  font-size: 0.67rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.eyebrow::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--rose);
  flex-shrink: 0;
}

#hero h1 {
  font-size: clamp(3rem, 5.5vw, 5rem);
  color: var(--cream);
  margin-bottom: 1.25rem;
}

#hero h1 em { color: var(--warm); font-style: italic; }

.hero-rule {
  display: block;
  width: 52px;
  height: 2px;
  background: var(--rose);
  margin: 0 0 1.5rem;
}

.hero-tagline {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--taupe);
  margin-bottom: 1.75rem;
  letter-spacing: 0.03em;
}

.hero-desc {
  font-size: 0.96rem;
  color: rgba(248,244,239,0.65);
  line-height: 1.85;
  max-width: 480px;
  margin-bottom: 2.75rem;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-gold {
  display: inline-block;
  background: var(--warm);
  color: var(--navy);
  border: none;
  padding: 0.9rem 2rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn-gold:hover { background: #d4c285; color: var(--navy); transform: translateY(-1px); }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(248,244,239,0.3);
  padding: 0.9rem 2rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s;
}

.btn-outline:hover { border-color: var(--cream); color: var(--cream); }

.btn-rose {
  display: inline-block;
  background: var(--rose);
  color: var(--navy);
  border: none;
  padding: 0.9rem 2.25rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-rose:hover { background: #d4857a; color: var(--navy); }

/* ============================================================
   SECTION COMMONS
   ============================================================ */
.site-section { padding: 5.5rem 3.5rem; }

.section-label {
  font-family: var(--sans);
  font-size: 0.67rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--rose);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  line-height: 1.12;
  color: var(--navy);
  margin-bottom: 1.5rem;
}

.section-title em { font-style: italic; color: var(--rose); }

/* ============================================================
   ABOUT SECTION
   ============================================================ */
#about { background: var(--cream); }

.about-grid {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

/* ── Headshot ──────────────────────────────────────── */
.about-photo-col { position: sticky; top: 88px; }

.headshot-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

.headshot-img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  object-position: center 15%;
  display: block;
  border-bottom: 3px solid var(--rose);
}

/* Fallback shown when no headshot uploaded yet */
.headshot-img[src$="headshot.jpg"]:not([naturalWidth]) {
  background: var(--taupe);
  min-height: 400px;
}

.headshot-caption {
  background: var(--navy);
  padding: 1rem 1.25rem;
}

.headshot-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 0.1rem;
  line-height: 1.3;
}

.headshot-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--rose);
  margin: 0;
}

.about-body p {
  color: var(--charcoal);
  font-size: 0.95rem;
  line-height: 1.85;
  margin-bottom: 1.1rem;
}

.pullquote {
  border-left: 3px solid var(--rose);
  padding: 1.25rem 1.75rem;
  background: rgba(222, 161, 147, 0.08);
  margin: 1.75rem 0;
}

.pullquote p {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-style: italic;
  color: var(--navy) !important;
  line-height: 1.5;
  margin: 0 !important;
}

.creds-block { margin-top: 2.5rem; }

.creds-label {
  font-family: var(--sans);
  font-size: 0.67rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--taupe);
  margin-bottom: 1rem;
}

.cred-list { margin-bottom: 1.75rem; }

.cred-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  color: var(--charcoal);
  line-height: 1.5;
}

.cred-dot {
  width: 6px;
  height: 6px;
  background: var(--rose);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.45rem;
}

.cred-item strong { color: var(--navy); }
.cred-item small { color: var(--taupe); font-size: 0.8rem; display: block; margin-top: 0.15rem; }

/* ============================================================
   PRACTICE AREAS
   ============================================================ */
#practice { background: var(--white); }

.practice-intro {
  max-width: 540px;
  margin-bottom: 3.5rem;
}

.practice-intro p { color: rgba(54,69,79,0.75); font-size: 0.95rem; line-height: 1.8; }

.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(186,166,142,0.25);
  max-width: 1060px;
  margin: 0 auto;
}

.practice-card {
  background: var(--white);
  padding: 2.25rem 1.75rem;
  transition: background 0.2s;
}

.practice-card:hover { background: rgba(0,0,53,0.03); }

.practice-num {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: rgba(222,161,147,0.4);
  line-height: 1;
  margin-bottom: 1rem;
}

.practice-card h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.6rem;
}

.practice-card p {
  font-size: 0.85rem;
  color: rgba(54,69,79,0.65);
  line-height: 1.75;
  margin: 0;
}

/* ============================================================
   IN THE NEWS SECTION
   ============================================================ */
#news { background: var(--cream); }

.news-intro {
  max-width: 560px;
  margin-bottom: 3.5rem;
}

.news-intro p {
  color: rgba(54,69,79,0.75);
  font-size: 0.95rem;
  line-height: 1.8;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.news-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid rgba(186,166,142,0.3);
  border-top: 3px solid var(--rose);
  padding: 1.75rem 1.5rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,53,0.1);
  border-top-color: var(--warm);
}

.news-source {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--taupe);
  margin-bottom: 0.85rem;
}

.news-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.news-desc {
  font-size: 0.85rem;
  color: rgba(54,69,79,0.7);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.news-link {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rose);
  margin-top: auto;
  transition: color 0.2s;
}

.news-card:hover .news-link { color: var(--navy); }

/* ============================================================
   CONTACT SECTION
   ============================================================ */
#contact { background: var(--navy); }

#contact .section-label { color: var(--rose); }
#contact .section-title { color: var(--cream); }
#contact .section-title em { color: var(--warm); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  max-width: 1060px;
  margin: 0 auto;
  align-items: start;
}

.contact-desc {
  color: rgba(248,244,239,0.65);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-icon {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(222,161,147,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--rose);
  font-size: 0.95rem;
}

.contact-item-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--taupe);
  margin-bottom: 0.25rem;
}

.contact-item-value {
  color: var(--cream);
  font-size: 0.9rem;
  line-height: 1.5;
}

.contact-item-value a { color: var(--cream); transition: color 0.2s; }
.contact-item-value a:hover { color: var(--warm); }

/* Form */
.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group { margin-bottom: 1rem; }
.form-group[hidden] { display: none; }

.form-group label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--taupe);
  margin-bottom: 0.45rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(248,244,239,0.12);
  color: var(--cream);
  padding: 0.8rem 0.9rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  border-radius: 0;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--rose); }

.form-group textarea { resize: vertical; min-height: 120px; }
.form-group select option { background: #00001f; }

/* ── Conditional practice-area fields ──────────────── */
.conditional-fields {
  border-left: 2px solid rgba(222,161,147,0.3);
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  animation: condFadeIn 0.3s ease;
}

.conditional-fields[hidden] { display: none; }

@keyframes condFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Contact form confirmation panel ───────────────── */
#form-confirmation {
  display: none;
  padding: 2.5rem;
  border: 1px solid rgba(222,161,147,0.3);
  background: rgba(222,161,147,0.06);
  text-align: center;
}

.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--rose);
  color: var(--navy);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 56px;
  margin: 0 auto 1.5rem;
}

.confirm-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 1rem;
}

.confirm-body {
  color: rgba(248,244,239,0.75);
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 380px;
  margin: 0 auto 1rem;
}

.confirm-body a {
  color: var(--warm);
  text-decoration: none;
  font-weight: 700;
}

.confirm-body a:hover { text-decoration: underline; }

.confirm-ref {
  font-size: 0.75rem;
  color: var(--taupe);
  margin-top: 1.5rem;
  letter-spacing: 0.03em;
}

.confirm-ref span { color: var(--rose); }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  background: var(--navy-deep);
  border-top: 1px solid rgba(222,161,147,0.18);
  padding: 2rem 3.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* Footer brand: round logo + wordmark */
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.footer-logo-mark {
  height: 72px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.footer-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.footer-firm {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cream);
}

.footer-sub {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose);
  margin-top: 0.15rem;
}

.footer-right {
  font-size: 0.72rem;
  color: var(--taupe);
  text-align: right;
  line-height: 1.7;
}

.footer-right a { color: var(--rose); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* Mid-range: nav is tight but should stay on ONE line (no wrap, no broken
   CTA button) before the hamburger takes over at 900px. Progressively
   tighten spacing and the wordmark so everything fits. */
@media (max-width: 1164px) and (min-width: 901px) {
  #site-header { padding: 0 2rem; }
  .logo-firm { font-size: 1rem; }
  #primary-nav ul { gap: 1.4rem; }
  #primary-nav a { font-size: 0.68rem; letter-spacing: 0.1em; }
  #primary-nav .nav-cta { padding: 0.4rem 0.85rem; }
}

/* Tighter still just above the hamburger cutoff */
@media (max-width: 1010px) and (min-width: 901px) {
  #site-header { padding: 0 1.5rem; }
  .logo-firm { font-size: 0.92rem; }
  #primary-nav ul { gap: 1rem; }
  #primary-nav a { font-size: 0.64rem; letter-spacing: 0.07em; }
  #primary-nav .nav-cta { padding: 0.38rem 0.7rem; }
}

@media (max-width: 900px) {
  #site-header { padding: 0 1.5rem; height: 72px; min-height: 72px; }

  /* Logo mark: shrink slightly, scale the wordmark down */
  .logo-mark { height: 48px; width: auto; }
  .logo-firm { font-size: 0.95rem; white-space: normal; line-height: 1.15; }

  #primary-nav {
    display: none;
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: var(--navy);
    border-top: 1px solid rgba(222,161,147,0.2);
    border-bottom: 2px solid var(--rose);
    padding: 1.5rem;
    z-index: 998;
  }

  /* WP admin bar: 32px on desktop, 46px on mobile */
  .admin-bar #site-header { top: 46px; }
  .admin-bar #primary-nav { top: 118px; }

  #primary-nav.open { display: block; }
  #primary-nav ul { flex-direction: column; gap: 1.25rem; }
  #primary-nav .nav-cta { display: inline-block; margin-top: 0.5rem; }

  #nav-toggle {
    display: flex;
    z-index: 1002;
    position: relative;
    padding: 0.5rem;
    margin-right: -0.5rem;
    -webkit-tap-highlight-color: transparent;
  }

  #hero { padding: 8rem 1.5rem 5rem; }
  .admin-bar #hero { padding-top: 9rem; }
  #hero::after { display: none; }

  .site-section { padding: 4rem 1.5rem; }

  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-photo-col { position: static; }
  .headshot-img { height: 380px; }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }

  .practice-grid { grid-template-columns: 1fr 1fr; }
  .news-grid { grid-template-columns: 1fr 1fr; }

  .contact-form .form-row { grid-template-columns: 1fr; }

  #site-footer { flex-direction: column; align-items: flex-start; padding: 1.75rem 1.5rem; gap: 1.25rem; }
  .footer-right { text-align: left; }
}

@media (max-width: 560px) {
  /* On very small screens the round logo stands alone to avoid crowding the menu button */
  .logo-wordmark { display: none; }
  .practice-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .btn-gold, .btn-outline { text-align: center; }
}
