/* PMR Centre — mobile & accessibility repairs.
 *
 * Loaded AFTER the theme's own stylesheets so the existing desktop design is
 * left exactly as-is; this only corrects defects that appear on small screens
 * and a few accessibility issues.
 *
 * What was broken before this file:
 *   - The header logo image (1000px wide) forced the page wider than the
 *     viewport, so every page scrolled sideways on a phone.
 *   - The three homepage boxes overflowed the right edge; the Centre Timings
 *     values (8am-6pm / CLOSED) were pushed outside the viewport entirely and
 *     could not be read at all on a phone.
 *   - Tap targets were below the 44px minimum.
 */

/* ------------------------------------------------------------------ *
 * 1. Stop horizontal overflow (the root cause of the cut-off layout)
 * ------------------------------------------------------------------ */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

img, svg, video, iframe, table {
  max-width: 100%;
}
img { height: auto; }

@media screen and (max-width: 767px) {
  /* The theme's fixed-width grid is the reason content was clipped. */
  .site_container,
  .page,
  .header,
  .header_container,
  .content,
  .footer_container,
  .footer {
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  /* The oversized wordmark was the main overflow culprit. */
  .header_left img,
  .logo img {
    max-width: 100%;
    height: auto;
  }

  /* Homepage / footer boxes: stack instead of sitting in a fixed row. */
  .home_box_container,
  .footer_box_container {
    display: block !important;
    width: 100% !important;
  }
  .home_box,
  .footer_box {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 0 14px 0 !important;
    box-sizing: border-box;
  }

  /* Opening-hours rows: the values were positioned off-screen. Lay them out
     as a flex row so label and value both stay inside the viewport. */
  .items_list li,
  .opening_hours li {
    display: flex !important;
    justify-content: space-between;
    gap: 12px;
    width: auto !important;
    float: none !important;
  }
  .items_list li .value,
  .opening_hours li .value {
    float: none !important;
    position: static !important;
    text-align: right;
    white-space: nowrap;
  }

  /* Generic de-floating so columns stack rather than clip. */
  .one_half, .one_third, .two_third, .one_fourth, .three_fourth,
  .column, .col, .sidebar, .main_content, .blog_item, .team_member {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }

  /* Tables and code blocks scroll inside themselves rather than the page. */
  table { display: block; overflow-x: auto; }

  /* The nav collapses to a <select> on mobile - make it a proper tap target. */
  select {
    width: 100%;
    min-height: 44px;
    font-size: 16px; /* < 16px makes iOS Safari zoom on focus */
    box-sizing: border-box;
  }
}

/* ------------------------------------------------------------------ *
 * 2. Accessibility
 * ------------------------------------------------------------------ */

/* Minimum tap target for interactive elements. */
a.more, .button, button, input[type="submit"], input[type="button"] {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Form controls at 16px+ so iOS doesn't zoom the page on focus. */
input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], input[type="date"], textarea, select {
  font-size: 16px;
  min-height: 44px;
  box-sizing: border-box;
  max-width: 100%;
}
textarea { min-height: 120px; }

/* The theme removes focus outlines; restore a visible one for keyboard and
   switch-access users. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #d94a10 !important;
  outline-offset: 2px;
}

/* Skip link for keyboard users. */
.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 9999;
  background: #29a7df;
  color: #fff;
  padding: 12px 18px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 0 0 6px 6px;
  transition: top .15s;
}
.skip-link:focus { top: 0; color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------------ *
 * 3. Performance / layout stability
 * ------------------------------------------------------------------ */

/* Reserve space for images so content doesn't jump as they load. */
.blog_item img, .team_member img, .home_box img { background: #f0f4f7; }

/* ------------------------------------------------------------------ *
 * 4. Slider overflow
 *
 * .slider li sets a fixed 670px height with no background-size, so the
 * background renders at its natural width (1000-1600px) and pushes the page
 * sideways on a phone. responsive.css only constrains height, not width, so
 * the overflow survived. Constrain to the viewport and scale to fit.
 * ------------------------------------------------------------------ */
@media screen and (max-width: 767px) {
  ul.slider,
  .slider {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
  }
  .slider li {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 190px;
    background-size: contain !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
  }

  /* The content box is pulled up by a large negative margin sized for the
     desktop slider; that lands it off-screen once the slider shrinks. */
  .slider_content_box {
    margin-top: 0 !important;
    min-height: 0 !important;
    position: static !important;
    padding: 0 !important;
  }
  .slider_content {
    position: static !important;
    width: auto !important;
    max-width: 100% !important;
  }
  .slider_content h1.title { font-size: 1.6rem !important; line-height: 1.2 !important; }
  .slider_content .subtitle { font-size: 1rem !important; }

  /* Slider arrows/pagination are decorative and cramped on a phone. */
  .slider_navigation { display: none !important; }
}

/* ================================================================== *
 * 5. Blog index — card grid
 *
 * Replaces the old single-column list that showed 2 posts per page
 * (11 pages for 22 posts). Scoped entirely to .blog_wide so no other
 * page that uses .post / .blog is affected.
 * ================================================================== */

.blog_wide {
  width: 100%;
  float: none;
  clear: both;
  padding-bottom: 10px;
}

.blog_intro {
  font-size: 16px;
  line-height: 1.6;
  color: #6a7480;
  max-width: 62ch;
  margin: 0 0 26px;
}

/* --- featured lead post --- */
.blog_featured {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e2e8ee;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 28px;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.blog_featured:hover {
  box-shadow: 0 10px 28px rgba(16, 42, 67, .13);
  border-color: #bcd4e6;
  transform: translateY(-2px);
}
.blog_featured_media {
  overflow: hidden;
  background: #eaf2f8;
  max-height: 380px;
}
.blog_featured_media img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  max-height: 380px;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.blog_featured:hover .blog_featured_media img { transform: scale(1.02); }
.blog_featured_body { padding: 24px 26px 26px; }
.blog_featured_body h2 {
  font-size: 26px;
  line-height: 1.25;
  margin: 6px 0 8px;
  color: #123a5a;
}
.blog_featured:hover .blog_featured_body h2 { color: #29a7df; }

.blog_tag {
  display: inline-block;
  background: #29a7df;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
}

/* --- grid --- */
.blog_grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.blog_card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e2e8ee;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.blog_card:hover {
  box-shadow: 0 10px 24px rgba(16, 42, 67, .12);
  border-color: #bcd4e6;
  transform: translateY(-3px);
}

.blog_card_media {
  position: relative;
  height: 180px;
  background: #eaf2f8;
  overflow: hidden;
  flex: none;
}
.blog_card_media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.blog_card:hover .blog_card_media img { transform: scale(1.04); }

/* Placeholder for the posts that have no usable image, so the grid keeps a
   consistent rhythm instead of showing a broken or stretched thumbnail. */
.blog_card_placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eaf4fa 0%, #d8e9f4 100%);
  color: #a8c9de;
}
.blog_card_placeholder svg { width: 46px; height: 46px; }

.blog_card_body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.blog_card_body h3 {
  font-size: 17px;
  line-height: 1.35;
  margin: 4px 0 8px;
  color: #123a5a;
}
.blog_card:hover .blog_card_body h3 { color: #29a7df; }

.blog_meta {
  font-size: 12px;
  color: #8a95a1;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.blog_dot { margin: 0 6px; }

.blog_excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: #5c6672;
  margin: 0 0 14px;
  /* Clamp so uneven excerpt lengths don't make the grid ragged. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog_featured .blog_excerpt { -webkit-line-clamp: 4; font-size: 15px; }

.blog_card .more,
.blog_featured .more {
  margin-top: auto;
  align-self: flex-start;
  font-size: 13px;
  font-weight: bold;
  color: #29a7df;
}

/* --- pagination --- */
.blog_pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 34px 0 10px;
}
.blog_page_link {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7e0e8;
  border-radius: 6px;
  background: #fff;
  color: #123a5a;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
}
.blog_page_link:hover { background: #eaf2f8; border-color: #bcd4e6; color: #123a5a; }
.blog_page_link.is_current {
  background: #29a7df;
  border-color: #29a7df;
  color: #fff;
  cursor: default;
}

/* --- responsive --- */
@media screen and (max-width: 1000px) {
  .blog_grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog_featured_body h2 { font-size: 22px; }
}
@media screen and (max-width: 640px) {
  .blog_grid { grid-template-columns: 1fr; gap: 18px; }
  .blog_featured_body { padding: 18px; }
  .blog_featured_body h2 { font-size: 20px; }
  .blog_featured_media img { max-height: 220px; }
  .blog_card_media { height: 165px; }
}

@media (prefers-reduced-motion: reduce) {
  .blog_card, .blog_featured,
  .blog_card_media img, .blog_featured_media img { transition: none !important; transform: none !important; }
}

/* ================================================================== *
 * 6. Homepage — blog preview grid
 * Reuses the .blog_card styling from the blog index (section 5) so the
 * two stay visually identical; only the container differs.
 * ================================================================== */
.home_blog_grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 18px;
}
@media screen and (max-width: 1000px) {
  .home_blog_grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 640px) {
  .home_blog_grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ================================================================== *
 * 7. Patient Portal launch banner
 * ================================================================== */
.portal_banner {
  margin: 34px 0 6px;
  border-radius: 12px;
  background: linear-gradient(120deg, #12466b 0%, #1b6d9e 55%, #29a7df 100%);
  color: #fff;
  overflow: hidden;
  position: relative;
}
/* Soft highlight so the flat gradient doesn't read as a plain block. */
.portal_banner::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  pointer-events: none;
}
.portal_banner_inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 32px 34px;
  position: relative;
  z-index: 1;
}
.portal_banner_text { flex: 1 1 auto; min-width: 0; }

.portal_badge {
  display: inline-block;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .38);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 3px;
  margin-bottom: 12px;
}
.portal_banner h2 {
  color: #fff;
  font-size: 27px;
  line-height: 1.25;
  margin: 0 0 8px;
}
.portal_lead {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .93);
  margin: 0 0 16px;
  max-width: 56ch;
}
.portal_features {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 22px;
}
.portal_features li {
  position: relative;
  padding-left: 26px;
  font-size: 14.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .95);
}
/* Tick built in CSS - no extra image request. */
.portal_features li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 6px;
  height: 11px;
  border: solid rgba(255, 255, 255, .95);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.portal_actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.portal_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  background: #fff;
  color: #12466b !important;
  border-radius: 7px;
  font-weight: bold;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .16);
  transition: transform .18s ease, box-shadow .18s ease;
}
.portal_btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
  color: #0d3552 !important;
}
.portal_note {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .82);
  max-width: 34ch;
}

/* Decorative phone mock */
.portal_banner_visual { flex: 0 0 auto; }
.portal_phone {
  width: 150px;
  height: 240px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .12);
  border: 2px solid rgba(255, 255, 255, .3);
  padding: 14px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}
.portal_phone_screen {
  background: rgba(255, 255, 255, .95);
  border-radius: 10px;
  height: 100%;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.portal_phone_bar { display: block; height: 9px; width: 55%; border-radius: 3px; background: #29a7df; }
.portal_phone_line { display: block; height: 6px; border-radius: 3px; background: #d5e3ee; }
.portal_phone_line.w70 { width: 70%; }
.portal_phone_line.w50 { width: 50%; }
.portal_phone_card { display: block; height: 40px; border-radius: 6px; background: #eaf2f8; border-left: 3px solid #29a7df; }

@media screen and (max-width: 900px) {
  .portal_banner_visual { display: none; }   /* decorative only */
  .portal_features { grid-template-columns: 1fr; }
}
@media screen and (max-width: 640px) {
  .portal_banner_inner { padding: 24px 20px; }
  .portal_banner h2 { font-size: 22px; }
  .portal_lead { font-size: 15px; }
  .portal_actions { gap: 12px; }
  .portal_btn { width: 100%; }
  .portal_note { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .portal_btn { transition: none !important; }
}

/* ================================================================== *
 * 8. Homepage banner boxes — fixed-height overflow
 *
 * .home_box sets height:159px. The OPD Days box carries two clinic
 * schedules and overflows it, so its "Read more" link escaped the box and
 * floated loose underneath (visible on the live site too). Equal-height
 * flex columns keep the row aligned while letting content set the height.
 * Scoped to .home_box_container so the sidebar's .home_box list on the
 * specialities page is untouched.
 * ================================================================== */
@media screen and (min-width: 768px) {
  ul.home_box_container {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
  }
  ul.home_box_container > .home_box {
    height: auto;
    min-height: 159px;
    display: flex;
    flex-direction: column;
  }
  ul.home_box_container > .home_box .news {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
  }
  /* Pin the call-to-action to the bottom so all three line up. */
  ul.home_box_container > .home_box .more {
    margin-top: auto;
    align-self: flex-start;
  }
}

/* Homepage blog preview sits in the narrow left column beside the
   specialities sidebar; two columns keeps titles and excerpts readable. */
.home_blog_grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media screen and (max-width: 640px) {
  .home_blog_grid { grid-template-columns: 1fr; }
}

/* ================================================================== *
 * 9. Two-column page layout below 767px
 *
 * .page_left (float:left; width:630px -> 475px at <=1009px) and
 * .page_right (float:right; width:330px -> 250px) keep those fixed widths
 * all the way down: responsive.css only ever adds `margin-top:50px` to
 * .page_right at <=767px and never clears the float or the width.
 *
 * Result between ~480px and 767px: the columns stack (too narrow to sit
 * side by side) but each keeps its fixed width, so the blog column is
 * pinned left and the specialities column pinned right, both with dead
 * space beside them.
 *
 * Section 1 de-floated .column/.sidebar/.one_half etc. but missed these
 * two, which are the classes this theme actually uses for page layout.
 * ================================================================== */
@media screen and (max-width: 767px) {
  .page_left,
  .page_right,
  .left_sidebar .page_left,
  .left_sidebar .page_right {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }

  /* Keep separation between the stacked columns, but less than the
     desktop-era 50px now that they sit directly on top of each other. */
  .page_right { margin-top: 28px !important; }

  /* Inner two-column splits used inside .columns wrappers. */
  .columns .column_left,
  .columns .column_right {
    width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* The theme pins several inner blocks to the old 475px column width. */
  .page_left .gallery,
  .page_left .blog,
  .page_left .post,
  .page_left .post_content {
    width: auto !important;
    max-width: 100% !important;
  }
}

/* ================================================================== *
 * 10. Tablet range (768px - 1009px) and remaining narrow-width gaps
 *
 * The theme is fixed-width, not fluid: .page is 990px, dropping to a hard
 * 750px for the whole 768-1009px range. At 875px that leaves ~125px of dead
 * space either side, so the content looks undersized - while the slider,
 * sized `auto 520px`, renders a 1000px-wide wordmark inside that 750px box
 * and gets clipped at both edges. Hence "some banners too large, some too
 * small" at the same viewport.
 *
 * Below 767px two further fixed widths survived: .sidebar_box (330px -> 250px)
 * which is what "Specialities" and "Make an Appointment" are built from, and
 * .home_box's height:159px.
 * ================================================================== */

/* --- containers become fluid instead of snapping to 750px --- */
@media screen and (min-width: 768px) and (max-width: 1009px) {
  .page,
  .header,
  .header_container,
  .footer,
  .footer_container,
  .page_layout {
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .page,
  .header,
  .footer {
    padding-left: 24px;
    padding-right: 24px;
  }

  /* Proportional columns so they track the viewport rather than staying
     475px / 250px inside a fluid parent. */
  .page_left  { width: 63% !important; }
  .page_right { width: 33% !important; }

  /* .sidebar_box is a fixed 250px; fill its column instead. */
  .sidebar_box { width: 100% !important; box-sizing: border-box; }

  /* Share the row evenly (the flex container comes from section 8). */
  ul.home_box_container > .home_box {
    width: auto !important;
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
  }
}

/* --- slider: scale to fit rather than overflow --- */
@media screen and (max-width: 1009px) {
  .slider li {
    background-size: contain !important;
    background-position: center center !important;
    height: auto !important;
    min-height: 210px;
  }
}
@media screen and (min-width: 768px) and (max-width: 1009px) {
  .slider li { min-height: 300px; }
  /* The content box is offset by a negative margin sized for the tall
     desktop slider; recentre it now the slider is shorter. */
  .slider_content_box { margin-top: -260px !important; }
}

/* --- remaining fixed widths below 767px --- */
@media screen and (max-width: 767px) {
  /* "Specialities" and "Make an Appointment" are .sidebar_box elements and
     kept their 250px width, so they never filled the stacked column. */
  .sidebar_box {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }

  /* height:159px is a desktop assumption; let content set the height so
     nothing is clipped once the boxes are full width. */
  ul.home_box_container > .home_box,
  .home_box {
    height: auto !important;
    min-height: 0 !important;
  }
}

/* ================================================================== *
 * 11. Footer banner boxes
 *
 * The footer's three call-to-action boxes use .footer_banner_box (NOT
 * .footer_box, which is the text-column class further down). It is fixed at
 * 270px, re-fixed to 416px at <=767px and 204px in the tablet range, so it
 * never filled the width at any narrow size. Both classes also carry fixed
 * heights that clip content once they go full width.
 * ================================================================== */
@media screen and (min-width: 768px) and (max-width: 1009px) {
  .footer_banner_box_container {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
  }
  .footer_banner_box_container > .footer_banner_box {
    width: auto !important;
    flex: 1 1 0;
    min-width: 0;
    height: auto !important;
    min-height: 60px;
    box-sizing: border-box;
  }
  .footer_box { width: 50% !important; box-sizing: border-box; }
}

@media screen and (max-width: 767px) {
  .footer_banner_box_container,
  .footer_box_container {
    display: block !important;
    width: 100% !important;
  }
  .footer_banner_box,
  .footer_box {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 0 12px 0 !important;
    padding-right: 20px !important;
    box-sizing: border-box;
  }
}

/* ================================================================== *
 * 12. Gallery / details blocks
 *
 * .gallery_box and .details_box (used by the team, facility, about-us and
 * booking pages) are pinned to fixed pixel widths - 375px / 352px in the
 * tablet block, and only reduced again below 479px. At exactly 480px they
 * therefore push ~14px past the viewport edge.
 * ================================================================== */
@media screen and (max-width: 767px) {
  .gallery_box,
  .details_box,
  .gallery_item_details_list .gallery_box,
  .gallery_item_details_list .details_box,
  .gallery_item_details_list .gallery_box img,
  .gallery_box img,
  .post_content,
  .post_content a.post_image img,
  .post_content .gallery_box img {
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .gallery_item_details_list .details_box .column_left,
  .gallery_item_details_list .details_box .column_right {
    width: 100% !important;
    float: none !important;
    margin-right: 0 !important;
  }
}

/* .gallery is fixed at 462px and is not always inside .page_left (the team
   page puts it at top level), so the earlier .page_left-scoped rule missed
   it. Its isotope items are only 225-267px wide and already fit; it is the
   container alone that overhangs a 480px viewport. */
@media screen and (max-width: 1009px) {
  .gallery,
  ul.gallery,
  .gallery.isotope {
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

/* ================================================================== *
 * 13. Mobile hamburger navigation (<= 767px)
 *
 * The theme's mobile menu was a <select>. It could not show hierarchy, was
 * not keyboard-friendly, and always read "Dietetics" because of a broken
 * selected-check. Replaced with a real disclosure menu.
 * ================================================================== */
.m_nav_toggle { display: none; }
.m_nav        { display: none; }

@media screen and (max-width: 1009px) {
  /* Retire the theme's <select> menu and the desktop dropdown bar. */
  .mobile_menu { display: none !important; }
  .sf-menu.header_right { display: none !important; }

  .m_nav_toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 6px 0;
    padding: 10px 14px;
    min-height: 44px;
    background: #fff;
    border: 1px solid #d7e0e8;
    border-radius: 7px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: bold;
    color: #123a5a;
    text-transform: uppercase;
    letter-spacing: .05em;
    float: right;
    clear: both;
  }
  .m_bar {
    display: block;
    width: 20px;
    height: 2px;
    background: #123a5a;
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
  }
  /* Stack the three bars into the icon. */
  .m_nav_toggle { position: relative; padding-left: 44px; }
  .m_bar { position: absolute; left: 14px; }
  .m_bar:nth-of-type(1) { top: 15px; }
  .m_bar:nth-of-type(2) { top: 21px; }
  .m_bar:nth-of-type(3) { top: 27px; }
  .m_nav_toggle[aria-expanded="true"] .m_bar:nth-of-type(1) { transform: translateY(6px) rotate(45deg); }
  .m_nav_toggle[aria-expanded="true"] .m_bar:nth-of-type(2) { opacity: 0; }
  .m_nav_toggle[aria-expanded="true"] .m_bar:nth-of-type(3) { transform: translateY(-6px) rotate(-45deg); }

  .m_nav {
    display: none;
    clear: both;
    width: 100%;
    background: #fff;
    border-top: 1px solid #e2e8ee;
    margin-top: 6px;
  }
  .m_nav.is_open { display: block; }

  .m_nav_list, .m_nav_list ul { list-style: none; margin: 0; padding: 0; }
  .m_nav_list > li { position: relative; border-bottom: 1px solid #e9eff4; }

  .m_nav_list a {
    display: block;
    padding: 14px 56px 14px 4px;
    min-height: 44px;
    font-size: 15px;
    font-weight: bold;
    color: #123a5a;
    text-decoration: none;
    box-sizing: border-box;
  }
  .m_nav_list a:hover { color: #29a7df; }

  /* Separate control for the submenu, so tapping the label still navigates
     and tapping the chevron only expands. */
  .m_sub_toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 51px;
    background: transparent;
    border: 0;
    border-left: 1px solid #e9eff4;
    cursor: pointer;
  }
  .m_sub_toggle::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 8px; height: 8px;
    margin: -6px 0 0 -4px;
    border: solid #5c6672;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: transform .2s ease;
  }
  .m_sub_toggle[aria-expanded="true"]::before { transform: rotate(-135deg); margin-top: -2px; }

  .m_has_sub > ul { display: none; background: #f6fafc; border-top: 1px solid #e9eff4; }
  .m_has_sub.is_open > ul { display: block; }
  .m_has_sub > ul > li { border-top: 1px solid #eaf1f6; }
  .m_has_sub > ul > li:first-child { border-top: 0; }
  .m_has_sub > ul a {
    padding: 12px 16px 12px 20px;
    font-weight: normal;
    font-size: 14.5px;
    color: #41586d;
  }

  .m_nav_cta { border-bottom: 0 !important; }
  .m_nav_cta a {
    background: #29a7df;
    color: #fff !important;
    text-align: center;
    border-radius: 7px;
    margin: 12px 0 4px;
    padding: 14px 10px !important;
  }
  .m_nav_cta a:hover { background: #1f8ec0; color: #fff !important; }
}

@media (prefers-reduced-motion: reduce) {
  .m_bar, .m_sub_toggle::before { transition: none !important; }
}

/* ================================================================== *
 * 14. Dropdown submenus on touch / tablet (>= 768px)
 *
 * The desktop bar is a superfish hover menu. On a touch device there is no
 * hover, so the first tap on "The Centre" or "Specialities" followed the
 * link straight away and the submenu was never reachable.
 *
 * Fix (see js/improvements.js): a click on a parent whose submenu is not
 * currently visible opens it instead of navigating; a second tap follows the
 * link. Mouse users are unaffected - hover has already opened the submenu by
 * the time they click, so the click passes through.
 * ================================================================== */
@media screen and (min-width: 1010px) {
  /* Chevron marking which items have a submenu. */
  /* .has_dropdown is applied by js/improvements.js only to items that
     actually contain a <ul>; HOME and BLOGS carry .submenu but have none. */
  .sf-menu > li.submenu.has_dropdown > a { position: relative; padding-right: 22px; }
  .sf-menu > li.submenu.has_dropdown > a::after {
    content: "";
    position: absolute;
    right: 8px; top: 50%;
    width: 6px; height: 6px;
    margin-top: -5px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: .75;
  }
  /* Reveal the same way superfish's hover rule does. Submenus are hidden
     with `top: -999em` (off-screen), NOT display:none, so overriding display
     alone would leave them parked off-screen. 44px matches the theme's own
     `.sf-menu li:hover ul { top: 44px }`. */
  .sf-menu > li.submenu.tap_open > ul {
    left: 0 !important;
    top: 44px !important;
    z-index: 99 !important;
  }
}

/* ================================================================== *
 * 15. Media placeholders
 * Departments and posts whose image was never uploaded (Dietetics,
 * Neurology, Psychology, Special Education, Speech Therapy) get a branded
 * placeholder instead of a broken image or a blurred upscale.
 * ================================================================== */
.media_box { display: block; position: relative; overflow: hidden; background: #eaf2f8; }
.media_box img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media_placeholder {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eaf4fa 0%, #d5e7f3 100%);
  color: #9dc3dc; min-height: 70px;
}
.media_placeholder svg { width: 34%; max-width: 46px; height: auto; }
.media_initial {
  position: absolute; font-weight: bold; font-size: 15px;
  color: #4a86ad; letter-spacing: .04em;
}
.thumb_media { width: 75px; height: 75px; border-radius: 4px; }
.thumb_media.media_placeholder { min-height: 75px; }
.thumb_media .media_initial { font-size: 13px; }

/* ================================================================== *
 * 16. Patient Portal phone mockup
 * Drawn in CSS so it needs no image request and stays sharp at any
 * density. The first attempt was a few grey bars and read as an empty
 * screen; this mirrors the portal's real layout.
 * ================================================================== */
.pp_phone {
  width: 190px; height: 380px; flex: none;
  border-radius: 26px; padding: 10px 8px;
  background: linear-gradient(160deg, #14324a 0%, #0d2537 100%);
  box-shadow: 0 16px 40px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.14);
}
.pp_screen {
  height: 100%; border-radius: 18px; background: #f4f8fb;
  display: flex; flex-direction: column; overflow: hidden;
}
.pp_topbar {
  background: #fff; padding: 9px 10px; display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid #e3ecf3;
}
.pp_logo { width: 15px; height: 15px; border-radius: 4px; background: #29a7df; flex: none; }
.pp_topbar_txt { font-size: 9px; font-weight: bold; color: #123a5a; letter-spacing: .02em; }
.pp_body { flex: 1; padding: 9px; display: flex; flex-direction: column; gap: 7px; }
.pp_greet { display: flex; flex-direction: column; gap: 4px; margin-bottom: 1px; }
.pp_line { display: block; height: 7px; border-radius: 3px; background: #c8dcea; }
.pp_line.pp_sm { height: 5px; background: #dbe8f1; }
.pp_w80 { width: 80%; } .pp_w70 { width: 70%; } .pp_w60 { width: 60%; }
.pp_w50 { width: 50%; } .pp_w40 { width: 40%; } .pp_w35 { width: 35%; } .pp_w30 { width: 30%; }
.pp_tiles { display: flex; gap: 5px; }
.pp_tile {
  flex: 1; background: #fff; border-radius: 7px; padding: 6px 3px;
  text-align: center; border: 1px solid #e3ecf3;
}
.pp_tile b { display: block; font-size: 13px; color: #1c7fb0; line-height: 1; }
.pp_tile span { display: block; font-size: 7px; color: #7b8b99; margin-top: 2px; }
.pp_card {
  background: #fff; border: 1px solid #e3ecf3; border-radius: 8px;
  padding: 8px; display: flex; flex-direction: column; gap: 5px; position: relative;
}
.pp_card_accent { border-left: 3px solid #29a7df; }
.pp_card_slim { opacity: .55; }
.pp_chip {
  align-self: flex-start; font-size: 6.5px; font-weight: bold; letter-spacing: .08em;
  text-transform: uppercase; color: #fff; background: #29a7df;
  padding: 2px 6px; border-radius: 3px;
}
.pp_pill {
  position: absolute; right: 8px; bottom: 8px;
  font-size: 7px; font-weight: bold; color: #fff; background: #1c7fb0;
  padding: 3px 8px; border-radius: 10px;
}
.pp_tabbar {
  background: #fff; border-top: 1px solid #e3ecf3; padding: 7px 12px;
  display: flex; justify-content: space-between;
}
.pp_tab { width: 16px; height: 4px; border-radius: 2px; background: #d9e6ef; }
.pp_tab_on { background: #29a7df; }

/* ================================================================== *
 * 17. Content pages (.pg_*) — About, Team, Facility, legal, portal page
 * ================================================================== */
.pg_wide { width: 100%; float: none; clear: both; }

.pg_hero {
  display: flex; align-items: center; gap: 34px;
  background: linear-gradient(120deg, #12466b 0%, #1b6d9e 55%, #29a7df 100%);
  border-radius: 12px; padding: 34px; color: #fff;
  margin-bottom: 30px; position: relative; overflow: hidden;
}
.pg_hero::after {
  content: ""; position: absolute; right: -110px; top: -110px;
  width: 340px; height: 340px; border-radius: 50%;
  background: rgba(255,255,255,.07); pointer-events: none;
}
.pg_hero_text { flex: 1 1 auto; min-width: 0; position: relative; z-index: 1; }
.pg_hero_visual { flex: none; position: relative; z-index: 1; }
.pg_hero h2 { color: #fff; font-size: 27px; line-height: 1.25; margin: 0 0 10px; }
.pg_badge {
  display: inline-block; background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.38); color: #fff;
  font-size: 11px; font-weight: bold; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 3px; margin-bottom: 12px;
}
.pg_lead { font-size: 16px; line-height: 1.65; color: rgba(255,255,255,.93); margin: 0 0 18px; max-width: 54ch; }

.pg_actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.pg_btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 7px;
  background: #fff; color: #12466b !important; font-weight: bold; font-size: 15px;
  text-decoration: none; box-shadow: 0 3px 12px rgba(0,0,0,.16);
  transition: transform .18s ease, box-shadow .18s ease;
}
.pg_btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.22); color: #0d3552 !important; }
.pg_btn_ghost {
  background: transparent; color: #fff !important;
  border: 2px solid rgba(255,255,255,.6); box-shadow: none;
}
.pg_btn_ghost:hover { background: rgba(255,255,255,.14); color: #fff !important; }
.pg_btn_light { background: #29a7df; color: #fff !important; }
.pg_btn_light:hover { background: #1f8ec0; color: #fff !important; }

.pg_section { margin: 0 0 34px; }
.pg_h2 {
  font-size: 21px; color: #123a5a; margin: 0 0 16px;
  padding-bottom: 9px; border-bottom: 2px solid #e2ecf3; position: relative;
}
.pg_h2::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 54px; height: 2px; background: #29a7df;
}
.pg_note { color: #5c6672; margin: 0 0 16px; max-width: 62ch; }

.pg_steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pg_steps li {
  background: #fff; border: 1px solid #e2e8ee; border-radius: 10px;
  padding: 22px 20px 20px; position: relative;
}
.pg_step_no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: #29a7df; color: #fff; font-weight: bold; font-size: 14px; margin-bottom: 10px;
}
.pg_steps h3 { font-size: 16px; color: #123a5a; margin: 0 0 6px; }
.pg_steps p { font-size: 14px; line-height: 1.6; color: #5c6672; margin: 0; }

.pg_grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pg_card {
  background: #fff; border: 1px solid #e2e8ee; border-radius: 10px; padding: 22px 20px;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.pg_card:hover { box-shadow: 0 10px 24px rgba(16,42,67,.10); border-color: #bcd4e6; transform: translateY(-2px); }
.pg_icon { font-size: 26px; display: block; margin-bottom: 10px; line-height: 1; }
.pg_card h3 { font-size: 16px; color: #123a5a; margin: 0 0 7px; }
.pg_card p { font-size: 14px; line-height: 1.6; color: #5c6672; margin: 0; }

.pg_contact_grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.pg_contact_card { background: #f5f9fc; border: 1px solid #e2e8ee; border-radius: 10px; padding: 18px; }
.pg_contact_card h3 { font-size: 15px; color: #123a5a; margin: 0 0 8px; }
.pg_contact_card p { font-size: 14.5px; line-height: 1.7; margin: 0; color: #5c6672; }
.pg_hours { background: #f5f9fc; border: 1px solid #e2e8ee; border-radius: 10px; padding: 18px; }
.pg_hours h3 { font-size: 15px; color: #123a5a; margin: 0 0 8px; }
.pg_hours p { margin: 0; color: #5c6672; line-height: 1.7; }

.pg_cta {
  background: #12466b; border-radius: 12px; padding: 30px; text-align: center; color: #fff;
}
.pg_cta h2 { color: #fff; font-size: 22px; margin: 0 0 6px; }
.pg_cta p { color: rgba(255,255,255,.88); margin: 0 0 18px; }

/* Long-form prose (legal pages, CMS body copy) */
.pg_doc {
  background: #fff; border: 1px solid #e2e8ee; border-radius: 10px;
  padding: 30px 40px; font-size: 15.5px; line-height: 1.75; color: #3f4a55;
}
.pg_doc h1, .pg_doc h2, .pg_doc h3, .pg_doc h4, .pg_doc strong b {
  color: #123a5a; line-height: 1.3;
}
.pg_doc h2 { font-size: 19px; margin: 28px 0 10px; }
.pg_doc h3 { font-size: 16.5px; margin: 22px 0 8px; }
.pg_doc h2:first-child, .pg_doc h3:first-child { margin-top: 0; }
.pg_doc p { margin: 0 0 14px; }
.pg_doc ul, .pg_doc ol { margin: 0 0 16px; padding-left: 22px; }
.pg_doc li { margin-bottom: 7px; }
.pg_doc a { color: #1c7fb0; text-decoration: underline; }
.pg_doc hr { border: 0; border-top: 1px solid #e6edf3; margin: 24px 0; }
.pg_doc table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.pg_doc th, .pg_doc td { border: 1px solid #e2e8ee; padding: 9px 12px; text-align: left; font-size: 14.5px; }
.pg_doc th { background: #f5f9fc; color: #123a5a; }

.pg_doc_aside {
  background: #f5f9fc; border: 1px solid #e2e8ee; border-radius: 10px;
  padding: 22px; margin-top: 24px;
}
.pg_doc_aside h2 { font-size: 17px; color: #123a5a; margin: 0 0 6px; }
.pg_doc_aside p { color: #5c6672; margin: 0 0 12px; line-height: 1.7; }
.pg_doc_aside .pg_btn_ghost { color: #12466b !important; border-color: #b7d2e4; }
.pg_doc_aside .pg_btn_ghost:hover { background: #e8f2f8; color: #0d3552 !important; }

.pg_cms { font-size: 15.5px; line-height: 1.75; color: #3f4a55; }

@media screen and (max-width: 1009px) {
  .pg_steps, .pg_grid { grid-template-columns: repeat(2, 1fr); }
  .pg_contact_grid { grid-template-columns: repeat(2, 1fr); }
}
@media screen and (max-width: 767px) {
  .pg_hero { flex-direction: column; align-items: flex-start; padding: 24px 20px; gap: 24px; }
  .pg_hero_visual { display: none; }
  .pg_hero h2 { font-size: 21px; }
  .pg_steps, .pg_grid, .pg_contact_grid { grid-template-columns: 1fr; }
  .pg_doc { padding: 22px 20px; font-size: 15px; }
  .pg_btn { width: 100%; }
  .pg_actions { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pg_btn, .pg_card { transition: none !important; }
}

/* ================================================================== *
 * 18. Instagram footer widget (replaces the empty "Latest Tweets" box)
 * ================================================================== */
.ig_widget { margin-top: 4px; }
.ig_grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.ig_item { display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 5px; background: #2a2a2a; }
.ig_item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.ig_item:hover img { transform: scale(1.06); }
.ig_follow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 14px 9px 10px; border-radius: 8px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  text-decoration: none; min-height: 44px; box-sizing: border-box;
}
.ig_follow:hover { background: rgba(255,255,255,.11); }
.ig_mark {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(45deg, #f9ce34 0%, #ee2a7b 50%, #6228d7 100%);
}
.ig_mark svg { width: 17px; height: 17px; }
.ig_follow_txt { display: flex; flex-direction: column; line-height: 1.3; }
.ig_follow_txt strong { color: #fff; font-size: 13.5px; }
.ig_follow_txt span { color: #9db8ca; font-size: 11.5px; }
@media (prefers-reduced-motion: reduce) { .ig_item img { transition: none !important; } }

/* SVG icons on the portal page. Emoji were used first but depend on a
   system emoji font and render as tofu boxes where one is missing. */
.pg_icon { display: block; margin-bottom: 12px; line-height: 0; }
.pg_icon svg {
  width: 30px; height: 30px;
  fill: none; stroke: #29a7df; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}

/* CMS prose often uses stacked <br> tags for spacing; collapse the runs so
   paragraphs don't drift apart. */
.pg_doc br + br { display: none; }
.pg_doc p:empty { display: none; }

/* Richer phone-mockup content (real labels instead of grey bars). */
.pp_avatar { width: 15px; height: 15px; border-radius: 50%; background: #d3e3ee; margin-left: auto; flex: none; }
.pp_topbar { align-items: center; }
.pp_greet { display: flex; flex-direction: column; gap: 1px; margin-bottom: 2px; }
.pp_hi  { font-size: 11px; font-weight: bold; color: #123a5a; }
.pp_sub { font-size: 7.5px; color: #8b9aa8; text-transform: uppercase; letter-spacing: .05em; }
.pp_row {
  display: flex; align-items: center; gap: 5px;
  font-size: 9px; color: #1f3a52; font-weight: bold;
}
.pp_row b { font-weight: bold; }
.pp_dot { width: 6px; height: 6px; border-radius: 50%; background: #29a7df; flex: none; }
.pp_meta { font-size: 7.5px; color: #8b9aa8; margin-top: 3px; }
.pp_card_dim { opacity: .78; }
.pp_pill {
  margin-left: auto; font-size: 7px; font-weight: bold; color: #fff;
  background: #1c7fb0; padding: 2px 8px; border-radius: 10px;
}
.pp_tag {
  margin-left: auto; font-size: 6.5px; font-weight: bold; letter-spacing: .05em;
  text-transform: uppercase; color: #1c7fb0; background: #e0f0f8;
  padding: 2px 6px; border-radius: 3px;
}

/* Phone mockup: let the body fill the screen height and add a quick-actions
   row so the lower area is not left empty. */
.pp_body { justify-content: flex-start; }
.pp_quick { display: flex; gap: 6px; margin-top: auto; }
.pp_qbtn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px;
  background: #eaf4fb; border: 1px solid #d3e6f2; border-radius: 7px;
  padding: 7px 4px; font-size: 8px; font-weight: bold; color: #1c7fb0;
}
.pp_qdot { width: 6px; height: 6px; border-radius: 2px; background: #29a7df; }
.pp_qdot2 { background: #1c7fb0; border-radius: 50%; }

/* ================================================================== *
 * 19. Header logo - full brand lockup
 * The horizontal lockup (pmr-logo-full.png, 1200x173) carries the icon,
 * "PMR CENTRE" wordmark and tagline, so the separate text span is gone.
 * Sized by height; the theme's fixed 320px .header_left is widened to fit.
 * ================================================================== */
.header_left { width: auto; }
.header_left a { padding: 0; }
.header_left a img.brand_logo {
  width: auto;
  max-width: 100%;
  margin-right: 0;
  float: none;
  display: block;
}
/* Desktop header is capped at 990px and the nav needs ~655px, so the logo
   must stay under ~330px wide (1200x173 lockup => ~46px tall) to share the
   row instead of pushing the nav to a second line. */
@media screen and (min-width: 1010px) {
  .header_left a img.brand_logo { height: 46px; }
  /* trim nav padding slightly so 6 items + logo fit comfortably */
  .sf-menu.header_right > li > a { padding-left: 12px; padding-right: 12px; }
}
@media screen and (min-width: 768px) and (max-width: 1009px) {
  .header_left a img.brand_logo { height: 42px; }
}
@media screen and (max-width: 767px) {
  .header_left a img.brand_logo { height: 40px; }
}
@media screen and (max-width: 400px) {
  .header_left a img.brand_logo { height: 34px; }
}

/* ================================================================== *
 * 21. Homepage hero (replaces the carouFredSel slider)
 *
 * The old slider was a 670px JS carousel that made the page feel oversized
 * and jumped on resize. This is a static, responsive hero: one team photo,
 * a brand-blue left-weighted gradient for text legibility, headline + CTAs.
 * No JavaScript, no resize recomputation.
 * ================================================================== */
.hero {
  background-size: cover;
  background-position: center 16%;
  background-repeat: no-repeat;
  color: #fff;
}
.hero_inner {
  width: min(100% - 2rem, 990px);
  margin: 0 auto;
  padding: 70px 0 76px;
  max-width: 990px;
}
.hero_eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7fd0f2;
  margin-bottom: 14px;
}
.hero_title {
  color: #fff;
  font-size: clamp(28px, 2rem + 1.6vw, 46px);
  line-height: 1.12;
  margin: 0 0 14px;
  max-width: 16ch;
  font-family: 'PT Sans', system-ui, sans-serif;
  font-weight: 700;
}
.hero_sub {
  font-size: clamp(15px, 1rem + .3vw, 18px);
  line-height: 1.6;
  color: rgba(255,255,255,.92);
  margin: 0 0 26px;
  max-width: 52ch;
}
.hero_actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.hero_btn_primary {
  background: #29a7df;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
}
.hero_btn_primary:hover { background: #1f8ec0; transform: translateY(-1px); box-shadow: 0 7px 20px rgba(0,0,0,.28); }
.hero_btn_ghost {
  background: rgba(255,255,255,.10);
  color: #fff !important;
  border: 2px solid rgba(255,255,255,.65);
}
.hero_btn_ghost:hover { background: rgba(255,255,255,.20); transform: translateY(-1px); }

@media screen and (min-width: 768px) and (max-width: 1009px) {
  .hero_inner { padding: 54px 24px 58px; }
}
@media screen and (max-width: 767px) {
  .hero { background-position: center 18%; }
  .hero_inner { padding: 44px 0 48px; }
  .hero_title { max-width: none; }
  .hero_btn { width: 100%; }
  .hero_actions { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .hero_btn { transition: none !important; } }

/* FAQ accordion (booking page). Native <details> - no JS, keyboard
   accessible, and the answer text stays in the DOM for crawlers/answer
   engines even when collapsed. */
.faq_list { border-top: 1px solid #e2e8ee; }
.faq_item { border-bottom: 1px solid #e2e8ee; }
.faq_item > summary {
  cursor: pointer; list-style: none; padding: 16px 40px 16px 2px;
  font-size: 16px; font-weight: 700; color: #123a5a; position: relative;
  min-height: 44px; display: flex; align-items: center;
}
.faq_item > summary::-webkit-details-marker { display: none; }
.faq_item > summary::after {
  content: ""; position: absolute; right: 10px; top: 50%;
  width: 9px; height: 9px; margin-top: -6px;
  border: solid #5c6672; border-width: 0 2px 2px 0;
  transform: rotate(45deg); transition: transform .2s ease;
}
.faq_item[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq_item > summary:hover { color: #29a7df; }
.faq_item p { margin: 0 0 18px; padding-right: 40px; color: #5c6672; line-height: 1.7; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .faq_item > summary::after { transition: none !important; } }

/* ================================================================== *
 * 22. Desktop dropdown submenu width & leading
 *
 * The theme sizes submenus at 190px with 160px items, and superfish sets
 * line-height:1.0 on .sf-menu. Long entries - "Physical Medicine &
 * Rehabilitation", "Refund and Cancellation" - therefore wrapped onto a
 * second line with no leading at all, so the two lines collided.
 *
 * Widened so the longest speciality fits on one line, with comfortable
 * leading for anything that still wraps. Desktop only; below 1010px the
 * hamburger menu has its own spacing.
 * ================================================================== */
@media screen and (min-width: 1010px) {
  .sf-menu li ul,
  .sf-menu li ul.wide {
    width: 268px !important;
  }
  /* superfish floats every <li> left; with width:auto the submenu entries
     flowed side by side instead of stacking, so un-float them too. */
  .sf-menu li ul li,
  .sf-menu li ul.wide li {
    float: none !important;
    clear: both !important;
    width: auto !important;
    display: block;
  }
  /* line-height:1.0 is inherited from superfish and is what made wrapped
     items unreadable. */
  .sf-menu li ul li a,
  .sf-menu li:hover ul a,
  .sf-menu li.submenu:hover ul a {
    line-height: 1.4 !important;
    padding: 11px 0 !important;
    white-space: normal;
  }
}
