/*
 * IRMI Foundation theme styles
 * Colours follow the IRMI logo: deep blue and cyan lead; purple, pink and amber are small accents only.
 */

/* ---------- Tokens ---------- */
:root {
	--irmi-blue-deep: #0a1f61;
	--irmi-blue: #072e73;
	--irmi-cyan: #00c1f0;
	--irmi-cyan-dark: #00749c;
	--irmi-cyan-hl: #0092c3;
	--irmi-muted: #505d85;
	--irmi-paper: #f7f9fd;
	--irmi-mist: #eef3fb;
	--irmi-line: #dde5f2;
	--irmi-white: #fff;
	--irmi-purple: #6847fb;
	--irmi-pink: #eb3094;
	--irmi-amber: #fcb203;

	--irmi-display: "Montserrat", Arial, sans-serif;
	--irmi-sans: "Source Sans 3", "Segoe UI", sans-serif;

	--irmi-wrap: 1240px;
	--irmi-narrow: 760px;
	--irmi-gutter: clamp(16px, 4vw, 32px);
	--irmi-radius: 16px;
	--irmi-radius-sm: 10px;
	--irmi-shadow: 0 12px 32px -14px color-mix(in srgb, var(--irmi-blue-deep) 22%, transparent);
	--irmi-ease: cubic-bezier(.22, 1, .36, 1);

	/* Typography tokens (changed from Appearance > Customize > IRMI Foundation > Global typography) */
	--irmi-font-size: 1.0625rem;
	--irmi-line-height: 1.7;
	--irmi-heading-weight: 700;
	--irmi-h1-weight: 800;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

body {
	margin: 0;
	background: var(--irmi-white);
	color: var(--irmi-blue-deep);
	font-family: var(--irmi-sans);
	font-size: var(--irmi-font-size);
	line-height: var(--irmi-line-height);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; }
img { display: block; }

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .5em;
	font-family: var(--irmi-display);
	font-weight: var(--irmi-heading-weight);
	line-height: 1.2;
	color: var(--irmi-blue-deep);
	letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: var(--irmi-h1-weight); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.2rem; }
h5, h6 { font-size: 1rem; }

p, ul, ol, dl, blockquote, figure, pre, table { margin: 0 0 1.25em; }

a { color: var(--irmi-cyan-dark); text-underline-offset: .18em; transition: color .2s var(--irmi-ease); }
a:hover { color: var(--irmi-blue); }

:focus-visible { outline: 3px solid var(--irmi-cyan); outline-offset: 3px; border-radius: 4px; }

hr { border: 0; border-top: 1px solid var(--irmi-line); margin: 2.5em 0; }

blockquote, .wp-block-quote {
	padding: .25em 0 .25em 1.25em;
	border-left: 4px solid var(--irmi-cyan);
	font-size: 1.15em;
	color: var(--irmi-blue);
}
blockquote cite { display: block; margin-top: .5em; font-size: .85em; font-style: normal; color: var(--irmi-muted); }

code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
pre { padding: 1.25em; background: var(--irmi-paper); border: 1px solid var(--irmi-line); border-radius: var(--irmi-radius-sm); overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: .7em .9em; border-bottom: 1px solid var(--irmi-line); text-align: left; }
th { font-family: var(--irmi-display); font-weight: 600; font-size: .9em; }

/* ---------- 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;
}
.skip-link:focus {
	position: fixed !important;
	top: 12px; left: 12px;
	z-index: 100000;
	width: auto; height: auto;
	clip: auto;
	padding: .75em 1.25em;
	background: var(--irmi-blue-deep);
	color: var(--irmi-white);
	border-radius: var(--irmi-radius-sm);
	font-weight: 700;
	text-decoration: none;
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: calc(var(--irmi-wrap) + var(--irmi-gutter) * 2); margin: 0 auto; padding: 0 var(--irmi-gutter); }
.wrap--narrow { max-width: calc(var(--irmi-narrow) + var(--irmi-gutter) * 2); }

.layout { display: grid; gap: clamp(32px, 5vw, 56px); padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(56px, 8vw, 96px); }
.irmi-has-sidebar .layout { grid-template-columns: minmax(0, 1fr) 300px; }
.irmi-has-sidebar .layout--single { grid-template-columns: minmax(0, var(--irmi-narrow)) 300px; justify-content: center; }
.irmi-no-sidebar .layout--single { max-width: calc(var(--irmi-narrow) + var(--irmi-gutter) * 2); }

@media (max-width: 960px) {
	.irmi-has-sidebar .layout,
	.irmi-has-sidebar .layout--single { grid-template-columns: minmax(0, 1fr); }
}

.site-main--builder { width: 100%; }

/* ---------- Buttons ---------- */
.btn,
.wp-element-button,
.wp-block-button__link,
button[type="submit"]:not(.search-submit),
input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	min-height: 46px;
	padding: .7em 1.6em;
	border: 0;
	border-radius: 999px;
	background: var(--irmi-blue);
	color: var(--irmi-white);
	font-family: var(--irmi-display);
	font-size: .9375rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s var(--irmi-ease), transform .2s var(--irmi-ease), box-shadow .2s var(--irmi-ease);
}
.btn:hover,
.wp-element-button:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover { background: var(--irmi-blue-deep); color: var(--irmi-white); transform: translateY(-1px); }

.btn--teal { background: var(--irmi-cyan); color: var(--irmi-blue-deep); }
.btn--teal:hover { background: var(--irmi-cyan-hl); color: var(--irmi-white); }
.btn--blue { background: var(--irmi-blue); }

.is-style-outline > .wp-block-button__link { background: transparent; color: var(--irmi-blue); box-shadow: inset 0 0 0 2px currentColor; }

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="number"], input[type="tel"], select, textarea {
	width: 100%;
	padding: .75em 1em;
	border: 1px solid var(--irmi-line);
	border-radius: var(--irmi-radius-sm);
	background: var(--irmi-white);
	color: var(--irmi-blue-deep);
	font: inherit;
	transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--irmi-cyan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--irmi-cyan) 25%, transparent); }
label { font-weight: 600; }

.search-form { position: relative; display: flex; max-width: 520px; }
.search-form .search-field { padding-right: 3.25em; border-radius: 999px; }
.search-submit {
	position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
	display: grid; place-items: center;
	width: 38px; height: 38px;
	border: 0; border-radius: 50%;
	background: var(--irmi-blue); color: var(--irmi-white);
	cursor: pointer;
}
.search-submit:hover { background: var(--irmi-cyan-dark); }

/* ---------- Page hero ---------- */
.page-hero {
	position: relative;
	padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px);
	background:
		radial-gradient(ellipse at 92% 0%, color-mix(in srgb, var(--irmi-cyan) 16%, transparent), transparent 55%),
		linear-gradient(120deg, var(--irmi-paper), var(--irmi-mist));
	border-bottom: 1px solid var(--irmi-line);
	overflow: hidden;
}
.page-hero .page-title { max-width: 18ch; margin-bottom: .25em; }
.page-intro { max-width: 62ch; font-size: 1.15rem; color: var(--irmi-muted); }
.page-intro p:last-child { margin-bottom: 0; }
.page-hero__search { margin-top: 24px; }

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 14px;
	font-family: var(--irmi-display);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--irmi-cyan-dark);
}
.eyebrow::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: var(--irmi-cyan); }

/* ---------- Post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 28px; }
.irmi-has-sidebar .post-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }

.card {
	display: flex;
	flex-direction: column;
	background: var(--irmi-white);
	border: 1px solid var(--irmi-line);
	border-radius: var(--irmi-radius);
	overflow: hidden;
	transition: transform .3s var(--irmi-ease), box-shadow .3s var(--irmi-ease), border-color .3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--irmi-shadow); border-color: transparent; }
.card .entry-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--irmi-mist); }
.card .entry-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--irmi-ease); }
.card:hover .entry-thumb img { transform: scale(1.05); }
.card__body { display: flex; flex: 1; flex-direction: column; padding: 22px 24px 24px; }
.card__title { margin: 6px 0 10px; font-size: 1.25rem; }
.card__title a { color: inherit; text-decoration: none; }
.card__title a:hover { color: var(--irmi-cyan-dark); }
.card__excerpt { color: var(--irmi-muted); font-size: 1rem; }
.card__excerpt p { margin: 0; }
.card__more {
	display: inline-flex; align-items: center; gap: 6px;
	margin-top: auto; padding-top: 18px;
	font-family: var(--irmi-display); font-size: .9rem; font-weight: 700;
	color: var(--irmi-blue); text-decoration: none;
}
.card__more svg { transition: transform .2s var(--irmi-ease); }
.card__more:hover svg { transform: translateX(4px); }
.sticky .card__title::before { content: "\2605  "; color: var(--irmi-amber); }

.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .9rem; color: var(--irmi-muted); }
.entry-meta a { color: inherit; }
.entry-meta--top time { font-size: .85rem; }

.entry-cat {
	display: inline-flex; align-items: center; gap: 7px;
	font-family: var(--irmi-display); font-size: .75rem; font-weight: 700;
	letter-spacing: .1em; text-transform: uppercase;
	color: var(--irmi-cyan-dark); text-decoration: none;
}
.entry-cat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--irmi-pink); }

/* ---------- Single entry ---------- */
.entry-header { margin-bottom: 28px; }
.entry-title { margin: 10px 0 14px; }
.entry .entry-thumb { margin: 0 0 32px; border-radius: var(--irmi-radius); overflow: hidden; }
.entry .entry-thumb img { width: 100%; }
.posted-on, .byline { display: inline-flex; }

.entry-content > * + h2 { margin-top: 1.6em; }
.entry-content > * + h3 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li + li { margin-top: .35em; }
.entry-content ul li::marker { color: var(--irmi-cyan); }

.entry-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--irmi-line); }
.entry-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.entry-tags a {
	padding: .3em .85em;
	border-radius: 999px;
	background: var(--irmi-paper);
	border: 1px solid var(--irmi-line);
	font-size: .875rem;
	color: var(--irmi-blue);
	text-decoration: none;
}
.entry-tags a:hover { background: var(--irmi-cyan); border-color: var(--irmi-cyan); color: var(--irmi-blue-deep); }
.edit-link a { font-size: .875rem; }

.page-links { display: flex; gap: 8px; margin-top: 24px; font-weight: 600; }

/* Post navigation */
.post-navigation { margin-top: 48px; }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-navigation a {
	display: block; height: 100%;
	padding: 18px 20px;
	border: 1px solid var(--irmi-line); border-radius: var(--irmi-radius-sm);
	text-decoration: none; color: var(--irmi-blue-deep);
	transition: border-color .2s, background .2s;
}
.post-navigation a:hover { border-color: var(--irmi-cyan); background: var(--irmi-paper); }
.post-navigation .nav-next { text-align: right; grid-column: 2; }
.post-navigation .nav-label { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--irmi-cyan-dark); }
.post-navigation .nav-title { display: block; margin-top: 4px; font-family: var(--irmi-display); font-weight: 600; line-height: 1.35; }
@media (max-width: 600px) {
	.post-navigation .nav-links { grid-template-columns: 1fr; }
	.post-navigation .nav-next { grid-column: auto; text-align: left; }
}

/* ---------- Pagination ---------- */
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.page-numbers {
	display: inline-grid; place-items: center;
	min-width: 44px; height: 44px; padding: 0 14px;
	border: 1px solid var(--irmi-line); border-radius: 999px;
	font-family: var(--irmi-display); font-weight: 600; font-size: .9rem;
	color: var(--irmi-blue-deep); text-decoration: none;
}
.page-numbers:hover { border-color: var(--irmi-cyan); color: var(--irmi-cyan-dark); }
.page-numbers.current { background: var(--irmi-blue); border-color: var(--irmi-blue); color: var(--irmi-white); }
.page-numbers.dots { border-color: transparent; }

/* ---------- Sidebar & widgets ---------- */
.widget-area { display: grid; gap: 24px; align-content: start; }
.widget-area .widget { padding: 24px; background: var(--irmi-paper); border: 1px solid var(--irmi-line); border-radius: var(--irmi-radius); }
.widget-title { margin-bottom: 14px; font-size: 1.05rem; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: .45em 0; border-bottom: 1px solid var(--irmi-line); }
.widget li:last-child { border-bottom: 0; }
.widget-area .widget a { color: var(--irmi-blue-deep); text-decoration: none; }
.widget-area .widget a:hover { color: var(--irmi-cyan-dark); }

/* ---------- Comments ---------- */
.comments-area { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--irmi-line); }
.comment-list { list-style: none; margin: 0 0 40px; padding: 0; }
.comment-list .children { list-style: none; padding-left: clamp(16px, 4vw, 40px); }
.comment-body { margin-bottom: 18px; padding: 20px 22px; background: var(--irmi-paper); border-radius: var(--irmi-radius-sm); }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 10px; font-size: .9rem; }
.comment-author { display: flex; align-items: center; gap: 10px; font-family: var(--irmi-display); font-weight: 700; }
.comment-author .avatar { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata a { color: var(--irmi-muted); text-decoration: none; }
.reply a { font-size: .875rem; font-weight: 700; }
.comment-form { display: grid; gap: 14px; }
.comment-form p { margin: 0; }
.comment-form-cookies-consent { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.comment-form-cookies-consent label { font-weight: 400; }

/* ---------- No results & 404 ---------- */
.no-results { padding: 40px; background: var(--irmi-paper); border: 1px dashed var(--irmi-line); border-radius: var(--irmi-radius); }
.no-results__title { font-size: 1.5rem; }

.error-404 { padding: clamp(64px, 10vw, 128px) 0; text-align: center; }
.error-404 .search-form { margin: 32px auto; }
.error-404 .page-intro { margin-left: auto; margin-right: auto; }
.error-404__code {
	margin: 0;
	font-family: var(--irmi-display);
	font-size: clamp(5rem, 16vw, 9rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.04em;
	background: linear-gradient(120deg, var(--irmi-blue) 30%, var(--irmi-cyan));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.error-404__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- WordPress core classes ---------- */
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.entry-content .alignwide { margin-left: calc(-1 * min(120px, 6vw)); margin-right: calc(-1 * min(120px, 6vw)); max-width: none; }
.entry-content .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; width: 100vw; }
@media (max-width: 960px) { .entry-content .alignwide { margin-left: 0; margin-right: 0; } }
.wp-caption, .wp-block-image figcaption, figcaption { font-size: .875rem; color: var(--irmi-muted); }
.wp-caption-text, figcaption { margin-top: .6em; text-align: center; }
.wp-block-image img, .wp-caption img { border-radius: var(--irmi-radius-sm); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.bypostauthor > .comment-body { border-left: 3px solid var(--irmi-cyan); }

/* ---------- Elementor compatibility ---------- */
.elementor-page .site-content,
.irmi-canvas .site-main { overflow-x: clip; }
.site-main--builder > .elementor { width: 100%; }
.elementor-widget-text-editor p:last-child { margin-bottom: 0; }

/* ---------- Print ---------- */
@media print {
	#irmi-hdr, #irmi-ftr, .ih-hdr-spacer, .widget-area, .post-navigation, .comments-area { display: none !important; }
	body { color: #000; }
	a { color: #000; text-decoration: underline; }
}
