/* ============================================================
   Otter Valley Trichology Clinic - Stylesheet
   ============================================================ */

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #333;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: #821151; text-decoration: none; transition: color .2s; }
a:hover { color: #a0336e; }
ul, ol { list-style-position: inside; }

/* --- CSS Variables --- */
:root {
  --primary: #821151;
  --primary-light: #a0336e;
  --primary-dark: #5e0b3a;
  --accent-bg: #ebebf3;
  --text: #333;
  --text-light: #666;
  --white: #fff;
  --max-width: 1140px;
  --header-height: 60px;
  --transition: .3s ease;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Lato', Arial, sans-serif;
  font-weight: 300;
  line-height: 1.3;
  color: var(--primary);
}

h1 { font-size: 2.4rem; margin-bottom: .6em; }
h2 { font-size: 1.8rem; margin-bottom: .5em; }
h3 { font-size: 1.4rem; margin-bottom: .4em; }
h4 { font-size: 1.15rem; margin-bottom: .3em; }

p { margin-bottom: 1em; }

.text-center { text-align: center; }
.text-white { color: var(--white); }
.text-white h1, .text-white h2, .text-white h3, .text-white h4 { color: var(--white); }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.col-full { flex: 0 0 100%; }
.col-half { flex: 0 0 calc(50% - 15px); }
.col-third { flex: 0 0 calc(33.333% - 20px); }
.col-two-thirds { flex: 0 0 calc(66.666% - 15px); }

section {
  padding: 60px 0;
}

section.bg-light {
  background: var(--accent-bg);
}

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

section.bg-primary h1,
section.bg-primary h2,
section.bg-primary h3,
section.bg-primary h4 {
  color: var(--white);
}

/* --- Header --- */
.site-header {
  background: var(--primary-dark);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.site-logo img {
  height: 50px;
  width: auto;
}

/* --- Navigation --- */
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 0;
}

.main-nav > ul > li {
  position: relative;
}

.main-nav a {
  display: block;
  padding: 0 14px;
  line-height: 70px;
  color: var(--white);
  font-size: .9rem;
  font-weight: 400;
  letter-spacing: .02em;
  transition: background var(--transition);
}

.main-nav > ul > li > a:hover,
.main-nav > ul > li:hover > a {
  background: rgba(255,255,255,.1);
}

.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--primary);
  min-width: 220px;
  list-style: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  z-index: 100;
}

.main-nav li:hover > .sub-menu {
  display: block;
}

.main-nav .sub-menu a {
  line-height: 1.4;
  padding: 12px 18px;
  font-size: .85rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.main-nav .sub-menu a:hover {
  background: rgba(255,255,255,.15);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--white);
  margin: 5px 0;
  border-radius: 2px;
  transition: var(--transition);
}

/* --- Hero Slider --- */
.hero-slider {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
  background: var(--primary-dark);
}

.hero-slider .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slider .slide.active {
  opacity: 1;
}

.hero-slider .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Page Hero Banner --- */
.page-hero {
  background: var(--primary);
  color: var(--white);
  padding: 60px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero.has-bg {
  background-size: cover;
  background-position: center;
}

.page-hero.has-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(130, 17, 81, .7);
}

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

.page-hero h1 {
  color: var(--white);
  font-size: 2.6rem;
  font-weight: 300;
  margin-bottom: 0;
}

.page-hero .breadcrumb {
  margin-top: 10px;
  font-size: .9rem;
  opacity: .85;
}

.page-hero .breadcrumb a { color: var(--white); }
.page-hero .breadcrumb a:hover { text-decoration: underline; }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-family: 'Josefin Sans', 'Lato', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
}

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

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

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

.btn-white {
  border-color: var(--white);
  color: var(--white);
}

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

/* --- Content Sections --- */
.intro-section .row {
  align-items: flex-start;
}

.content-text ul {
  margin: .8em 0 1.2em 0;
  padding-left: 1.2em;
  list-style-position: outside;
}

.content-text li {
  margin-bottom: .4em;
}

.content-text table {
  width: 100%;
  min-width: 400px;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: .9rem;
}

.content-text table caption {
  font-weight: 600;
  margin-bottom: .5em;
  text-align: left;
}

.content-text table th,
.content-text table td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid #ddd;
}

.content-text table th {
  background: var(--accent-bg);
  font-weight: 600;
}

.content-text table tbody tr:nth-child(even) {
  background: #fafafa;
}

.content-text .back-link {
  margin-top: 2em;
  padding-top: 1.5em;
  border-top: 1px solid #eee;
}

.content-text .table-wrapper {
  overflow-x: auto;
  margin: 1.5em 0;
}

.content-text .table-wrapper table {
  margin: 0;
}

/* --- Image with placeholder fallback --- */
.img-placeholder {
  background: linear-gradient(135deg, #ebebf3 0%, #d4d4e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: .85rem;
  min-height: 250px;
  aspect-ratio: 16/9;
  border-radius: 4px;
  text-align: center;
  padding: 20px;
}

.img-rounded { border-radius: 6px; overflow: hidden; }

/* --- Alternating Content Rows --- */
.alternating-section {
  padding: 50px 0;
}

.alternating-section:nth-child(even) {
  background: var(--accent-bg);
}

.alternating-section .row {
  align-items: center;
}

.alternating-section:nth-child(even) .row {
  flex-direction: row-reverse;
}

.alternating-section .content-img img {
  border-radius: 6px;
  width: 100%;
}

/* --- Benefit Cards --- */
.benefit-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.benefit-card {
  background: var(--white);
  padding: 30px 24px;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  text-align: center;
}

.benefit-card h3 {
  margin-bottom: .5em;
}

/* --- Pricing Table --- */
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.pricing-table th,
.pricing-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.pricing-table th {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  font-size: .9rem;
}

.pricing-table tr:nth-child(even) {
  background: var(--accent-bg);
}

.pricing-table td:last-child,
.pricing-table th:last-child {
  text-align: right;
}

/* --- Testimonials Carousel --- */
.testimonials-carousel {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
}

.testimonial-track {
  display: flex;
  transition: transform .5s ease;
}

.testimonial-slide {
  min-width: 100%;
  padding: 30px 40px;
  text-align: center;
}

.testimonial-slide blockquote {
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 1em;
}

.testimonial-slide cite {
  font-style: normal;
  font-weight: 700;
  color: var(--primary);
}

.carousel-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.carousel-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.form-group {
  margin-bottom: 1.2em;
}

.form-group label {
  display: block;
  margin-bottom: .3em;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

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

/* --- Blog Grid --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.blog-card {
  background: var(--white);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}

.blog-card-body h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.blog-card:hover h3 a {
  text-decoration: underline;
}

.blog-card-img {
  height: 200px;
  overflow: hidden;
  background: var(--accent-bg);
}

.blog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card-body {
  padding: 20px;
}

.blog-card-body h3 {
  font-size: 1.05rem;
  font-weight: 400;
  margin-bottom: .4em;
}

.blog-card-body h3 a {
  color: var(--primary);
}

.blog-card-body .meta {
  font-size: .8rem;
  color: var(--text-light);
  margin-bottom: .6em;
}

.blog-card-body p {
  font-size: .9rem;
  color: var(--text-light);
  margin-bottom: 0;
}

/* --- Partner Logos --- */
.partner-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 20px 0;
}

.partner-logos img {
  max-height: 80px;
  width: auto;
  opacity: .85;
  transition: opacity var(--transition);
}

.partner-logos img:hover {
  opacity: 1;
}

/* --- Footer --- */
.site-footer {
  background: var(--primary-dark);
  color: var(--white);
  text-align: center;
  padding: 30px 0;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  list-style: none;
  margin-bottom: 14px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3);
  color: var(--white);
  font-size: 1.1rem;
  transition: all var(--transition);
}

.social-links a svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.social-links a:hover {
  background: var(--white);
  color: var(--primary);
}

.site-footer .copyright {
  font-size: .85rem;
  opacity: .7;
}

/* --- Scroll to Top --- */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background: var(--primary-light);
}

/* --- Three-col images --- */
.image-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.image-row-3 img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 6px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 992px) {
  .col-half { flex: 0 0 100%; }
  .col-third { flex: 0 0 calc(50% - 15px); }
  .col-two-thirds { flex: 0 0 100%; }
  .benefit-cards { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 2rem; }
  .image-row-3 { grid-template-columns: 1fr; }
  .image-row-3 img { height: 280px; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .main-nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
  }

  .main-nav.open { display: block; }

  .main-nav ul {
    flex-direction: column;
  }

  .main-nav a {
    line-height: 1.4;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .main-nav .sub-menu {
    position: static;
    box-shadow: none;
    background: rgba(0,0,0,.15);
  }

  .main-nav li:hover > .sub-menu {
    display: block;
  }

  .hero-slider { height: 260px; }
  .page-hero { padding: 40px 0; }
  .page-hero h1 { font-size: 1.8rem; }
  section { padding: 40px 0; }

  .row { gap: 20px; }
  .alternating-section:nth-child(even) .row { flex-direction: column; }

  .benefit-cards { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }

  .testimonial-slide { padding: 20px 16px; }
}

@media (max-width: 480px) {
  .header-inner { height: 60px; }
  .site-logo img { height: 40px; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.4rem; }
  .hero-slider { height: 200px; }
  .btn { padding: 10px 20px; font-size: .85rem; }
}
