/* ==========================================================================
   MTR Rehab — Clinical Trust (#3) + Tab-Based Sections (#5)
   Domain: mtrrehab.com
   Colors: Medical Blue #1E5AA8 / Trust Blue #4A90D9 / Health Green #28A745
   Fonts: Roboto (headings) + Open Sans (body)
   ========================================================================== */

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Open Sans', Arial, sans-serif;
  color: #212529;
  background: #FFFFFF;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: #1E5AA8; text-decoration: none; transition: color .2s; }
a:hover { color: #4A90D9; }
ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Roboto', Arial, sans-serif;
  color: #1E5AA8;
  line-height: 1.3;
  font-weight: 700;
}
h1 { font-size: 2.4rem; margin-bottom: 1rem; }
h2 { font-size: 1.9rem; margin-bottom: .85rem; }
h3 { font-size: 1.4rem; margin-bottom: .65rem; }
h4 { font-size: 1.15rem; margin-bottom: .5rem; }
p { margin-bottom: 1rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- Skip Link --- */
.skip-link {
  position: absolute; left: -9999px; top: auto;
  background: #1E5AA8; color: #fff; padding: 8px 16px;
  z-index: 10000; font-size: .9rem; border-radius: 0 0 4px 4px;
}
.skip-link:focus { left: 20px; top: 0; }

/* --- Top Bar --- */
.top-bar {
  background: #1E5AA8;
  color: #fff;
  font-size: .85rem;
  padding: 8px 0;
}
.top-bar .container {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
}
.top-bar a { color: #fff; }
.top-bar a:hover { color: #c5dfff; }
.top-bar__contact { display: flex; gap: 20px; align-items: center; }
.top-bar__hours { opacity: .9; }

/* --- Header --- */
.site-header {
  background: #fff;
  border-bottom: 2px solid #e9ecef;
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.site-header .container {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; padding-bottom: 12px;
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.35rem; color: #1E5AA8; }
.logo:hover { color: #1E5AA8; }
.logo__icon {
  width: 42px; height: 42px; background: #1E5AA8; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1.1rem;
}
.logo__text span { display: block; font-size: .7rem; color: #6c757d; font-weight: 400; letter-spacing: .5px; }

/* --- Main Nav --- */
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  padding: 8px 14px; font-size: .92rem; font-weight: 500; color: #212529;
  border-radius: 4px; transition: background .2s, color .2s;
}
.main-nav a:hover, .main-nav a.active { background: #e8f0fe; color: #1E5AA8; }
.nav-cta {
  background: #28A745 !important; color: #fff !important;
  font-weight: 600 !important; border-radius: 4px !important;
  padding: 10px 20px !important;
}
.nav-cta:hover { background: #218838 !important; }

/* Hamburger */
.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  width: 36px; height: 36px; position: relative;
}
.hamburger span {
  display: block; width: 24px; height: 2px; background: #212529;
  position: absolute; left: 6px; transition: .3s;
}
.hamburger span:nth-child(1) { top: 10px; }
.hamburger span:nth-child(2) { top: 17px; }
.hamburger span:nth-child(3) { top: 24px; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg); top: 17px; }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg); top: 17px; }

/* --- Tab Navigation (Architecture #5) --- */
.tab-nav {
  background: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-nav .container { display: flex; gap: 0; }
.tab-nav__item {
  padding: 14px 22px;
  font-size: .9rem; font-weight: 500; color: #6c757d;
  border-bottom: 3px solid transparent;
  white-space: nowrap; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
  background: none; border-top: none; border-left: none; border-right: none;
  font-family: 'Open Sans', Arial, sans-serif;
}
.tab-nav__item:hover { color: #1E5AA8; background: #e8f0fe; }
.tab-nav__item.active {
  color: #1E5AA8; border-bottom-color: #1E5AA8;
  font-weight: 600; background: #fff;
}

/* --- Tab Content --- */
.tab-content { display: none; animation: tabFadeIn .4s ease; }
.tab-content.active { display: block; }
@keyframes tabFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 520px;
  display: flex; align-items: center;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  color: #fff;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(30,90,168,.88) 0%, rgba(74,144,217,.7) 100%);
}
.hero__content { position: relative; z-index: 1; max-width: 700px; padding: 60px 0; }
.hero h1 { color: #fff; font-size: 2.6rem; margin-bottom: .6rem; }
.hero__subtitle { font-size: 1.2rem; margin-bottom: 1.5rem; opacity: .95; line-height: 1.6; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Inner page heroes (smaller) */
.hero--inner { min-height: 300px; }
.hero--inner h1 { font-size: 2.2rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; font-size: 1rem; font-weight: 600;
  border-radius: 4px; border: none; cursor: pointer;
  transition: background .2s, transform .1s; text-align: center;
  font-family: 'Open Sans', Arial, sans-serif;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: #28A745; color: #fff; }
.btn-primary:hover { background: #218838; color: #fff; }
.btn-secondary { background: #fff; color: #1E5AA8; }
.btn-secondary:hover { background: #e8f0fe; color: #1E5AA8; }
.btn-outline {
  background: transparent; color: #1E5AA8;
  border: 2px solid #1E5AA8;
}
.btn-outline:hover { background: #1E5AA8; color: #fff; }
.btn-white-outline {
  background: transparent; color: #fff; border: 2px solid #fff;
}
.btn-white-outline:hover { background: rgba(255,255,255,.15); color: #fff; }

/* --- Trust Bar --- */
.trust-bar {
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  padding: 20px 0;
}
.trust-bar__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px; text-align: center;
}
.trust-bar__item { display: flex; align-items: center; gap: 10px; justify-content: center; }
.trust-bar__icon {
  width: 44px; height: 44px; background: #1E5AA8; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem; flex-shrink: 0;
}
.trust-bar__text { font-size: .9rem; font-weight: 600; color: #212529; text-align: left; }
.trust-bar__text span { display: block; font-weight: 400; font-size: .8rem; color: #6c757d; }

/* --- Section Styles --- */
.section { padding: 70px 0; }
.section--gray { background: #f8f9fa; }
.section--blue { background: #1E5AA8; color: #fff; }
.section--blue h2, .section--blue h3, .section--blue h4 { color: #fff; }
.section__header { text-align: center; margin-bottom: 45px; }
.section__header p { color: #6c757d; max-width: 650px; margin: 0 auto; font-size: 1.05rem; }
.section__header h2 { position: relative; padding-bottom: 15px; }
.section__header h2::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 60px; height: 3px; background: #28A745; border-radius: 2px;
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.card {
  background: #fff; border: 1px solid #e9ecef;
  border-radius: 4px; overflow: hidden;
  transition: box-shadow .25s, transform .25s;
}
.card:hover { box-shadow: 0 8px 30px rgba(0,0,0,.08); transform: translateY(-3px); }
.card__image { height: 200px; overflow: hidden; }
.card__image img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 24px; }
.card__body h3 { font-size: 1.2rem; }
.card__body p { color: #6c757d; font-size: .92rem; }
.card__link {
  display: inline-flex; align-items: center; gap: 6px;
  color: #1E5AA8; font-weight: 600; font-size: .9rem; margin-top: 10px;
}
.card__link:hover { gap: 10px; }

/* Icon card variant */
.card--icon { text-align: center; padding: 32px 24px; }
.card--icon .card__icon {
  width: 64px; height: 64px; background: #e8f0fe; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px; font-size: 1.6rem; color: #1E5AA8;
}
.card--icon h3 { font-size: 1.1rem; }

/* --- Program Tabs --- */
.program-tabs { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; justify-content: center; }
.program-tab {
  padding: 10px 24px; border: 2px solid #e9ecef;
  border-radius: 4px; background: #fff;
  font-size: .9rem; font-weight: 500; color: #6c757d;
  cursor: pointer; transition: all .2s;
  font-family: 'Open Sans', Arial, sans-serif;
}
.program-tab:hover { border-color: #4A90D9; color: #1E5AA8; }
.program-tab.active { border-color: #1E5AA8; background: #1E5AA8; color: #fff; }

/* --- Stats Row --- */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px; text-align: center; padding: 40px 0;
}
.stat__number { font-size: 2.4rem; font-weight: 700; color: #1E5AA8; font-family: 'Roboto', sans-serif; }
.stat__label { font-size: .9rem; color: #6c757d; margin-top: 4px; }
.section--blue .stat__number { color: #fff; }
.section--blue .stat__label { color: rgba(255,255,255,.8); }

/* --- Testimonials --- */
.testimonial-card {
  background: #fff; border: 1px solid #e9ecef;
  border-radius: 4px; padding: 30px;
  position: relative;
}
.testimonial-card::before {
  content: '\201C'; font-size: 4rem; color: #4A90D9;
  position: absolute; top: 10px; left: 20px; line-height: 1; opacity: .3;
}
.testimonial-card__text { font-style: italic; color: #495057; margin-bottom: 16px; padding-left: 20px; }
.testimonial-card__author { font-weight: 600; color: #1E5AA8; }
.testimonial-card__program { font-size: .85rem; color: #6c757d; }

/* --- FAQ Accordion --- */
.faq-item { border-bottom: 1px solid #e9ecef; }
.faq-question {
  width: 100%; padding: 20px 0; background: none; border: none;
  text-align: left; cursor: pointer;
  font-size: 1.05rem; font-weight: 600; color: #212529;
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Open Sans', Arial, sans-serif;
}
.faq-question:hover { color: #1E5AA8; }
.faq-question::after {
  content: '+'; font-size: 1.4rem; color: #1E5AA8; transition: transform .2s;
  flex-shrink: 0; margin-left: 16px;
}
.faq-item.active .faq-question::after { content: '\2212'; }
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
  color: #495057; font-size: .95rem; line-height: 1.7;
}
.faq-item.active .faq-answer { max-height: 600px; padding-bottom: 20px; }

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, #1E5AA8 0%, #4A90D9 100%);
  color: #fff; text-align: center; padding: 60px 0;
}
.cta-section h2 { color: #fff; margin-bottom: .5rem; }
.cta-section p { opacity: .9; margin-bottom: 1.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.cta-section .cta-phone {
  font-size: 2rem; font-weight: 700; color: #fff; display: block; margin-bottom: 1.2rem;
}
.cta-section .cta-phone:hover { color: #c5dfff; }

/* --- Blog Cards --- */
.blog-card { overflow: hidden; }
.blog-card__meta { font-size: .8rem; color: #6c757d; margin-bottom: 8px; }
.blog-card__category {
  display: inline-block; background: #e8f0fe; color: #1E5AA8;
  padding: 3px 10px; border-radius: 3px; font-size: .75rem; font-weight: 600;
}

/* --- Contact Info --- */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 40px; align-items: start;
}
.contact-info__item {
  display: flex; gap: 14px; margin-bottom: 24px;
}
.contact-info__icon {
  width: 48px; height: 48px; background: #e8f0fe;
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  color: #1E5AA8; font-size: 1.2rem; flex-shrink: 0;
}
.contact-info__text h4 { color: #212529; margin-bottom: 2px; }
.contact-info__text p { color: #6c757d; margin-bottom: 0; font-size: .92rem; }
.contact-info__text a { color: #1E5AA8; font-weight: 500; }

.map-container { border-radius: 4px; overflow: hidden; border: 1px solid #e9ecef; }
.map-container iframe { width: 100%; height: 400px; display: block; }

/* --- Insurance Grid --- */
.insurance-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.insurance-item {
  background: #f8f9fa; border: 1px solid #e9ecef;
  border-radius: 4px; padding: 16px; text-align: center;
  font-weight: 500; font-size: .92rem; color: #212529;
}

/* --- Timeline / Steps --- */
.steps-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px; counter-reset: step;
}
.step-card { text-align: center; padding: 30px 20px; position: relative; }
.step-card::before {
  counter-increment: step; content: counter(step);
  width: 48px; height: 48px; border-radius: 50%;
  background: #1E5AA8; color: #fff; font-size: 1.2rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.step-card h3 { font-size: 1.05rem; }
.step-card p { color: #6c757d; font-size: .9rem; }

/* --- Image Gallery --- */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.gallery-grid img { width: 100%; height: 220px; object-fit: cover; border-radius: 4px; }

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 14px 0; font-size: .85rem; color: #6c757d;
}
.breadcrumb a { color: #4A90D9; }
.breadcrumb a:hover { color: #1E5AA8; }
.breadcrumb span { margin: 0 8px; }

/* --- Footer --- */
.site-footer {
  background: #1a1a2e; color: #adb5bd; padding: 60px 0 0;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 40px;
}
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 18px; position: relative; padding-bottom: 10px; }
.footer-col h4::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 30px; height: 2px; background: #28A745;
}
.footer-col p { font-size: .88rem; line-height: 1.7; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { color: #adb5bd; font-size: .88rem; }
.footer-col ul a:hover { color: #fff; }
.footer-contact__item { display: flex; gap: 10px; margin-bottom: 12px; font-size: .88rem; }
.footer-contact__item strong { color: #fff; min-width: 55px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px 0; text-align: center; font-size: .82rem;
}
.footer-bottom a { color: #adb5bd; }
.footer-bottom a:hover { color: #fff; }

/* --- Utility --- */
.text-center { text-align: center; }
.text-white { color: #fff; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.pb-0 { padding-bottom: 0; }

/* Two-column layout */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 40px; align-items: center;
}
.two-col--reverse { direction: rtl; }
.two-col--reverse > * { direction: ltr; }

.two-col img { border-radius: 4px; width: 100%; height: auto; }

/* Lists styled */
.check-list li {
  padding: 6px 0 6px 28px; position: relative; font-size: .95rem;
}
.check-list li::before {
  content: '✓'; position: absolute; left: 0; color: #28A745; font-weight: 700;
}

/* Daily schedule table */
.schedule-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.schedule-table th, .schedule-table td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid #e9ecef;
  font-size: .92rem;
}
.schedule-table th { background: #f8f9fa; font-weight: 600; color: #1E5AA8; }

/* Privacy page */
.privacy-content h2 { font-size: 1.5rem; margin-top: 2rem; }
.privacy-content h3 { font-size: 1.2rem; margin-top: 1.5rem; }
.privacy-content ul { margin: 10px 0 10px 20px; }
.privacy-content ul li { list-style: disc; margin-bottom: 6px; font-size: .92rem; color: #495057; }

/* --- Responsive --- */
@media (max-width: 992px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.2rem; }
}

@media (max-width: 768px) {
  .main-nav {
    display: none; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 2px solid #e9ecef;
    padding: 10px 20px; box-shadow: 0 8px 20px rgba(0,0,0,.1);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; border-radius: 0; border-bottom: 1px solid #f1f1f1; }
  .hamburger { display: block; }
  .site-header .container { position: relative; }

  .footer-grid { grid-template-columns: 1fr; }
  .hero { min-height: 400px; }
  .hero--inner { min-height: 240px; }
  .hero h1 { font-size: 1.8rem; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.5rem; }
  .section { padding: 45px 0; }

  .top-bar .container { justify-content: center; text-align: center; }
  .top-bar__hours { display: none; }

  /* Tabs scroll on mobile */
  .tab-nav .container { gap: 0; overflow-x: auto; }
  .tab-nav__item { padding: 12px 16px; font-size: .82rem; }

  .stats-row { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero__actions { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .gallery-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .insurance-grid { grid-template-columns: 1fr 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
