/*
Theme Name: Hip Knee Surgeon
Theme URI: https://hipkneesurgeon.co.uk/
Author: Arun Kumar Practice
Description: Custom theme recreating the hipkneesurgeon.co.uk site design (surgeon profile, treatments, news, contact).
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: hipkneesurgeon
*/

:root {
  --color-accent: #9b0b12;      /* primary red accent (buttons, nav bg) */
  --color-header-bg: #998100;   /* header gold bar */
  --color-footer-bg: #4e0004;   /* dark red footer */
  --color-text: #444444;
  --color-text-light: #777777;
  --color-bg: #ffffff;
  --color-bg-alt: #f2f2f2;
  --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --container-width: 1140px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  font-size: 15px;
  line-height: 1.7;
}

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

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

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header — the top nav bar itself is red; gold is reserved for page/section
   titles within the content (see .treatment-title, .about-page h2 etc). */
.site-header {
  background: var(--color-accent);
  border-bottom: 1px solid #fff;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.site-logo a {
  display: block;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
}
.site-logo img {
  max-height: 60px;
  width: auto;
}
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.site-nav li { position: relative; }
.site-nav a {
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
}
/* Dropdown level 1 — e.g. Treatments' own panel. When it contains further
   nested items (Hip / Knee, each with their own list) it becomes a
   fixed-width two-column "mega menu" instead of a plain single-column
   dropdown; a plain dropdown (About, Contact, etc. if they ever get
   children) still just gets the single-column list below. */
.site-nav > ul > li > .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 260px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  padding: 20px 0;
  z-index: 50;
}
.site-nav > ul > li:hover > .sub-menu { display: flex; }

.site-nav > ul > li > .sub-menu > li {
  flex: 1 0 220px;
  padding: 0 24px;
}
.site-nav > ul > li > .sub-menu > li + li {
  border-left: 1px solid #eee;
}

/* Level-1 dropdown links (used when there's no further nesting) */
.site-nav .sub-menu a {
  color: var(--color-text);
  text-transform: none;
  font-weight: 400;
  padding: 8px 18px;
  display: block;
  font-size: 14px;
}
.site-nav .sub-menu a:hover { background: var(--color-bg-alt); text-decoration: none; }

/* Column headers (Hip / Knee) — static labels, not flyout triggers. Their
   own child list (the actual procedures) renders directly beneath them,
   always visible once the mega menu is open — no extra hover/tap needed. */
.site-nav > ul > li > .sub-menu > li > a {
  padding: 0 6px 10px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #222;
  border-bottom: 2px solid var(--color-accent);
  margin-bottom: 8px;
}
.site-nav > ul > li > .sub-menu > li > .sub-menu {
  position: static;
  display: block;
  box-shadow: none;
  padding: 0;
  min-width: 0;
}
.site-nav > ul > li > .sub-menu > li > .sub-menu a {
  padding: 8px 6px;
}

.header-phone { color: #fff; font-weight: 700; white-space: nowrap; }

.mobile-nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 26px; }

/* Hero — full-bleed background photo with overlaid text, left-aligned,
   matching the original site rather than a side-by-side photo/text card. */
.hero {
  min-height: 640px;
  background-size: cover;
  background-position: center top;
  display: flex;
  align-items: center;
  position: relative;
}
.hero-overlay { position: relative; width: 100%; }
/* Hero text sits in a semi-transparent dark box on the left, matching the
   original (rather than plain text over a gradient). */
.hero-text {
  max-width: 560px;
  color: #fff;
  background: rgba(0,0,0,0.35);
  padding: 40px 45px;
}
.hero-text .hero-name { font-size: 46px; font-weight: 700; letter-spacing: 0; margin: 0 0 14px; line-height: 1.1; }
.hero-text .credentials { color: rgba(255,255,255,0.9); font-size: 15px; margin: 0 0 18px; }
.hero-text h1 { font-size: 30px; margin: 0; color: #fff; font-weight: 700; line-height: 1.3; }

/* Scroll-down chevron centered at the bottom of the hero */
.hero-scroll {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  text-decoration: none;
  z-index: 2;
}
.hero-scroll:hover { background: rgba(255,255,255,0.15); text-decoration: none; }

/* Intro / bio — three column: portrait photo, bio copy, pull-quote */
.intro { padding: 60px 0; }
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 40px;
  align-items: start;
}
.intro-photo img { border-radius: 4px; }
/* Pull-quote — large, light weight, no border, matching the original. */
.intro-quote blockquote {
  margin: 0;
  font-size: 26px;
  font-weight: 400;
  color: #333;
  line-height: 1.35;
}
.text-center { text-align: center; }

/* Page title band — a full-width GOLD band with the page title centered
   in white. Matches the original, which shows this band on treatment
   pages and news (listing + articles) but NOT on Home, About or Contact. */
.page-title-bar {
  background: var(--color-header-bg);
  padding: 40px 0;
  text-align: center;
}
/* Plain centered page title (no band) — used on Contact, matching the
   original where Contact/About have no gold band. */
.plain-page-title { text-align: center; font-size: 30px; color: #222; margin: 0 0 30px; }
.page-title-bar h1 {
  color: #fff;
  font-size: 30px;
  text-transform: capitalize;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin: 0;
}

/* About page — plain centered title, no banner, centered photo, then a
   two-column flowing content area with the publications image inserted
   partway down, matching the original's layout. */
.about-page { padding-top: 40px; padding-bottom: 60px; }
.about-title { text-align: center; font-size: 30px; margin: 0 0 24px; color: #222; }
.about-photo { text-align: center; margin-bottom: 30px; }
.about-photo img { max-width: 320px; border: 1px solid #eee; padding: 6px; }
.about-page.section h2 { color: var(--color-header-bg); }

/* Two explicit columns built from real content chunks (see page-about.php)
   rather than CSS column-count auto-balancing, which left uneven gaps and
   made headings land unpredictably near a column break. */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  margin-bottom: 40px;
}
.about-col-left { text-align: center; }
.about-col-left ul { list-style: none; padding: 0; }
.about-col-right { text-align: left; }

.about-publications-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
}
.about-publications-grid ol { padding-left: 20px; }
.about-publications-grid li { margin-bottom: 14px; color: var(--color-text-light); }
/* Each publication title is a gold bold link (to PubMed etc.); the authors
   (em) and journal citation stay plain grey, matching the original. */
.about-publications-grid a { color: var(--color-header-bg); font-weight: 700; }
.about-publications-grid a:hover { color: var(--color-header-bg); text-decoration: underline; }
.about-pub-image img { max-width: 100%; border: 1px solid #eee; padding: 6px; }

@media (max-width: 780px) {
  .about-grid, .about-publications-grid { grid-template-columns: 1fr; }
  .about-col-right { text-align: center; }
}

/* Treatment pages — plain text title (no colored bar), two-column layout:
   content (8/12) + sidebar (4/12) with the booking form and lead image. */
.treatment-title { font-size: 28px; margin: 30px 0 20px; color: var(--color-header-bg); }
.treatment-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 50px; align-items: start; }
.sidebar-form-box { background: var(--color-bg-alt); padding: 24px; margin-bottom: 24px; }
.sidebar-form-box h2 { font-size: 18px; margin: 0 0 16px; }
.sidebar-image img { width: 100%; border: 1px solid #eee; padding: 6px; }
@media (max-width: 900px) {
  .treatment-layout { grid-template-columns: 1fr; }
}

/* Content sections */
.section { padding: 50px 0; }
.section-alt { background: var(--color-bg-alt); }
.section h2 { font-size: 24px; color: #222; margin-bottom: 20px; }

.entry-content h2 { font-size: 22px; margin-top: 34px; }
.entry-content h3 { font-size: 18px; margin-top: 24px; }
.entry-content p { margin: 0 0 18px; }
.entry-content ul, .entry-content ol { margin: 0 0 18px; padding-left: 22px; }

/* Testimonials — full-bleed parallax-style background image, one quote
   visible at a time, auto-rotating fade (see assets/js/main.js). */
.testimonials-section {
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  position: relative;
  padding: 90px 0;
}
.testimonials-overlay { background: rgba(0,0,0,0.55); padding: 60px 0; }
.testimonial-slider {
  position: relative;
  max-width: 760px;
  margin-left: auto;
  min-height: 140px;
}
.testimonial-slide {
  display: none;
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
  text-align: right;
}
.testimonial-slide.is-active { display: block; }

/* Clinic locations */
.clinics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; margin-top: 20px; }
.clinic-card { background: #fff; padding: 24px; border: 1px solid #e5e5e5; }
.clinic-card h3 { margin-top: 0; }
.clinic-map { display: block; border-radius: 3px; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.btn:hover { background: #7d090f; color: #fff; text-decoration: none; }

/* Contact form */
.wpcf7-form p { margin-bottom: 14px; }
.wpcf7-form input[type=text],
.wpcf7-form input[type=email],
.wpcf7-form input[type=tel],
.wpcf7-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  font-family: var(--font-body);
}
.wpcf7-form textarea { min-height: 140px; }
.wpcf7-form input[type=submit] {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 12px 30px;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
}

/* News — 3-column card grid (featured image, title, date, excerpt),
   matching the original listing layout. */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 34px;
}
.news-card-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-bg-alt);
}
.news-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card-title {
  font-size: 17px;
  line-height: 1.35;
  text-transform: uppercase;
  margin: 18px 0 8px;
  color: #333;
}
.news-card-title a { color: #333; }
.news-card-title a:hover { color: var(--color-accent); text-decoration: none; }
.news-card-date { font-style: italic; font-size: 13px; color: var(--color-text-light); margin: 0 0 10px; }
.news-card-excerpt { font-size: 14px; color: var(--color-text-light); }
.news-card-excerpt p { margin: 0; }

.news-pagination { margin-top: 40px; text-align: center; }
.page-numbers { display: inline-flex; gap: 8px; list-style: none; padding: 0; }
.page-numbers a, .page-numbers span { display: inline-block; padding: 6px 12px; border: 1px solid #ddd; }
.page-numbers .current { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

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

/* Footer */
.site-footer {
  background: var(--color-footer-bg);
  color: #f1e5e5;
  padding: 40px 0 20px;
  font-size: 14px;
}
.site-footer a { color: #f1e5e5; }
.footer-columns { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-col { flex: 1 1 220px; }
.footer-contact-list { list-style: none; margin: 12px 0 0; padding: 0; }
.footer-contact-list li { margin-bottom: 8px; }
.footer-col-badge { display: flex; align-items: flex-start; justify-content: center; }
.footer-col-badge img { max-width: 100%; height: auto; }
.footer-col-form h4 { margin-top: 0; }

/* CF7 form sitting on the dark footer background needs light fields,
   unlike the same shortcode rendered on the (white) Contact page. */
.footer-col-form .wpcf7-form input[type=text],
.footer-col-form .wpcf7-form input[type=email],
.footer-col-form .wpcf7-form input[type=tel],
.footer-col-form .wpcf7-form textarea {
  background: rgba(255,255,255,0.95);
  border: none;
}
.footer-col-form .wpcf7-form input[type=submit] {
  background: #fff;
  color: var(--color-accent);
}
.footer-col-form .wpcf7-form input[type=submit]:hover { background: #f1e5e5; }

.footer-bottom { margin-top: 30px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.15); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12px; opacity: 0.85; }

/* Doctify reviews widget wrapper on the homepage */
.doctify-reviews { padding-top: 0; }

/* Cookie notice */
#cookie-notice {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #222;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  z-index: 999;
}
#cookie-notice a.btn { padding: 8px 18px; font-size: 12px; }

/* Responsive */
@media (max-width: 860px) {
  .site-nav { display: none; }
  .site-nav.is-open { display: block; }
  .mobile-nav-toggle { display: block; }
  .hero { min-height: 480px; text-align: center; }
  .hero-text { max-width: none; }
  .intro-grid { grid-template-columns: 1fr; text-align: center; }
  .intro-quote blockquote { border-left: none; border-top: 3px solid var(--color-accent); padding-left: 0; padding-top: 14px; }
  .testimonials-section { background-attachment: scroll; }
  .testimonial-slide { text-align: center; font-size: 16px; }
  .testimonial-slider { margin-left: 0; }
  .clinics { grid-template-columns: 1fr; }

  /* Mobile nav becomes a stacked accordion — hover doesn't exist on touch,
     so the top-level dropdown (e.g. Treatments) is shown/hidden by the
     .submenu-open class toggled in JS instead of the desktop :hover rule.
     Once open, its columns (Hip / Knee) and their procedure lists are all
     shown at once, stacked vertically — no further tapping needed, since
     only the very top level (Treatments itself) has a toggle button. */
  .site-nav ul { flex-direction: column; gap: 0; width: 100%; }
  .site-nav .sub-menu { position: static; box-shadow: none; min-width: 0; width: 100%; padding-left: 16px; }

  .site-nav > ul > li > .sub-menu { display: none; flex-direction: column; padding: 0; }
  .site-nav > ul > li.submenu-open > .sub-menu { display: flex; }
  .site-nav > ul > li > .sub-menu > li { padding: 12px 0 12px 16px; }
  .site-nav > ul > li > .sub-menu > li + li { border-left: none; border-top: 1px solid #eee; }
  .site-nav > ul > li > .sub-menu > li > a { border-bottom: none; padding: 0 0 8px; }
  .site-nav > ul > li > .sub-menu > li > .sub-menu a { padding: 8px 0 8px 12px; }

  .site-nav li { border-bottom: 1px solid rgba(255,255,255,0.15); }
  .site-nav .sub-menu li { border-bottom-color: rgba(0,0,0,0.08); }
  .site-nav a { padding: 12px 44px 12px 0; }

  .submenu-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
  }
  li.submenu-open > .submenu-toggle { transform: rotate(90deg); }
}
