/*
 * The Advance Media — Base
 * Reset, document, typography, layout primitives, accessibility.
 * Depends on tokens.css. No component styles here.
 */

/* ---------------------------------------------------------------- reset */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* offset for the fixed header when jumping to an anchor */
	scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
	margin: 0;
}

ul[class],
ol[class] {
	list-style: none;
	padding: 0;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

button {
	background: none;
	border: 0;
	cursor: pointer;
}

table {
	border-collapse: collapse;
	width: 100%;
}

/* ------------------------------------------------------------- document */

body {
	background: var(--tam-ivory);
	color: var(--tam-text);
	font-family: var(--ff-body);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-synthesis-weight: none;
	overflow-x: hidden;
}

/* Reserve room for the sticky mobile CTA bar so it never covers content (spec §55) */
@media (max-width: 767px) {
	body.has-sticky-cta {
		padding-bottom: 64px;
	}
}

/* --------------------------------------------------------- typography */

h1,
h2,
h3,
h4 {
	font-family: var(--ff-display);
	font-weight: 400;
	line-height: var(--lh-heading);
	letter-spacing: var(--ls-heading);
	text-wrap: balance;
	color: var(--tam-text);
}

h1 {
	font-size: var(--fs-h1);
}
h2 {
	font-size: var(--fs-h2);
}
h3 {
	font-size: var(--fs-h3);
}
h4 {
	font-size: var(--fs-h4);
	font-family: var(--ff-body);
	font-weight: 600;
	letter-spacing: 0;
}

p {
	text-wrap: pretty;
}

a {
	color: inherit;
	text-decoration-color: var(--tam-gold);
	text-underline-offset: 0.22em;
	text-decoration-thickness: 1px;
	transition: color var(--dur-fast) var(--ease),
		text-decoration-color var(--dur-fast) var(--ease);
}

a:hover {
	text-decoration-color: currentColor;
}

strong,
b {
	font-weight: 600;
}

small {
	font-size: var(--fs-small);
	line-height: var(--lh-small);
}

code,
kbd,
samp {
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
	font-size: 0.92em;
	background: var(--tam-beige-soft);
	padding: 0.12em 0.36em;
	border-radius: var(--r-sm);
}

hr {
	border: 0;
	border-top: 1px solid var(--tam-line);
	margin: var(--sp-6) 0;
}

/* -------------------------------------------------------- helper types */

.tam-eyebrow {
	display: inline-block;
	font-family: var(--ff-body);
	font-size: var(--fs-eyebrow);
	font-weight: 600;
	letter-spacing: var(--ls-eyebrow);
	text-transform: uppercase;
	color: var(--tam-muted);
	margin-bottom: var(--sp-3);
}

.tam-eyebrow--gold {
	color: var(--tam-gold);
}

.tam-display {
	font-size: var(--fs-display);
	line-height: var(--lh-display);
	letter-spacing: var(--ls-display);
}

.tam-lead {
	font-size: var(--fs-lead);
	line-height: var(--lh-lead);
	color: var(--tam-muted);
	max-width: var(--measure);
}

.tam-muted {
	color: var(--tam-muted);
}

.tam-note {
	font-size: var(--fs-small);
	line-height: var(--lh-small);
	color: var(--tam-muted);
}

/* --------------------------------------------------------- layout */

.tam-container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.tam-container--wide {
	max-width: var(--container-wide);
}

.tam-container--narrow {
	max-width: var(--container-narrow);
}

.tam-section {
	padding-block: var(--section-y);
	position: relative;
}

.tam-section--tight {
	padding-block: calc(var(--section-y) * 0.62);
}

/* Dark band. Inverts every colour role in one place so components don't
   need their own dark variants. */
.tam-section--dark {
	background: var(--tam-charcoal);
	color: var(--tam-ink-on-dark);
	--tam-text: var(--tam-ink-on-dark);
	--tam-muted: var(--tam-muted-on-dark);
	--tam-line: var(--tam-line-dark);
	--tam-line-strong: rgba(247, 244, 238, 0.32);
	--tam-white: rgba(247, 244, 238, 0.05);
}

.tam-section--beige {
	background: var(--tam-beige);
}

.tam-section--white {
	background: var(--tam-white);
}

/* Section heading block */
.tam-section-head {
	max-width: 46rem;
	margin-bottom: var(--sp-6);
}

.tam-section-head--center {
	margin-inline: auto;
	text-align: center;
}

.tam-section-head p {
	margin-top: var(--sp-3);
}

/* Prose column — article and legal body */
.tam-prose {
	max-width: var(--measure);
}

.tam-prose > * + * {
	margin-top: var(--sp-4);
}

.tam-prose h2 {
	margin-top: var(--sp-7);
	margin-bottom: var(--sp-3);
}

.tam-prose h3 {
	margin-top: var(--sp-6);
	margin-bottom: var(--sp-2);
}

.tam-prose ul,
.tam-prose ol {
	padding-left: 1.25rem;
}

.tam-prose li + li {
	margin-top: var(--sp-1);
}

.tam-prose ul {
	list-style: none;
	padding-left: 0;
}

.tam-prose ul > li {
	position: relative;
	padding-left: 1.5rem;
}

.tam-prose ul > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.75em;
	width: 8px;
	height: 1px;
	background: var(--tam-gold);
}

.tam-prose blockquote {
	border-left: 2px solid var(--tam-gold);
	padding-left: var(--sp-4);
	font-family: var(--ff-display);
	font-size: var(--fs-h3);
	line-height: 1.35;
}

.tam-prose table {
	font-size: var(--fs-small);
}

.tam-prose th,
.tam-prose td {
	text-align: left;
	padding: var(--sp-2) var(--sp-3);
	border-bottom: 1px solid var(--tam-line);
	vertical-align: top;
}

.tam-prose th {
	font-weight: 600;
	border-bottom-color: var(--tam-line-strong);
}

/* Any wide content scrolls inside itself — the page body never scrolls sideways */
.tam-scroll-x {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* Grids */
.tam-grid {
	display: grid;
	gap: var(--sp-4);
}

@media (min-width: 640px) {
	.tam-grid--2 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 900px) {
	.tam-grid--3 {
		grid-template-columns: repeat(3, 1fr);
	}
	.tam-grid--4 {
		grid-template-columns: repeat(4, 1fr);
	}
	.tam-grid--2-1 {
		grid-template-columns: 1.15fr 0.85fr;
		gap: var(--sp-7);
		align-items: center;
	}
}

@media (min-width: 640px) and (max-width: 899px) {
	.tam-grid--3,
	.tam-grid--4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ------------------------------------------------------- accessibility */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.tam-skip-link {
	position: absolute;
	left: var(--sp-3);
	top: var(--sp-3);
	z-index: var(--z-skip);
	transform: translateY(-200%);
	background: var(--tam-charcoal);
	color: var(--tam-ivory);
	padding: var(--sp-2) var(--sp-4);
	border-radius: var(--r-sm);
	text-decoration: none;
	transition: transform var(--dur-fast) var(--ease);
}

.tam-skip-link:focus {
	transform: translateY(0);
}

/* One focus treatment for the whole site. Never remove it. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--tam-gold);
	outline-offset: 2px;
	border-radius: var(--r-sm);
}

/* ---------------------------------------------------------- motion */

.tam-reveal {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity var(--dur-slow) var(--ease),
		transform var(--dur-slow) var(--ease);
	will-change: opacity, transform;
}

.tam-reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* Stagger children without per-element JS */
.tam-reveal-group > * {
	transition-delay: calc(var(--i, 0) * 70ms);
}

/*
 * Global reduced-motion contract (spec §58, §91).
 * Implemented once here so no component needs its own guard.
 */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}

	.tam-reveal {
		opacity: 1;
		transform: none;
	}
}

/* -------------------------------------------------------------- print */

@media print {
	.tam-header,
	.tam-footer,
	.tam-sticky-cta,
	.tam-whatsapp-float,
	.tam-consent {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
	}
}
