/* =======================================================================
 * ax-legal — Terms & Conditions, Privacy Policy and Cookie Policy styling.
 *
 * CSS only: the page content in WordPress is untouched. The T&C and Privacy
 * pages are Word-pasted markup with no real headings, so the styling keys
 * off the structures the paste left behind:
 *
 *   Terms & Conditions  — section titles are <p> whose only child is <strong>
 *                         ("I  About Us", "II  Purpose", …), the whole
 *                         document sits inside one <ol><li> wrapper.
 *   Privacy Policy      — numbered sections are single-item <ol>s, sub-headings
 *                         are single-item <ul>s, and every <ol> restarts at
 *                         "1." (a CSS counter renumbers them 1–11).
 *   Cookie Policy       — clean markup: real <h2>/<h3> with their own numbers
 *                         ("1. Introduction", "2.1 …") and plain paragraphs,
 *                         so it only needs the shared rules plus section 6.
 *
 * All selectors are scoped under #top (Enfold's body id) per the site
 * convention, and limited to the three page bodies.
 *
 * Version 1.1.0
 * ===================================================================== */

/* -----------------------------------------------------------------------
 * 1. Tokens + page shell
 * -------------------------------------------------------------------- */
#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) {
	--ax-purple: #444192;
	--ax-green: #00bd87;
	--ax-ink: #1a1a1a;
	--ax-muted: #5b5b6b;
	--ax-line: rgba(0, 0, 0, .1);
}

/* The T&C page is built with an ALB section on #f5f5f5; the Privacy Policy
 * uses the default page template, whose wrap is white. Both run plain on
 * white, like the article pages. Set this to #f5f5f5 for a grey ground. */
#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) #main > .container_wrap {
	background-color: #fff;
}

/* Narrower measure than the 1448px site container — long legal copy needs a
 * readable line length. Top padding clears the fixed 112px header. */
#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) #main > .container_wrap > .container {
	max-width: 960px;
	padding-top: 78px;
	padding-bottom: 96px;
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock {
	font-family: "Montserrat", sans-serif !important;
	font-size: 16px !important;
	line-height: 1.75 !important;
	color: var(--ax-ink) !important;
}

/* -----------------------------------------------------------------------
 * 2. Document title
 *
 * T&C already carries its title as the first <strong> in the wrapper list
 * item. The Privacy and Cookie policies have no title in the content at
 * all, so one is generated. Swap the strings below if the wording should
 * change; if you'd rather have a real <h1> in the DOM, add a heading
 * element at the top of the Enfold text block and delete that ::before.
 * -------------------------------------------------------------------- */
#top.page-id-2591 .avia_textblock > ol > li > strong:first-child,
#top:is(.page-id-2633, .page-id-3, .privacy-policy) .avia_textblock::before {
	display: block;
	font-family: "Montserrat", sans-serif;
	font-size: 34px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .6px;
	text-transform: uppercase;
	color: var(--ax-purple);
	margin: 0 0 34px;
}

#top:is(.page-id-3, .privacy-policy) .avia_textblock::before {
	content: "Privacy Policy";
}

#top.page-id-2633 .avia_textblock::before {
	content: "IP Address and Cookie Policy";
}

/* -----------------------------------------------------------------------
 * 3. Body copy, links, lists (shared)
 * -------------------------------------------------------------------- */
#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock p {
	font-size: 16px;
	line-height: 1.75;
	color: var(--ax-ink);
	margin: 0 0 18px;
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock strong {
	font-weight: 600;
	color: var(--ax-ink);
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock a {
	color: var(--ax-purple);
	text-decoration: underline;
	text-underline-offset: 3px;
	word-break: break-word;
	transition: color .2s ease;
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock a:hover {
	color: var(--ax-green);
}

/* Real lists — anything with more than one item. Single-item lists are
 * headings on the Privacy Policy and are handled in section 5. */
#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock ul:not(:has(> li:only-child)),
#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock ol:not(:has(> li:only-child)) {
	margin: 0 0 20px;
	padding-left: 26px;
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock ul:not(:has(> li:only-child)) {
	list-style: disc;
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock ol:not(:has(> li:only-child)) {
	list-style: decimal;
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock ul:not(:has(> li:only-child)) > li,
#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock ol:not(:has(> li:only-child)) > li {
	font-size: 16px;
	line-height: 1.75;
	color: var(--ax-ink);
	margin: 0 0 10px;
	padding-left: 4px;
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock li::marker {
	color: var(--ax-purple);
}

/* -----------------------------------------------------------------------
 * 4. Terms & Conditions
 * -------------------------------------------------------------------- */

/* The whole document is wrapped in a single <ol><li> — kill the stray "1." */
#top.page-id-2591 .avia_textblock > ol {
	list-style: none;
	margin: 0;
	padding: 0;
}

#top.page-id-2591 .avia_textblock > ol > li {
	margin: 0;
	padding: 0;
}

/* Section headings: a paragraph whose only child is <strong>. */
#top.page-id-2591 .avia_textblock p:has(> strong:only-child) {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--ax-purple);
	margin: 46px 0 16px;
}

#top.page-id-2591 .avia_textblock p:has(> strong:only-child) strong {
	font-weight: 700;
	color: inherit;
}

/* Three stray empty bold paragraphs (<p><strong>&nbsp;</strong></p>) sit
 * directly above a real heading. A bold-only paragraph immediately followed
 * by another bold-only paragraph is always one of those — hide it. */
#top.page-id-2591 .avia_textblock p:has(> strong:only-child):has(+ p > strong:only-child) {
	display: none;
}

/* -----------------------------------------------------------------------
 * 5. Privacy Policy
 * -------------------------------------------------------------------- */

/* Numbered sections. Every <ol> in the paste restarts at "1.", so the native
 * marker is dropped and a counter numbers them 1–11 in document order. */
#top:is(.page-id-3, .privacy-policy) .avia_textblock {
	counter-reset: ax_legal_sect;
}

#top:is(.page-id-3, .privacy-policy) .avia_textblock > ol:has(> li:only-child) {
	counter-increment: ax_legal_sect;
	list-style: none;
	margin: 50px 0 18px;
	padding: 0;
}

#top:is(.page-id-3, .privacy-policy) .avia_textblock > ol:has(> li:only-child):first-child {
	margin-top: 6px;
}

#top:is(.page-id-3, .privacy-policy) .avia_textblock > ol:has(> li:only-child) > li {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--ax-purple);
	margin: 0;
	padding: 0;
}

#top:is(.page-id-3, .privacy-policy) .avia_textblock > ol:has(> li:only-child) > li::before {
	content: counter(ax_legal_sect) ". ";
}

/* The heading text is wrapped in <strong> in the paste — let it take the
 * heading's own colour and weight instead of the body-copy <strong> rule. */
#top:is(.page-id-3, .privacy-policy) .avia_textblock > ol:has(> li:only-child) > li strong,
#top:is(.page-id-3, .privacy-policy) .avia_textblock > ul:has(> li:only-child) > li strong {
	color: inherit;
	font-weight: inherit;
}

/* Sub-headings: single-item <ul>s ("About Us", "Scope", "Controller", …). */
#top:is(.page-id-3, .privacy-policy) .avia_textblock > ul:has(> li:only-child) {
	list-style: none;
	margin: 34px 0 12px;
	padding: 0;
}

#top:is(.page-id-3, .privacy-policy) .avia_textblock > ul:has(> li:only-child) > li {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--ax-ink);
	margin: 0;
	padding: 0;
}

/* Exceptions — three single-item lists in "General Terms" that are body
 * clauses, not headings. Targeted by position, so if that part of the page
 * is re-edited these three numbers need checking (they are the 21st, 23rd
 * and 25th blocks in the text block). */
#top:is(.page-id-3, .privacy-policy) .avia_textblock > ul:nth-child(21):has(> li:only-child),
#top:is(.page-id-3, .privacy-policy) .avia_textblock > ul:nth-child(23):has(> li:only-child),
#top:is(.page-id-3, .privacy-policy) .avia_textblock > ul:nth-child(25):has(> li:only-child) {
	list-style: disc;
	margin: 0 0 12px;
	padding-left: 26px;
}

#top:is(.page-id-3, .privacy-policy) .avia_textblock > ul:nth-child(21):has(> li:only-child) > li,
#top:is(.page-id-3, .privacy-policy) .avia_textblock > ul:nth-child(23):has(> li:only-child) > li,
#top:is(.page-id-3, .privacy-policy) .avia_textblock > ul:nth-child(25):has(> li:only-child) > li {
	font-size: 16px;
	font-weight: 400;
	line-height: 1.75;
	color: var(--ax-ink);
}

/* -----------------------------------------------------------------------
 * 6. Real headings (Cookie Policy)
 *
 * The Cookie Policy is the one document that came through with proper
 * <h2>/<h3> elements, already carrying their own numbering ("1.",
 * "2.1"). Matched to the pseudo-headings on the other two pages: h2 = the
 * 22px purple section, h3 = the 18px ink sub-heading. Kept in the shared
 * group so any heading later added to the other pages picks it up.
 * -------------------------------------------------------------------- */
#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock h2 {
	font-family: "Montserrat", sans-serif;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--ax-purple);
	margin: 46px 0 16px;
	padding: 0;
	text-transform: none;
	letter-spacing: normal;
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock h3 {
	font-family: "Montserrat", sans-serif;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--ax-ink);
	margin: 32px 0 12px;
	padding: 0;
	text-transform: none;
	letter-spacing: normal;
}

/* An h3 straight after its h2 keeps the section together */
#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock h2 + h3 {
	margin-top: 22px;
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock h2:first-child {
	margin-top: 6px;
}

/* -----------------------------------------------------------------------
 * 7. Tables
 *
 * Two shapes: 2-column contact blocks (label / value) and the 3-column
 * "Purpose / Type of data / Lawful basis" table on the Privacy Policy,
 * whose first row is a header in the original markup.
 * -------------------------------------------------------------------- */
#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock table {
	width: 100% !important;
	table-layout: auto;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--ax-line);
	border-radius: 16px;
	overflow: hidden;
	margin: 26px 0 30px;
	font-size: 15px;
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock td {
	width: auto !important;
	padding: 14px 18px;
	border: 0;
	border-top: 1px solid var(--ax-line);
	vertical-align: top;
	line-height: 1.6;
	color: var(--ax-ink);
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock tr:first-child td {
	border-top: 0;
}

/* 3-column table — first row is the header */
#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock table:has(tr:first-child td:nth-child(3)) tr:first-child td,
#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock table:has(tr:first-child td:nth-child(3)) tr:first-child td strong {
	background: var(--ax-purple);
	color: #fff;
	font-weight: 600;
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock table:has(tr:first-child td:nth-child(3)) tr:nth-child(even) td {
	background: #faf9fc;
}

/* 2-column contact block — label column */
#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock table:not(:has(tr:first-child td:nth-child(3))) td:first-child {
	color: var(--ax-muted);
	font-weight: 500;
	white-space: nowrap;
}

#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock table p {
	margin: 0;
	font-size: inherit;
	line-height: inherit;
}

/* -----------------------------------------------------------------------
 * 8. Responsive
 * -------------------------------------------------------------------- */
@media only screen and (max-width: 989px) {
	#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) #main > .container_wrap > .container {
		padding-top: 56px;
		padding-bottom: 70px;
	}
}

@media only screen and (max-width: 767px) {
	#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock {
		font-size: 15px !important;
	}

	#top.page-id-2591 .avia_textblock > ol > li > strong:first-child,
	#top:is(.page-id-3, .privacy-policy) .avia_textblock::before {
		font-size: 25px;
		margin-bottom: 26px;
	}

	#top.page-id-2591 .avia_textblock p:has(> strong:only-child),
	#top:is(.page-id-3, .privacy-policy) .avia_textblock > ol:has(> li:only-child) > li,
	#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock h2 {
		font-size: 19px;
	}

	#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock h3 {
		font-size: 17px;
	}

	#top:is(.page-id-3, .privacy-policy) .avia_textblock > ol:has(> li:only-child) {
		margin-top: 38px;
	}

	#top:is(.page-id-3, .privacy-policy) .avia_textblock > ul:has(> li:only-child) > li {
		font-size: 17px;
	}

	#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock p,
	#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock ul:not(:has(> li:only-child)) > li,
	#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock ol:not(:has(> li:only-child)) > li {
		font-size: 15px;
	}

	/* The 3-column table scrolls sideways rather than crushing to nothing */
	#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock table:has(tr:first-child td:nth-child(3)) {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock table:has(tr:first-child td:nth-child(3)) td {
		min-width: 190px;
		padding: 12px 14px;
	}

	#top:is(.page-id-2591, .page-id-2633, .page-id-3, .privacy-policy) .avia_textblock table:not(:has(tr:first-child td:nth-child(3))) td {
		white-space: normal;
	}
}
