/*
Theme Name: Humber Bay Sailing Centre
Description: Theme for the Humber Bay Sailing Centre website.
Version: 2.0.0
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: hbsc
*/

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("assets/fonts/montserrat.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("assets/fonts/source-sans-3.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 300 800;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-italic.woff2") format("woff2");
}

:root {
  --maroon: #860038;
  --maroon-deep: #5e0027;
  --maroon-tint: #f7e9ef;
  --ink: #1c2833;
  --navy: #1f3441;
  --sea: #2f4d5c;
  --sand: #f6f2ea;
  --line: #e4ded3;
  --muted: #5b6670;
  --white: #ffffff;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 18px 40px -22px rgba(28, 40, 51, 0.45);
  --wide: 1200px;
  --read: 860px;
  --font-head: "Montserrat", -apple-system, "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", -apple-system, "Segoe UI", sans-serif;
  --header-h: 76px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; text-wrap: balance; }
a { color: var(--maroon); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--maroon-deep); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--maroon); outline-offset: 2px; border-radius: 4px; }

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; z-index: 100;
  top: 12px; left: 12px; padding: 10px 16px;
  background: var(--white); color: var(--maroon); font-weight: 600; box-shadow: var(--shadow);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-bar .site-header { top: 32px; }
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgba(28, 40, 51, 0.5); }

.header-inner {
  position: relative;
  max-width: var(--wide);
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo { display: block; flex-shrink: 0; }
.logo img { display: block; height: 52px; width: auto; }

/* Mobile menu toggle and close buttons */
.menu-toggle,
.menu-close {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: none;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--maroon);
  cursor: pointer;
}

/* Hamburger icon - three horizontal lines */
.menu-btn-lines,
.menu-btn-lines::before,
.menu-btn-lines::after {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}

/* Position the middle line */
.menu-btn-lines {
  position: relative;
  flex-shrink: 0;
}

/* Top line */
.menu-btn-lines::before {
  position: absolute;
  top: -8px;
  left: 0;
}

/* Bottom line */
.menu-btn-lines::after {
  position: absolute;
  top: 8px;
  left: 0;
}

.main-nav { display: none; margin-left: auto; }
.main-nav-list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav-list > li { position: relative; }
/* The Members button in the header already leads there, and the bar has no room for another item. */
.main-nav-list > li.menu-item-members { display: none; }
.main-nav-list > li > a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.main-nav-list > li > a:hover,
.main-nav-list > li:focus-within > a { background: var(--sand); color: var(--maroon); }
.main-nav-list > li.current-menu-item > a,
.main-nav-list > li.current-menu-ancestor > a,
.main-nav-list > li.current-menu-parent > a { color: var(--maroon); font-weight: 600; }
.main-nav-list > .menu-item-has-children > a::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.6;
}
.main-nav .sub-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 300px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.main-nav .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.main-nav-list > li:hover > .sub-menu,
.main-nav-list > li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.main-nav .sub-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
  text-decoration: none;
}
.main-nav .sub-menu a:hover,
.main-nav .sub-menu .current-menu-item > a { background: var(--maroon-tint); color: var(--maroon); }

.login-btn {
  margin-left: auto;
  padding: 10px 18px;
  border: 1.5px solid var(--maroon);
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--maroon);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.login-btn:hover { background: var(--maroon); color: var(--white); }

@media (min-width: 1240px) {
  .menu-toggle { display: none; }
  .main-nav { display: block; }
  .login-btn { margin-left: 8px; }
}
@media (max-width: 1239px) {
  .logo { position: absolute; left: 50%; transform: translateX(-50%); }
}
@media (max-width: 860px) {
  .login-btn { display: none; }
  .book-btn, .login-btn + .book-btn { margin-left: auto; }
}
@media (max-width: 560px) {
  :root { --header-h: 64px; }
  .logo img { height: 44px; }
  .menu-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Mobile drawer (slides from the left, where the Menu button is) */
.flyout {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 60;
  width: min(360px, 88vw);
  overflow-y: auto;
  background: var(--navy);
  color: var(--white);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0.28s;
}
.flyout.is-open { transform: none; visibility: visible; transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s; }
.flyout-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(15, 24, 31, 0.5); }
.flyout-backdrop[hidden] { display: none; }
.flyout-top { display: flex; padding: 14px 16px 6px; }
.menu-close { color: var(--white); padding: 10px; }
.menu-close-x { position: relative; display: block; width: 22px; height: 22px; }
.menu-close-x::before,
.menu-close-x::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 0;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.menu-close-x::before { transform: rotate(45deg); }
.menu-close-x::after { transform: rotate(-45deg); }
.flyout-nav { padding: 0 24px; }
.flyout-nav ul { list-style: none; margin: 0; padding: 0; }
.flyout-nav > ul > li { border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.flyout-nav > ul > li > a {
  display: block;
  padding: 16px 0;
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
}
.flyout-nav ul ul { margin: 0 0 14px; padding: 0 0 4px 12px; border-left: 2px solid rgba(255, 255, 255, 0.12); }
.flyout-nav ul ul li a { display: block; padding: 7px 0 7px 12px; font-size: 16px; color: #d9e2e7; text-decoration: none; }
.flyout-nav a:hover, .flyout-nav .current-menu-item > a { color: #f3c5d6; }
.flyout-login {
  display: block;
  margin: 24px;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--white);
  color: var(--maroon);
  font-family: var(--font-head);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

/* ---------- Page header ---------- */
.page-header {
  padding: 56px 20px 40px;
  background: var(--sand);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.page-eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--maroon);
  text-decoration: none;
}
.page-eyebrow:hover { text-decoration: underline; }
.page-title {
  max-width: 900px;
  margin: 0 auto;
  font-size: clamp(30px, 4.2vw, 46px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.section-nav { max-width: var(--wide); margin: 28px auto 0; }
.section-nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.section-nav a {
  display: block;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.section-nav a:hover { border-color: var(--maroon); color: var(--maroon); }
.section-nav a[aria-current="page"] { background: var(--maroon); border-color: var(--maroon); color: var(--white); }
@media (max-width: 700px) {
  .page-header { padding: 36px 0 28px; }
  .page-title { padding: 0 20px; }
  .section-nav { margin-top: 20px; }
  .section-nav ul { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 2px 20px 6px; scrollbar-width: none; }
  .section-nav ul::-webkit-scrollbar { display: none; }
}

/* Link to a page's only sub-page, shown under the content instead of a one-tab row */
.page-related { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.page-related-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1.5px solid var(--maroon);
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  color: var(--maroon);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.page-related-link::after { content: "\2192"; }
.page-related-link:hover { background: var(--maroon); color: var(--white); }

/* ---------- Page body ---------- */
.site-page { max-width: var(--read); margin: 0 auto; padding: 48px 20px 88px; }
.entry-content { overflow-wrap: break-word; }
/* Links inside text are underlined so they don't rely on colour alone (WCAG 1.4.1). Buttons keep their own style. */
.entry-content a:not([class]), .entry-content a.learn-btn { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.entry-content > * { margin-top: 0; margin-bottom: 24px; }
.entry-content h2 { margin: 40px 0 12px; font-size: 28px; font-weight: 700; color: var(--maroon); }
.entry-content h3 { margin: 32px 0 10px; font-size: 21px; font-weight: 700; color: var(--sea); }
.entry-content h4 { margin: 24px 0 8px; font-size: 18px; color: var(--ink); }
.entry-content > :first-child,
.entry-content > :first-child > :first-child { margin-top: 0; }
.entry-content p { margin: 0 0 16px; }
.entry-content ul, .entry-content ol { margin: 0 0 16px; padding-left: 24px; }
.entry-content li { margin-bottom: 6px; }
.entry-content li::marker { color: var(--maroon); }
.entry-content hr { margin: 40px 0; border: 0; border-top: 1px solid var(--line); }

.entry-content a.learn-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--maroon);
  transition: gap 0.2s;
}
.entry-content a.learn-btn:hover { gap: 10px; }
.entry-content .svg-circle-right::after { content: "\2192"; }

.entry-content img { max-width: 100%; height: auto; border-radius: var(--radius); }
.entry-content img[style*="float: right"] { margin: 4px 0 16px 32px; border: 0 !important; box-shadow: var(--shadow); }
@media (max-width: 767px) { .hidden-xs { display: none !important; } }

/* Amilia registration */
.entry-content #amilia { margin: 28px 0; }
.entry-content #amilia-iframe { min-height: 480px; width: 100%; visibility: visible !important; }

/* Tables: data tables, button tables and layout tables need different treatment */
.entry-content table { border-collapse: collapse; max-width: 100%; margin: 0 0 24px; }
.entry-content table td, .entry-content table th { vertical-align: top; overflow-wrap: anywhere; } /* long email addresses */
.entry-content table.table,
.wp-block-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 17px;
}
.entry-content table.table td, .entry-content table.table th,
.wp-block-table td, .wp-block-table th {
  padding: 12px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.entry-content table.table tr:first-child > *,
.wp-block-table tr:first-child > * { border-top: 0; }
.entry-content table.table-striped tr:nth-child(odd) > *,
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: var(--sand); }
.wp-block-table.is-style-stripes { border: 0; }
.wp-block-table { margin: 0 0 24px; }
@media (max-width: 767px) {
  .entry-content table.tableStack td, .wp-block-table td { display: block; width: 100% !important; padding: 4px 16px; border-top: 0; }
  .entry-content table.tableStack td:first-child, .wp-block-table td:first-child { padding-top: 14px; font-weight: 700; }
  .entry-content table.tableStack td:last-child, .wp-block-table td:last-child { padding-bottom: 14px; }
  .entry-content table.tableStack tr + tr td:first-child, .wp-block-table tr + tr td:first-child { border-top: 1px solid var(--line); }
}

/* Buttons: old "button tables" and editor buttons share one style */
.entry-content table.table-button, .entry-content table.tableButton,
.entry-content table.table-button-secondary, .entry-content table.tableButtonSecondary { width: auto; margin: 8px 0 24px; }
.entry-content table[class*="able-button"], .entry-content table[class*="ableButton"] { opacity: 1 !important; }
.entry-content table.table-button td, .entry-content table.tableButton td,
.entry-content table.table-button-secondary td, .entry-content table.tableButtonSecondary td { padding: 0; border: 0; }
.entry-content .table-button td a, .entry-content .tableButton td a,
.entry-content .table-button-secondary td a, .entry-content .tableButtonSecondary td a,
.wp-block-button__link, .wp-element-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: 2px solid var(--maroon);
  border-radius: 999px;
  background: var(--maroon);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.entry-content .table-button td a:hover, .entry-content .tableButton td a:hover,
.wp-block-button__link:hover { background: var(--maroon-deep); border-color: var(--maroon-deep); color: var(--white); transform: translateY(-1px); }
.entry-content .table-button-secondary td a, .entry-content .tableButtonSecondary td a,
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--maroon); }
.entry-content .table-button-secondary td a:hover, .entry-content .tableButtonSecondary td a:hover,
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--maroon); color: var(--white); }
.wp-block-buttons { gap: 12px; }

/* ---------- Front page ---------- */
.site-front { padding-bottom: 72px; }
.site-front .entry-content > * { margin-bottom: 0; }

.hbsc-hero {
  position: relative;
  width: calc(100% - 40px);
  max-width: calc(var(--wide) - 40px);
  margin: 24px auto 0 !important;
  aspect-ratio: 1600 / 750;
  border-radius: var(--radius-lg);
  background: var(--navy);
  box-shadow: var(--shadow);
}
.hbsc-hero figure { position: absolute; inset: 0; margin: 0; overflow: hidden; border-radius: var(--radius-lg); opacity: 0; transition: opacity 1.2s ease; }
.hbsc-hero:not(.is-slideshow) figure:first-child, .hbsc-hero figure.is-active { opacity: 1; }
.hbsc-hero img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.hbsc-scroll {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: -28px;
  width: 56px;
  height: 56px;
  margin-left: -28px;
  border: 4px solid var(--white);
  border-radius: 50%;
  background: var(--maroon);
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(28, 40, 51, 0.5);
  transition: transform 0.2s;
}
.hbsc-scroll::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  border-right: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: translate(-50%, -70%) rotate(45deg);
}
.hbsc-scroll:hover { transform: translateY(2px); }
@media (max-width: 768px) {
  .hbsc-scroll { display: none; }
  .hbsc-hero { width: calc(100% - 32px); margin-top: 12px !important; }
  .hbsc-hero, .hbsc-hero figure { border-radius: var(--radius); }
}

.hbsc-panel { max-width: var(--wide); margin: 88px auto 0 !important; padding: 0 20px; align-items: center; }
.hbsc-panel .wp-block-media-text__media {
  min-height: 460px;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hbsc-panel .wp-block-media-text__media img { border-radius: 0; }
.hbsc-panel .wp-block-media-text__content { padding: 32px 56px; }
.hbsc-panel .wp-block-media-text__content h2 { margin: 0 0 16px; font-size: 30px; font-weight: 700; }
.hbsc-panel .wp-block-media-text__content a:hover { text-decoration: underline; }
.hbsc-panel .wp-block-media-text__content img { box-shadow: var(--shadow); }
@media (max-width: 1100px) {
  .hbsc-panel { grid-template-columns: 50% 50% !important; }
  .hbsc-panel .wp-block-media-text__content { padding: 24px 36px; }
}
@media (max-width: 900px) {
  .hbsc-panel { grid-template-columns: 1fr !important; margin-top: 48px !important; }
  .hbsc-panel .wp-block-media-text__media { grid-row: 1 !important; min-height: 280px; }
  .hbsc-panel .wp-block-media-text__content { grid-row: 2 !important; grid-column: 1 !important; padding: 28px 4px 0; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #c9d4db; font-size: 16px; }
.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 64px 20px 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
.footer-name { margin: 0 0 12px; font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--white); }
.footer-brand p { margin: 0 0 12px; }
.footer-heading {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8fa3b0;
}
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { margin-bottom: 8px; }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { color: #f3c5d6; text-decoration: underline; }
.footer-bottom {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 14px;
  color: #8fa3b0;
}
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr 1fr; padding-top: 48px; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.footer-social-icon {
    color: #fff;
    display: inline-block;
    width: 22px;
    margin-right: 8px;
    text-align: center;
    font-size: 16px;
}

/* ---------- Booking ---------- */
.book-btn {
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--maroon);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}
.book-btn:hover { background: var(--maroon-deep); color: var(--white); }
@media (min-width: 861px) { .login-btn + .book-btn { margin-left: 8px; } }
@media (max-width: 560px) {
  .book-btn, .login-btn + .book-btn { padding: 9px 14px; font-size: 13px; }
}
.flyout-book {
  display: block;
  margin: 24px 24px 0;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--maroon);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.flyout-book + .flyout-login { margin-top: 12px; background: transparent; color: var(--white); border: 1.5px solid rgba(255, 255, 255, 0.5); }

/* Booking box at the top of a course page */
.entry-content .hbsc-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin: 0 0 40px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--maroon);
  border-radius: var(--radius);
  background: var(--sand);
}
.entry-content .hbsc-summary > p { flex: 1 1 280px; margin: 0; }
.entry-content .hbsc-summary .wp-block-buttons { margin: 0; }
.entry-content .hbsc-summary .wp-block-button__link { padding: 12px 22px; font-size: 14px; }

/* Course cards */
.site-page.is-wide { max-width: var(--wide); }
.entry-content .hbsc-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
  gap: 20px;
  margin-bottom: 56px;
}
.entry-content .hbsc-course-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.entry-content .hbsc-course-card:hover { border-color: #d6ccbc; box-shadow: var(--shadow); }
.entry-content .hbsc-course-card > * { margin: 0 0 10px; }
.entry-content .hbsc-course-card h3 { margin: 0 0 8px; font-size: 20px; color: var(--ink); }
.entry-content .hbsc-course-card p { font-size: 17px; color: var(--muted); }
.entry-content .hbsc-course-card .hbsc-course-tag {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--maroon);
}
.entry-content .hbsc-course-card .hbsc-course-note { font-size: 15px; font-style: italic; }
.entry-content .hbsc-course-card .wp-block-buttons { margin: auto 0 0; padding-top: 12px; }
.entry-content .hbsc-course-card .wp-block-button__link { padding: 11px 20px; font-size: 14px; }

/* Home banner with editable text */
.hbsc-hero-cover.wp-block-cover {
  width: calc(100% - 40px);
  max-width: calc(var(--wide) - 40px);
  margin: 24px auto 0 !important;
  padding: 56px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hbsc-hero-cover .wp-block-cover__inner-container { max-width: 620px; color: var(--white); }
.hbsc-hero-cover .hbsc-hero-title { margin: 0 0 16px; font-size: clamp(34px, 5vw, 56px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; color: var(--white); }
.hbsc-hero-cover .hbsc-hero-text { margin: 0 0 28px; font-size: 20px; color: #e8eef2; }
.hbsc-hero-cover .wp-block-buttons { gap: 12px; }
.hbsc-hero-cover .is-style-outline .wp-block-button__link { border-color: var(--white); color: var(--white); }
.hbsc-hero-cover .is-style-outline .wp-block-button__link:hover { background: var(--white); color: var(--maroon); }
@media (max-width: 700px) {
  .hbsc-hero-cover.wp-block-cover { width: calc(100% - 32px); min-height: 440px !important; margin-top: 12px !important; padding: 32px 24px; border-radius: var(--radius); }
  .hbsc-hero-cover .hbsc-hero-text { font-size: 18px; }
}
@media (max-width: 380px) { .book-btn-more { display: none; } }

/* ---------- Elementor ---------- */
/* Elementor pages sit inside the same page layout; these make its widgets match the rest of the site. */
.elementor .e-con.hbsc-el-page { --padding-top: 0px; --padding-bottom: 0px; --padding-left: 0px; --padding-right: 0px; --gap: 0px; }
.elementor .hbsc-el-page > .elementor-widget:not(:last-child),
.elementor .hbsc-el-page > .e-con:not(:last-child) { margin-bottom: 24px; }
.elementor .elementor-widget-text-editor > :last-child,
.elementor .elementor-widget-text-editor p:last-child { margin-bottom: 0; }
.elementor .elementor-widget-heading .elementor-heading-title { font-family: var(--font-head); font-weight: 700; line-height: 1.25; }
.elementor .elementor-widget-heading h1.elementor-heading-title { color: var(--ink); }
.elementor .elementor-widget-heading h2.elementor-heading-title { font-size: 28px; color: var(--maroon); }
.elementor .elementor-widget-heading h3.elementor-heading-title { font-size: 21px; color: var(--sea); }
.elementor .hbsc-el-page > .elementor-widget-heading { margin-top: 16px; }

.elementor .elementor-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border: 2px solid var(--maroon);
  border-radius: 999px;
  background: var(--maroon);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.elementor .elementor-button:hover, .elementor .elementor-button:focus { background: var(--maroon-deep); border-color: var(--maroon-deep); color: var(--white); }
.elementor .hbsc-btn-outline .elementor-button { background: transparent; color: var(--maroon); }
.elementor .hbsc-btn-outline .elementor-button:hover { background: var(--maroon); color: var(--white); }
.elementor .e-con.hbsc-el-buttons { --gap: 12px; --padding-top: 0px; --padding-bottom: 0px; --padding-left: 0px; --padding-right: 0px; }

.elementor .e-con.hbsc-summary {
  --padding-top: 24px; --padding-bottom: 24px; --padding-left: 28px; --padding-right: 28px; --gap: 16px 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--maroon);
  border-radius: var(--radius);
  background: var(--sand);
}
.elementor .hbsc-summary > .elementor-widget-text-editor { flex: 1 1 280px; }
.elementor .hbsc-summary .elementor-button { padding: 12px 22px; font-size: 14px; }

.elementor .e-con.hbsc-course-grid { --gap: 20px; margin-bottom: 32px; }
.elementor .e-con.hbsc-course-card {
  --padding-top: 24px; --padding-bottom: 24px; --padding-left: 24px; --padding-right: 24px; --gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.elementor .e-con.hbsc-course-card:hover { border-color: #d6ccbc; box-shadow: var(--shadow); }
.elementor .hbsc-course-card .elementor-widget-text-editor { font-size: 17px; color: var(--muted); }
.elementor .hbsc-course-card .hbsc-course-tag {
  font-family: var(--font-head); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--maroon);
}
.elementor .hbsc-course-card .hbsc-course-tag p { color: inherit; font-size: inherit; }
.elementor .hbsc-course-card .hbsc-course-note { font-size: 15px; font-style: italic; }
.elementor .hbsc-course-card h3.elementor-heading-title { font-size: 20px; color: var(--ink); }
.elementor .hbsc-course-card .hbsc-el-buttons { margin-top: auto; padding-top: 12px; }
.elementor .hbsc-course-card .elementor-button { padding: 11px 20px; font-size: 14px; }

.elementor .e-con.hbsc-el-hero {
  width: calc(100% - 40px);
  max-width: calc(var(--wide) - 40px);
  margin: 24px auto 0;
  --padding-top: 56px; --padding-bottom: 56px; --padding-left: 56px; --padding-right: 56px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.elementor .hbsc-el-hero > .elementor-widget { max-width: 620px; }
.elementor .hbsc-el-hero .hbsc-hero-title .elementor-heading-title { font-size: clamp(34px, 5vw, 56px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; color: var(--white); }
.elementor .hbsc-el-hero .hbsc-hero-text { font-size: 20px; color: #e8eef2; }
.elementor .hbsc-el-hero .hbsc-btn-outline .elementor-button { border-color: var(--white); color: var(--white); }
.elementor .hbsc-el-hero .hbsc-btn-outline .elementor-button:hover { background: var(--white); color: var(--maroon); }

.elementor .e-con.hbsc-el-panel { max-width: var(--wide); margin: 88px auto 0; --padding-left: 20px; --padding-right: 20px; --gap: 0px; --align-items: stretch; }
.elementor .e-con.hbsc-el-panel-text { --justify-content: center; }
.elementor .e-con.hbsc-el-panel-photo { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.elementor .e-con.hbsc-el-panel-text { --padding-top: 32px; --padding-bottom: 32px; --padding-left: 56px; --padding-right: 56px; }
.elementor .hbsc-el-panel-text h2 { margin: 0 0 16px; font-size: 30px; font-weight: 700; color: var(--maroon); }
.elementor .hbsc-el-panel-text img { border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 767px) {
  .elementor .e-con.hbsc-el-hero { width: calc(100% - 32px); margin-top: 12px; --padding-top: 32px; --padding-bottom: 32px; --padding-left: 24px; --padding-right: 24px; border-radius: var(--radius); }
  .elementor .e-con.hbsc-el-panel { margin-top: 48px; }
  .elementor .e-con.hbsc-el-panel-text { --padding-top: 28px; --padding-left: 4px; --padding-right: 4px; --padding-bottom: 0px; }
}

/* Placeholder shown for the Amilia widget inside the Elementor editor */
.hbsc-amilia-editor { border: 2px dashed var(--maroon); background: var(--sand); padding: 16px 20px; border-radius: var(--radius); }
.hbsc-amilia-editor p { margin: 6px 0 0; font-size: 15px; word-break: break-all; }
.hbsc-amilia-editor .hbsc-amilia-note { color: var(--muted); word-break: normal; }

/* ---------- Members area: profile, directory, boat reservations ---------- */
.hbsc-member-editor p { word-break: normal; }
.hbsc-small { font-size: 15px; color: var(--muted); }
.hbsc-notice { margin: 0 0 16px; padding: 12px 16px; border-left: 4px solid #2e7d4f; background: #edf7f0; border-radius: 6px; }
.hbsc-notice.is-warning { border-color: #a35a00; background: #fff4e3; }
.hbsc-notice.is-error { border-color: var(--maroon); background: var(--maroon-tint); }
.hbsc-notice.is-info { border-color: var(--sea); background: var(--sand); }
.hbsc-notice p, .hbsc-notice ul { margin: 0; }
.hbsc-notice ul { padding-left: 20px; }
.hbsc-panel { padding: 20px 24px; margin: 0 0 28px; background: var(--sand); border-radius: var(--radius); }
.hbsc-panel h2 { margin-top: 0; font-size: 20px; }
.hbsc-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0 0 12px; }
.hbsc-facts dt { font-weight: 600; }
.hbsc-facts dd { margin: 0; }
@media (max-width: 520px) { .hbsc-facts { grid-template-columns: 1fr; } .hbsc-facts dd { margin-bottom: 8px; } }

.hbsc-form fieldset, .hbsc-field-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 20px 8px; margin: 0 0 20px; }
.hbsc-form legend, .hbsc-field-group legend { padding: 0 6px; font-family: var(--font-head); font-weight: 600; font-size: 15px; }
.hbsc-field { margin: 0 0 14px; }
.hbsc-field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.hbsc-field input:not([type=checkbox]):not([type=radio]), .hbsc-field select, .hbsc-field textarea, .hbsc-datejump input {
  width: 100%; max-width: 420px; padding: 9px 12px; border: 1px solid #8a949c; border-radius: 6px; font: inherit; background: var(--white); color: var(--ink);
}
.hbsc-field-check { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; }
.hbsc-field-check input { width: 20px; height: 20px; margin: 3px 0 0; flex: none; accent-color: var(--maroon); }
.hbsc-field-check label { font-weight: 400; margin: 0; }
.hbsc-indent { margin-left: 28px; }

.hbsc-btn, .entry-content a.hbsc-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 11px 22px; border: 2px solid var(--maroon); border-radius: 999px;
  background: var(--maroon); color: var(--white); font-family: var(--font-head); font-size: 14px; font-weight: 600; line-height: 1.3; text-decoration: none; cursor: pointer;
}
.hbsc-btn:hover, .entry-content a.hbsc-btn:hover { background: var(--maroon-deep); border-color: var(--maroon-deep); color: var(--white); }
.hbsc-btn-small, .entry-content a.hbsc-btn-small { padding: 6px 16px; font-size: 13px; }
.hbsc-btn-link, .entry-content a.hbsc-btn-link {
  padding: 0; border: 0; background: none; color: var(--maroon); font: inherit; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.hbsc-inline-form { display: inline; margin: 0; }

.hbsc-tabs { display: flex; gap: 6px; margin: 0 0 20px; border-bottom: 2px solid var(--line); }
.hbsc-tabs a { padding: 10px 16px; font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--navy); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.hbsc-tabs a[aria-current] { color: var(--maroon); border-bottom-color: var(--maroon); }
.hbsc-tabs a:hover { color: var(--maroon); text-decoration: underline; }

.hbsc-table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 15px; }
.hbsc-table th, .hbsc-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.hbsc-table thead th { font-family: var(--font-head); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.hbsc-table tbody th { font-weight: 600; }
.hbsc-table a { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .hbsc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hbsc-table, .hbsc-table tbody, .hbsc-table tr, .hbsc-table th, .hbsc-table td { display: block; }
  .hbsc-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .hbsc-table th, .hbsc-table td { padding: 2px 0; border: 0; }
  .hbsc-table td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--muted); }
}
.hbsc-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--sand); color: var(--navy); font-size: 13px; font-weight: 600; white-space: nowrap; }
.hbsc-tag.is-skipper { background: var(--navy); color: var(--white); }
.hbsc-tag.is-guest { background: #fff4e3; color: #6b3b00; }

.hbsc-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 16px; margin: 0 0 8px; }
.hbsc-filter .hbsc-field input, .hbsc-filter .hbsc-field select { width: auto; min-width: 200px; }
.hbsc-count { font-weight: 600; }

.hbsc-daynav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.hbsc-day-title { margin: 0; font-size: 22px; text-align: center; }
.hbsc-datejump { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 0 0 20px; }
.hbsc-datejump label { font-weight: 600; font-size: 15px; }
.hbsc-datejump input { width: auto; }
.hbsc-daynote { padding: 12px 16px; margin: 0 0 20px; border-radius: var(--radius); background: #fff4e3; }
.hbsc-daynote.is-staff { background: var(--maroon-tint); }
.hbsc-daynote h3 { margin: 0 0 4px; font-size: 16px; }
.hbsc-daynote p { margin: 0 0 6px; }
.hbsc-admin-box { margin: 0 0 20px; padding: 10px 16px; border: 1px dashed var(--sea); border-radius: var(--radius); }
.hbsc-admin-box summary { font-weight: 600; cursor: pointer; }

.hbsc-boats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin: 0 0 24px; }
.hbsc-boat { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; background: var(--white); scroll-margin-top: calc(var(--header-h) + 16px); }
.hbsc-boat h3 { margin: 0 0 10px; font-size: 19px; }
.hbsc-boat-meta { display: block; font-family: var(--font-body); font-size: 14px; font-weight: 400; color: var(--muted); }
.hbsc-slots, .hbsc-crew, .entry-content .hbsc-slots, .entry-content .hbsc-crew { list-style: none; margin: 0; padding: 0; }
.hbsc-slot { padding: 12px 0; border-top: 1px solid var(--line); }
.hbsc-slot-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-weight: 600; }
.hbsc-slot-time { color: var(--muted); font-weight: 400; font-size: 15px; }
.hbsc-slot.is-past .hbsc-slot-head { color: var(--muted); }
.hbsc-slot-block { margin: 6px 0 0; padding: 6px 10px; border-radius: 6px; background: #e9ecee; color: var(--navy); font-size: 15px; }
.hbsc-crew, .entry-content .hbsc-crew { margin: 8px 0 0; }
.hbsc-crew li { margin: 0 0 6px; font-size: 15px; }
.hbsc-crew-name { font-weight: 600; }
.hbsc-crew-note { font-style: italic; color: var(--sea); }
.hbsc-note-edit { display: inline-block; font-size: 14px; }
.hbsc-note-edit summary { color: var(--maroon); text-decoration: underline; cursor: pointer; }
.hbsc-note-edit input { max-width: 180px; padding: 4px 8px; border: 1px solid #8a949c; border-radius: 6px; font: inherit; }
.hbsc-slot-status { margin: 6px 0; font-size: 14px; color: var(--muted); }
.hbsc-slot p:last-child { margin-bottom: 0; }
.hbsc-book-form { margin: 12px 0 4px; padding: 16px; border: 2px solid var(--maroon); border-radius: var(--radius); background: var(--sand); scroll-margin-top: calc(var(--header-h) + 16px); }
.hbsc-book-form h4 { margin: 0 0 12px; font-size: 17px; }
.hbsc-book-form fieldset { background: var(--white); }
.hbsc-sheet .hbsc-table { font-size: 14px; }

@media print {
  .site-header, .flyout, .flyout-backdrop, .site-footer, .page-header, .hbsc-tabs, .hbsc-daynav, .hbsc-datejump, .hbsc-admin-box, .hbsc-no-print { display: none !important; }
  .hbsc-sheet .hbsc-table thead { position: static; width: auto; height: auto; clip: auto; }
}
@media (max-width: 600px) {
  .hbsc-daynav { flex-wrap: wrap; }
  .hbsc-day-title { order: -1; flex-basis: 100%; font-size: 20px; }
}

/* ---------- Club calendar ---------- */
/* Category colours: tint backgrounds with dark text (AA contrast), plus a stronger accent for dots and borders. */
.is-club-events { --cat: var(--maroon); --cat-tint: var(--maroon-tint); --cat-ink: var(--maroon-deep); }
.is-maintenance { --cat: #b36200; --cat-tint: #fff1dc; --cat-ink: #6b3b00; }
.is-seminars { --cat: #2e7d4f; --cat-tint: #e6f4ea; --cat-ink: #1e5a37; }

.hbsc-cal-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 0 0 24px; border-bottom: 2px solid var(--line); }
.hbsc-cal-bar .hbsc-tabs { margin: 0; border: 0; }
.hbsc-cat-pills { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 10px; }
.hbsc-cat-pills a, .entry-content .hbsc-cat-pills a {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); color: var(--navy); font-size: 14px; text-decoration: none;
}
.hbsc-cat-pills a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cat, var(--navy)); }
.hbsc-cat-pills a:first-child::before { display: none; }
.hbsc-cat-pills a:hover { border-color: var(--navy); }
.hbsc-cat-pills a[aria-current] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.hbsc-cat-pills a[aria-current]::before { background: var(--white); }

.hbsc-cal-month { margin: 28px 0 12px; font-size: 18px; color: var(--navy); }
.hbsc-cal-empty { padding: 32px; border-radius: var(--radius); background: var(--sand); text-align: center; }

.hbsc-event-cards, .entry-content .hbsc-event-cards { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 12px; }
.hbsc-event-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); }
.hbsc-event-card:hover { border-color: #cfc6b6; box-shadow: 0 6px 20px -14px rgba(28, 40, 51, 0.5); }
.hbsc-event-card-body { flex: 1; min-width: 0; }
.hbsc-event-card h3, .entry-content .hbsc-event-card h3 { margin: 0 0 2px; font-size: 17px; }
.hbsc-event-card h3 a { color: var(--ink); text-decoration: none; }
.hbsc-event-card h3 a:hover { color: var(--maroon); text-decoration: underline; }
.hbsc-event-card-when, .entry-content .hbsc-event-card-when { margin: 0 0 6px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.hbsc-event-card-action { flex: none; }
.hbsc-event-card .hbsc-upcoming-date { background: var(--sand); }
.hbsc-cat-tag { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--cat-tint, var(--sand)); color: var(--cat-ink, var(--navy)); font-size: 13px; font-weight: 600; }
@media (max-width: 560px) {
  .hbsc-event-card { flex-wrap: wrap; align-items: flex-start; }
  .hbsc-event-card-body { flex: 1 1 calc(100% - 72px); }
  .hbsc-event-card-action { margin-left: 68px; }
}

.hbsc-cal-monthnav { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 0 0 16px; }
.hbsc-cal-monthnav .hbsc-cal-month { margin: 0; min-width: 200px; text-align: center; font-size: 22px; }
.hbsc-round-btn, .entry-content a.hbsc-round-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%;
  background: var(--white); color: var(--navy); font-size: 24px; line-height: 1; text-decoration: none;
}
.hbsc-round-btn:hover { border-color: var(--maroon); color: var(--maroon); }

.hbsc-cal { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; margin: 0 0 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.hbsc-cal th { padding: 10px 8px; background: var(--sand); font-family: var(--font-head); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); text-align: left; }
.hbsc-cal td { height: 104px; padding: 6px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); vertical-align: top; }
.hbsc-cal td:first-child { border-left: 0; }
.hbsc-cal td.is-other .hbsc-cal-day { color: #6f6a60; font-weight: 400; }
.hbsc-cal-day { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; margin-bottom: 4px; border-radius: 50%; font-size: 14px; font-weight: 600; color: var(--navy); }
.hbsc-cal td.is-today .hbsc-cal-day { background: var(--maroon); color: var(--white); }
.hbsc-cal-event, .entry-content a.hbsc-cal-event {
  display: block; margin: 0 0 4px; padding: 3px 7px; border-radius: 6px; background: var(--cat-tint, var(--sand)); color: var(--cat-ink, var(--navy));
  font-size: 13px; font-weight: 600; line-height: 1.3; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hbsc-cal-event:hover, .entry-content a.hbsc-cal-event:hover { text-decoration: underline; }
.hbsc-cal-time { font-weight: 400; }
.hbsc-agenda { display: none; }
.hbsc-agenda h3 { margin: 22px 0 8px; font-size: 16px; color: var(--navy); }
.hbsc-agenda h3[aria-current] { color: var(--maroon); }
@media (max-width: 760px) {
  .hbsc-cal { display: none; }
  .hbsc-agenda { display: block; }
}

.hbsc-event-back { margin: 0 auto 12px; max-width: 760px; }
.hbsc-event { max-width: 760px; margin: 0 auto; padding: 28px 32px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); }
.hbsc-event-head { display: flex; gap: 18px; align-items: center; margin: 0 0 20px; }
.hbsc-event-head h2 { margin: 0 0 6px; font-size: 26px; }
.hbsc-event-head .hbsc-upcoming-date { width: 64px; font-size: 26px; background: var(--sand); }
.hbsc-event-body { margin: 0 0 20px; }
.hbsc-event-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0; padding-top: 20px; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .hbsc-event { padding: 20px; } .hbsc-event-head h2 { font-size: 21px; } }

.hbsc-upcoming { margin: 0 0 28px; padding: 20px 24px; border-radius: var(--radius); background: var(--sand); }
.hbsc-upcoming h2 { margin: 0 0 12px; font-size: 20px; }
.hbsc-upcoming-list, .entry-content .hbsc-upcoming-list { list-style: none; margin: 0 0 12px; padding: 0; }
.hbsc-upcoming-list li { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 12px; }
.hbsc-upcoming-date { flex: none; width: 52px; padding: 4px 0; border-radius: 8px; background: var(--white); text-align: center; font-family: var(--font-head); font-size: 20px; font-weight: 700; line-height: 1.1; color: var(--maroon); }
.hbsc-upcoming-date span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.hbsc-upcoming p { margin: 0; }

/* Booking form: one row per person */
.hbsc-person { display: flex; flex-wrap: wrap; gap: 0 16px; padding-top: 4px; }
.hbsc-person .hbsc-field { flex: 1 1 220px; }
.hbsc-person + .hbsc-person { border-top: 1px dashed var(--line); padding-top: 12px; }
.hbsc-person[hidden] { display: none; }
.hbsc-add-row { margin: 0 0 12px; }
/* "Browse all members" window */
.hbsc-modal { width: min(640px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 48px)); padding: 0; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow); color: var(--ink); }
.hbsc-modal[open] { display: flex; flex-direction: column; }
.hbsc-modal::backdrop { background: rgba(28, 40, 51, 0.55); }
.hbsc-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }
.hbsc-modal-head h2 { margin: 0; font-size: 20px; }
.hbsc-modal-close { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); font-size: 24px; line-height: 1; color: var(--navy); cursor: pointer; }
.hbsc-modal-close:hover { border-color: var(--maroon); color: var(--maroon); }
.hbsc-modal-tools { padding: 0 20px; }
.hbsc-modal-tools .hbsc-field { margin-bottom: 10px; }
.hbsc-modal-tools .hbsc-field input { max-width: none; }
.hbsc-modal-tools .hbsc-cat-pills { padding: 0 0 6px; }
.hbsc-cat-pills button { padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--navy); font: inherit; font-size: 14px; cursor: pointer; }
.hbsc-cat-pills button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.hbsc-modal-tools [data-hbsc-shown] { margin: 0 0 8px; }
.hbsc-modal-list { flex: 1; overflow-y: auto; padding: 0 20px 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hbsc-modal-list h3 { position: sticky; top: 0; margin: 0; padding: 8px 0 4px; background: var(--white); font-size: 14px; color: var(--maroon); }
.hbsc-modal-list ul { list-style: none; margin: 0 0 4px; padding: 0; }
.hbsc-modal-list li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 6px; }
.hbsc-modal-list li:hover { background: var(--sand); }
.hbsc-modal-list li.is-full label { color: var(--muted); }
.hbsc-modal-list input { width: 20px; height: 20px; flex: none; accent-color: var(--maroon); }
.hbsc-modal-list label { flex: 1; cursor: pointer; }
.hbsc-modal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 20px 16px; }
.hbsc-modal-foot [data-hbsc-picked] { flex: 1 1 100%; margin: 0; }
.hbsc-modal-foot .hbsc-btn:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 560px) {
  .hbsc-modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
}

/* Booking window: a header, a scrolling body and a footer with the button, on two screens (form, browse). */
html.hbsc-modal-open { overflow: hidden; }
.hbsc-book-dialog { width: min(960px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); }
.hbsc-book-dialog[open] { display: block; }
.hbsc-book-screen { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
.hbsc-book-screen[hidden] { display: none; }
.hbsc-book-screen > form { display: flex; flex-direction: column; min-height: 0; flex: 1; margin: 0; padding: 0; border: 0; background: none; }
/* The close button sits in the top-right corner whatever the title's length. */
.hbsc-book-dialog .hbsc-modal-head { position: relative; display: block; padding: 20px 76px 14px 28px; border-bottom: 1px solid var(--line); }
.hbsc-book-dialog .hbsc-modal-close { position: absolute; top: 16px; right: 20px; }
.hbsc-book-dialog .hbsc-modal-head h2 { font-size: 22px; }
.hbsc-book-dialog .hbsc-modal-head p { margin: 2px 0 0; }
.hbsc-book-dialog .hbsc-modal-head .hbsc-btn-link { margin-bottom: 6px; }
a.hbsc-modal-close, .entry-content a.hbsc-modal-close { display: inline-flex; align-items: center; justify-content: center; flex: none; text-decoration: none; }
.hbsc-modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 28px 4px; background: var(--sand); }
.hbsc-modal-body fieldset { background: var(--white); }
.hbsc-book-dialog .hbsc-modal-foot { justify-content: flex-start; border-top: 1px solid var(--line); background: var(--white); padding: 14px 28px 18px; }
.hbsc-book-dialog .hbsc-modal-foot .hbsc-field-check { flex: 1 1 100%; margin: 0; }
.hbsc-book-dialog .hbsc-modal-list { border-top: 0; }
.hbsc-book-dialog [data-hbsc-screen="browse"] .hbsc-modal-tools { padding-top: 12px; }
.hbsc-person .hbsc-field-check { flex: 1 1 220px; align-self: center; margin: 0 0 14px; }
/* Without JavaScript the window is shown as a normal panel above the boats. */
.hbsc-book-dialog:not(:modal) { position: static; width: auto; max-width: none; max-height: none; margin: 0 0 24px; border: 2px solid var(--maroon); box-shadow: none; }
.hbsc-book-dialog:not(:modal) .hbsc-book-screen, .hbsc-book-dialog:not(:modal) .hbsc-modal-body { max-height: none; overflow: visible; }
@media (max-width: 560px) {
  .hbsc-book-dialog, .hbsc-book-screen { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .hbsc-modal-body, .hbsc-book-dialog .hbsc-modal-foot { padding-left: 16px; padding-right: 16px; }
  .hbsc-book-dialog .hbsc-modal-head { padding: 16px 68px 12px 16px; }
  .hbsc-book-dialog .hbsc-modal-close { top: 12px; right: 12px; }
}
.hbsc-book-dialog .hbsc-person .hbsc-field { flex: 1 1 200px; }
.hbsc-boat-filter { justify-content: center; padding: 0; margin: 0 0 20px; }
.hbsc-boat-filter a::before { display: none; }

/* ---------- Members page: tools as cards, information pages as a grid of links ---------- */
.hbsc-members-home .elementor .e-con.hbsc-el-page { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.hbsc-members-home .elementor .hbsc-el-page > * { margin-bottom: 0 !important; }
.hbsc-members-home .elementor .hbsc-el-page > .elementor-widget { grid-column: 1 / -1; }
.hbsc-members-home .hbsc-upcoming { margin-bottom: 16px; }
.hbsc-members-home .elementor .e-con.hbsc-summary {
  --flex-direction: column; --align-items: flex-start; --justify-content: space-between; --gap: 16px;
  --padding-top: 20px; --padding-bottom: 20px; --padding-left: 22px; --padding-right: 22px;
  flex-direction: column; font-size: 17px; line-height: 1.5;
}
.hbsc-members-home .elementor .hbsc-summary > .elementor-widget-text-editor { flex: 0 0 auto; }
.hbsc-members-home .elementor .hbsc-summary > .elementor-widget-text-editor strong { display: block; margin-bottom: 4px; font-family: var(--font-head); font-size: 18px; color: var(--ink); }
.hbsc-members-home .elementor .hbsc-el-page > .elementor-widget-heading { margin-top: 40px; }
.hbsc-members-home .elementor .hbsc-el-page > .elementor-widget-text-editor ul {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none;
}
.hbsc-members-home .elementor .hbsc-el-page > .elementor-widget-text-editor li { margin: 0; }
.hbsc-members-home .elementor .hbsc-el-page > .elementor-widget-text-editor li a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 100%;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  font-family: var(--font-head); font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--ink); text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.hbsc-members-home .elementor .hbsc-el-page > .elementor-widget-text-editor li a::after { content: "\2192"; color: var(--maroon); }
.hbsc-members-home .elementor .hbsc-el-page > .elementor-widget-text-editor li a:hover { border-color: var(--maroon); color: var(--maroon); }

/* ---------- Information pages from ClubEssentials (tables marked by hbsc_ce_tidy_tables()) ---------- */
.hbsc-info-page .entry-content table { width: 100%; margin: 8px 0 32px; font-size: 17px; line-height: 1.5; }
.hbsc-info-page .entry-content td, .hbsc-info-page .entry-content th { text-align: left; }
.hbsc-info-page .entry-content td ul, .hbsc-info-page .entry-content td ol { margin: 0; padding-left: 18px; }
.hbsc-info-page .entry-content td p { margin: 0 0 8px; }
.hbsc-info-page .entry-content .hbsc-data-table { border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.hbsc-data-table th {
  padding: 12px 16px; background: var(--sand); border-bottom: 1px solid var(--line);
  font-family: var(--font-head); font-size: 14px; font-weight: 600; color: var(--navy); vertical-align: bottom;
}
.hbsc-data-table td { padding: 12px 16px; border-top: 1px solid var(--line); }
.hbsc-data-table tr:nth-child(2) td { border-top: 0; }
.hbsc-layout-table td { padding: 12px 24px 12px 0; }
.hbsc-layout-table td:last-child { padding-right: 0; }
.hbsc-layout-table tr + tr td { border-top: 1px solid var(--line); }
.hbsc-layout-table img { display: block; margin: 0 0 8px; }
@media (max-width: 700px) {
  .hbsc-layout-table, .hbsc-layout-table tbody, .hbsc-layout-table tr, .hbsc-layout-table td,
  .hbsc-data-table, .hbsc-data-table tbody, .hbsc-data-table tr, .hbsc-data-table td { display: block; width: 100% !important; }
  .hbsc-layout-table td { padding: 4px 0; }
  .hbsc-layout-table tr { padding: 12px 0; }
  .hbsc-layout-table tr + tr { border-top: 1px solid var(--line); }
  .hbsc-layout-table tr + tr td { border-top: 0; }
  .hbsc-data-table tr:first-child { display: none; } /* the headings move into each cell's label */
  .hbsc-data-table tr { padding: 12px 16px; }
  .hbsc-data-table tr + tr { border-top: 1px solid var(--line); }
  .hbsc-data-table tr:nth-child(2) { border-top: 0; }
  .hbsc-data-table td { padding: 4px 0; border-top: 0; }
  .hbsc-data-table td[data-label]::before {
    content: attr(data-label); display: block; font-family: var(--font-head); font-size: 12px; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); text-decoration: none;
  }
}

/* ---------- Event registration (inc/event-registration.php) ---------- */
.hbsc-reg { margin: 0 0 20px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sand); }
.hbsc-reg h3 { margin: 0 0 6px; font-size: 18px; color: var(--navy); }
.hbsc-reg-facts { margin: 0 0 14px; font-size: 15px; color: var(--muted); }
.hbsc-reg form { margin: 0; }
.hbsc-reg form p:last-child { margin-bottom: 0; }
.hbsc-reg .hbsc-field select, .hbsc-reg .hbsc-field input { max-width: 420px; background: var(--white); }
.hbsc-reg .hbsc-notice { background-color: var(--white); }
.hbsc-reg details { margin: 12px 0 0; }
.hbsc-reg summary { cursor: pointer; font-weight: 600; color: var(--maroon); }
.hbsc-reg-change form { margin-top: 10px; }
.hbsc-reg-who ul { margin: 8px 0 0; padding-left: 20px; columns: 2 220px; }
button.hbsc-btn-link { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.hbsc-reg-cancel { margin-top: 4px; }
.hbsc-reg-tag { flex: none; display: inline-block; padding: 3px 12px; border-radius: 999px; background: #edf7f0; color: #1f6b3e; font-size: 13px; font-weight: 600; white-space: nowrap; }
.hbsc-reg-tag.is-waitlist { background: #fff4e3; color: #7a4300; }
.hbsc-upcoming-list .hbsc-btn-small, .entry-content .hbsc-upcoming-list a.hbsc-btn-small { padding: 2px 12px; font-size: 12px; vertical-align: 1px; }

/* ---------- Club news (inc/news.php) ---------- */
.hbsc-news-list, .entry-content .hbsc-news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.hbsc-news-card { display: flex; gap: 20px; align-items: flex-start; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); }
.hbsc-news-card h2, .entry-content .hbsc-news-card h2 { margin: 0 0 6px; font-size: 20px; }
.hbsc-news-card h2 a { color: var(--ink); text-decoration: none; }
.hbsc-news-card h2 a:hover { color: var(--maroon); text-decoration: underline; }
.hbsc-news-card p { margin: 0; font-size: 17px; line-height: 1.55; }
.hbsc-news-thumb { flex: none; width: 160px; }
.hbsc-news-thumb img { display: block; width: 160px; height: 112px; object-fit: cover; border-radius: var(--radius); }
.hbsc-news-date, .entry-content .hbsc-news-date { margin: 0 0 4px; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.hbsc-news-pages { display: flex; justify-content: space-between; margin: 24px 0 0; }
.hbsc-news-item h2 { margin: 0 0 16px; font-size: 28px; }
.hbsc-news-picture { margin: 0 0 20px; }
.hbsc-news-picture img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
@media (max-width: 560px) {
  .hbsc-news-card { flex-direction: column; gap: 12px; }
  .hbsc-news-thumb, .hbsc-news-thumb img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .hbsc-news-item h2 { font-size: 22px; }
}
.hbsc-news-mini, .entry-content .hbsc-news-mini { list-style: none; margin: 0 0 12px; padding: 0; }
.hbsc-news-mini li { margin: 0 0 14px; line-height: 1.4; }
.hbsc-news-mini li > * { display: block; }
.hbsc-news-mini .hbsc-small { margin: 2px 0; }
.hbsc-news-mini-text { font-size: 15px; color: var(--muted); }

/* Members page: Coming up and Latest news side by side */
.hbsc-members-home .elementor .e-con.hbsc-el-row { grid-column: 1 / -1; --gap: 16px; --flex-wrap: wrap; --align-items: stretch; }
.hbsc-members-home .elementor .hbsc-el-row > .elementor-widget { flex: 1 1 320px; }
.hbsc-members-home .elementor .hbsc-el-row .hbsc-upcoming { height: 100%; margin: 0; }
