/*
 * Stylesheet for Alida Botha Physiotherapy Practice (revised)
 *
 * This stylesheet maintains the existing clean layout and natural palette
 * while adding subtle animations and supporting additional sections such
 * as the FAQ. The hero background and icons are pulled from the images
 * directory created for this site.
 */

/* Colour palette */
:root {
  --colour-bg: #f9fdf9;
  --colour-primary: #1a3d2f;
  --colour-secondary: #2f5d44;
  --colour-accent: #4caf50;
  --colour-accent-dark: #388e3c;
  --colour-card-bg: #ffffff;
  --colour-section-alt-bg: #eef8ef;
}

/* Reset and global rules */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--colour-bg);
  color: var(--colour-primary);
  line-height: 1.6;
}

a {
  color: var(--colour-accent);
  text-decoration: none;
}

a:hover {
  color: var(--colour-accent-dark);
  text-decoration: underline;
}

/* Containers */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  background-color: transparent;
  transition: background-color 0.3s ease;
}

/* When scrolled add a tinted background */
.header.scrolled {
  background-color: rgba(26, 61, 47, 0.9);
  backdrop-filter: blur(6px);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.nav {
  display: flex;
  gap: 1.5rem;
  margin-right: 3.25%;
}

.nav a {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  transition: color 0.3s;
}

.nav a:hover {
  color: var(--colour-accent);
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: var(--colour-accent);
  transition: width 0.3s;
}

.nav a:hover::after {
  width: 100%;
}

/* Hero */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #ffffff;
  background-image: url('../images/praktyk-1.webp');
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 1rem;
  animation: fadeIn 1s ease-out;
}

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: #e4f5e5;
}

.btn {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  border-radius: 50px;
  background-color: var(--colour-accent);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: #ffffff;
  color: var(--colour-accent-dark);
  text-decoration: none;
}

/* Sections */
.section {
  padding: 4rem 0;
  scroll-margin-top: 110px;
  background-color: var(--colour-bg);
}

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

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--colour-secondary);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--colour-primary);
}

p {
  margin-bottom: 1rem;
}

ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Column layouts */
.two-col {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.two-col.reverse {
  flex-direction: row-reverse;
}

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

.responsive-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.service-card {
  background-color: var(--colour-card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  animation: fadeInUp 0.6s ease both;
  overflow: hidden;
}

/* Callout text within service cards */
.callout {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background-color: #dff5df;
  border-left: 4px solid var(--colour-accent);
  font-style: italic;
}

.service-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  object-fit: contain;
}

/* Image collage */
.collage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-top: 2rem;
}

.collage-cell {
  overflow: hidden;
  border-radius: 8px;
  position: relative;
}

.collage-cell.portrait {
  aspect-ratio: 9 / 16;
}

.collage-cell.landscape {
  aspect-ratio: 16 / 9;
}

.collage-cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.collage-cell:hover img {
  transform: scale(1.04);
}

@media (max-width: 768px) {
  .collage-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* FAQ */
.faq-list details {
  background-color: #eef8ef;
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--colour-primary);
  margin-bottom: 0.5rem;
}

.faq-list p {
  margin-top: 0.5rem;
}

/* Contact */
.contact-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: stretch; /* ensure map stretches to same height as contact cards on desktop */
}

.contact-details {
  flex: 1 1 280px;
}

.contact-item {
  background-color: #eef8ef;
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.contact-item strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--colour-secondary);
}

.contact-phone a {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--colour-accent);
}

.map-container {
  flex: 1 1 280px;
  /* allow map to stretch to match contact cards height on desktop */
  min-height: 300px;
  background-color: #eef8ef;
  border-radius: 14px;
  padding: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

/* Footer */
.footer {
  background-color: var(--colour-primary);
  color: #ffffff;
  text-align: center;
  padding: 1rem 0;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 0.5rem 0;
  }
  .logo-text {
    font-size: 1.25rem;
  }
  .nav {
    gap: 1rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .btn {
    padding: 0.75rem 2rem;
  }
  .two-col {
    flex-direction: column;
    text-align: center;
  }
  .two-col.reverse {
    flex-direction: column;
  }
  .two-col img {
    max-width: 100%;
    margin-bottom: 1rem;
  }
  .contact-wrapper {
    flex-direction: column;
  }
  /* Hide nav by default on mobile */
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background-color: rgba(26, 61, 47, 0.95);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    padding: 0.25rem 0;
  }
  .nav-toggle {
    display: flex;
  }
}

/* Hide hamburger by default */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
  padding: 0;
  margin-left: 0.75rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

@media (max-width: 768px) {
  .section { scroll-margin-top: 90px; }
  .nav-toggle { display: flex; }
}

/* Fade‑in and slide‑up animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Generic scroll-triggered animation classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: none;
}

/* Team */
.team-grid {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.team-member {
  flex: 1 1 260px;
  max-width: 360px;
  text-align: center;
}

.team-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin: 0 auto 1rem;
}

@media (min-width: 900px) {
  .team-member {
    flex: 0 1 calc(33.333% - 1.333rem);
    max-width: none;
  }
}

.service-card h3 {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  text-align: left;
}

.service-details {
  width: 100%;
}

.service-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}

.service-details summary::-webkit-details-marker {
  display: none;
}

.service-details summary::after {
  content: '\25BE';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background-color: var(--colour-section-alt-bg);
  color: var(--colour-primary);
  font-size: 1rem;
  transition: transform 0.25s ease;
}

.service-details[open] summary::after {
  transform: rotate(180deg);
}

.service-details-content {
  padding: 0 1.5rem 1.5rem;
  text-align: left;
}

.service-details-content p,
.service-details-content ul,
.service-details-content li,
.service-details-content .callout {
  text-align: left;
}

.affiliations-section {
  text-align: center;
}

.affiliations-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
  margin-top: 2rem;
}

.affiliation-card {
  text-align: center;
}

.affiliation-logo {
  width: 100%;
  max-width: 220px;
  height: 110px;
  object-fit: contain;
  display: block;
  margin: 0 auto 1rem;
}

.affiliation-card p {
  margin-bottom: 0;
  font-weight: 700;
  color: var(--colour-primary);
}

@media (max-width: 768px) {
  .affiliations-grid {
    grid-template-columns: 1fr;
  }
  .service-icon {
    width: 40px;
    height: 40px;
  }
  .service-details summary {
    padding: 1rem;
    gap: 0.75rem;
  }
  .service-details-content {
    padding: 0 1rem 1rem;
  }
}
