/* Western Family Dental — shared styles
   Palette: Pine / Linen / Ink / Amber / Sage / Brick (see design notes in project memory)
   Type: Libre Caslon Display (headings) + Source Sans 3 (body/UI)
*/

@import url('https://fonts.googleapis.com/css2?family=Libre+Caslon+Display&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --pine: #1e3a34;
  --pine-deep: #142720;
  --linen: #f1efe7;
  --linen-raised: #e8e4d8;
  --ink: #262420;
  --amber: #b9812f;
  --amber-deep: #8f6423;
  --sage: #7e8f80;
  --brick: #a6503b;

  --border: rgba(38, 36, 32, 0.14);
  --radius: 5px;
  --max-width: 1120px;

  --font-display: 'Libre Caslon Display', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}

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

a { color: inherit; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  text-wrap: balance;
  color: var(--pine);
  margin: 0;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }

p { max-width: 62ch; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-deep);
  display: block;
  margin-bottom: 10px;
}

.rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* Buttons — rectangular, 5px radius, no pills, no gradients */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--pine);
  color: var(--linen);
}
.btn-primary:hover { background: var(--pine-deep); }

.btn-accent {
  background: var(--amber);
  color: #fff;
}
.btn-accent:hover { background: var(--amber-deep); }

.btn-outline {
  background: transparent;
  border-color: var(--pine);
  color: var(--pine);
}
.btn-outline:hover { background: rgba(30, 58, 52, 0.06); }

.btn-urgent {
  background: var(--brick);
  color: #fff;
}
.btn-urgent:hover { background: #883f2e; }

/* Header */
.site-header {
  background: var(--linen);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  gap: 24px;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--pine);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--amber-deep); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.main-nav a {
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  border-bottom-color: var(--amber);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.phone-link {
  font-weight: 700;
  color: var(--pine);
  text-decoration: none;
  font-size: 0.96rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* Emergency strip */
.emergency-strip {
  background: var(--brick);
  color: #fff;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
}
.emergency-strip a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Hero */
.hero {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: start;
}
.hero h1 { margin-bottom: 18px; }
.hero-sub {
  font-size: 1.1rem;
  color: var(--ink);
  opacity: 0.86;
  margin-bottom: 28px;
}
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.88rem;
  color: var(--sage);
  font-weight: 600;
}

/* Quick actions card (replaces generic "floating glass card") */
.quick-actions {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.quick-actions h3 {
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--pine);
  margin-bottom: 16px;
}
.quick-action-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.quick-action-item:first-of-type { border-top: none; padding-top: 0; }
.qa-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: var(--linen-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pine);
}
.qa-icon svg { width: 17px; height: 17px; }
.quick-action-item strong { display: block; font-size: 0.96rem; margin-bottom: 2px; }
.quick-action-item span { font-size: 0.87rem; color: var(--ink); opacity: 0.75; }
.quick-action-item a.qa-link {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--amber-deep);
  text-decoration: none;
  white-space: nowrap;
  margin-left: auto;
  align-self: center;
}

/* Section scaffolding */
section.block { padding: 64px 0; }
section.block.alt { background: var(--linen-raised); }
.block-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

/* Services preview — structured rows, not icon-tile grid */
.service-rows { border-top: 1px solid var(--border); }
.service-row {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr 0.6fr 0.5fr;
  gap: 20px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.service-row .cat {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 700;
}
.service-row .name { font-weight: 600; }
.service-row .price {
  font-variant-numeric: tabular-nums;
  color: var(--amber-deep);
  font-weight: 700;
  text-align: right;
}
.service-row .duration {
  font-size: 0.85rem;
  color: var(--ink);
  opacity: 0.65;
  text-align: right;
}

/* Staff preview */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.staff-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.staff-photo {
  aspect-ratio: 4 / 3;
  background: linear-gradient(155deg, var(--pine) 0%, var(--pine-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(241,239,231,0.5);
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-align: center;
  padding: 12px;
}
.staff-card-body { padding: 18px 20px 22px; }
.staff-card-body .role {
  font-size: 0.82rem;
  color: var(--amber-deep);
  font-weight: 700;
  margin-bottom: 6px;
}
.staff-card-body p {
  font-size: 0.92rem;
  opacity: 0.85;
  margin: 10px 0 0;
}

/* Reviews */
.review-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.review-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.review-stars { color: var(--amber); letter-spacing: 2px; margin-bottom: 10px; font-size: 0.95rem; }
.review-card blockquote {
  margin: 0 0 14px;
  font-size: 0.95rem;
  line-height: 1.55;
}
.review-meta { font-size: 0.83rem; color: var(--sage); font-weight: 600; }

/* Insurance / financing strip */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--pine);
}

/* FAQ preview */
.faq-list { border-top: 1px solid var(--border); }
.faq-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.faq-item strong { display: block; margin-bottom: 6px; font-size: 1rem; }
.faq-item p { margin: 0; font-size: 0.94rem; opacity: 0.82; }

/* Footer */
.site-footer {
  background: var(--pine);
  color: rgba(241,239,231,0.85);
  padding: 52px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
.site-footer h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--linen);
  margin: 0 0 14px;
}
.site-footer a {
  display: block;
  color: rgba(241,239,231,0.78);
  text-decoration: none;
  font-size: 0.92rem;
  margin-bottom: 9px;
}
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(241,239,231,0.18);
  padding-top: 20px;
  font-size: 0.82rem;
  color: rgba(241,239,231,0.55);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Responsive */
@media (max-width: 880px) {
  .main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .hero-grid { grid-template-columns: 1fr; }
  .staff-grid, .review-strip { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .service-row { grid-template-columns: 1fr auto; }
  .service-row .cat, .service-row .duration { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .main-nav a { transition: none; }
}

/* ===== Call Now floating widget ===== */
.wfd-call-widget {
  position: fixed;
  right: 22px;
  bottom: 92px;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--amber);
  color: #fff;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(143, 100, 35, 0.32);
  z-index: 198;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.wfd-call-widget:hover { background: var(--amber-deep); transform: translateY(-1px); }
.wfd-call-widget svg { width: 21px; height: 21px; }

/* Desktop variant: button + popover live in one fixed wrapper so the popover
   can be positioned relative to the button without inheriting its own fixed
   coordinates. */
.wfd-call-widget-wrap {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 198;
}
.wfd-call-widget-wrap .wfd-call-widget {
  position: static;
}

.wfd-call-popover {
  position: absolute;
  bottom: 62px;
  right: 0;
  width: 230px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(20, 39, 32, 0.22);
  padding: 16px;
}
.wfd-call-popover[hidden] { display: none; }
.wfd-call-popover-label {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 6px;
}
.wfd-call-popover-number {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--pine);
  margin-bottom: 14px;
}
.wfd-call-popover-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wfd-call-popover-copy {
  background: var(--pine);
  color: var(--linen);
  border: none;
  border-radius: var(--radius);
  padding: 9px 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.wfd-call-popover-copy:hover { background: var(--pine-deep); }
.wfd-call-popover-dial {
  text-align: center;
  font-size: 0.84rem;
  color: var(--amber-deep);
  font-weight: 600;
  text-decoration: none;
  padding: 4px 0;
}
.wfd-call-popover-dial:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .wfd-call-widget,
  .wfd-call-widget-wrap { right: 16px; bottom: 82px; }
  .wfd-call-widget { width: 46px; height: 46px; }
}

/* ===== Chat widget ===== */
.wfd-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: var(--pine);
  color: var(--linen);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(20, 39, 32, 0.28);
  z-index: 200;
  border: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.wfd-chat-launcher:hover { background: var(--pine-deep); transform: translateY(-1px); }
.wfd-chat-launcher svg { width: 25px; height: 25px; }
.wfd-chat-launcher .wfd-chat-close-icon { display: none; }
.wfd-chat-launcher[aria-expanded="true"] .wfd-chat-open-icon { display: none; }
.wfd-chat-launcher[aria-expanded="true"] .wfd-chat-close-icon { display: block; }
.wfd-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brick);
  border: 2px solid var(--linen);
}

.wfd-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(20, 39, 32, 0.24);
  z-index: 199;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wfd-chat-panel[hidden] { display: none; }

.wfd-chat-header {
  background: var(--pine);
  color: var(--linen);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.wfd-chat-header strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  display: block;
}
.wfd-chat-status {
  display: block;
  font-size: 0.78rem;
  color: rgba(241,239,231,0.68);
  margin-top: 3px;
}
.wfd-chat-close {
  background: none;
  border: none;
  color: rgba(241,239,231,0.85);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  flex-shrink: 0;
}
.wfd-chat-close svg { width: 18px; height: 18px; display: block; }
.wfd-chat-close:hover { color: #fff; }

.wfd-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--linen);
}

.wfd-msg { display: flex; flex-direction: column; max-width: 84%; }
.wfd-msg-assistant { align-self: flex-start; align-items: flex-start; }
.wfd-msg-user { align-self: flex-end; align-items: flex-end; }
.wfd-msg-bubble {
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.wfd-msg-assistant .wfd-msg-bubble {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink);
}
.wfd-msg-user .wfd-msg-bubble {
  background: var(--pine);
  color: var(--linen);
}
.wfd-msg-images {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.wfd-msg-images img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border);
}
.wfd-msg-error .wfd-msg-bubble {
  background: #fff;
  border: 1px solid rgba(166, 80, 59, 0.35);
  color: var(--brick);
}

.wfd-typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 2px;
}
.wfd-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  animation: wfd-typing-bounce 1.1s infinite ease-in-out;
}
.wfd-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.wfd-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes wfd-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.wfd-chat-previews {
  display: flex;
  gap: 8px;
  padding: 10px 14px 0;
  flex-shrink: 0;
}
.wfd-chat-previews[hidden] { display: none; }
.wfd-preview-thumb {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
.wfd-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border);
}
.wfd-preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brick);
  color: #fff;
  border: 1.5px solid #fff;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.wfd-chat-notice {
  font-size: 0.78rem;
  color: var(--brick);
  padding: 6px 14px 0;
  flex-shrink: 0;
}
.wfd-chat-notice[hidden] { display: none; }

.wfd-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}
.wfd-chat-attach {
  background: none;
  border: none;
  color: var(--sage);
  cursor: pointer;
  padding: 7px;
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
}
.wfd-chat-attach:hover { background: var(--linen-raised); color: var(--pine); }
.wfd-chat-attach svg { width: 20px; height: 20px; }
.wfd-chat-attach:disabled { opacity: 0.4; cursor: not-allowed; }

.wfd-chat-textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.4;
  max-height: 90px;
  color: var(--ink);
}
.wfd-chat-textarea:focus { outline: none; border-color: var(--pine); }
.wfd-chat-textarea:disabled { background: var(--linen-raised); }

.wfd-chat-send {
  background: var(--amber);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.wfd-chat-send:hover:not(:disabled) { background: var(--amber-deep); }
.wfd-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }
.wfd-chat-send svg { width: 17px; height: 17px; }

@media (max-width: 480px) {
  .wfd-chat-panel {
    right: 10px;
    left: 10px;
    bottom: 84px;
    width: auto;
    max-width: none;
    height: calc(100vh - 120px);
  }
  .wfd-chat-launcher { right: 16px; bottom: 16px; }
}
