/* ==========================================================================
   DWMD Consulting — Style Sheet
   Donald Wickline, MD, FACEP | Emergency Medicine Expert Witness
   ========================================================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Sans 3', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: #333333;
  background: #ffffff;
}

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

a {
  color: #2E75B6;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: #1B3A5C;
  text-decoration: underline;
}

ul, ol {
  padding-left: 1.5em;
}

/* ---------- Utility ---------- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Header / Navigation ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #1B3A5C;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-brand {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.site-brand:hover,
.site-brand:focus {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.9;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #ffffff;
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.25rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.nav-links a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 600;
}

/* ---------- Main Content ---------- */
main {
  margin-top: 60px;
}

/* ---------- Sections ---------- */
.section {
  padding: 3rem 0;
}

.section--alt {
  background: #F8F9FA;
}

.section--hero {
  padding: 4rem 0 3rem;
  background: linear-gradient(135deg, #1B3A5C 0%, #1a4a6e 33%, #234b73 66%, #1B3A5C 100%);
  background-size: 300% 300%;
  animation: gradient-drift 12s ease infinite;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.section--hero .container {
  position: relative;
  z-index: 1;
}

.hero-layout {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-illustration {
  flex: 0 0 320px;
  max-width: 320px;
  margin-right: -60px;
}

.hero-illustration svg {
  width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .hero-layout {
    flex-direction: column;
  }
  .hero-illustration {
    flex: none;
    max-width: 160px;
    margin: 0 auto;
    order: -1;
  }
}

.section--hero h1 {
  color: #ffffff;
  font-size: 1.85rem;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.section--hero .subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.section--hero p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  max-width: 700px;
}

/* ---------- Headings ---------- */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  color: #1B3A5C;
  line-height: 1.3;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  padding-top: 0.5rem;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.section h2:first-child {
  padding-top: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.1s ease;
  cursor: pointer;
  border: none;
}

.btn:hover,
.btn:focus {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn--primary {
  background: #2E75B6;
  color: #ffffff;
}

.btn--primary:hover,
.btn--primary:focus {
  background: #245f96;
  color: #ffffff;
}

.btn--outline {
  background: transparent;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.btn--outline:hover,
.btn--outline:focus {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: #ffffff;
}

/* ---------- Headshot & Bio Header ---------- */
.headshot {
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  object-fit: cover;
}

#biography > .container > p {
  margin-bottom: 1rem;
  line-height: 1.75;
}

#biography > .container > h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
  color: #1B3A5C;
}

.bio-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.bio-header .headshot {
  width: 220px;
  height: auto;
}

.bio-header-text p {
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

.bio-header-text p:first-child {
  font-size: 1.2rem;
  color: #1B3A5C;
}

@media (min-width: 768px) {
  .bio-header {
    flex-direction: row;
    align-items: flex-start;
  }

  .bio-header .headshot {
    width: 250px;
    flex-shrink: 0;
  }
}

/* ---------- Credential Cards ---------- */
.credentials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.credential-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  color: #ffffff;
}

.credential-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.credential-card span {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

/* ---------- Expertise Cards ---------- */
.expertise-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.expertise-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 1.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.expertise-card:hover {
  border-color: #2E75B6;
  box-shadow: 0 2px 8px rgba(46, 117, 182, 0.1);
}

.expertise-card h3 {
  margin-bottom: 0.5rem;
}

.expertise-card h3 a {
  color: #1B3A5C;
}

.expertise-card p {
  font-size: 0.95rem;
  color: #555;
}

/* ---------- Process Steps ---------- */
.process-steps {
  counter-reset: step;
  margin: 1.5rem 0;
}

.process-step {
  position: relative;
  padding: 1.5rem 1.5rem 1.5rem 4rem;
  margin-bottom: 1.5rem;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

.process-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 1.25rem;
  top: 1.5rem;
  width: 2rem;
  height: 2rem;
  background: #2E75B6;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.section--alt .process-step {
  background: #ffffff;
}

/* ---------- Article / Resource Cards ---------- */
.article-section {
  padding: 2rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.article-section:last-of-type {
  border-bottom: none;
}

.article-meta {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.75rem;
}

/* ---------- Structured Lists (About page) ---------- */
.credential-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.credential-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
  padding-left: 0;
}

.credential-list li:last-child {
  border-bottom: none;
}

/* ---------- Contact Icons ---------- */
.contact-icon {
  width: 18px;
  height: 18px;
  fill: #2E75B6;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 0.25rem;
  flex-shrink: 0;
}

.site-footer .contact-icon {
  fill: rgba(255, 255, 255, 0.7);
}

/* ---------- LinkedIn ---------- */
.linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.linkedin-link svg {
  width: 18px;
  height: 18px;
  fill: #0A66C2;
  flex-shrink: 0;
  vertical-align: middle;
}

.linkedin-link:hover svg {
  fill: #004182;
}

/* ---------- Contact Info ---------- */
.contact-info {
  margin: 1.5rem 0;
}

.contact-info p {
  margin-bottom: 0.5rem;
}

.contact-info a {
  font-weight: 600;
}

/* ---------- Contact Form ---------- */
.contact-form {
  max-width: 600px;
  margin: 2rem 0;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #1B3A5C;
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  color: #333;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2E75B6;
  box-shadow: 0 0 0 3px rgba(46, 117, 182, 0.15);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

/* ---------- CTA Section ---------- */
.cta-section {
  text-align: center;
  padding: 3rem 0;
}

.cta-section h2 {
  margin-bottom: 1rem;
}

.cta-section p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  color: #555;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #1B3A5C;
  color: rgba(255, 255, 255, 0.8);
  padding: 2.5rem 0 1.5rem;
  font-size: 0.9rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-section h3 {
  color: #ffffff;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.footer-section p {
  margin-bottom: 0.35rem;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
}

.footer-section a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.35rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Date Stamp ---------- */
.date-stamp {
  font-size: 0.85rem;
  color: #777;
  font-style: italic;
  margin-top: 2rem;
}

/* ---------- 404 ---------- */
.error-page {
  text-align: center;
  padding: 6rem 0;
}

.error-page h1 {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.error-page p {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 1.5rem;
}

/* ---------- CV Print Page ---------- */
.cv-page {
  max-width: 750px;
  margin: 0 auto;
  padding: 2rem;
}

.cv-page h1 {
  font-size: 1.75rem;
  border-bottom: 2px solid #1B3A5C;
  padding-bottom: 0.5rem;
}

.cv-page h2 {
  font-size: 1.15rem;
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.25rem;
  margin-top: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cv-page ul {
  margin: 0.5rem 0;
}

.cv-page li {
  margin-bottom: 0.35rem;
}

/* ---------- Responsive: Tablet / Desktop ---------- */
@media (min-width: 768px) {
  .section--hero h1 {
    font-size: 2.25rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  .credentials-grid {
    grid-template-columns: 1fr 1fr;
  }

  .expertise-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* ---------- Responsive: Mobile Nav ---------- */
@media (max-width: 767px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #1B3A5C;
    flex-direction: column;
    padding: 0.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 1.25rem;
    border-radius: 0;
  }
}

/* ---------- Hero Animations ---------- */
@keyframes gradient-drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-ecg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  animation: ecg-glow 1s ease-in-out infinite;
}

@keyframes ecg-glow {
  0%, 100% { filter: drop-shadow(0 0 1px rgba(255,255,255,0.05)); }
  20% { filter: drop-shadow(0 0 16px rgba(255,255,255,0.7)) drop-shadow(0 0 4px rgba(255,255,255,0.9)); }
  50% { filter: drop-shadow(0 0 1px rgba(255,255,255,0.05)); }
}

.hero-ecg polyline {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 3200;
  stroke-dashoffset: 3200;
  animation: ecg-trace 5s linear infinite;
}

@keyframes ecg-trace {
  0% { stroke-dashoffset: 3200; opacity: 0; }
  3% { opacity: 1; }
  92% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .section--hero {
    animation: none;
  }
  .hero-ecg {
    animation: none;
  }
  .hero-ecg polyline {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  .site-header,
  .nav-toggle,
  .site-footer,
  .btn {
    display: none;
  }

  main {
    margin-top: 0;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .section {
    padding: 1rem 0;
  }

  .container {
    max-width: 100%;
  }
}
