/*
Theme Name:   Divi Child
Theme URI:    https://www.elegantthemes.com/gallery/divi/
Description:  Child theme for Divi 5. All custom CSS and PHP for this build lives here so Divi can update safely.
Author:       TBC
Author URI:   https://www.elegantthemes.com
Template:     Divi
Version:      1.0.0
License:      GNU General Public License v2 or later
Text Domain:  divi-child
*/

/* ==========================================================================
   IMPORTANT — read before adding anything here

   95% of styling should live in Divi Global Variables and Presets, NOT in this
   file. Anything defined here is invisible to the Visual Builder, which means
   the client can't change it and future-you won't find it.

   Only put things here that Divi genuinely has no UI for:
     - focus states and accessibility fixes
     - ::selection, scrollbars, print styles
     - global overrides nobody will ever want to edit visually

   See design/divi-global-variables.md.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Design tokens as CSS custom properties

   Mirrors design/tokens.json. These are for use in THIS file only — Divi
   modules should reference Divi Global Variables instead. Keep the two in sync;
   if you change a colour, change it in both places or things drift.
   -------------------------------------------------------------------------- */

:root {
	--c-primary:            #002995;   /* ABSA royal blue */
	--c-primary-dark:       #001C6B;
	--c-primary-deep:       #00113F;
	--c-primary-light:      #4E6ACB;
	--c-primary-pale:       #E7EBF7;
	--c-accent:             #F3A602;   /* ABSA gold */
	--c-accent-dark:        #C98600;

	--c-ink:                #0E1729;
	--c-ink-muted:          #566076;
	--c-ink-reversed:       #FFFFFF;
	--c-ink-reversed-muted: #BFC9E6;

	--c-surface:            #FFFFFF;
	--c-surface-alt:        #F3F5FB;
	--c-surface-dark:       #001C6B;
	--c-border:             #DCE2F0;

	--radius-sm:            4px;
	--radius-md:            8px;
	--radius-lg:            16px;
	--radius-pill:          999px;

	/* Shadows tinted with the brand blue rather than neutral grey. */
	--shadow-sm:            0 1px 2px rgba(18, 42, 112, 0.06);
	--shadow-md:            0 8px 28px rgba(18, 42, 112, 0.10);
	--shadow-lg:            0 16px 40px rgba(18, 42, 112, 0.16);

	--duration:             250ms;
	--easing:               cubic-bezier(0.4, 0, 0.2, 1);

	--measure:              68ch;
}


/* --------------------------------------------------------------------------
   2. Accessibility — keyboard focus

   Divi's default focus states are weak or absent in places. A visible focus
   ring is a WCAG requirement and costs nothing. Do not remove this.
   -------------------------------------------------------------------------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.et_pb_button:focus-visible {
	outline: 3px solid var(--c-primary-light);
	outline-offset: 3px;
	border-radius: var(--radius-sm);
}

/* Skip link — lets keyboard users jump past the nav. Hidden until focused. */
.skip-to-content {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	padding: 12px 20px;
	background: var(--c-primary);
	color: var(--c-ink-reversed);
	font-weight: 600;
	text-decoration: none;
	border-radius: 0 0 var(--radius-md) 0;
}

.skip-to-content:focus {
	left: 0;
}


/* --------------------------------------------------------------------------
   3. Readability guards
   -------------------------------------------------------------------------- */

/* Stop long body copy running the full width of wide screens. Applied to the
   prose utility class — add "prose" to the CSS Class field of any Text module
   holding long-form content. */
.prose p,
.prose ul,
.prose ol,
.prose blockquote {
	max-width: var(--measure);
}

/* Prevent long URLs and unbroken strings blowing out mobile layouts. */
body {
	overflow-wrap: break-word;
}

/* Images never exceed their container. Divi mostly handles this; this catches
   images pasted into Text modules by the client. */
.et_pb_text img {
	max-width: 100%;
	height: auto;
}


/* --------------------------------------------------------------------------
   4. Polish
   -------------------------------------------------------------------------- */

::selection {
	background: var(--c-primary-light);
	color: var(--c-ink);
}

/* Smooth scrolling for anchor links, disabled for users who've asked for
   reduced motion. */
@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* Offset anchor targets so the sticky header doesn't cover the heading. */
:target {
	scroll-margin-top: 120px;
}

/* Respect the OS-level reduced-motion setting. Accessibility requirement, and
   it stops Divi's animations from causing problems for motion-sensitive users. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}


/* --------------------------------------------------------------------------
   5. Print
   -------------------------------------------------------------------------- */

@media print {
	.et-l--header,
	.et-l--footer,
	.et_pb_button,
	.et_pb_video,
	.et_pb_map {
		display: none !important;
	}

	body {
		color: #000;
		background: #fff;
		font-size: 12pt;
	}

	/* Show the destination of links when printed. */
	a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 0.85em;
		color: #555;
	}
}


/* --------------------------------------------------------------------------
   6. Project-specific overrides

   Add below this line. Comment every rule with WHY it exists — future-you will
   not remember, and neither will the next person.
   -------------------------------------------------------------------------- */


/* --------------------------------------------------------------------------
   7. Header — full width, sticky, logo left / menu right
   -------------------------------------------------------------------------- */

/* Sticky. Divi's header layout wrapper is the right element to pin. */
.et-l--header {
	position: sticky;
	top: 0;
	z-index: 9999;
	background: var(--c-surface);
	transition: box-shadow var(--duration) var(--easing);
}

/* Class added by the inline script in functions.php once scrolled past 40px.
   Scales the whole bar down noticeably so it reclaims vertical space on scroll. */
.et-l--header.absa-stuck { box-shadow: 0 2px 20px rgba(0, 28, 107, 0.16); }
.et-l--header.absa-stuck .et_pb_section { padding-top: 2px !important; padding-bottom: 2px !important; }
.et-l--header.absa-stuck .et_pb_menu__logo img { max-height: 38px; }
.et-l--header.absa-stuck .et_pb_menu__menu > nav > ul > li > a { font-size: 15px; }
.et-l--header.absa-stuck .absa-nav-row .et_pb_menu__menu li.nav-cta > a {
	padding: 11px 22px !important;
	font-size: 13px;
}

/* Divi 5 constrains rows with these custom properties — overriding them is
   cleaner than fighting max-width with !important. */
.absa-nav-row {
	--content-width: 100%;
	--content-max-width: 100%;
	padding-left: 44px !important;
	padding-right: 44px !important;
}

@media (max-width: 980px) {
	.absa-nav-row { padding-left: 20px !important; padding-right: 20px !important; }
}

/* Logo hard left, menu pushed hard right. */
.absa-nav-row .et_pb_menu_inner_container {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.absa-nav-row .et_pb_menu__wrap { margin-left: auto; justify-content: flex-end; flex-grow: 1; }
.absa-nav-row .et_pb_menu__menu { margin-left: auto; }
.absa-nav-row .et_pb_menu__menu > nav > ul { display: flex; align-items: center; gap: 6px; }

.absa-nav-row .et_pb_menu__logo img {
	max-height: 60px;
	width: auto;
	transition: max-height var(--duration) var(--easing);
}

/* Active page gets a gold underline.

   Drawn with an absolutely positioned pseudo-element, NOT padding or a border.
   Adding padding to only the active item changes that item's box height, which
   pushes it out of line with its neighbours — the "dropping" effect. This way
   every item keeps identical geometry whether active or not. */
.absa-nav-row .et_pb_menu__menu > nav > ul > li > a {
	position: relative;
	padding-bottom: 6px;
}

.absa-nav-row .et_pb_menu__menu > nav > ul > li.current-menu-item > a::before,
.absa-nav-row .et_pb_menu__menu > nav > ul > li.current-menu-ancestor > a::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: var(--c-accent);
}

/* The CTA is a button, not a nav link — it never gets the underline. */
.absa-nav-row .et_pb_menu__menu > nav > ul > li.nav-cta > a::before { display: none; }
.absa-nav-row .et_pb_menu__menu > nav > ul > li.nav-cta > a { padding-bottom: 15px; }


/* --------------------------------------------------------------------------
   8. Nav CTA — the "Find Your Sport" menu item rendered as a button

   Applied via the "nav-cta" class on the menu item, so it stays an ordinary
   WordPress menu item and can be reordered or relabelled in Appearance → Menus.
   -------------------------------------------------------------------------- */

.absa-nav-row .et_pb_menu__menu li.nav-cta { margin-left: 18px; }

.absa-nav-row .et_pb_menu__menu li.nav-cta > a {
	background: var(--c-accent);
	color: var(--c-ink) !important;      /* never white on gold — fails contrast */
	font-family: Montserrat, sans-serif;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 15px 28px !important;
	display: inline-block;
	line-height: 1;
	box-shadow: none;
	transition: background-color var(--duration) var(--easing),
	            transform var(--duration) var(--easing);
}

.absa-nav-row .et_pb_menu__menu li.nav-cta > a:hover {
	background: var(--c-accent-dark);
	transform: translateY(-2px);
	opacity: 1;
}


/* --------------------------------------------------------------------------
   9. Buttons — squared, and NO border

   Divi's default .et_pb_button carries a 2px border in the text colour, which
   reads as an unwanted outline on filled buttons. Stripped here rather than
   per-module so it can't reappear on a newly added button.
   -------------------------------------------------------------------------- */

.et_pb_button,
.et_pb_button:hover {
	border: 0 !important;
	border-width: 0 !important;
	border-radius: 0 !important;
	text-transform: uppercase;
	transition: background-color var(--duration) var(--easing),
	            color var(--duration) var(--easing),
	            transform var(--duration) var(--easing);
}

.et_pb_button:hover { transform: translateY(-2px); }

/* Divi injects an arrow via ::after and animates padding on hover, which makes
   buttons visibly resize. Suppressed — squared buttons read better without. */
.et_pb_button::after { display: none !important; }
.et_pb_button:hover { padding-left: 36px !important; padding-right: 36px !important; }

/* Hero CTAs side by side. Divi wraps each button module in its own block-level
   div, so the wrappers are what need to go inline. */
.absa-cta-inline { display: inline-block !important; vertical-align: top; }
.absa-cta-inline:first-of-type { margin-right: 14px; }

@media (max-width: 600px) {
	.absa-cta-inline { display: block !important; margin-right: 0 !important; }
	.absa-cta-inline .et_pb_button { display: block; text-align: center; }
}


/* --------------------------------------------------------------------------
   10. Diagonal section transitions

   Self-contained: the class clips its own top edge and pulls up over the
   section above, so neighbours need no matching rules. One variable controls
   the angle everywhere.
   -------------------------------------------------------------------------- */

:root { --slant: 72px; }

.absa-slant-t {
	clip-path: polygon(0 var(--slant), 100% 0, 100% 100%, 0 100%);
	margin-top: calc(var(--slant) * -1);
	position: relative;
	z-index: 2;
}

.absa-slant-t.absa-slant--alt {
	clip-path: polygon(0 0, 100% var(--slant), 100% 100%, 0 100%);
}

@media (max-width: 767px) { :root { --slant: 38px; } }


/* --------------------------------------------------------------------------
   11. Cards — squared, sport-coloured top edge, image-flush
   -------------------------------------------------------------------------- */

.absa-card {
	background: var(--c-surface);
	border-radius: 0;
	padding: 0 0 32px;
	box-shadow: var(--shadow-md);
	overflow: hidden;
	border-top: 5px solid var(--c-primary);
	transition: transform var(--duration) var(--easing),
	            box-shadow var(--duration) var(--easing);
}

.absa-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }

/* Per-sport top edge — the only place sport colours appear, so the four cards
   read as distinct without fracturing the brand. */
.absa-card--bv { border-top-color: #002995; }
.absa-card--fv { border-top-color: #0E7C7B; }
.absa-card--ab { border-top-color: #3B4EAE; }
.absa-card--bt { border-top-color: #E08A1E; }

.absa-card .et_pb_image { margin: 0 0 24px; }
.absa-card .et_pb_image img { width: 100%; display: block; transition: transform 400ms var(--easing); }
.absa-card:hover .et_pb_image img { transform: scale(1.04); }
.absa-card .et_pb_heading,
.absa-card .et_pb_text { padding-left: 28px; padding-right: 28px; }
.absa-card:not(:has(.et_pb_image)) { padding-top: 34px; }


/* --------------------------------------------------------------------------
   12. Sports cards overlap the hero

   Pulls the card grid up so it straddles the hero boundary. One of the
   strongest anti-template moves available — the grid stops reading as simply
   "the next section down".
   -------------------------------------------------------------------------- */

@media (min-width: 981px) {
	.absa-overlap { margin-top: -110px !important; position: relative; z-index: 5; }
}


/* --------------------------------------------------------------------------
   13. Step numbers as outlined watermarks
   -------------------------------------------------------------------------- */

.absa-step { position: relative; padding-left: 8px; }

.absa-step .et_pb_text:first-child p {
	-webkit-text-stroke: 2px var(--c-accent);
	color: transparent !important;
	font-size: 104px !important;
	opacity: .85;
}


/* --------------------------------------------------------------------------
   14. Asymmetric two-column
   -------------------------------------------------------------------------- */

@media (min-width: 981px) {
	.absa-asym .et_pb_column:last-child { margin-top: 46px; }
	.absa-asym .et_pb_column:first-child { padding-right: 40px; }
}


/* --------------------------------------------------------------------------
   15. Full-bleed section

   Edge to edge, no gutters. Breaks the column grid entirely, which is what
   stops a page reading as one repeated container.
   -------------------------------------------------------------------------- */

.absa-bleed .et_pb_row {
	--content-width: 100%;
	--content-max-width: 100%;
	padding: 0 !important;
	width: 100%;
}

.absa-bleed .et_pb_column { padding: 0; }
.absa-bleed .et_pb_image { margin: 0 !important; height: 100%; }
.absa-bleed .et_pb_image img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (min-width: 981px) {
	.absa-bleed .et_pb_column:last-child { padding: 80px 70px 80px 60px; }
}
@media (max-width: 980px) {
	.absa-bleed .et_pb_column:last-child { padding: 48px 24px; }
}


/* --------------------------------------------------------------------------
   16. Gold diagonal stripe behind the stats band
   -------------------------------------------------------------------------- */

.absa-stripe { position: relative; overflow: hidden; }

.absa-stripe::before {
	content: "";
	position: absolute;
	inset: -40% -10%;
	background: repeating-linear-gradient(
		115deg,
		rgba(255, 255, 255, 0.18) 0 2px,
		transparent 2px 34px
	);
	pointer-events: none;
}

.absa-stripe > * { position: relative; z-index: 1; }


/* --------------------------------------------------------------------------
   17. Section heading rule
   -------------------------------------------------------------------------- */

.absa-rule { display: block; width: 60px; height: 4px; background: var(--c-accent); margin: 0 0 22px; }
.absa-rule--center { margin-left: auto; margin-right: auto; }


/* --------------------------------------------------------------------------
   18. Centred CTA rows

   Divi wraps each button module in its own block-level div. The buttons are
   inline-block via .absa-cta-inline, so centring the container centres them.
   -------------------------------------------------------------------------- */

.absa-center { text-align: center; }
.absa-center .et_pb_button_module_wrapper { text-align: center; }


/* --------------------------------------------------------------------------
   19. Nav alignment

   Every top-level item is a flex row with identical geometry, so nothing sits
   higher or lower than its neighbours. Divi positions the dropdown arrow with
   an absolute ::after and a fixed top offset, which floats above the text once
   the link becomes a flex box — recentred here.
   -------------------------------------------------------------------------- */

.absa-nav-row .et_pb_menu__menu > nav > ul {
	display: flex;
	align-items: center;
	gap: 4px;
}

.absa-nav-row .et_pb_menu__menu > nav > ul > li {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0;
	float: none;
}

.absa-nav-row .et_pb_menu__menu > nav > ul > li > a {
	display: flex;
	align-items: center;
	line-height: 1;
	padding: 16px 12px !important;
	position: relative;
}

/* Room for the arrow, and recentre it against the text. */
.absa-nav-row .et_pb_menu__menu > nav > ul > li.menu-item-has-children > a {
	padding-right: 26px !important;
}

.absa-nav-row .et_pb_menu__menu > nav > ul > li.menu-item-has-children > a::after {
	top: 50% !important;
	bottom: auto !important;
	margin-top: 0 !important;
	right: 6px !important;
	transform: translateY(-50%);
	line-height: 1 !important;
}

/* Active underline pinned to the link's own bottom edge, so it can't shift the
   item's height. */
.absa-nav-row .et_pb_menu__menu > nav > ul > li.current-menu-item > a::before,
.absa-nav-row .et_pb_menu__menu > nav > ul > li.current-menu-ancestor > a::before {
	bottom: 8px;
	left: 12px;
	right: 12px;
}

/* The CTA matches the other items' box height exactly. */
.absa-nav-row .et_pb_menu__menu > nav > ul > li.nav-cta > a {
	padding: 15px 28px !important;
}

/* Dropdown panel sits below the flex row cleanly. */
.absa-nav-row .et_pb_menu__menu > nav > ul > li > ul.sub-menu {
	top: 100%;
	margin-top: 0;
}


/* --------------------------------------------------------------------------
   20. Equal-height card rows

   Divi columns are independent blocks, so cards with different copy lengths
   end at different heights and the grid looks ragged. Making the row a flex
   container lets every column stretch to the tallest.
   -------------------------------------------------------------------------- */

.absa-cards {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
}

.absa-cards > .et_pb_column {
	display: flex;
	flex-direction: column;
}

/* The card class sits on the column itself, so it needs to fill its own box. */
.absa-cards > .et_pb_column.absa-card {
	height: auto;
	align-self: stretch;
}

/* Push the last element down so buttons and links line up across the row
   regardless of how much copy sits above them. */
.absa-cards > .et_pb_column > .et_pb_module:last-child {
	margin-top: auto;
}

@media (max-width: 980px) {
	.absa-cards { display: block; }
	.absa-cards > .et_pb_column { display: block; }
}


/* --------------------------------------------------------------------------
   21. Icon cards

   Icon sits in a gold square. Cards with an icon have no image, so they need
   their own top padding — the image-led cards get theirs from the image.
   -------------------------------------------------------------------------- */

.absa-card--icon { padding-top: 36px; }

.absa-card--icon .et_pb_text:first-child { padding-left: 28px; padding-right: 28px; }

.absa-card--icon svg { display: block; }

/* Icon is unfilled — a larger blue glyph with a short gold rule beneath.
   The solid gold square was too heavy and competed with the headings. The
   gold rule echoes the logo lockup and the section heading rule. */
.absa-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	height: auto;
	background: none !important;
	margin-bottom: 18px !important;
	padding-bottom: 16px;
	position: relative;
	transition: transform var(--duration) var(--easing);
}

.absa-icon::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 38px;
	height: 3px;
	background: var(--c-accent);
}

.absa-card--icon:hover .absa-icon { transform: translateY(-3px); }
.absa-card--icon:hover .absa-icon::after { width: 54px; transition: width var(--duration) var(--easing); }


/* --------------------------------------------------------------------------
   22. FAQ toggles

   Divi's toggle module has no font attributes set, so titles and body copy
   fall back to Divi's defaults instead of Montserrat / Inter. Set here rather
   than per-module so any toggle added later inherits it.
   -------------------------------------------------------------------------- */

.et_pb_toggle {
	background: var(--c-surface);
	border: 0;
	border-bottom: 1px solid var(--c-border);
	border-radius: 0;
	padding: 4px 30px;
	margin-bottom: 0;
}

.et_pb_toggle_title {
	font-family: Montserrat, 'Segoe UI', sans-serif !important;
	font-weight: 700 !important;
	font-size: 19px !important;
	line-height: 1.4 !important;
	color: var(--c-ink) !important;
	letter-spacing: -0.005em;
	padding: 20px 46px 20px 0 !important;
	transition: color var(--duration) var(--easing);
}

.et_pb_toggle_title:hover { color: var(--c-primary) !important; }

.et_pb_toggle_content,
.et_pb_toggle_content p {
	font-family: Inter, -apple-system, 'Segoe UI', sans-serif !important;
	font-size: 17px !important;
	line-height: 1.75 !important;
	color: var(--c-ink-muted) !important;
}

.et_pb_toggle_content { padding-right: 44px; padding-bottom: 8px; }

/* Open state gets a gold left marker rather than a background change. */
.et_pb_toggle_open {
	box-shadow: inset 4px 0 0 var(--c-accent);
	padding-left: 30px;
}

.et_pb_toggle_open .et_pb_toggle_title { color: var(--c-primary) !important; }

/* Divi's +/- marker — recolour and align it with the new title padding. */
.et_pb_toggle_title::before {
	color: var(--c-accent) !important;
	font-size: 22px !important;
	top: 50% !important;
	transform: translateY(-50%);
	margin-top: 0 !important;
	right: 2px !important;
	left: auto !important;
}
