/* === DAVIDSON LAW OFFICES - COMPONENTS CSS === */

/* ========================
   LAYOUT
======================== */
.section {
  padding: var(--section-padding-y) var(--section-padding-x);
}

.container {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  width: 100%;
}

.container.row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--grid-gutter);
}

/* ========================
   BUTTON SYSTEM
======================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--btn-padding-y) var(--btn-padding-x);
  font-family: var(--font-body);
  font-weight: var(--btn-font-weight);
  font-size: var(--btn-font-size);
  letter-spacing: var(--letter-spacing-wider);
  text-transform: uppercase;
  border-radius: var(--btn-radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus-ring);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--color-text-on-primary);
}

.btn-secondary {
  background: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
  border-radius: 0;
}
.btn-secondary:hover {
  background: var(--color-secondary-dark);
  border-color: #febd0e;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: #febd0e;
}

.btn-accent {
  background: var(--color-accent);
  color: var(--color-secondary);
  border-color: var(--color-accent);
}
.btn-accent:hover {
  background: #e5aa0d;
  border-color: #e5aa0d;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--color-secondary);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
}

.btn-outline-white {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.8);
  color: #fff;
}
.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.btn-white {
  background: #fff;
  color: var(--color-secondary);
  border-color: #fff;
}
.btn-white:hover {
  background: var(--color-neutral-100);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: var(--btn-sm-padding-y) var(--btn-sm-padding-x);
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: var(--btn-lg-padding-y) var(--btn-lg-padding-x);
  font-size: var(--font-size-base);
}

/* ========================
   CARD COMPONENT
======================== */
.card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--card-shadow);
  border: var(--card-border);
  transition: all var(--duration-normal) var(--ease-default);
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-3px);
}

.card-dark {
  background: var(--color-secondary);
  color: var(--color-text-on-dark);
  border-color: rgba(255, 255, 255, 0.08);
}

.card-accent-top {
  border-top: 3px solid var(--color-accent);
}

/* ========================
   BADGE COMPONENT
======================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--badge-padding-y) var(--badge-padding-x);
  border-radius: var(--badge-radius);
  font-size: var(--badge-font-size);
  font-weight: var(--badge-font-weight);
  letter-spacing: var(--letter-spacing-wider);
  text-transform: uppercase;
  line-height: 1;
  flex-grow: 0;
  flex-shrink: 0;
  align-self: flex-start;
  width: fit-content;
}

.badge-primary {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.badge-secondary {
  background: var(--color-secondary-light);
  color: #fff;
}

.badge-accent {
  background: var(--color-accent);
  color: var(--color-secondary);
}

.badge-success {
  background: color-mix(in srgb, var(--color-success) 15%, transparent);
  color: var(--color-success);
}

/* ========================
   FORM INPUTS
======================== */
.form-input {
  width: 100%;
  height: var(--input-height);
  padding: 0 var(--input-padding-x);
  border: var(--input-border);
  border-radius: var(--input-radius);
  background: var(--input-bg);
  font-size: var(--font-size-base);
  font-family: var(--font-body);
  color: var(--color-text);
  transition: border-color var(--duration-fast) var(--ease-default);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--input-focus-ring);
}

textarea.form-input {
  height: auto;
  padding: var(--space-3) var(--input-padding-x);
  resize: vertical;
}

select.form-input {
  cursor: pointer;
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-2);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  font-family: var(--font-body);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

/* ========================
   GRID UTILITIES
======================== */
.grid-2, .grid-3, .grid-4 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--grid-gutter);
}

.grid-2 > * { flex: 0 0 calc(50% - var(--grid-gutter) / 2); }
.grid-3 > * { flex: 0 0 calc(33.333% - var(--grid-gutter) * 2 / 3); }
.grid-4 > * { flex: 0 0 calc(25% - var(--grid-gutter) * 3 / 4); }

@media (max-width: 768px) {
  .grid-2 > *, .grid-3 > *, .grid-4 > * { flex: 0 0 100%; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 > *, .grid-4 > * { flex: 0 0 calc(50% - var(--grid-gutter) / 2); }
}

/* ========================
   HEADING CLASSES
======================== */
.heading-xl {
  font-family: var(--font-heading);
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.heading-lg {
  font-family: var(--font-heading);
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.heading-md {
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
}

.heading-sm {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
}

/* ========================
   SECTION LABEL / EYEBROW
======================== */
.section-label {
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-widest);
  color: var(--color-accent);
  margin-bottom: var(--space-3);
  display: block;
}

.section-label-light {
  color: rgba(254, 189, 14, 0.9);
}

/* ========================
   TEXT BODY
======================== */
.text-body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
}

.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }

/* ========================
   STATS
======================== */
.stat-number {
  font-family: var(--font-heading);
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-none);
  color: var(--color-accent);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-2);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wider);
  font-weight: var(--font-weight-semibold);
}

/* ========================
   SECTION DIVIDERS
   Site-wide: angle divider
======================== */
.section-divider {
  position: relative;
}

.section-divider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--divider-height);
  background: var(--divider-color);
  pointer-events: none;
  z-index: 0;
}

.section-divider-bottom::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--divider-height);
  background: var(--divider-accent-color);
  pointer-events: none;
  z-index: 0;
}

/* Angle divider - site-wide shape */
.divider-angle::before {
  clip-path: polygon(0 0, 100% 0, 100% 0%, 0 100%);
}

.divider-angle::after {
  clip-path: polygon(0 100%, 100% 0%, 100% 100%, 0 100%);
}

/* ========================
   ACCENT ELEMENTS
   Gold bars for elegant law firm
======================== */
.accent-line {
  width: var(--accent-line-width);
  height: var(--accent-line-height);
  background: var(--accent-line-color);
  border-radius: var(--accent-line-radius);
  flex-shrink: 0;
}

.accent-line-center {
  margin-left: auto;
  margin-right: auto;
}

.accent-line-white {
  background: rgba(255, 255, 255, 0.7);
}

.accent-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent-line-color);
  display: inline-block;
}

/* ========================
   IMAGE PRESENTATION
======================== */
.img-rounded {
  border-radius: var(--img-radius);
}

.img-avatar {
  border-radius: var(--img-radius-avatar);
  object-fit: cover;
}

.img-framed {
  border: 3px solid var(--color-accent);
  padding: var(--space-2);
}

/* ========================
   DECORATIVE BLOBS
======================== */
.blob {
  position: absolute;
  width: var(--blob-size);
  height: var(--blob-size);
  border-radius: var(--radius-full);
  opacity: var(--blob-opacity);
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

.blob-primary { background: var(--blob-color-1); }
.blob-secondary { background: var(--blob-color-2); }

/* ========================
   ACCORDION / FAQ
======================== */
.accordion {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.accordion-item {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--card-radius);
  overflow: hidden;
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-5) var(--space-6);
  background: var(--color-bg-surface);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-heading);
  cursor: pointer;
  border: none;
  text-align: left;
  transition: background var(--duration-fast) var(--ease-default);
  color: var(--color-text);
  line-height: var(--line-height-snug);
}

.accordion-trigger:hover {
  background: var(--color-bg-secondary);
}

.accordion-trigger .accordion-icon {
  transition: transform var(--duration-normal) var(--ease-default);
  flex-shrink: 0;
  color: var(--color-accent);
  margin-left: var(--space-4);
}

.accordion-item.active .accordion-trigger {
  background: var(--color-bg-secondary);
  color: var(--color-primary);
}

.accordion-item.active .accordion-trigger .accordion-icon {
  transform: rotate(180deg);
}

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-moderate) var(--ease-default);
}

.accordion-panel-inner {
  padding: var(--space-4) var(--space-6) var(--space-6);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  border-top: var(--border-width) solid var(--color-border);
}

/* ========================
   TABS
======================== */
.tabs {
  display: flex;
  flex-direction: column;
}

.tab-list {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  flex-wrap: wrap;
}

.tab-trigger {
  padding: var(--space-3) var(--space-6);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-body);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.tab-trigger:hover { color: var(--color-text); }

.tab-trigger.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

.tab-panel {
  display: none;
  padding: var(--space-6) 0;
}

.tab-panel.active { display: block; }

/* ========================
   MODAL / LIGHTBOX
======================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
}

.modal.active { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--color-bg-overlay);
  z-index: var(--z-modal-backdrop);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: var(--z-modal);
  background: var(--color-bg-surface);
  border-radius: var(--card-radius);
  padding: var(--space-8);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-fast) var(--ease-default);
}

.modal-close:hover { color: var(--color-text); }

/* ========================
   CAROUSEL / SLIDER
======================== */
.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform var(--duration-moderate) var(--ease-default);
}

.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
}

.carousel-prev, .carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-base);
  background: var(--color-bg-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-full);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast) var(--ease-default);
}

.carousel-prev { left: var(--space-4); }
.carousel-next { right: var(--space-4); }

.carousel-prev:hover, .carousel-next:hover {
  background: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-md);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  border: none;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
}

.carousel-dot.active { background: var(--color-accent); }

/* ========================
   BACK TO TOP
======================== */
.back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  z-index: var(--z-sticky);
  background: var(--color-secondary);
  color: #fff;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-none);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-default);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--color-accent);
  color: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ========================
   TOOLTIP
======================== */
.tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  z-index: var(--z-dropdown);
}

/* ========================
   SECTION HEADER UTILITY
======================== */
.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header .accent-line {
  margin: var(--space-4) auto var(--space-6);
}

/* ========================
   ICON CIRCLES
======================== */
.icon-circle {
  background: var(--color-primary);
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-none);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-circle-accent {
  background: var(--color-accent);
  color: var(--color-secondary);
}

.icon-circle-light {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

/* ========================
   MOBILE CTA BAR
   Fixed bottom bar, mobile only
======================== */
.mobile-cta-bar {
  display: none; /* hidden on desktop */
}

@media (max-width: 768px) {
  /* Body padding so content isn't hidden behind the bar */
  body {
    padding-bottom: 56px;
  }

  .mobile-cta-bar {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: var(--color-secondary);
    border-top: 2px solid var(--color-accent);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
  }

  .mobile-cta-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    background: var(--color-primary);
    border: none;
    cursor: pointer;
    color: #fff;
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
    min-height: 48px;
    width: 100%;
    text-align: left;
  }

  .mobile-cta-toggle-text {
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }

  .mobile-cta-bar.open .mobile-cta-chevron {
    transform: rotate(180deg);
  }

  .mobile-cta-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-normal) var(--ease-default);
  }

  .mobile-cta-bar.open .mobile-cta-panel {
    max-height: 200px;
  }

  .mobile-cta-address {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: rgba(255,255,255,0.75);
    font-size: var(--font-size-xs);
    padding: var(--space-3) var(--space-5) var(--space-2);
    margin: 0;
  }

  .mobile-cta-buttons {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-5) var(--space-4);
  }

  .mobile-cta-btn-call {
    flex: 1;
    background: var(--color-accent);
    color: var(--color-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    padding: var(--space-3) var(--space-4);
    border-radius: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    transition: all var(--duration-fast) var(--ease-default);
  }

  .mobile-cta-btn-call:hover {
    background: #e5a800;
  }

  .mobile-cta-btn-consult {
    flex: 1;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.5);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    padding: var(--space-3) var(--space-4);
    border-radius: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    transition: all var(--duration-fast) var(--ease-default);
  }

  .mobile-cta-btn-consult:hover {
    background: rgba(255,255,255,0.1);
  }
}
