/*
 * Mosaic Wall – Claire Jubileum
 * Grafisk profil: Druva #6E2C3C · Sand #FEEAD3 · Lind #AAD29A
 * Fonts: Crimson Pro (rubriker) · Work Sans (brödtext)
 * ------------------------------------------------------------------
 */

/* ── Custom properties ─────────────────────────────────────────── */
:root {
	--mw-druva:      #6E2C3C;
	--mw-druva-dark: #551f2c;
	--mw-sand:       #FEEAD3;
	--mw-sand-dark:  #f5d9b5;
	--mw-lind:       #AAD29A;
	--mw-lind-dark:  #7fb86b;
	--mw-white:      #ffffff;
	--mw-text:       #2b1a1f;

	--mw-font-heading: 'Crimson Pro', Georgia, serif;
	--mw-font-body:    'Work Sans', system-ui, sans-serif;

	--mw-radius-btn:   40px;
	--mw-radius-card:  16px;
	--mw-radius-tile:  50%;

	--mw-shadow-tile:  0 6px 20px rgba(110, 44, 60, 0.22);
	--mw-shadow-modal: 0 24px 64px rgba(43, 26, 31, 0.28);

	--mw-transition: 0.22s ease;
}

/* ── Reset / base ──────────────────────────────────────────────── */
.mw-hero,
.mw-stories,
.mw-jubilee-banner {
	box-sizing: border-box;
	font-family: var(--mw-font-body);
	color: var(--mw-text);
}

.mw-hero *,
.mw-stories *,
.mw-jubilee-banner *,
.mw-modal *,
.mw-tooltip * {
	box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════
   HERO SECTION  [mosaic_wall]
   ═══════════════════════════════════════════════════════════════ */

.mw-hero {
	background-color: var(--mw-sand);
	width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	padding: 56px 24px 64px;
	overflow: hidden;
}

/* ── Mosaic grid ─────────────────────────────────────────────── */

.mw-mosaic-wrap {
	max-width: 1100px;
	margin: 0 auto 48px;
}

.mw-mosaic-grid {
	display: grid;
	grid-template-columns: repeat(20, 1fr);
	gap: clamp(4px, 0.7vw, 8px);
	width: 100%;
}

/* ── Individual tile ─────────────────────────────────────────── */

.mw-tile {
	aspect-ratio: 1;
	border-radius: var(--mw-radius-tile);
	border: none;
	padding: 0;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	transition:
		transform var(--mw-transition),
		box-shadow var(--mw-transition);

	/* Start invisible; animation adds .mw-mosaic-grid--visible */
	opacity: 0;
	transform: translateY(14px) scale(0.88);
	will-change: opacity, transform;
}

/* Animation triggered by IntersectionObserver via JS */
.mw-mosaic-grid--visible .mw-tile {
	animation: mwTileIn 0.55s cubic-bezier(0.34, 1.28, 0.64, 1) forwards;
}

@keyframes mwTileIn {
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* Subtle pulse after appearing – keep the mosaic "alive" */
.mw-mosaic-grid--visible .mw-tile:not(.mw-tile--empty) {
	animation:
		mwTileIn 0.55s cubic-bezier(0.34, 1.28, 0.64, 1) forwards,
		mwPulse 6s ease-in-out 1.6s infinite;
}

@keyframes mwPulse {
	0%, 100% { box-shadow: none; }
	50%       { box-shadow: 0 0 0 3px rgba(110, 44, 60, 0.12); }
}

/* Hover state */
.mw-tile:not(.mw-tile--empty):hover,
.mw-tile:not(.mw-tile--empty):focus-visible {
	transform: scale(1.14) translateY(-2px);
	box-shadow: var(--mw-shadow-tile);
	z-index: 10;
	outline: none;
}

/* Sporadic warm palette – 4 rose/terracotta tones (none are exact Sand or Druva) */
.mw-tile--color-1 { background-color: #B05A6A; }
.mw-tile--color-2 { background-color: #8A3D4E; }
.mw-tile--color-3 { background-color: #C08060; }
.mw-tile--color-4 { background-color: #A06878; }

/* Tile without a quote: lightly tinted, no pointer feedback */
.mw-tile--no-quote {
	opacity: 0.35;
	filter: saturate(0.4);
	cursor: default;
	pointer-events: none;
}

/* CTA "Är du en av dom?" tile – always the last (100th) slot */
.mw-tile--cta {
	background-color: var(--mw-druva);
	cursor: pointer;
}
.mw-tile--cta .mw-tile__symbol--question {
	font-size: 1.1rem;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.9);
	line-height: 1;
	white-space: normal;
}
.mw-tooltip__circle.mw-tile--cta {
	color: rgba(255, 255, 255, 0.9);
	font-size: 1.4rem;
	font-weight: 700;
}
.mw-tile--cta .mw-tile__age {
	display: none;
}

/* Empty placeholder tile */
.mw-tile--empty {
	background-color: var(--mw-sand-dark);
	cursor: default;
}

/* Gender symbol + age label inside each mosaic tile */
.mw-tile__label {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	gap: 1px;
	pointer-events: none;
	user-select: none;
}

.mw-tile__symbol {
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.9);
}

.mw-tile__symbol .mw-gender-svg {
	width: clamp(9px, 1.4vw, 14px);
	height: clamp(9px, 1.4vw, 14px);
	display: block;
	fill: currentColor;
}

.mw-tile__age {
	font-family: var(--mw-font-body);
	font-size: clamp(6px, 0.9vw, 9px);
	line-height: 1;
	color: rgba(255, 255, 255, 0.75);
	letter-spacing: 0;
}

/* ── Hero content (heading + CTAs) ──────────────────────────── */

.mw-hero__content {
	text-align: center;
	margin: 0 auto;
}

.mw-hero__heading {
	font-family: var(--mw-font-heading);
	font-weight: 600;
	font-size: clamp(1.75rem, 4vw, 2.75rem);
	line-height: 1.2;
	color: var(--mw-druva);
	margin: 0 0 24px;
}

.mw-hero__ctas {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	justify-content: center;
	margin-top: 32px;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.mw-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--mw-font-body);
	font-weight: 400;
	font-size: 1rem;
	letter-spacing: 0.02em;
	border-radius: var(--mw-radius-btn);
	padding: 14px 32px;
	text-decoration: none;
	cursor: pointer;
	border: 2px solid transparent;
	transition:
		background-color var(--mw-transition),
		color var(--mw-transition),
		border-color var(--mw-transition),
		transform var(--mw-transition);
}

.mw-btn:hover,
.mw-btn:focus-visible {
	transform: translateY(-2px);
	outline: none;
}

.mw-btn--primary {
	background-color: var(--mw-druva);
	color: var(--mw-white);
	border-color: var(--mw-druva);
}
.mw-btn--primary:hover,
.mw-btn--primary:focus-visible {
	background-color: var(--mw-druva-dark);
	border-color: var(--mw-druva-dark);
	color: #fff;
}

.mw-btn--secondary {
	background-color: transparent;
	color: var(--mw-druva);
	border-color: var(--mw-druva);
}
.mw-btn--secondary:hover,
.mw-btn--secondary:focus-visible {
	background-color: var(--mw-druva);
	color: var(--mw-white);
}

.mw-btn--text {
	background: none;
	border: none;
	color: var(--mw-druva);
	padding: 0;
	font-size: 0.875rem;
	font-weight: 400;
	text-decoration: underline;
	text-underline-offset: 3px;
	border-radius: 0;
}
.mw-btn--text:hover {
	color: var(--mw-druva-dark);
	transform: none;
}

.mw-btn--large {
	font-size: 1.0625rem;
	padding: 16px 40px;
}

/* ── Spotlight tile highlight ────────────────────────────────── */

.mw-tile--spotlight {
	box-shadow: 0 0 0 3px var(--mw-sand), 0 0 0 6px rgba(110, 44, 60, 0.7);
	z-index: 5;
}

.mw-tile--spotlight-active {
	animation:
		mwTileIn 0.55s cubic-bezier(0.34, 1.28, 0.64, 1) both,
		mwSpotlightRing 2.4s ease-in-out 0.6s infinite !important;
}

@keyframes mwSpotlightRing {
	0%, 100% { box-shadow: 0 0 0 2px var(--mw-sand), 0 0 0 5px rgba(110, 44, 60, 0.55); }
	50%       { box-shadow: 0 0 0 3px var(--mw-sand), 0 0 0 8px rgba(110, 44, 60, 0.2); }
}

/* ── Daily spotlight section ─────────────────────────────────── */

.mw-spotlight {
	max-width: 680px;
	margin: 0 auto 48px;
	text-align: center;
}

.mw-spotlight__eyebrow {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	font-family: var(--mw-font-body);
	font-size: 0.78rem;
	font-weight: 400;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--mw-druva);
	margin: 0 0 24px;
	opacity: 0.7;
}

.mw-spotlight__eyebrow-line {
	flex: 1;
	height: 1px;
	background: currentColor;
	opacity: 0.35;
}

.mw-spotlight__card {
	display: flex;
	align-items: center;
	gap: 28px;
	background: rgba(255, 255, 255, 0.62);
	border-radius: 20px;
	padding: 28px 32px;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	box-shadow: 0 4px 24px rgba(110, 44, 60, 0.08);
	text-align: left;
}

.mw-spotlight__circle {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba(110, 44, 60, 0.22);
}

.mw-spotlight__symbol {
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.9);
}

.mw-spotlight__symbol .mw-gender-svg {
	width: 2.2rem;
	height: 2.2rem;
	display: block;
	fill: currentColor;
}

.mw-spotlight__body {
	flex: 1;
	min-width: 0;
}

.mw-spotlight__meta {
	font-size: 0.8rem;
	color: #888;
	text-transform: capitalize;
	letter-spacing: 0.03em;
	margin: 0 0 10px;
	padding-bottom: 0;
}

.mw-spotlight__quote {
	font-family: var(--mw-font-heading);
	font-size: 1.2rem;
	font-style: italic;
	color: var(--mw-text);
	line-height: 1.55;
	margin: 0 0 16px;
	padding: 0 0 0 1em;
	border: none;
}

.mw-spotlight__readmore {
	font-size: 0.875rem;
}

.mw-spotlight__hashtag {
	font-size: 0.875rem;
	color: var(--mw-druva);
	opacity: 0.7;
	margin-left: 0.5em;
}

@media (max-width: 600px) {
	.mw-spotlight__card {
		flex-direction: column;
		align-items: center;
		text-align: center;
		padding: 24px 20px;
		gap: 16px;
	}
}

/* ── Hover tooltip ───────────────────────────────────────────── */

.mw-tooltip {
	position: fixed;
	z-index: 9999;
	background: var(--mw-white);
	border-radius: 12px;
	padding: 16px 18px;
	box-shadow: 0 8px 28px rgba(43, 26, 31, 0.18);
	max-width: 220px;
	pointer-events: none;
	opacity: 0;
	transform: translateY(6px) scale(0.97);
	transition:
		opacity 0.18s ease,
		transform 0.18s ease;
}
.mw-tooltip.mw-tooltip--visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.mw-tooltip__circle {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	margin: 0 auto 10px;
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mw-tooltip__circle .mw-gender-svg {
	width: 0.95rem;
	height: 0.95rem;
	display: block;
	fill: currentColor;
	color: rgba(255, 255, 255, 0.9);
}
/* color-N classes handle tooltip circle background automatically */

.mw-tooltip__meta {
	font-size: 0.78rem;
	font-weight: 400;
	text-align: center;
	color: #888;
	margin-bottom: 8px;
}

.mw-tooltip__quote {
	font-family: var(--mw-font-heading);
	font-size: 0.9rem;
	font-style: italic;
	color: var(--mw-text);
	margin: 0 0 8px;
	line-height: 1.4;
	padding-bottom: 0;
}

.mw-tooltip__cta-btn {
	display: block;
	margin-top: 10px;
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--mw-druva);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-align: center;
}
.mw-tooltip__cta-btn:hover {
	color: var(--mw-druva-dark);
}

.mw-tooltip__hint {
	display: block;
	font-size: 0.72rem;
	color: var(--mw-druva);
	text-align: center;
	margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════════
   STORIES GRID  [patient_stories]
   ═══════════════════════════════════════════════════════════════ */

.mw-stories {
	padding: 48px 24px 64px;
	background: var(--mw-white);
}

/* ── Age filter buttons ──────────────────────────────────────── */

.mw-stories__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin-bottom: 40px;
}

.mw-filter-btn {
	font-family: var(--mw-font-body);
	font-size: 0.875rem;
	padding: 8px 20px;
	border-radius: 40px;
	border: 1.5px solid var(--mw-druva);
	background: transparent;
	color: var(--mw-druva);
	cursor: pointer;
	transition:
		background-color var(--mw-transition),
		color var(--mw-transition);
}
.mw-filter-btn--active,
.mw-filter-btn:hover,
.mw-filter-btn:focus-visible {
	background-color: var(--mw-druva);
	color: var(--mw-white);
	outline: none;
}

/* ── Grid ────────────────────────────────────────────────────── */

.mw-stories__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
	max-width: 1080px;
	margin: 0 auto;
}

/* ── Story card ──────────────────────────────────────────────── */

.mw-story-card {
	background: var(--mw-sand);
	border-radius: var(--mw-radius-card);
	padding: 32px 24px 28px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	transition: transform var(--mw-transition), box-shadow var(--mw-transition);
}
.mw-story-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--mw-shadow-tile);
}
.mw-story-card[aria-hidden="true"],
.mw-story-card[data-hidden="true"] {
	display: none;
}

.mw-story-card__circle {
	width: 88px;
	height: 88px;
	border-radius: 50%;
	margin-bottom: 16px;
	position: relative;
	overflow: hidden;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.9);
}

.mw-story-card__circle .mw-gender-svg {
	width: 44px;
	height: 44px;
	display: block;
	fill: currentColor;
}
/* color-N classes handle story card circle background automatically */

.mw-story-card__meta {
	font-size: 0.8rem;
	color: #888;
	margin-bottom: 12px;
	text-transform: capitalize;
	letter-spacing: 0.03em;
}

.mw-story-card__quote {
	font-family: var(--mw-font-heading);
	font-size: 1.05rem;
	font-style: italic;
	line-height: 1.5;
	color: var(--mw-text);
	margin: 0 0 20px;
	flex: 1;
	padding-left: 0;
	border: none;
}
.mw-story-card__quote::before,
.mw-story-card__quote::after {
	content: none;
}
.mw-story-card__quote p {
	margin: 0;
}

.mw-story-card__readmore {
	margin-top: auto;
}

/* ── Bottom CTA ──────────────────────────────────────────────── */

.mw-stories__cta-wrap {
	margin-top: 56px;
	text-align: center;
}
.mw-stories__cta-label {
	font-family: var(--mw-font-heading);
	font-size: 1.3rem;
	color: var(--mw-druva);
	margin: 0 0 20px;
}

.mw-stories__empty {
	text-align: center;
	color: #888;
	font-style: italic;
	padding: 48px 0;
}

/* ═══════════════════════════════════════════════════════════════
   JUBILEE BANNER  [jubilee_banner]
   ═══════════════════════════════════════════════════════════════ */

.mw-jubilee-banner {
	background-color: var(--mw-druva);
	color: var(--mw-white);
	width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	display: flex;
	align-items: center;
	padding: 14px 24px;
	gap: 12px;
}
.mw-jubilee-banner[hidden],
.mw-jubilee-banner--dismissed {
	display: none;
}

.mw-jubilee-banner__inner {
	flex: 1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px 20px;
}

.mw-jubilee-banner__icon {
	color: var(--mw-lind);
	font-size: 1rem;
}

.mw-jubilee-banner__text {
	font-family: var(--mw-font-body);
	font-size: 0.9375rem;
	font-weight: 400;
	letter-spacing: 0.02em;
}

.mw-jubilee-banner__link {
	color: var(--mw-lind);
	font-size: 0.9rem;
	font-weight: 400;
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
	transition: color var(--mw-transition);
}
.mw-jubilee-banner__link:hover {
	color: var(--mw-white);
}

.mw-jubilee-banner__dismiss {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.7);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	flex-shrink: 0;
	transition: color var(--mw-transition);
}
.mw-jubilee-banner__dismiss:hover {
	color: var(--mw-white);
}

/* ═══════════════════════════════════════════════════════════════
   MODAL  (shared by hero + stories)
   ═══════════════════════════════════════════════════════════════ */

.mw-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.mw-modal[hidden] {
	display: none;
}

.mw-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(43, 26, 31, 0.55);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	cursor: pointer;
}

.mw-modal__box {
	position: relative;
	z-index: 1;
	background: var(--mw-white);
	border-radius: 20px;
	padding: 40px 36px 36px;
	max-width: 540px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: var(--mw-shadow-modal);
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;

	/* Entry animation */
	animation: mwModalIn 0.3s cubic-bezier(0.34, 1.28, 0.64, 1);
}
@keyframes mwModalIn {
	from { opacity: 0; transform: scale(0.92) translateY(16px); }
	to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.mw-modal__close {
	position: absolute;
	top: 14px;
	right: 16px;
	background: none;
	border: none;
	font-size: 1.5rem;
	color: #aaa;
	cursor: pointer;
	line-height: 1;
	padding: 6px 10px;
	border-radius: 50%;
	transition: background-color var(--mw-transition), color var(--mw-transition);
}
.mw-modal__close:hover {
	background: var(--mw-sand);
	color: var(--mw-druva);
}

.mw-modal__circle {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	margin-bottom: 18px;
	position: relative;
	overflow: hidden;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.9);
}

.mw-modal__circle .mw-gender-svg {
	width: 48px;
	height: 48px;
	display: block;
	fill: currentColor;
}
/* color-N classes handle modal circle background automatically */

.mw-modal__meta {
	font-size: 0.82rem;
	color: #888;
	text-transform: capitalize;
	letter-spacing: 0.03em;
	margin: 0 0 14px;
}

.mw-modal__quote {
	font-family: var(--mw-font-heading);
	font-size: 1.2rem;
	font-style: italic;
	color: var(--mw-druva);
	line-height: 1.5;
	margin: 0 0 24px;
	padding: 0;
	border: none;
}
.mw-modal__quote::before { content: '\201C'; }
.mw-modal__quote::after  { content: '\201D'; }

.mw-modal__body {
	font-family: var(--mw-font-body);
	font-size: 0.9375rem;
	line-height: 1.7;
	color: var(--mw-text);
	text-align: left;
	width: 100%;
}
.mw-modal__body p { margin: 0 0 1em; }
.mw-modal__body p:last-child { margin-bottom: 0; }
.mw-modal__selftest-btn {
	display: block;
	text-align: center;
	margin-top: 12px;
	width: 100%;
}

/* Loading spinner inside modal */
.mw-modal__loading {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 80px;
}
.mw-modal__spinner {
	width: 32px;
	height: 32px;
	border: 3px solid var(--mw-sand-dark);
	border-top-color: var(--mw-druva);
	border-radius: 50%;
	animation: mwSpin 0.7s linear infinite;
}
@keyframes mwSpin {
	to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 900px) {
	.mw-stories__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}
}

/* Mobile */
@media (max-width: 600px) {
	.mw-hero {
		padding: 32px 16px 48px;
	}

	.mw-mosaic-grid {
		grid-template-columns: repeat(10, 1fr);
		gap: 5px;
	}

	.mw-mosaic-wrap {
		margin-bottom: 32px;
	}

	.mw-hero__heading {
		font-size: 1.5rem;
	}

	.mw-stories__grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.mw-stories {
		padding: 32px 16px 48px;
	}

	.mw-modal__box {
		padding: 32px 20px 28px;
	}

	.mw-jubilee-banner {
		padding: 12px 16px;
	}
	.mw-jubilee-banner__text {
		font-size: 0.8125rem;
	}

	/* On mobile, tiles are smaller but keep their silhouette */
	.mw-tile {
		/* silhouette pseudo-elements use % – scales automatically */
	}

	.mw-modal__quote::before,
	.mw-modal__quote::after {
		display: none;
	}
	
	.mw-jubilee-banner__inner {
		justify-content: start;
		gap: 0px 5px;
	}
	
	.mw-btn {
    	font-size: 0.85rem;
    	padding: 10px 29px;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.mw-tile,
	.mw-mosaic-grid--visible .mw-tile {
		animation: none !important;
		opacity: 1;
		transform: none;
	}
	.mw-modal__box {
		animation: none;
	}
}

/* Desktop (true pointer device): hero tile modal never appears */
@media (hover: hover) and (pointer: fine) {
        #mw-hero-modal {
                display: none !important;
        }
}
