/* AHDMA redesign: global tokens + header/footer restyle of Divi's default header (no Theme Builder).
   Loaded by ahdma-redesign.php. All selectors are Divi core ids/classes, so a re-sync loses nothing. */
:root {
  --ahdma-navy: #0b2233;
  --ahdma-teal: #0b5a7a;
  --ahdma-gold: #d0a73f;
  --ahdma-gold-hover: #e2bb55;
  --ahdma-ink: #1d2b36;
  --ahdma-mist: #f2f6f8;
  --ahdma-line: #dbe6ec;
  --ahdma-font-head: "Cinzel", Georgia, serif;
  --ahdma-font-body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body { font-family: var(--ahdma-font-body); color: var(--ahdma-ink); }
h1, h2, h3, h4 { font-family: var(--ahdma-font-head); color: var(--ahdma-navy); }

/* Keyboard focus: visible everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
#top-menu a:focus-visible { outline: 3px solid var(--ahdma-gold); outline-offset: 2px; }

/* Header */
#main-header { background: #fff; box-shadow: 0 1px 0 var(--ahdma-line); }
#main-header .container.et_menu_container { width: calc(100% - 48px); max-width: 1440px; }
#main-header .logo_container img#logo { max-height: 54px; width: auto; }
#et-top-navigation { padding-left: 0 !important; }
#top-menu > li { padding-right: 8px; }
#top-menu > li > a { font-family: var(--ahdma-font-body); font-weight: 500; font-size: 14px; letter-spacing: .005em; color: var(--ahdma-navy); opacity: 1; padding: 0 8px; }
#top-menu > li.menu-item-has-children > a:first-child { padding-right: 28px; }
#top-menu li a:hover, #top-menu li.current-menu-item > a, #top-menu li.current-menu-ancestor > a { color: var(--ahdma-teal); opacity: 1; }
#top-menu > li.current-menu-item > a, #top-menu > li.current-menu-ancestor > a { box-shadow: inset 0 -3px 0 var(--ahdma-gold); }
#top-menu li ul.sub-menu { left: 50%; width: 292px; padding: 8px 0; border-top: 3px solid var(--ahdma-gold); border-radius: 0 0 8px 8px; box-shadow: 0 12px 30px rgba(11, 34, 51, .16); transform: translateX(-50%); }
#top-menu li ul.sub-menu li { display: block; width: 100%; padding: 0; }
#top-menu li ul.sub-menu li a { box-sizing: border-box; width: 100%; font-size: 14px; line-height: 1.35; padding: 12px 18px; white-space: normal; }
#top-menu li ul.sub-menu li a:hover, #top-menu li ul.sub-menu li.current-menu-item > a { background: var(--ahdma-mist); color: var(--ahdma-teal); }
#top-menu li ul.sub-menu li.current-menu-item > a { box-shadow: none; }

/* Nested menu groups: keep the information architecture visible in one calm dropdown.
   Group labels remain useful landing links; their children stay inline instead of
   becoming a difficult-to-discover third-level flyout. */
#top-menu > li > ul.sub-menu > li.menu-item-has-children > a {
  color: var(--ahdma-teal) !important;
  cursor: default;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  line-height: 1.25;
  padding: 13px 18px 6px;
  text-transform: uppercase;
}
#top-menu > li > ul.sub-menu > li.menu-item-has-children > ul.sub-menu {
  background: transparent;
  border: 0;
  box-shadow: none;
  display: block;
  left: auto;
  opacity: 1;
  padding: 0 0 7px;
  position: static;
  transform: none;
  visibility: visible;
  width: auto;
}
#top-menu > li > ul.sub-menu > li.menu-item-has-children > ul.sub-menu li a {
  font-size: 13px;
  padding: 9px 18px 9px 30px;
}

/* Archive landing pages: make historical content feel intentional and keep the current
   programme pages visually distinct from completed training and events. */
.ahdma-archive-page { max-width: 1120px; margin: 0 auto; padding: clamp(48px, 7vw, 92px) 24px 80px; }
.ahdma-archive-intro { max-width: 760px; margin-bottom: 42px; }
.ahdma-archive-kicker { margin: 0 0 12px; color: var(--ahdma-teal); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ahdma-archive-page h1 { margin: 0 0 18px; font-size: clamp(36px, 5vw, 64px); }
.ahdma-archive-intro > p:last-child,
.ahdma-archive-lead { margin: 0; color: #536675; font-size: 18px; line-height: 1.7; }
.ahdma-archive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.ahdma-archive-card { padding: 30px; background: #fff; border: 1px solid var(--ahdma-line); border-top: 4px solid var(--ahdma-gold); border-radius: 12px; box-shadow: 0 12px 28px rgba(11, 34, 51, .08); }
.ahdma-archive-status { margin: 0 0 12px; color: var(--ahdma-teal); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ahdma-archive-card h2 { margin: 0 0 12px; font-family: var(--ahdma-font-body); font-size: 24px; line-height: 1.25; }
.ahdma-archive-card p:not(.ahdma-archive-status) { margin: 0 0 22px; color: #536675; line-height: 1.65; }
.ahdma-archive-link { color: var(--ahdma-teal); font-weight: 700; text-decoration: none; }
.ahdma-archive-link:hover { color: var(--ahdma-navy); text-decoration: underline; }

/* Event Archive: present the records as a calm, scannable list rather than a
   collection of equal-weight cards. The HTML remains inside a native Divi Text
   module so editors can add or reorder entries from the Visual Builder. */
.ahdma-archive-list { border-top: 1px solid var(--ahdma-line); background: #fff; }
.ahdma-archive-list-item { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 30px; align-items: center; padding: 26px 18px; border-bottom: 1px solid var(--ahdma-line); }
.ahdma-archive-list-item:hover { background: #f8fbfc; }
.ahdma-archive-list .ahdma-archive-status { margin: 0; color: var(--ahdma-teal); font-size: 11px; font-weight: 700; letter-spacing: .08em; line-height: 1.4; text-transform: uppercase; }
.ahdma-archive-list-body h2 { margin: 0 0 6px; color: var(--ahdma-navy); font-family: var(--ahdma-font-body); font-size: 23px; line-height: 1.25; }
.ahdma-archive-list-body p { margin: 0; color: #536675; line-height: 1.6; }
.ahdma-archive-list .ahdma-archive-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Shared page-header system: membership is the reference treatment. Each page keeps its
   own relevant image or gradient, while the framing, typography and action treatment stay
   consistent across legacy Divi and refreshed sections. */
.ahdma-membership-hero,
.ahdma-page-hero,
.ahdma-event-hero { background-position: center; background-size: cover; }
.ahdma-membership-hero,
.ahdma-page-hero { padding-top: 96px !important; padding-bottom: 88px !important; }
.ahdma-event-hero { padding-top: 88px !important; padding-bottom: 72px !important; }
.ahdma-membership-hero > .et_pb_row,
.ahdma-page-hero > .et_pb_row,
.ahdma-event-hero > .et_pb_row { width: 88%; max-width: 1120px; }
.ahdma-membership-hero .et_pb_text h1,
.ahdma-page-hero .et_pb_text h1,
.ahdma-event-hero .et_pb_text h1 { margin: 0; color: #fff !important; font-family: var(--ahdma-font-head); font-size: clamp(40px, 5vw, 58px) !important; line-height: 1.12; }
.ahdma-membership-hero .ahdma-lead,
.ahdma-page-hero .ahdma-lead,
.ahdma-event-hero .ahdma-lead { max-width: 48em; color: #fff !important; font-size: clamp(18px, 2vw, 20px); line-height: 1.65; }
.ahdma-membership-hero .ahdma-cta,
.ahdma-page-hero .ahdma-cta,
.ahdma-event-hero .ahdma-cta { border: 0 !important; border-radius: 4px !important; background: var(--ahdma-gold) !important; color: var(--ahdma-navy) !important; font-family: var(--ahdma-font-body); font-weight: 600; padding: 14px 32px !important; }
.ahdma-membership-hero .ahdma-cta:hover,
.ahdma-page-hero .ahdma-cta:hover,
.ahdma-event-hero .ahdma-cta:hover { background: var(--ahdma-gold-hover) !important; }

/* Bring older fullwidth-header pages into the same hero proportions. The wrapper and the
   header both carried legacy padding, which created a blank band above the image. */
.et_pb_section.et_pb_fullwidth_section { padding-top: 0 !important; padding-bottom: 0 !important; }
.et_pb_fullwidth_header { min-height: 400px !important; padding: 0 !important; background-position: center !important; background-size: cover !important; }
.et_pb_fullwidth_header .header-content { width: 88%; max-width: 1120px; padding: 96px 0 88px !important; }
.et_pb_fullwidth_header h1,
.et_pb_fullwidth_header h2 { color: #fff !important; font-family: var(--ahdma-font-head) !important; font-size: clamp(40px, 5vw, 58px) !important; line-height: 1.12; }

/* Gallery keeps its legacy Divi header module, but should share the Membership hero
   proportions and visual language with the refreshed landing pages. */
body.page-id-228 .et_pb_fullwidth_header {
  min-height: 0 !important;
  background-image: linear-gradient(100deg, rgba(11, 34, 51, .95) 0%, rgba(11, 34, 51, .75) 62%, rgba(18, 85, 107, .62) 100%), url("https://web.ahdma.org/wp-content/uploads/2018/10/pexels-photo-861099.jpeg") !important;
  background-position: center !important;
  background-size: cover !important;
}
body.page-id-228 .et_pb_fullwidth_header .header-content { width: 88%; max-width: 1120px; padding: 96px 0 88px !important; text-align: left; }
body.page-id-228 .et_pb_fullwidth_header h1,
body.page-id-228 .et_pb_fullwidth_header h2 { font-size: clamp(40px, 5vw, 52px) !important; text-transform: uppercase; }

body.page-id-196 .et_pb_fullwidth_header {
  min-height: 0 !important;
  background-image: linear-gradient(100deg, rgba(11, 34, 51, .95) 0%, rgba(11, 34, 51, .75) 62%, rgba(18, 85, 107, .62) 100%), url("https://web.ahdma.org/wp-content/uploads/2018/10/pexels-photo-861099.jpeg") !important;
  background-position: center !important;
  background-size: cover !important;
}
body.page-id-196 .et_pb_fullwidth_header .header-content { width: 88%; max-width: 1120px; padding: 96px 0 88px !important; text-align: left; }
body.page-id-196 .et_pb_fullwidth_header h1,
body.page-id-196 .et_pb_fullwidth_header h2 { font-size: clamp(40px, 5vw, 52px) !important; text-transform: uppercase; }
body.page-id-196 .et_pb_fullwidth_header p { max-width: 48em; color: rgba(255, 255, 255, .92) !important; font-size: clamp(18px, 2vw, 20px); line-height: 1.65; }

/* Archive landing pages use the same image-led header hierarchy without requiring a Divi
   fullwidth-header module. */
.ahdma-archive-page > .ahdma-archive-intro { max-width: none; margin: 0 calc(50% - 50vw) 48px; padding: 96px max(24px, calc((100vw - 1120px) / 2)) 88px; background: linear-gradient(100deg, rgba(11, 34, 51, .94), rgba(11, 90, 122, .66)), url("https://web.ahdma.org/wp-content/uploads/2018/09/anemone-aquarium-aquatic-1125979-e1538056374298.jpg") center / cover; }
body.page-id-3583 .ahdma-archive-page,
body.page-id-3584 .ahdma-archive-page,
body.page-id-248 .ahdma-archive-page { padding-top: 0; }
body.page-id-3583 .ahdma-archive-page,
body.page-id-3584 .ahdma-archive-page,
body.page-id-248 .ahdma-archive-page { max-width: none; margin: 0; padding: 0 0 80px; }
body.page-id-3583 .ahdma-archive-page > .ahdma-archive-intro,
body.page-id-3584 .ahdma-archive-page > .ahdma-archive-intro,
body.page-id-248 .ahdma-archive-page > .ahdma-archive-intro {
  max-width: none;
  margin: 0 0 48px;
  padding: 96px 6% 88px;
  background: linear-gradient(100deg, rgba(11, 34, 51, .95) 0%, rgba(11, 34, 51, .75) 62%, rgba(18, 85, 107, .62) 100%), url("https://web.ahdma.org/wp-content/uploads/2018/10/pexels-photo-861099.jpeg") center / cover;
}
body.page-id-3583 .ahdma-archive-page > .ahdma-archive-intro .ahdma-archive-kicker,
body.page-id-3584 .ahdma-archive-page > .ahdma-archive-intro .ahdma-archive-kicker,
body.page-id-248 .ahdma-archive-page > .ahdma-archive-intro .ahdma-archive-kicker { display: none; }
body.page-id-3583 .ahdma-archive-page > .ahdma-archive-intro h1,
body.page-id-3584 .ahdma-archive-page > .ahdma-archive-intro h1,
body.page-id-248 .ahdma-archive-page > .ahdma-archive-intro h1 { margin: 0 0 18px; color: #fff !important; font-size: clamp(40px, 5vw, 52px); text-transform: uppercase; }
body.page-id-3583 .ahdma-archive-page > .ahdma-archive-intro p:not(.ahdma-archive-kicker),
body.page-id-3584 .ahdma-archive-page > .ahdma-archive-intro p:not(.ahdma-archive-kicker),
body.page-id-248 .ahdma-archive-page > .ahdma-archive-intro p:not(.ahdma-archive-kicker) { max-width: 48em; color: rgba(255, 255, 255, .92) !important; font-size: clamp(18px, 2vw, 20px); line-height: 1.65; }
body.page-id-3583 .ahdma-archive-page > .ahdma-archive-grid,
body.page-id-3584 .ahdma-archive-page > .ahdma-archive-grid,
body.page-id-248 .ahdma-archive-page > .ahdma-archive-grid { width: 88%; max-width: 1120px; margin: 0 auto; padding: 0; }
.ahdma-history-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 30px; }
.ahdma-history-stat { padding: 22px 24px; background: var(--ahdma-mist); border: 1px solid var(--ahdma-line); border-radius: 10px; }
.ahdma-history-stat strong { display: block; color: var(--ahdma-navy); font-size: 25px; line-height: 1.15; }
.ahdma-history-stat span { display: block; margin-top: 6px; color: #536675; font-size: 13px; }
.ahdma-history-page .ahdma-archive-notice { max-width: none; margin: 0 0 30px; }
.ahdma-archive-notice a { color: var(--ahdma-teal); font-weight: 700; }
.ahdma-history-table-wrap { overflow-x: auto; border: 1px solid var(--ahdma-line); border-radius: 12px; box-shadow: 0 12px 28px rgba(11, 34, 51, .06); }
.ahdma-history-table { width: 100%; border-collapse: collapse; background: #fff; }
.ahdma-history-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ahdma-history-table th { padding: 17px 18px; color: #fff !important; background: var(--ahdma-navy) !important; border-bottom: 3px solid var(--ahdma-gold); font-size: 12px; font-weight: 700; letter-spacing: .08em; line-height: 1.25; opacity: 1 !important; text-align: left; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }
.ahdma-history-table th:nth-child(1), .ahdma-history-table td:nth-child(1) { width: 8%; }
.ahdma-history-table th:nth-child(2), .ahdma-history-table td:nth-child(2) { width: 18%; }
.ahdma-history-table th:nth-child(3), .ahdma-history-table td:nth-child(3) { width: 20%; }
.ahdma-history-table th:nth-child(4), .ahdma-history-table td:nth-child(4) { width: 22%; }
.ahdma-history-table th:nth-child(5), .ahdma-history-table td:nth-child(5) { width: 20%; }
.ahdma-history-table th:nth-child(6), .ahdma-history-table td:nth-child(6) { width: 12%; }
.ahdma-history-table td { padding: 17px 18px; border-top: 1px solid var(--ahdma-line); color: #405463; font-size: 14px; line-height: 1.45; vertical-align: top; }
.ahdma-history-table tbody tr:nth-child(even) { background: #f8fbfc; }
.ahdma-history-table tbody tr:hover { background: #eef6f8; }
.ahdma-history-table td:first-child { color: var(--ahdma-navy); font-weight: 700; white-space: nowrap; }
.ahdma-history-table a { color: var(--ahdma-teal); font-weight: 700; text-decoration: none; white-space: nowrap; }
.ahdma-history-table a:hover { text-decoration: underline; }
.ahdma-history-footnote { margin: 24px 0 0; color: #536675; font-size: 14px; line-height: 1.65; }
.ahdma-history-footnote a { color: var(--ahdma-teal); font-weight: 700; }

/* These notices are added by the mirror-only archive filter on completed programme pages. */
.ahdma-archive-notice { margin: 0 auto 28px; max-width: 1120px; padding: 18px 22px; color: var(--ahdma-navy); background: #fff8e5; border: 1px solid #ead18a; border-left: 5px solid var(--ahdma-gold); border-radius: 8px; }
.ahdma-archive-notice strong { color: var(--ahdma-teal); }

@media (max-width: 700px) {
  .ahdma-archive-page { padding-right: 18px; padding-left: 18px; }
  .ahdma-archive-grid { grid-template-columns: 1fr; }
  .ahdma-archive-card { padding: 24px; }
  .ahdma-archive-list-item { grid-template-columns: 1fr; gap: 8px; padding: 22px 4px; }
  .ahdma-archive-list .ahdma-archive-link { margin-top: 5px; }
  .ahdma-history-summary { grid-template-columns: 1fr; }
  .ahdma-history-table-wrap { overflow: visible; border: 0; box-shadow: none; }
  .ahdma-history-table, .ahdma-history-table tbody, .ahdma-history-table tr, .ahdma-history-table td { display: block; }
  .ahdma-history-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ahdma-history-table tr { margin: 0 0 14px; border: 1px solid var(--ahdma-line); border-radius: 10px; background: #fff; box-shadow: 0 8px 18px rgba(11, 34, 51, .06); }
  .ahdma-history-table td { display: grid; grid-template-columns: minmax(7.5rem, 34%) 1fr; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--ahdma-line); }
  .ahdma-history-table td:first-child { border-top: 0; }
  .ahdma-history-table td::before { content: attr(data-label); color: var(--ahdma-teal); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
}

@media (max-width: 767px) {
  .ahdma-membership-hero,
  .ahdma-page-hero { padding-top: 52px !important; padding-bottom: 52px !important; }
  .ahdma-event-hero { padding-top: 52px !important; padding-bottom: 52px !important; }
  .et_pb_fullwidth_header { min-height: 300px !important; }
  .et_pb_fullwidth_header .header-content { padding: 64px 0 56px !important; }
  .ahdma-archive-page > .ahdma-archive-intro { margin-bottom: 36px; padding-top: 64px; padding-bottom: 56px; }
  body.page-id-3583 .ahdma-archive-page > .ahdma-archive-intro,
  body.page-id-3584 .ahdma-archive-page > .ahdma-archive-intro,
  body.page-id-248 .ahdma-archive-page > .ahdma-archive-intro { padding-right: 6%; padding-left: 6%; }
  body.page-id-3583 .ahdma-archive-page > .ahdma-archive-grid,
  body.page-id-3584 .ahdma-archive-page > .ahdma-archive-grid,
  body.page-id-248 .ahdma-archive-page > .ahdma-archive-grid { width: 88%; }
}
#et_top_search { margin-left: 4px; }
#et_search_icon { display: block; width: 34px; height: 34px; line-height: 34px; text-align: center; }

/* Mobile menu: 44px tap targets */
.et_mobile_menu { border-top: 3px solid var(--ahdma-gold); }
.et_mobile_menu { max-height: calc(100vh - 82px); overflow-y: auto; padding: 8px 0; box-shadow: 0 12px 24px rgba(11, 34, 51, .14); }
.et_mobile_menu li a { padding: 12px 7%; font-size: 16px; line-height: 1.35; color: var(--ahdma-navy); }
.et_mobile_menu li a:hover, .et_mobile_menu li.current-menu-item > a { background: var(--ahdma-mist); color: var(--ahdma-teal); }
.et_mobile_menu .sub-menu { padding: 0 0 6px 12px; }
.et_mobile_menu .sub-menu li a { padding: 9px 7% 9px 12%; font-size: 15px; }
.et_mobile_menu .menu-item-has-children > .sub-menu { display: block !important; }
.et_mobile_menu .menu-item-has-children > a { color: var(--ahdma-teal); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.et_mobile_menu .menu-item-has-children > .sub-menu .menu-item-has-children > a { padding-top: 8px; padding-bottom: 5px; }
.mobile_menu_bar:before { color: var(--ahdma-teal); }

/* Keep the desktop menu usable before Divi switches to its mobile menu. */
@media (min-width: 981px) and (max-width: 1240px) {
  #main-header .container.et_menu_container { width: calc(100% - 32px); }
  #top-menu > li { padding-right: 2px; }
  #top-menu > li > a { font-size: 13px; padding-left: 5px; padding-right: 5px; }
}

@media (max-width: 980px) {
  #main-header .container.et_menu_container { width: 92%; }
  #et-top-navigation { padding-top: 16px !important; }
  #et_mobile_nav_menu .mobile_nav { padding-bottom: 10px; }
}

/* Footer */
#main-footer { background: var(--ahdma-navy); }
#footer-bottom { background: transparent; padding: 28px 0; }
#footer-info { float: none; text-align: center; color: #c9d6de; font-size: 13px; padding-bottom: 0; }
#footer-info a { color: #fff; text-decoration: underline; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
