/* ==========================================================================
   Component Patterns — Singapore Cardiology Clinic
   Generated: 2026-02-05
   Requires: tokens.css (loaded first)
   ========================================================================== */

/* --------------------------------------------------------------------------
   RESET & BASE
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
}

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

a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-text-link-hover);
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
}

h2 {
  font-size: var(--text-4xl);
  font-weight: var(--font-semibold);
}

h3 {
  font-size: var(--text-3xl);
  font-weight: var(--font-semibold);
}

h4 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
}

h5 {
  font-size: var(--text-xl);
  font-weight: var(--font-medium);
}

h6 {
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
}

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

.text-accent {
  color: var(--color-text-accent);
}

.text-inverse {
  color: var(--color-text-inverse);
}

/* Overline / label text (e.g., "OUR SERVICES" above a section heading) */
.overline {
  font-family: var(--font-cta);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-accent-500);
}

/* --------------------------------------------------------------------------
   LAYOUT
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding-x);
  padding-right: var(--container-padding-x);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

/* --------------------------------------------------------------------------
   SECTION PATTERNS
   Derived from competitor analysis: generous vertical padding, alternating
   backgrounds for visual rhythm.
   -------------------------------------------------------------------------- */

.section {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
}

.section--alt {
  background-color: var(--color-bg-secondary);
}

.section--warm {
  background-color: var(--color-bg-warm);
}

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-inverse);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark p {
  color: var(--color-text-inverse);
}

.section--dark .text-muted {
  color: var(--color-gray-400);
}

.section--dark .overline {
  color: var(--color-accent-400);
}

/* Section header pattern — overline + heading + subtitle */
.section-header {
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-8);
}

.section-header h2 {
  margin-top: var(--space-3);
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   BUTTONS

   Competitor analysis:
   - 3/7 sharp (0px), 2/7 pill (25px+), 2/7 slight round
   - Recommendation: 8px radius (modern middle ground)
   - Padding: 14px 32px (comfortable between extremes)
   - Primary: Navy bg + white text (5/7 pattern)
   - Secondary: Gold accent (5/7 pattern)
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-cta);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.875rem 2rem;  /* 14px 32px */
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid var(--color-secondary-500);
  outline-offset: 2px;
}

/* Primary — Navy background, white text */
.btn-primary {
  background-color: var(--color-primary-900);
  color: var(--color-white);
  border-color: var(--color-primary-900);
}

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

/* Secondary — Gold background, navy text */
.btn-secondary {
  background-color: var(--color-accent-500);
  color: var(--color-primary-900);
  border-color: var(--color-accent-500);
}

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

/* Outline — Transparent background, navy border + text */
.btn-outline {
  background-color: transparent;
  color: var(--color-primary-900);
  border-color: var(--color-primary-900);
}

.btn-outline:hover {
  background-color: var(--color-primary-900);
  color: var(--color-white);
  transform: translateY(-1px);
}

/* Ghost — For dark backgrounds */
.btn-ghost {
  background-color: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

.btn-ghost:hover {
  background-color: var(--color-white);
  color: var(--color-primary-900);
}

/* WhatsApp CTA — Green branded button */
.btn-whatsapp {
  background-color: var(--color-whatsapp);
  color: var(--color-white);
  border-color: var(--color-whatsapp);
}

.btn-whatsapp:hover {
  background-color: #20BD5A;
  border-color: #20BD5A;
  color: var(--color-white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Button sizes */
.btn-sm {
  font-size: var(--text-xs);
  padding: 0.5rem 1.25rem;
}

.btn-lg {
  font-size: var(--text-base);
  padding: 1rem 2.5rem;
}

/* --------------------------------------------------------------------------
   CARDS

   4/7 competitors use service cards with icons. Subtle shadow on hover
   matches the modern trend (EHeart, OrchardHeart).
   -------------------------------------------------------------------------- */

.card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
}

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

.card__icon {
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-4);
  color: var(--color-secondary-700);
}

.card__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

.card__text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.card__link {
  font-family: var(--font-cta);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-secondary-700);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.card__link:hover {
  color: var(--color-secondary-600);
}

/* Grid layout for cards */
.card-grid {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .card-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --------------------------------------------------------------------------
   TRUST BAR

   Derived from EHeart's credential icons pattern — one of the most
   effective trust-building patterns, placed immediately below the hero.
   -------------------------------------------------------------------------- */

.trust-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-10) 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  max-width: 200px;
}

.trust-item__icon {
  width: 56px;
  height: 56px;
  color: var(--color-accent-500);
}

.trust-item__label {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   NAVIGATION

   All 7 competitors use sticky nav with CTA. This pattern includes:
   - Top info bar (phone + address — used by 3/7)
   - Main nav with logo + links + primary CTA button
   -------------------------------------------------------------------------- */

.topbar {
  background-color: var(--color-primary-900);
  color: var(--color-text-inverse);
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
}

.topbar a {
  color: var(--color-text-inverse);
}

.topbar a:hover {
  color: var(--color-accent-400);
}

.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background-color: var(--color-white);
  box-shadow: var(--shadow-nav);
  padding: var(--space-4) 0;
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.navbar__logo img {
  height: 83px;
  width: auto;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
}

.navbar__link {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  transition: color var(--transition-fast);
}

.navbar__link:hover {
  color: var(--color-secondary-700);
}

/* Mobile hamburger (hidden by default on desktop) */
.navbar__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

@media (max-width: 1024px) {
  .navbar__links {
    display: none;
  }
  .navbar__toggle {
    display: flex;
  }
}

/* --------------------------------------------------------------------------
   HERO SECTION

   Recommended: Text left + doctor photo right (OrchardHeart pattern).
   Dual CTA above fold (appointment + WhatsApp).
   -------------------------------------------------------------------------- */

.hero {
  padding: var(--space-16) 0 var(--space-20);
  background-color: var(--color-bg-primary);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.hero__overline {
  margin-bottom: var(--space-4);
}

.hero h1 {
  margin-bottom: var(--space-6);
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 520px;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.hero__image {
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.hero__image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

@media (max-width: 768px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero__subtitle {
    max-width: 100%;
  }
  .hero__ctas {
    justify-content: center;
  }
  .hero__image {
    order: -1;
    max-width: 400px;
    margin: 0 auto;
  }
}

/* --------------------------------------------------------------------------
   DOCTOR PROFILE

   5/7 competitors feature a doctor profile section prominently.
   Photo + bio + credentials is the standard pattern.
   -------------------------------------------------------------------------- */

.doctor-profile {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: var(--space-12);
  align-items: start;
}

.doctor-profile__image {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.doctor-profile__image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.doctor-profile__name {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-2);
}

.doctor-profile__title {
  font-size: var(--text-lg);
  color: var(--color-secondary-700);
  font-weight: var(--font-medium);
  margin-bottom: var(--space-6);
}

.doctor-profile__credentials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.credential-badge {
  font-family: var(--font-cta);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  padding: var(--space-1) var(--space-3);
  background-color: var(--color-accent-50);
  color: var(--color-accent-800);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-accent-200);
}

.doctor-profile__bio {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
}

@media (max-width: 768px) {
  .doctor-profile {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .doctor-profile__image {
    max-width: 300px;
    margin: 0 auto;
  }
  .doctor-profile__credentials {
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   STATS / HEART FACTS

   Follows CapitalHeart's animated counter pattern.
   Builds urgency about cardiovascular health.
   -------------------------------------------------------------------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  text-align: center;
}

.stat-item__number {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
  color: var(--color-accent-500);
  line-height: var(--leading-none);
  margin-bottom: var(--space-2);
}

.stat-item__label {
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

.section--dark .stat-item__number {
  color: var(--color-accent-400);
}

.section--dark .stat-item__label {
  color: var(--color-gray-300);
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }
}

/* --------------------------------------------------------------------------
   CTA BANNER

   Full-width dark section with strong CTA — used by 3/7 competitors.
   Positioned mid-page to recapture scrolling visitors.
   -------------------------------------------------------------------------- */

.cta-banner {
  text-align: center;
  padding: var(--space-12) var(--container-padding-x);
  background: linear-gradient(135deg, var(--color-primary-900) 0%, #0B2E5C 50%, var(--color-secondary-900) 100%);
  color: var(--color-text-inverse);
}

.cta-banner h2 {
  color: var(--color-text-inverse);
  margin-bottom: var(--space-4);
}

.cta-banner p {
  color: var(--color-gray-300);
  font-size: var(--text-lg);
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

.cta-banner__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
}

/* --------------------------------------------------------------------------
   CONTACT FORM

   4/7 competitors include a contact form on their homepage.
   Clean, minimal fields — Name, Phone/WhatsApp, Email, Message.
   -------------------------------------------------------------------------- */

.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  background-color: var(--color-white);
  color: var(--color-text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-secondary-700);
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.15);
}

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

/* --------------------------------------------------------------------------
   FLOATING WHATSAPP BUTTON

   5/7 competitors use a floating WhatsApp button.
   This is the SG medical standard.
   -------------------------------------------------------------------------- */

.whatsapp-float {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-whatsapp);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background-color: var(--color-whatsapp);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-xl);
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   FOOTER

   All 7 competitors include footer with contact info.
   Standard pattern: Logo, nav links, clinic details, copyright.
   -------------------------------------------------------------------------- */

.footer {
  background-color: var(--color-gray-950);
  color: var(--color-gray-400);
  padding: var(--space-16) 0 var(--space-8);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer__logo img {
  height: 78px;
  width: auto;
  margin-bottom: var(--space-4);
}

.footer__heading {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-white);
  margin-bottom: var(--space-4);
}

.footer a {
  color: var(--color-gray-400);
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: var(--color-accent-400);
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__bottom {
  border-top: 1px solid var(--color-gray-800);
  padding-top: var(--space-6);
  font-size: var(--text-sm);
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   UTILITY CLASSES
   -------------------------------------------------------------------------- */

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

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
