/*
Theme Name:  Bayside Ledger
Theme URI:   https://baysideledger.com
Author:      Bayside Ledger LLC
Description: Custom theme for Bayside Ledger bookkeeping firm — Bigfork, Montana.
Version:     1.0.0
License:     GNU General Public License v2 or later
Text Domain: bayside-ledger
Tags:        custom-menu, featured-images, threaded-comments, translation-ready
*/

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

:root {
  --espresso:     #2b1f1e;
  --espresso-mid: #3d2b2a;
  --teal-dark:    #3d6b72;
  --teal:         #5a8f96;
  --teal-lt:      #85b5bc;
  --sage:         #8fa89c;
  --sun:          #e8d882;
  --sun-lt:       #f2e9a8;
  --cream:        #f7f3ec;
  --sand:         #ede8de;
  --white:        #ffffff;
  --text:         #2e2420;
  --muted:        #7a6e6a;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Jost', sans-serif;
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
}

/* ============================================================
   NAV
   ============================================================ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 4rem;
  background: rgba(43, 31, 30, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(232, 216, 130, 0.2);
}
.nav-logo-wrap { display: flex; align-items: center; gap: 0.9rem; text-decoration: none; }
.nav-logo-img { height: 40px; width: 40px; }
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem; font-weight: 500;
  color: var(--white); letter-spacing: 0.04em;
  text-decoration: none;
}
.nav-logo span { color: var(--sun); }

/* WordPress nav menu */
.nav-links,
.nav-links ul { display: flex; gap: 2.5rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-size: 0.77rem; font-weight: 500; letter-spacing: 0.13em;
  text-transform: uppercase; color: rgba(255,255,255,0.7);
  text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover,
.nav-links .current-menu-item > a,
.nav-links .current_page_item > a { color: var(--sun); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
  padding-top: 68px;
  background: var(--espresso);
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 65% 35%, rgba(90,143,150,0.15) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 75%, rgba(232,216,130,0.07) 0%, transparent 50%);
}
.hero::after {
  content: '';
  position: absolute; top: 12%; bottom: 12%; left: 50%;
  width: 1px; background: rgba(232,216,130,0.18);
}
.hero-left {
  display: flex; flex-direction: column; justify-content: center;
  padding: 6rem 5rem 6rem 8rem;
  position: relative; z-index: 1;
}
.hero-eyebrow {
  font-size: 0.71rem; font-weight: 500; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--sun);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.8rem, 4vw, 4.2rem);
  font-weight: 300; line-height: 1.15;
  color: var(--white); margin-bottom: 1.5rem;
}
.hero-title em { font-style: italic; color: var(--sun); }
.hero-sub {
  font-size: 0.94rem; font-weight: 300; line-height: 1.85;
  color: rgba(255,255,255,0.6); max-width: 420px; margin-bottom: 3rem;
}
.hero-cta {
  display: inline-block;
  font-size: 0.74rem; font-weight: 500; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--espresso);
  background: var(--sun); padding: 1rem 2.4rem;
  text-decoration: none; transition: background 0.2s;
  width: fit-content;
}
.hero-cta:hover { background: var(--sun-lt); }
.hero-right {
  display: flex; flex-direction: column; justify-content: center;
  padding: 6rem 8rem 6rem 5rem;
  position: relative; z-index: 1; gap: 2.5rem;
}
.hero-pillar { display: flex; align-items: flex-start; gap: 1.5rem; }
.pillar-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem; font-weight: 300;
  color: rgba(232,216,130,0.25); line-height: 1;
  flex-shrink: 0; width: 3rem;
}
.pillar-content h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem; font-weight: 500; color: var(--white);
  margin-bottom: 0.4rem;
}
.pillar-content p {
  font-size: 0.87rem; font-weight: 300; line-height: 1.75;
  color: rgba(255,255,255,0.52);
}

/* ============================================================
   SECTION BASE
   ============================================================ */
section,
.page-section { padding: 6rem 8rem; }
.section-label {
  font-size: 0.7rem; font-weight: 500; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--teal);
  margin-bottom: 1rem;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 3vw, 2.8rem); font-weight: 300; line-height: 1.2;
  color: var(--espresso); margin-bottom: 1.5rem;
}
.section-body {
  font-size: 0.94rem; font-weight: 300; line-height: 1.9;
  color: var(--muted); max-width: 560px;
}
.divider { width: 40px; height: 1px; background: var(--sun); margin: 1.5rem 0; }

/* ============================================================
   SERVICES PAGE
   ============================================================ */
.services { background: var(--sand); }
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2px; margin-top: 4rem;
}
.service-card {
  background: var(--white); padding: 3rem 2.5rem;
  position: relative; overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.service-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--teal);
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s;
}
.service-card:hover { transform: translateY(-4px); box-shadow: 0 20px 50px rgba(43,31,30,0.1); }
.service-card:hover::before { transform: scaleX(1); }
.service-icon { width: 42px; height: 42px; margin-bottom: 1.8rem; }
.service-icon svg { width: 100%; height: 100%; stroke: var(--teal); fill: none; stroke-width: 1.5; }
.service-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem; font-weight: 500; color: var(--espresso);
  margin-bottom: 0.75rem;
}
.service-card p { font-size: 0.87rem; font-weight: 300; line-height: 1.8; color: var(--muted); }

.service-contact-prompt {
  margin-top: 2rem;
  font-size: 0.82rem; font-weight: 400; color: var(--teal-dark);
  border-top: 1px solid var(--sand);
  padding-top: 1.2rem;
}
.service-contact-prompt a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}
.service-contact-prompt a:hover { color: var(--teal-dark); text-decoration: underline; }

/* ============================================================
   ABOUT SECTION / PAGE
   ============================================================ */
.about {
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 0; background: var(--espresso);
}
.about-photo-wrap {
  position: relative; overflow: hidden; min-height: 600px;
}
.about-photo-wrap img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  display: block; filter: saturate(0.9);
}
.about-photo-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(43,31,30,0.55) 0%, transparent 50%);
}
.about-text {
  padding: 7rem 7rem 7rem 5rem;
  display: flex; flex-direction: column; justify-content: center;
  border-left: 1px solid rgba(232,216,130,0.12);
}
.about-text .section-label { color: var(--sun); }
.about-text .section-title { color: var(--white); }
.about-text .section-body { color: rgba(255,255,255,0.58); }
.about-text .divider { background: var(--teal-lt); }
.about-credentials { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
.cred {
  display: flex; align-items: center; gap: 1.2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.cred:last-child { border-bottom: none; padding-bottom: 0; }
.cred-bar { width: 3px; height: 36px; background: var(--teal-lt); flex-shrink: 0; }
.cred-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem; font-weight: 500; color: var(--white);
  margin-bottom: 0.2rem;
}
.cred-detail { font-size: 0.78rem; font-weight: 300; color: rgba(255,255,255,0.4); letter-spacing: 0.04em; }

/* ============================================================
   VALUES
   ============================================================ */
.values { background: var(--cream); }
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; margin-top: 4rem; }
.value-item { border-top: 1px solid var(--sun); padding-top: 2rem; }
.value-item h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem; font-weight: 500; color: var(--espresso);
  margin-bottom: 0.75rem;
}
.value-item p { font-size: 0.87rem; font-weight: 300; line-height: 1.8; color: var(--muted); }

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonials { background: var(--sand); }
.test-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; margin-top: 4rem; }
.test-card { background: var(--white); padding: 2.5rem; position: relative; }
.test-card::before {
  content: '\201C';
  font-family: 'Cormorant Garamond', serif;
  font-size: 5rem; line-height: 0.8;
  color: var(--teal-lt); opacity: 0.35;
  position: absolute; top: 1.5rem; left: 1.5rem;
}
.test-card blockquote {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem; font-weight: 400; line-height: 1.7;
  color: var(--espresso); padding-top: 1rem; margin-bottom: 1.5rem;
  position: relative; z-index: 1;
}
.test-author {
  font-size: 0.74rem; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--teal);
}

/* ============================================================
   CTA STRIP
   ============================================================ */
.cta-section { background: var(--espresso); text-align: center; padding: 7rem 8rem; }
.cta-section .section-label { color: var(--sun); }
.cta-section .section-title { color: var(--white); max-width: 600px; margin: 0 auto 1.5rem; }
.cta-section .section-body { color: rgba(255,255,255,0.52); margin: 0 auto 3rem; }
.cta-email {
  display: inline-block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem; font-weight: 300; font-style: italic;
  color: var(--sun); text-decoration: none;
  border-bottom: 1px solid rgba(232,216,130,0.4);
  padding-bottom: 0.2rem; transition: color 0.2s, border-color 0.2s;
}
.cta-email:hover { color: var(--sun-lt); border-color: var(--sun-lt); }

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-page { background: var(--cream); }
.contact-layout {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 6rem; margin-top: 4rem;
}
.contact-info { }
.contact-info-email {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem; font-style: italic; color: var(--teal);
  text-decoration: none; display: block; margin-top: 1rem;
}
.contact-info-email:hover { color: var(--teal-dark); }
.contact-form-wrap { }
.contact-form-wrap .wpforms-container { margin-top: 0; }

/* WPForms style overrides to match theme */
.wpforms-form .wpforms-field input,
.wpforms-form .wpforms-field textarea,
.wpforms-form .wpforms-field select {
  border: 1px solid var(--sand) !important;
  border-radius: 0 !important;
  background: var(--white) !important;
  font-family: 'Jost', sans-serif !important;
  font-size: 0.9rem !important;
  color: var(--text) !important;
  padding: 0.85rem 1rem !important;
}
.wpforms-form .wpforms-field input:focus,
.wpforms-form .wpforms-field textarea:focus {
  border-color: var(--teal) !important;
  outline: none !important;
  box-shadow: none !important;
}
.wpforms-form .wpforms-field label {
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--espresso) !important;
  margin-bottom: 0.5rem !important;
}
.wpforms-form .wpforms-submit-container .wpforms-submit {
  background: var(--sun) !important;
  color: var(--espresso) !important;
  border: none !important;
  border-radius: 0 !important;
  font-family: 'Jost', sans-serif !important;
  font-size: 0.74rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.15em !important;
  text-transform: uppercase !important;
  padding: 1rem 2.4rem !important;
  cursor: pointer !important;
  transition: background 0.2s !important;
}
.wpforms-form .wpforms-submit-container .wpforms-submit:hover {
  background: var(--sun-lt) !important;
}

/* ============================================================
   RESOURCES PAGE
   ============================================================ */
.resources-page { background: var(--cream); }
.resources-intro { max-width: 640px; }
.resources-list { margin-top: 4rem; }
.resource-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--sand);
  gap: 2rem;
}
.resource-item:first-child { border-top: 1px solid var(--sand); }
.resource-meta { flex: 1; }
.resource-meta h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem; font-weight: 500; color: var(--espresso);
  margin-bottom: 0.25rem;
}
.resource-meta p { font-size: 0.84rem; font-weight: 300; color: var(--muted); }
.resource-download {
  flex-shrink: 0;
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--espresso);
  background: var(--sun); padding: 0.65rem 1.4rem;
  text-decoration: none; transition: background 0.2s;
  white-space: nowrap;
}
.resource-download:hover { background: var(--sun-lt); }
.resources-empty {
  font-size: 0.94rem; font-weight: 300; color: var(--muted);
  margin-top: 3rem; font-style: italic;
}

/* Resource post type (wp-admin) featured image as downloadable file */
.resource-type-badge {
  font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--teal); font-weight: 500; margin-bottom: 0.2rem;
}

/* ============================================================
   CONTACT BAR (persistent, above footer)
   ============================================================ */
.contact-bar {
  background: var(--teal-dark);
  text-align: center;
  padding: 1.6rem 2rem;
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  flex-wrap: wrap;
}
.contact-bar p {
  font-size: 0.84rem; font-weight: 400; letter-spacing: 0.04em;
  color: rgba(255,255,255,0.85);
  margin: 0;
}
.contact-bar a {
  color: var(--sun);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.contact-bar a:hover { color: var(--sun-lt); }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: #1a1110;
  display: flex; align-items: center; justify-content: space-between;
  padding: 2rem 8rem;
}
.footer-left { display: flex; align-items: center; gap: 0.8rem; }
.footer-logo-img { height: 32px; width: 32px; opacity: 0.7; }
.footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem; font-weight: 500;
  color: rgba(255,255,255,0.45); letter-spacing: 0.05em;
  text-decoration: none;
}
.footer-logo span { color: var(--sun); opacity: 0.8; }
footer .footer-right p {
  font-size: 0.74rem; font-weight: 300;
  color: rgba(255,255,255,0.22); letter-spacing: 0.05em;
  text-align: right; margin-bottom: 0.25rem;
}
footer .footer-right p:last-child { margin-bottom: 0; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-left > * { animation: fadeUp 0.7s ease both; }
.hero-left > *:nth-child(1) { animation-delay: 0.1s; }
.hero-left > *:nth-child(2) { animation-delay: 0.22s; }
.hero-left > *:nth-child(3) { animation-delay: 0.34s; }
.hero-left > *:nth-child(4) { animation-delay: 0.46s; }
.hero-pillar { animation: fadeUp 0.7s ease both; }
.hero-pillar:nth-child(1) { animation-delay: 0.3s; }
.hero-pillar:nth-child(2) { animation-delay: 0.44s; }
.hero-pillar:nth-child(3) { animation-delay: 0.58s; }

/* ============================================================
   INNER PAGE HERO (non-front-page banner)
   ============================================================ */
.page-hero {
  background: var(--espresso);
  padding: 10rem 8rem 5rem;
  position: relative;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(90,143,150,0.12) 0%, transparent 60%);
}
.page-hero-inner { position: relative; z-index: 1; }
.page-hero .section-label { color: var(--sun); }
.page-hero .section-title { color: var(--white); margin-bottom: 1rem; }
.page-hero .section-body { color: rgba(255,255,255,0.6); }

/* ============================================================
   GUTENBERG BLOCK WRAPPER RESETS
   wp:group blocks render as .wp-block-group + our className.
   Reset WP defaults so our own layout rules take over.
   ============================================================ */

/* Strip default block padding/margin from all our layout sections */
.wp-block-group.hero,
.wp-block-group.hero-left,
.wp-block-group.hero-right,
.wp-block-group.hero-pillar,
.wp-block-group.pillar-content,
.wp-block-group.services,
.wp-block-group.services-grid,
.wp-block-group.service-card,
.wp-block-group.about,
.wp-block-group.about-text,
.wp-block-group.about-credentials,
.wp-block-group.cred,
.wp-block-group.cred-body,
.wp-block-group.values,
.wp-block-group.values-grid,
.wp-block-group.value-item,
.wp-block-group.testimonials,
.wp-block-group.test-grid,
.wp-block-group.test-card,
.wp-block-group.cta-section,
.wp-block-group.contact-page,
.wp-block-group.contact-layout,
.wp-block-group.contact-info,
.wp-block-group.contact-form-wrap,
.wp-block-group.contact-facts,
.wp-block-group.page-section {
  padding: 0;
  margin: 0;
  max-width: none;
}

/*
 * WordPress 6.x applies is-layout-constrained to wp:group blocks by default.
 * That layout class injects `margin-left: auto !important; margin-right: auto
 * !important; max-width: var(--content-size)` on EVERY direct child — which
 * causes grid/flex children (.hero-left, .hero-right, .about-photo-wrap, etc.)
 * to shrink to intrinsic width and stack to the left instead of filling their
 * grid cells.
 *
 * Fix: target children of every container that uses CSS grid or flex with
 * higher-specificity !important rules. Three-class specificity (0-3-0) beats
 * WordPress's :where()-based rules (0-0-0) when both use !important.
 */
.wp-block-group.hero > *,
.wp-block-group.about > *,
.wp-block-group.contact-layout > *,
.wp-block-group.services-grid > *,
.wp-block-group.values-grid > *,
.wp-block-group.test-grid > *,
.wp-block-group.hero-right > *,
.wp-block-group.hero-pillar > *,
.wp-block-group.about-credentials > *,
.wp-block-group.cred > *,
.wp-block-group.contact-facts > * {
  margin-left:  0 !important;
  margin-right: 0 !important;
  max-width:    none !important;
}

/* Credential body (inner text wrapper in cred rows) */
.wp-block-group.cred-body {
  flex: 1;
}

/* Gutenberg default cite styling reset — use our .test-author look */
.test-card .wp-block-quote cite {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  font-style: normal;
  display: block;
  margin-top: 0;
}

/* Remove Gutenberg's default quote border/padding */
.test-card .wp-block-quote {
  border-left: none;
  padding: 0;
  margin: 0;
}

/* Background helpers used by block sections on Services / About pages */
.wp-block-group.bg-cream { background: var(--cream); padding: 6rem 8rem; }
.wp-block-group.bg-sand  { background: var(--sand);  padding: 6rem 8rem; }

/* Contact info heading — slightly smaller than default section-title */
.contact-info-heading { font-size: clamp(1.6rem, 2.5vw, 2.2rem) !important; }

@media (max-width: 900px) {
  .wp-block-group.bg-cream,
  .wp-block-group.bg-sand { padding: 4rem 2rem; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  nav { padding: 1rem 1.5rem; }
  section, .page-section { padding: 4rem 2rem; }
  .hero { grid-template-columns: 1fr; }
  .hero::after { display: none; }
  .hero-left { padding: 5rem 2rem 3rem; }
  .hero-right { padding: 2rem 2rem 5rem; }
  .services-grid { grid-template-columns: 1fr; gap: 1px; }
  .about { grid-template-columns: 1fr; }
  .about-photo-wrap { min-height: 360px; }
  .about-text { padding: 4rem 2rem; border-left: none; border-top: 1px solid rgba(232,216,130,0.12); }
  .values-grid { grid-template-columns: 1fr; gap: 2rem; }
  .test-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 0.75rem; padding: 2rem; text-align: center; }
  footer .footer-right p { text-align: center; }
  .contact-layout { grid-template-columns: 1fr; gap: 3rem; }
  .page-hero { padding: 8rem 2rem 4rem; }
  .nav-links { gap: 1.5rem; }
}

@media (max-width: 600px) {
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.7rem; letter-spacing: 0.08em; }
  nav { padding: 1rem; }
}
