/*
 * Legal / policy pages — Privacy Policy, Terms & Conditions, Refund and
 * Returns Policy.
 *
 * Nothing new is invented here. The banner is the Page Header block's
 * (blocks/page-header/style.css, loaded alongside this file); the body borrows
 * the article layout's measurements from ksa-blog.css so a policy and an
 * article read at the same size, in the same column, beside the same sidebar.
 * The colours are the design tokens from ksa-theme.css.
 */

/* ======================================================================
 * Date strip and the row of policies
 * ====================================================================== */

.lg-strip { background: #F1F6FD; border-bottom: 1px solid #DCE9FB; }
.lg-strip-in {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px 26px;
	flex-wrap: wrap;
	padding-top: 13px;
	padding-bottom: 13px;
}

.lg-updated { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #58595B; margin: 0; }
.lg-updated svg { flex-shrink: 0; color: #3B7DD8; }
.lg-updated time { font-weight: 700; color: #10469E; }

/*
 * The other policies. Pills rather than the header's underline treatment —
 * this row sits on a tinted band, where an underline would read as part of the
 * band's border rather than as a tab.
 */
.lg-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.lg-tab,
.lg-tab:visited {
	display: inline-block;
	background: #FFFFFF;
	border: 1px solid #DCE9FB;
	border-radius: 3px;
	padding: 8px 15px;
	font-size: 13px;
	font-weight: 600;
	color: #3C4654;
	white-space: nowrap;
}
.lg-tab:hover,
.lg-tab:focus { border-color: #3B7DD8; background: #FFFFFF; color: #10469E; }
.lg-tab.is-current,
.lg-tab.is-current:visited,
.lg-tab.is-current:hover { background: #10469E; border-color: #10469E; color: #FFFFFF; font-weight: 700; }

/* ======================================================================
 * Body — prose beside the sticky sidebar
 * ====================================================================== */

.lg-body {
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 56px;
	align-items: start;
	padding-top: 38px;
	padding-bottom: 56px;
}

.lg-art { max-width: 72ch; min-width: 0; }
.lg-art > *:first-child { margin-top: 0; }
.lg-art > *:last-child { margin-bottom: 0; }

.lg-art p { font-size: 15.5px; line-height: 1.8; color: #2E3742; margin: 0 0 18px; text-wrap: pretty; }

/*
 * Each clause opens with a hairline above it, so a long policy scans as a
 * stack of sections rather than one unbroken column. The first heading skips
 * the rule — there is nothing above it to separate from.
 */
.lg-art h2 {
	font-size: 22px;
	font-weight: 700;
	color: #111111;
	margin: 40px 0 14px;
	padding-top: 26px;
	border-top: 1px solid #E3E6EB;
}
.lg-art > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.lg-art h3 { font-size: 17.5px; font-weight: 700; color: #111111; margin: 26px 0 10px; }
.lg-art h4 { font-size: 15.5px; font-weight: 700; color: #10469E; margin: 22px 0 8px; }

/* Focused by the contents list, so it lands clear of the viewport edge. */
.lg-art h2[id] { scroll-margin-top: 24px; }
.lg-art h2[id]:focus { outline: none; }
.lg-art h2[id]:focus-visible { outline: 2px solid #3B7DD8; outline-offset: 4px; }

.lg-art ul,
.lg-art ol { margin: 0 0 18px; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.lg-art li { font-size: 15.5px; line-height: 1.75; color: #2E3742; }
.lg-art li::marker { color: #3B7DD8; }
.lg-art li > ul,
.lg-art li > ol { margin: 9px 0 0; }

/*
 * Content comes from the editor, so the design's hand-written classes will not
 * be on it. A plain blockquote is where a policy quotes a statute or calls out
 * a condition, and gets the article's pull-quote rule.
 */
.lg-art blockquote { border-left: 3px solid #3B7DD8; background: #F7FAFE; padding: 16px 22px; margin: 26px 0; border-radius: 0 4px 4px 0; }
.lg-art blockquote p { font-size: 15px; line-height: 1.7; color: #10469E; margin: 0 0 10px; }
.lg-art blockquote > *:last-child { margin-bottom: 0; }
.lg-art blockquote cite { display: block; font-size: 13px; font-style: normal; color: #8A919C; }

/* A wide table scrolls inside the column rather than widening the page. */
.lg-art .wp-block-table { overflow-x: auto; margin: 0 0 22px; }
.lg-art table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 14.5px; }
.lg-art th,
.lg-art td { border: 1px solid #E3E6EB; padding: 10px 12px; text-align: left; line-height: 1.6; color: #2E3742; }
.lg-art th { background: #F7F8FA; font-weight: 700; color: #111111; }

.lg-art a { color: #10469E; text-decoration: underline; text-underline-offset: 2px; }
.lg-art a:hover,
.lg-art a:focus { color: #3B7DD8; }
.lg-art strong { color: #111111; font-weight: 700; }
.lg-art hr { border: 0; border-top: 1px solid #E3E6EB; margin: 34px 0; }
.lg-art figure { margin: 26px 0; }
.lg-art img { border-radius: 5px; display: block; }
.lg-art figcaption { font-size: 13px; line-height: 1.6; color: #8A919C; margin-top: 9px; }

/* ======================================================================
 * Closing call to action
 * ====================================================================== */

/* The article's end-of-post panel, reused: same navy, same radius, same
   white button, so a policy ends the way a post does. */
.lg-cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 26px;
	flex-wrap: wrap;
	background: #0C3474;
	border-radius: 5px;
	padding: 28px 30px;
	margin-top: 40px;
}
.lg-cta h2 { font-size: 20px; font-weight: 700; color: #FFFFFF; margin: 0 0 6px; padding: 0; border: 0; }
.lg-cta p { font-size: 14px; line-height: 1.6; color: #C9DCF8; margin: 0; max-width: 46ch; }
.lg-cta-btn,
.lg-cta-btn:visited {
	background: #FFFFFF;
	color: #0C3474;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.06em;
	padding: 14px 26px;
	border-radius: 3px;
	white-space: nowrap;
	text-decoration: none;
}
.lg-cta .lg-cta-btn { text-decoration: none; }
.lg-cta-btn:hover,
.lg-cta-btn:focus { background: #DCE9FB; color: #0C3474; }

/* ======================================================================
 * Sidebar
 * ====================================================================== */

.lg-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lg-side-card { border: 1px solid #E3E6EB; border-radius: 5px; padding: 18px 18px 20px; }
.lg-side-card h2 { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #8A919C; margin: 0 0 12px; }

/*
 * Contents list. The markup also carries .bd-toc, which is what
 * assets/js/ksa-blog.js looks for — the scroll spy is shared with the article
 * pages. The look is not: ksa-blog.css only loads on the blog, so the rules
 * are restated here against .lg-toc rather than left to a stylesheet this page
 * never gets. A long policy scrolls the list rather than the rail.
 */
.lg-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: toc; max-height: 60vh; overflow-y: auto; }
/* Numbered with a counter rather than the <ol> marker: the entries are flex
   rows, which suppresses the native marker, and this keeps the number aligned
   to the first line of a clause title that wraps. */
.lg-toc li { counter-increment: toc; display: flex; gap: 9px; }
.lg-toc li::before { content: counter(toc) "."; font-size: 13px; font-weight: 800; color: #3B7DD8; flex-shrink: 0; }
.lg-toc a { font-size: 13.5px; line-height: 1.5; color: #3C4654; }
.lg-toc a:hover,
.lg-toc a:focus { color: #10469E; }
/* Set by assets/js/ksa-blog.js as the reader moves down the page. */
.lg-toc a.is-active { color: #10469E; font-weight: 700; }

.lg-side-help { background: #F7FAFE; border-color: #D9E6F8; }
.lg-side-help p { font-size: 13.5px; line-height: 1.6; color: #3C4654; margin: 0 0 12px; }
.lg-side-line { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: #10469E; padding: 7px 0; }
.lg-side-line svg { flex-shrink: 0; }
/*
 * The shared mail and phone icons are drawn in the pale blue they need against
 * the navy utility bar. On a white card that is barely visible, so they take
 * the link's own colour — a CSS declaration outranks the presentation
 * attribute in the sprite.
 */
.lg-side-line svg path,
.lg-side-line svg rect { stroke: currentColor; }
.lg-side-line span { word-break: break-word; }
.lg-side-line:hover { color: #3B7DD8; }

.lg-side-more ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.lg-side-more a { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; font-weight: 600; color: #3C4654; padding: 9px 0; }
.lg-side-more a:hover { color: #10469E; }
.lg-side-more svg { flex-shrink: 0; opacity: 0; transform: translateX(-4px); transition: opacity 0.16s ease, transform 0.16s ease; }
.lg-side-more a:hover svg,
.lg-side-more a:focus svg { opacity: 1; transform: translateX(0); }

.lg-edit { padding-bottom: 34px; font-size: 13px; }

/* ======================================================================
 * Tablet
 * ====================================================================== */

@media (max-width: 1000px) {
	.lg-body { grid-template-columns: 1fr; gap: 32px; }
	/* Contents first, then the page: on one column a sticky rail has nothing
	   to sit beside, and a list of clauses is more use before the text than
	   after it. */
	.lg-side { position: static; order: -1; flex-direction: row; flex-wrap: wrap; }
	.lg-side-card { flex: 1; min-width: 240px; }
	.lg-toc { max-height: none; }
	.lg-art { max-width: none; }
}

/* ======================================================================
 * Mobile
 * ====================================================================== */

@media (max-width: 640px) {
	.lg-strip-in { flex-direction: column; align-items: flex-start; gap: 12px; }
	.lg-tabs { gap: 6px; }
	.lg-tab { padding: 7px 12px; font-size: 12.5px; }
	.lg-body { padding-top: 26px; padding-bottom: 38px; gap: 26px; }
	.lg-art p,
	.lg-art li { font-size: 15px; }
	.lg-art h2 { font-size: 19.5px; margin-top: 30px; padding-top: 20px; }
	.lg-art h3 { font-size: 16.5px; }
	.lg-cta { padding: 22px; gap: 18px; }
	.lg-cta h2 { font-size: 18px; }
	.lg-cta-btn { width: 100%; text-align: center; }
	.lg-side { flex-direction: column; }
	.lg-side-card { min-width: 0; }
}

/* ======================================================================
 * Print
 * ====================================================================== */

/*
 * A policy is the one page on this site people do print, or save as a PDF for
 * a procurement file. Everything that is navigation goes; the text and the URL
 * behind each link stay.
 */
@media print {
	.util,
	.hdr,
	.menu-m,
	.ftr,
	.lg-tabs,
	.lg-side,
	.lg-cta,
	.lg-edit,
	.skip-link { display: none !important; }

	.pagehead { background: none !important; color: #000000 !important; padding: 0 0 12px; border-bottom: 1px solid #999999; }
	.pagehead h1 { color: #000000 !important; font-size: 22pt; }
	.pagehead p,
	.pagehead .crumb { color: #333333 !important; }

	.lg-strip { background: none; border-bottom: 0; }
	.lg-strip-in { padding: 8px 0 0; }
	.lg-body { display: block; padding: 0; }
	.lg-art { max-width: none; }
	.lg-art p,
	.lg-art li { font-size: 10.5pt; line-height: 1.55; color: #000000; }
	.lg-art h2 { font-size: 14pt; break-after: avoid; page-break-after: avoid; }
	.lg-art h3 { font-size: 12pt; break-after: avoid; page-break-after: avoid; }
	.lg-art a { color: #000000; }
	/* Paper has no hover, so a link's destination has to be on the page. */
	.lg-art a[href^="http"]::after { content: " (" attr( href ) ")"; font-size: 9pt; color: #555555; word-break: break-all; }
}
