/* Multidisciplinary Sydney Pain — shared site styles
   Colours and fonts sampled from multidisciplinarysydneypain.com.au */

:root {
  --bg-page: #F4F6FF;
  --bg-panel: #DDE4FF;
  --bg-panel-80: rgba(221, 228, 255, 0.8);
  --color-primary: #2952D9;
  --color-text: #2952D9;
  --color-button-bg: #1B3898;
  --color-button-text: #F4F6FF;
  --font-heading: 'Poppins', Arial, Helvetica, sans-serif;
  --font-body: 'Poppins', Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--color-text);
  font-family: var(--font-body);
}

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

a { text-decoration: none; color: inherit; }

ul { margin: 0; padding: 0; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-page);
  border-bottom: 1px solid var(--bg-panel);
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  max-width: 1280px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand svg { width: 34px; height: 34px; }

.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
  color: var(--color-primary);
}

.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
  flex-wrap: wrap;
}

.main-nav a {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--color-primary);
  white-space: nowrap;
}

.main-nav a.active,
.main-nav a:hover {
  text-decoration: underline;
}

.btn-bookings {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: 50px;
  padding: 10px 22px;
  flex-shrink: 0;
}

.btn-bookings:hover { background: var(--bg-panel); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background: url('../images/hero-sand-dunes.jpg') center / cover no-repeat;
  padding: 90px 24px;
  display: flex;
  justify-content: center;
}

.hero-card {
  background: var(--bg-panel-80);
  max-width: 760px;
  width: 100%;
  padding: 56px 48px;
  text-align: center;
  border-radius: 4px;
}

.hero-card h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 48px;
  line-height: 1.15;
  margin: 0 0 28px;
  color: var(--color-primary);
}

.hero-card p {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 20px;
}

.btn-primary {
  display: inline-block;
  margin-top: 12px;
  background: var(--color-button-bg);
  color: var(--color-button-text);
  font-family: 'Poppins', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .3px;
  padding: 16px 40px;
  border-radius: 2px;
}

.btn-primary:hover { opacity: .9; }

/* ---------- Page header (non-home pages) ---------- */

.page-hero {
  padding: 64px 24px 40px;
  text-align: center;
}

.page-hero h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 40px;
  color: var(--color-primary);
  margin: 0 0 20px;
}

.page-hero p {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.7;
  max-width: 900px;
  margin: 0 auto 14px;
}

/* ---------- Areas of Expertise ---------- */

.expertise {
  background: var(--bg-panel-80);
  padding: 70px 24px;
}

.expertise h2 {
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 32px;
  color: var(--color-primary);
  margin: 0 0 50px;
}

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
}

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

.expertise-card .thumb {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 18px;
}

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

.expertise-card h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 12px;
  color: var(--color-primary);
}

.expertise-card p {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* ---------- Consultations ---------- */

.consultations {
  padding: 70px 24px;
}

.consultations h2 {
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 32px;
  color: var(--color-primary);
  margin: 0 0 46px;
}

.consult-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.consult-grid h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 19px;
  margin: 0 0 10px;
  color: var(--color-primary);
}

.consult-grid p {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 15px;
  margin: 0;
}

/* ---------- Generic content sections (Locations / Conditions / Procedures) ---------- */

.content-section {
  padding: 50px 24px;
}

.content-section.alt {
  background: var(--bg-panel-80);
}

.content-section h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 28px;
  color: var(--color-primary);
  margin: 0 0 24px;
  text-align: center;
}

/* Locations */

.office-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto 10px;
  text-align: center;
}

.office-cards .icon {
  font-size: 30px;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.office-cards h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 8px;
  color: var(--color-primary);
}

.office-cards p {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 14px;
  margin: 2px 0;
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 34px;
  max-width: 1140px;
  margin: 0 auto;
}

.location-grid.single {
  grid-template-columns: repeat(4, 1fr);
}

.location-card h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  text-align: center;
  color: var(--color-primary);
  margin: 0 0 14px;
}

.location-card ul {
  list-style: none;
  text-align: center;
}

.location-card li {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 4px;
}

.location-card li a { color: var(--color-primary); text-decoration: underline; }

/* Conditions we treat */

.condition-block {
  max-width: 900px;
  margin: 0 auto 56px;
}

.condition-block h2 {
  text-align: left;
  font-size: 26px;
}

.condition-block > p {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 20px;
}

.condition-block h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-primary);
  margin: 18px 0 8px;
}

.condition-block ul {
  list-style: disc;
  padding-left: 22px;
}

.condition-block li {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 6px;
}

/* Conditions A-Z interactive grid */

.conditions-grid-section {
  padding: 20px 24px 60px;
}

.conditions-grid-section .section-intro {
  max-width: 900px;
  margin: 0 auto 40px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}

.conditions-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 26px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.condition-card {
  background: none;
  border: none;
  padding: 10px 8px 0;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  border-radius: 10px;
  transition: background .15s ease, transform .15s ease;
}

.condition-card:hover,
.condition-card:focus-visible {
  background: var(--bg-panel);
  transform: translateY(-2px);
  outline: none;
}

.condition-card .condition-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  color: var(--color-primary);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.condition-card .condition-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto;
  border: 3px solid var(--bg-panel);
}

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

/* Condition info modal — deliberately black / white / Times New Roman per spec */

.condition-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.condition-modal-overlay[hidden] { display: none; }

.condition-modal {
  background: #000000;
  color: #ffffff;
  font-family: 'Times New Roman', Times, serif;
  font-size: 14px;
  line-height: 1.6;
  max-width: 680px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  padding: 34px 38px;
  border-radius: 6px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.condition-modal h3 {
  font-family: 'Times New Roman', Times, serif;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 16px;
  padding-right: 30px;
}

.condition-modal p {
  font-family: 'Times New Roman', Times, serif;
  font-size: 14px;
  color: #ffffff;
  margin: 0 0 14px;
}

.condition-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #ffffff;
  font-family: Arial, sans-serif;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.condition-modal-close:hover { opacity: .7; }

@media (max-width: 1000px) {
  .conditions-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .conditions-grid { grid-template-columns: repeat(2, 1fr); }
  .condition-modal { padding: 26px 22px; }
}

/* Procedures */

.procedures-intro {
  max-width: 900px;
  margin: 0 auto 40px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.7;
  text-align: center;
}

.procedure-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.procedure-group h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-primary);
  margin: 0 0 12px;
}

.procedure-group ul {
  list-style: disc;
  padding-left: 20px;
}

.procedure-group li {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 6px;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bg-panel);
  padding: 50px 24px 30px;
  margin-top: 20px;
}

.footer-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto 34px;
}

.footer-logos img {
  max-height: 60px;
  width: auto;
}

.footer-contact {
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 22px;
}

.footer-contact a { text-decoration: underline; }

.footer-brand {
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.footer-copy {
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 13px;
  margin-top: 14px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .expertise-grid { grid-template-columns: repeat(2, 1fr); }
  .office-cards { grid-template-columns: repeat(2, 1fr); }
  .location-grid { grid-template-columns: repeat(2, 1fr); }
  .consult-grid { grid-template-columns: 1fr; }
  .procedure-groups { grid-template-columns: 1fr; }
  .main-nav ul { gap: 16px; }
}

@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; }
  .main-nav ul { justify-content: center; }
  .expertise-grid { grid-template-columns: 1fr; }
  .office-cards { grid-template-columns: 1fr; }
  .location-grid { grid-template-columns: 1fr; }
  .hero-card { padding: 36px 24px; }
  .hero-card h1 { font-size: 32px; }
}


.category-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  color: var(--color-primary);
  text-align: center;
  margin: 46px 0 26px;
}
.category-heading:first-child { margin-top: 0; }

/* ==========================================================================
   Added: Procedures / Conditions hover-grid + individual detail pages
   ========================================================================== */

/* ---- Shared 4-across grid with hover(2s) tooltip + optional link ---- */

.item-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 44px 28px;
  max-width: 1180px;
  margin: 0 auto;
}

.item-card {
  position: relative;
  text-align: center;
}

.item-card .item-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.item-card .item-link.not-linked {
  cursor: default;
}

.item-card .item-name {
  font-family: 'Times New Roman', Times, serif;
  font-size: 14pt;
  color: #000;
  line-height: 1.3;
  min-height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 12px;
}

.item-card .item-image-box {
  width: 10cm;
  height: 10cm;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.item-card .item-image-box.has-image {
  border: 1px solid #ccc;
  background: #fafafa;
}

.item-card .item-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-card .item-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 10px;
  width: 300px;
  max-width: 85vw;
  background: #000;
  color: #fff;
  font-family: 'Times New Roman', Times, serif;
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
  padding: 16px 18px;
  border-radius: 6px;
  z-index: 60;
  box-shadow: 0 14px 34px rgba(0,0,0,.4);
}

.item-card.tooltip-visible .item-tooltip {
  display: block;
}

@media (max-width: 1000px) {
  .item-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .item-grid { grid-template-columns: repeat(2, 1fr); }
  .item-card .item-image-box { width: 8cm; height: 8cm; }
}
@media (max-width: 420px) {
  .item-grid { grid-template-columns: 1fr; }
}

/* ---- Individual procedure / condition detail pages ---- */

.detail-back-link {
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 0 24px;
}

.detail-back-link a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-primary);
  text-decoration: underline;
}

.detail-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 24px 70px;
}

.detail-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 20pt;
  font-weight: bold;
  color: #000;
  text-align: center;
  margin: 0 0 34px;
}

.detail-layout-wrap {
  width: 100%;
  overflow-x: auto;
}

.detail-layout {
  border-collapse: collapse;
  margin: 0 auto;
}

.detail-layout td {
  vertical-align: top;
  padding: 0 20px;
}

.detail-text {
  font-family: 'Times New Roman', Times, serif;
  font-size: 13pt;
  line-height: 1.65;
  color: #000;
  width: 500px;
  max-width: 46vw;
}

.detail-text p {
  margin: 0 0 16px;
}

.detail-image-cell {
  width: 20cm;
  text-align: center;
}

.detail-image-cell img {
  width: 20cm;
  height: 20cm;
  object-fit: cover;
  border: 1px solid #ccc;
  background: #fafafa;
}

.detail-image-placeholder {
  display: inline-block;
  width: 20cm;
  height: 20cm;
}

@media (max-width: 900px) {
  .detail-layout, .detail-layout tbody, .detail-layout tr, .detail-layout td {
    display: block;
    width: 100% !important;
  }
  .detail-layout td { padding: 0 0 24px; }
  .detail-image-cell img, .detail-image-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

/* ---- Procedures-page-only overrides (Procedures.html) ---- */

/* Fix: a grid column's minimum width defaults to the size of its content
   (here, a fixed 10cm image box), so a full 4-across row could demand more
   width than the grid's own max-width and spill past the right edge of the
   page -- shrinking the right-hand margin to nothing on rows with 4 items
   while rows with fewer items stayed correctly centered. Allowing the
   column (and therefore the fixed-size image box inside it, via its
   existing max-width:100%) to shrink below its content size keeps every
   row -- full or partial -- inside the same centered box, so the left and
   right margins end up equal everywhere on the page. */
.procedures-grid-instance .item-card {
  min-width: 0;
}

/* Larger, bolder procedure names */
.procedures-grid-instance .item-card .item-name {
  font-size: 16pt;
  font-weight: bold;
}

/* The row-to-row gap itself stays at the shared default (see .item-grid
   above); JS (hover-grid.js) measures each row's own tallest hover
   dropdown and adds exactly as much extra space below that specific row
   as it needs, so short-text rows stay compact and only the rows with
   long descriptions get pushed further apart. */

/* Bigger, more spaced-out category headings (e.g. "Epidural Steroid
   Injections", "Sympathetic & Ganglion Blocks") */
.category-heading.procedures-heading {
  font-size: 30px;
  margin-bottom: 78px;
}

/* ---- Conditions We Treat-page-only overrides (same treatment as the
   Procedures page above: equal margins fix, larger bold condition names,
   bigger/more-spaced category headings). Per-row dropdown-overlap spacing
   and row image-alignment are handled generically by hover-grid.js for
   both grids. ---- */
.conditions-grid-instance .item-card {
  min-width: 0;
}

.conditions-grid-instance .item-card .item-name {
  font-size: 16pt;
  font-weight: bold;
}

.category-heading.conditions-heading {
  font-size: 30px;
  margin-bottom: 78px;
}
