/**
 * Premium Earth sciences institute — homepage portal styles.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

body.home.ies-portal-home,
body.front-page.ies-portal-home {
	font-family: 'DM Sans', 'Manrope', 'BPG Nino Mtavruli', sans-serif;
	-webkit-font-smoothing: antialiased;
}

body.ies-portal-home .container.content-width {
	padding-top: 1rem;
	background: #fbfbfc;
}

body.ies-portal-home .home-content-shell {
	background: transparent;
}

/* ── Design tokens ── */
.ies-portal-main {
	--p-ink: #18181f;
	--p-muted: #6d6d78;
	--p-faint: #a1a1ab;
	--p-line: rgba(24, 24, 31, 0.08);
	--p-accent: #8d1533;
	--p-accent-soft: rgba(141, 21, 51, 0.08);
	--p-surface: #ffffff;
	--p-bg: #fbfbfc;
	--p-radius: 14px;
	--p-shadow: 0 2px 16px rgba(24, 24, 31, 0.05);
	--p-shadow-lg: 0 8px 40px rgba(24, 24, 31, 0.07);
}

.ies-portal-stack {
	display: flex;
	flex-direction: column;
	gap: 3.5rem;
}

/* ── Section intros ── */
.portal-section-intro {
	margin-bottom: 1.5rem;
}

.portal-section-intro h2 {
	margin: 0 0 0.35rem;
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: -0.025em;
	color: var(--p-ink);
}

.portal-section-intro p {
	margin: 0;
	font-size: 0.92rem;
	color: var(--p-muted);
	line-height: 1.55;
}

.portal-section-intro--row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.portal-section-intro--row h2 {
	margin: 0;
}

.portal-section-link {
	font-size: 0.86rem;
	font-weight: 600;
	color: var(--p-accent);
	text-decoration: none;
	white-space: nowrap;
}

.portal-section-link:hover {
	text-decoration: underline;
}

/* ══════════════════════════════════════
   HERO — 40 / 60
══════════════════════════════════════ */
.portal-hero {
	padding: 0.5rem 0 0;
}

.portal-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: 2rem;
	align-items: stretch;
}

/* Left — identity */
.portal-hero__identity {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 0.5rem 0;
}

.portal-hero__eyebrow {
	margin: 0 0 0.85rem;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--p-faint);
	line-height: 1.4;
}

.portal-hero__title {
	margin: 0 0 1rem;
	font-size: clamp(1.2rem, 1.85vw, 1.55rem);
	font-weight: 700;
	line-height: 1.22;
	letter-spacing: -0.02em;
	color: var(--p-ink);
}

.portal-hero__lead {
	margin: 0 0 1.35rem;
	font-size: 0.97rem;
	line-height: 1.7;
	color: var(--p-muted);
	max-width: 36em;
}

.portal-hero__pillars {
	margin: 0 0 1.75rem;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.portal-hero__pillars li {
	position: relative;
	padding-left: 1.1rem;
	font-size: 0.88rem;
	line-height: 1.5;
	color: var(--p-ink);
	font-weight: 500;
}

.portal-hero__pillars li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--p-accent);
}

.portal-hero__cta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
}

.portal-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 0 1.25rem;
	border-radius: 8px;
	font-size: 0.88rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.portal-cta--primary,
a.portal-cta--primary:link,
a.portal-cta--primary:visited {
	background: var(--p-accent);
	color: #fff;
	box-shadow: 0 2px 12px rgba(141, 21, 51, 0.22);
}

.portal-cta--primary:hover,
a.portal-cta--primary:hover {
	background: #7a1230;
	color: #fff;
	box-shadow: 0 4px 18px rgba(141, 21, 51, 0.28);
}

.portal-cta--ghost,
a.portal-cta--ghost:link,
a.portal-cta--ghost:visited {
	background: transparent;
	color: var(--p-ink);
	border: 1px solid var(--p-line);
}

.portal-cta--ghost:hover,
a.portal-cta--ghost:hover {
	background: var(--p-surface);
	border-color: rgba(141, 21, 51, 0.2);
	color: var(--p-accent);
}

/* Right — live monitoring (focal point) */
.portal-hero__monitoring {
	display: flex;
	flex-direction: column;
	background: var(--p-surface);
	border-radius: var(--p-radius);
	box-shadow: var(--p-shadow-lg);
	overflow: hidden;
	border: 0;
	min-height: 460px;
}

.portal-hero__monitoring.home-feature-card {
	border: 0;
	box-shadow: var(--p-shadow-lg);
}

.portal-hero__monitoring.home-feature-card:hover {
	box-shadow: var(--p-shadow-lg);
}

.portal-monitor-head {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	padding: 0.85rem 1.1rem !important;
	border-bottom: 1px solid var(--p-line) !important;
	background: var(--p-surface) !important;
}

.portal-monitor-head__left {
	display: flex;
	align-items: center;
	gap: 0.55rem;
}

.portal-monitor-head .home-feature-card__title {
	margin: 0 !important;
	font-size: 0.88rem !important;
	font-weight: 600 !important;
	letter-spacing: -0.01em;
	color: var(--p-ink) !important;
}

.portal-live-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
	animation: portal-pulse 2s ease-in-out infinite;
}

@keyframes portal-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.55; }
}

.portal-hero__monitoring .home-seismic-widget-slot {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.portal-hero__monitoring .home-seismic-widget-slot #map,
.portal-hero__monitoring .home-seismic-widget-slot #earthquakesmapwg,
.portal-hero__monitoring .home-seismic-widget-slot .ies-google-map-canvas,
.portal-hero__monitoring .home-seismic-widget-slot .ies-leaflet-map,
.portal-hero__monitoring .home-seismic-widget-slot iframe[src*="google"] {
	width: 100% !important;
	max-width: none !important;
	min-height: 260px !important;
	height: 280px !important;
}

.portal-hero__monitoring .home-seismic-widget-slot .seismic-map-wrap,
.portal-hero__monitoring .home-seismic-widget-slot #earthquakesmapwg,
.portal-hero__monitoring .home-seismic-widget-slot #earthquakesmap,
.portal-hero__monitoring .home-seismic-widget-slot [id^="earthquakesmap"] {
	width: 100% !important;
	max-width: none !important;
}

.portal-hero__monitoring .home-seismic-widget-slot [id^="earthquakesmap"] > div {
	width: 100% !important;
}

/* ══════════════════════════════════════
   METRICS DASHBOARD
══════════════════════════════════════ */
.portal-dash {
	margin-top: -1.5rem;
}

.portal-dash__row {
	display: flex;
	align-items: stretch;
	background: var(--p-surface);
	border-radius: var(--p-radius);
	box-shadow: var(--p-shadow);
	overflow: hidden;
}

.portal-dash__metric {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	padding: 0.85rem 1rem;
	text-decoration: none;
	color: inherit;
	border-right: 1px solid var(--p-line);
	transition: background 0.15s ease;
	min-width: 0;
}

.portal-dash__metric:last-child {
	border-right: 0;
}

.portal-dash__metric:hover {
	background: rgba(141, 21, 51, 0.03);
}

.portal-dash__label {
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--p-faint);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.portal-dash__value {
	font-size: 1.2rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--p-ink);
	line-height: 1.2;
}

.portal-dash__meta {
	font-size: 0.7rem;
	color: var(--p-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.portal-dash__metric--eq .portal-dash__value { color: #c2410c; }
.portal-dash__metric--day .portal-dash__value { color: var(--p-ink); }
.portal-dash__metric--seismic .portal-dash__value { color: var(--p-accent); }
.portal-dash__metric--gnss .portal-dash__value { color: #0f766e; }
.portal-dash__metric--projects .portal-dash__value { color: var(--p-ink); }
.portal-dash__metric--pubs .portal-dash__value { color: var(--p-ink); }

/* ══════════════════════════════════════
   RESEARCH ICON CARDS
══════════════════════════════════════ */
.portal-research-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 0.75rem;
}

.portal-research-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.85rem;
	padding: 1.15rem 1.1rem;
	background: var(--p-surface);
	border-radius: var(--p-radius);
	text-decoration: none;
	color: var(--p-ink);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	box-shadow: var(--p-shadow);
}

.portal-research-card:hover {
	box-shadow: var(--p-shadow-lg);
	transform: translateY(-2px);
	color: var(--p-accent);
}

.portal-research-card__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--p-accent-soft);
	color: var(--p-accent);
}

.portal-research-card__icon svg {
	width: 22px;
	height: 22px;
}

.portal-research-card__title {
	font-size: 0.88rem;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -0.01em;
}

/* ══════════════════════════════════════
   NEWS
══════════════════════════════════════ */
.portal-news-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.15rem;
}

.portal-news-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--p-surface);
	border: 1px solid var(--p-line);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: var(--p-shadow);
	transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}

.portal-news-card:hover {
	box-shadow: var(--p-shadow-lg);
	transform: translateY(-3px);
	border-color: rgba(141, 21, 51, 0.14);
}

.portal-news-card__media {
	display: block;
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: linear-gradient(135deg, #f5eef1 0%, #ebe2e6 100%);
}

.portal-news-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 55%, rgba(20, 12, 16, 0.18) 100%);
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.portal-news-card:hover .portal-news-card__media::after {
	opacity: 1;
}

.portal-news-card__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	background: #f4eff1;
	display: block;
	transition: transform 0.2s ease;
}

.portal-news-card:hover .portal-news-card__media img {
	transform: scale(1.01);
}

.portal-news-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	flex: 1;
	padding: 1rem 1.05rem 1.15rem;
}

.portal-news-card__body time {
	display: block;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--p-accent);
}

.portal-news-card__body h3 {
	margin: 0;
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: -0.01em;
}

.portal-news-card__body h3 a {
	color: var(--p-ink);
	text-decoration: none;
	transition: color 0.18s ease;
}

.portal-news-card:hover h3 a {
	color: var(--p-accent);
}

.portal-news-card__excerpt {
	margin: 0;
	font-size: 0.8rem;
	line-height: 1.55;
	color: var(--p-muted);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ══════════════════════════════════════
   PROJECTS + PUBLICATIONS
══════════════════════════════════════ */
.portal-dual {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2.5rem;
}

.portal-list {
	display: flex;
	flex-direction: column;
}

.portal-list__item {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--p-line);
	text-decoration: none;
	color: inherit;
	transition: color 0.15s ease;
}

.portal-list__item:first-child {
	border-top: 1px solid var(--p-line);
}

.portal-list__item strong {
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--p-ink);
	flex: 1;
}

.portal-list__item span {
	font-size: 0.78rem;
	color: var(--p-faint);
	white-space: nowrap;
}

.portal-list__item:hover strong {
	color: var(--p-accent);
}

/* ══════════════════════════════════════
   SAFETY (minimal override)
══════════════════════════════════════ */
.portal-safety .safety-guide {
	background: transparent;
	box-shadow: none;
	border: 0;
	padding: 0;
}

.portal-safety .safety-guide-title {
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.portal-safety .safety-guide-cards {
	gap: 1rem;
}

.portal-safety .safety-card {
	background: var(--p-surface);
	border: 0;
	box-shadow: var(--p-shadow);
	border-radius: var(--p-radius);
}

.portal-empty {
	color: var(--p-muted);
	font-size: 0.9rem;
}

/* Sidebar hidden — seismic widget source */
.layout-shell--home .layout-sidebar {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1100px) {
	.portal-hero__grid {
		display: flex !important;
		flex-direction: column !important;
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.portal-hero__monitoring {
		order: 1 !important;
		min-height: 320px;
	}

	.portal-hero__identity {
		order: 2 !important;
	}

	.portal-dash__row {
		flex-wrap: wrap;
	}

	.portal-dash__metric {
		flex: 1 1 calc(33.333% - 1px);
		border-bottom: 1px solid var(--p-line);
	}

	.portal-research-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.portal-news-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.portal-dual {
		grid-template-columns: 1fr;
		gap: 2rem;
	}
}

@media (max-width: 640px) {
	.ies-portal-stack {
		gap: 1.5rem;
	}

	.portal-hero__monitoring {
		min-height: 0;
	}

	.portal-hero__cta {
		flex-direction: column;
	}

	.portal-cta {
		width: 100%;
		min-height: 48px;
	}
}
