/* MGPK Rekisteri - main stylesheet.
   Identity: a registry ledger. Warm paper background, deep ink text, Maltese red as the brand colour,
   a verification green used only for licence stamps. Mobile first. */

:root {
	--paper: #fbf9f4;
	--card: #ffffff;
	--ink: #19202b;
	--ink-soft: #3a4352;
	--muted: #5f6774;
	--line: #e4dfd3;
	--line-strong: #cfc8b8;
	--brand: #b3202a;
	--brand-dark: #8e1820;
	--brand-ink: #ffffff;
	--check: #1d6b58;
	--check-bg: #e7f2ee;
	--head: #19202b;
	--focus: #f2b705;
	--radius: 10px;
	--wrap: 1160px;
	--gutter: 16px;
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.65;
	overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; }
a { color: var(--brand-dark); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--ink); margin: 1.6em 0 .55em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); margin-top: 0; }
h2 { font-size: clamp(1.45rem, 3.4vw, 1.95rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; font-family: var(--font-body); }

.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;
}

.mp-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.mp-skip {
	position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--focus); color: var(--ink);
	padding: 8px 14px; border-radius: 6px; font-weight: 700; text-decoration: none;
}
.mp-skip:focus { top: 8px; }

/* Header */
.mp-head {
	position: sticky; top: 0; z-index: 50; background: var(--head); color: #fff;
	border-bottom: 4px solid var(--brand);
}
.mp-head__row { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.mp-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; margin-right: auto; }
.mp-brand:hover { color: #fff; }
/* Logo mark: a plain block image inside the flex .mp-brand link. Fixed size, natural 1:1 ratio, never cropped. */
.mp-brand__mark { display: block; flex: 0 0 auto; width: 36px; height: 36px; }
.mp-brand__name { font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; letter-spacing: .01em; }

.mp-nav__toggle {
	display: inline-flex; align-items: center; gap: 8px; background: transparent; color: #fff;
	border: 1px solid rgba(255, 255, 255, .35); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: .95rem; cursor: pointer;
}
.mp-nav__bars, .mp-nav__bars::before, .mp-nav__bars::after {
	display: block; width: 18px; height: 2px; background: currentColor; position: relative; content: "";
}
.mp-nav__bars::before { position: absolute; top: -6px; }
.mp-nav__bars::after { position: absolute; top: 6px; }

.mp-nav { display: none; width: 100%; order: 3; padding-bottom: 12px; }
.mp-nav.is-open { display: block; }
.mp-nav__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mp-nav__list a {
	display: block; color: #fff; text-decoration: none; padding: 10px 8px; border-radius: 6px; font-size: .98rem;
}
.mp-nav__list a:hover, .mp-nav__list .current-menu-item > a { background: rgba(255, 255, 255, .1); color: #fff; }

.mp-age-badge {
	display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 6px; border-radius: 13px;
	border: 2px solid var(--brand); color: var(--brand); background: #fff; font-weight: 800; font-size: .8rem; line-height: 1;
}
.mp-head .mp-age-badge { border-color: #fff; color: #fff; background: transparent; }

@media (max-width: 559px) {
	.mp-head__row { gap: 8px; flex-wrap: nowrap; }
	.mp-head__row .mp-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--head); padding: 4px var(--gutter) 12px; border-bottom: 4px solid var(--brand); }
	.mp-head__row { position: relative; flex-wrap: nowrap; }
	.mp-brand__name { font-size: 1rem; }
	.mp-nav__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
	.mp-nav__toggle { padding: 10px; min-width: 44px; min-height: 44px; justify-content: center; }
	.mp-head .mp-age-badge { order: 2; }
	.mp-nav__toggle { order: 3; }
}

@media (min-width: 900px) {
	.mp-head__row { flex-wrap: nowrap; }
	.mp-nav__list a { white-space: nowrap; }
	.mp-nav__toggle { display: none; }
	.mp-nav { display: block; width: auto; order: 0; padding: 0; }
	.mp-nav__list { display: flex; gap: 4px; }
	.mp-nav__list a { padding: 8px 10px; font-size: .92rem; }
}

/* Buttons */
.mp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
	padding: 10px 18px; border-radius: 8px; background: var(--brand); color: var(--brand-ink);
	font-weight: 700; text-decoration: none; border: 0; white-space: nowrap;
}
.mp-btn:hover { background: var(--brand-dark); color: #fff; }
.mp-btn--light { background: #fff; color: var(--brand-dark); }
.mp-btn--light:hover { background: #f4ede0; color: var(--brand-dark); }
.mp-btn--disabled { background: #e9e6df; color: var(--muted); cursor: not-allowed; font-weight: 600; }

/* Hero */
.mp-hero {
	background:
		linear-gradient(180deg, rgba(25, 32, 43, .96), rgba(25, 32, 43, .92)),
		repeating-linear-gradient(90deg, transparent 0 46px, rgba(255, 255, 255, .04) 46px 47px);
	color: #f3f0e8; padding: 36px 0 32px;
}
.mp-hero__title { color: #fff; }
.mp-hero__kicker {
	display: inline-block; margin: 0 0 14px; padding: 4px 10px; border: 1px dashed rgba(255, 255, 255, .5);
	border-radius: 4px; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase;
}
.mp-intro__body { max-width: 72ch; }
.mp-intro__body p { margin: 0 0 .9em; }
.mp-intro__body a { color: #ffd9d4; }
.mp-intro.is-collapsed .mp-intro__body {
	max-height: 15em; overflow: hidden;
	-webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
	mask-image: linear-gradient(180deg, #000 55%, transparent);
}
.mp-intro__more {
	background: none; border: 0; color: #fff; text-decoration: underline; font: inherit; padding: 6px 0; cursor: pointer;
}
.mp-hero__cta { margin: 18px 0 0; }

/* Hero split: intro left, the first comparison casino on the right above the fold. */
.mp-hero__grid { display: grid; gap: 22px; align-items: start; }
@media (min-width: 900px) {
	.mp-hero__grid { grid-template-columns: minmax(0, 1fr) 318px; gap: 40px; }
	.mp-hero__text { min-width: 0; }
}
.mp-herocard {
	background: var(--card); color: var(--ink);
	border: 1px solid var(--line); border-radius: var(--radius);
	padding: 16px 18px 18px; box-shadow: 0 8px 26px rgba(0, 0, 0, .30);
}
.mp-herocard__flag {
	margin: 0 0 10px; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
	color: var(--ink-soft);
}
.mp-herocard__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.mp-herocard__logo {
	flex: 0 0 auto; width: 64px; height: 40px; object-fit: contain;
	background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px;
}
.mp-herocard__logo--text {
	display: inline-flex; align-items: center; justify-content: center;
	font-weight: 700; color: var(--ink-soft);
}
.mp-herocard__name { margin: 0; font-family: var(--head, inherit); font-size: 1.18rem; font-weight: 700; }
.mp-herocard__lic { margin: 0 0 10px; }
.mp-herocard__offer { margin: 0 0 14px; font-size: .92rem; line-height: 1.5; color: var(--ink); }
.mp-herocard__cta { margin: 0 0 10px; }
.mp-herocard__cta .mp-btn { display: block; text-align: center; }
.mp-herocard__fine { margin: 0; font-size: .76rem; line-height: 1.45; color: var(--ink-soft); }

/* Sections */
.mp-section { padding: 28px 0; }
.mp-section--toplist { background: var(--card); border-bottom: 1px solid var(--line); }
.mp-section--toplist h2 { margin-top: 0; }
.mp-section--new { background: #f4efe4; border-bottom: 1px solid var(--line); }
.mp-section--new h2 { margin-top: 0; }

/* Toplist: stacked cards on mobile, table from 760px */
.mp-disclosure { font-size: .88rem; color: var(--ink-soft); background: #f6f3ec; border-left: 4px solid var(--line-strong); padding: 10px 12px; margin: 0 0 16px; }
.mp-toplist--empty p { padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--paper); margin: 0; }
/* Top 3 cards, above the comparison table */
.mp-top3 { margin: 0 0 24px; }
.mp-top3__h { margin: 0 0 6px; font-size: 1.22rem; }
.mp-top3__lede { margin: 0 0 16px; font-size: .95rem; line-height: 1.55; color: var(--ink-soft); max-width: 68ch; }
.mp-top3__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 760px) { .mp-top3__grid { grid-template-columns: repeat(3, 1fr); } }
.mp-top3card {
	position: relative; display: flex; flex-direction: column;
	background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 16px 16px 18px;
}
.mp-top3card__rank {
	position: absolute; top: -10px; left: 14px; margin: 0;
	min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px;
	background: var(--brand-dark, #19202b); color: #fff;
	font-size: .82rem; font-weight: 700; line-height: 26px; text-align: center;
}
.mp-top3card__head { display: flex; align-items: center; gap: 12px; margin: 8px 0 10px; }
.mp-top3card__logo {
	flex: 0 0 auto; width: 60px; height: 38px; object-fit: contain;
	background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px;
}
.mp-top3card__logo--text { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink-soft); }
.mp-top3card__name { margin: 0; font-size: 1.05rem; font-weight: 700; }
.mp-top3card__lic { margin: 0 0 10px; }
.mp-top3card__offer { margin: 0 0 14px; font-size: .88rem; line-height: 1.5; }
.mp-top3card__cta { margin: auto 0 0; }
.mp-top3card__cta .mp-btn { display: block; text-align: center; }

.mp-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.mp-table thead { display: none; }
.mp-table tr {
	display: grid; grid-template-columns: 44px 1fr; gap: 6px 12px; padding: 14px; margin-bottom: 12px;
	background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: 0 1px 0 var(--line);
}
.mp-table td, .mp-table th { display: block; padding: 0; text-align: left; font-weight: 400; }
.mp-table td[data-label]:not(.mp-rank)::before {
	content: attr(data-label); display: block; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
.mp-table .mp-rank { grid-row: span 2; }
.mp-table td:not(.mp-rank), .mp-table .mp-name { grid-column: 2; }
.mp-rank span {
	display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
	background: var(--ink); color: #fff; font-weight: 800; font-family: var(--font-head);
}
.mp-name { display: flex !important; align-items: center; gap: 10px; font-weight: 700 !important; }
.mp-logo { width: 120px; height: auto; aspect-ratio: 480 / 220; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--line); }
.mp-logo--text, .mp-show__logo--text, .mp-new__logo--text {
	display: inline-flex; align-items: center; justify-content: center; width: 120px; aspect-ratio: 480 / 220; border-radius: 6px;
	background: #ece7dc; color: var(--ink-soft); font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; border: 1px solid var(--line);
}
.mp-new__logo--text { width: 96px; }
.mp-show__logo--text { width: 132px; }
.mp-name__text { font-size: 1.05rem; }
.mp-stamp {
	display: inline-block; padding: 2px 8px; border: 1.5px solid var(--check); color: var(--check); background: var(--check-bg);
	border-radius: 4px; font-size: .86rem; font-weight: 700;
}
.mp-stamp--other { border-color: #8a6a1f; color: #6e5313; background: #f8f0dc; }
.mp-stamp__note { display: block; margin-top: 4px; font-size: .78rem; color: var(--muted); }
.mp-cta { margin-top: 6px; }
.mp-cta .mp-btn { width: 100%; }
.mp-muted { color: var(--muted); }
.mp-age { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }

@media (min-width: 760px) {
	.mp-table thead { display: table-header-group; }
	.mp-table tr { display: table-row; box-shadow: none; }
	.mp-table th, .mp-table td { display: table-cell; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
	.mp-table thead th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--ink); }
	.mp-table td[data-label]::before { display: none !important; }
	.mp-table .mp-name { display: table-cell !important; min-width: 150px; }
	.mp-table .mp-name .mp-logo { display: block; margin-bottom: 6px; }
	.mp-table .mp-name__text { display: block; }
	.mp-table td[data-label="Lisenssi"] { min-width: 180px; }
	.mp-table tbody tr:hover { background: #fdfbf6; }
	.mp-cta .mp-btn { width: auto; }
	.mp-cta { margin: 0; text-align: right; }
}

/* New casinos */
.mp-new { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mp-new__item {
	display: grid; grid-template-columns: 96px 1fr; gap: 10px 14px; align-items: center;
	background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.mp-new__item .mp-btn { grid-column: 1 / -1; }
.mp-new__logo { width: 96px; aspect-ratio: 480 / 220; object-fit: contain; }
.mp-new__name { margin: 0; font-weight: 700; }
.mp-new__evidence { margin: 0; font-size: .9rem; color: var(--muted); }
@media (min-width: 760px) {
	.mp-new { grid-template-columns: repeat(2, 1fr); }
}

/* Two-column layout with TOC */
.mp-layout { display: grid; gap: 20px; padding-top: 24px; padding-bottom: 40px; }
.mp-layout__main { min-width: 0; }
.mp-toc {
	background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px;
}
.mp-toc summary { cursor: pointer; padding: 12px 0; font-weight: 700; font-family: var(--font-head); font-size: 1.05rem; }
.mp-toc ol { margin: 0 0 14px; padding-left: 1.3em; font-size: .94rem; }
.mp-toc li { margin: 4px 0; }
.mp-toc a { color: var(--ink-soft); text-decoration: none; }
.mp-toc a:hover { color: var(--brand); text-decoration: underline; }
@media (min-width: 1000px) {
	.mp-layout { grid-template-columns: 250px 1fr; gap: 40px; align-items: start; }
	.mp-layout__side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
	.mp-layout:has(> .mp-layout__side:empty) { grid-template-columns: 1fr; }
}
.mp-layout__side:empty { display: none; }

/* Editorial content */
.mp-content { max-width: 78ch; }
.mp-content > :first-child { margin-top: 0; }
.mp-content table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; display: block; overflow-x: auto; }
.mp-content th, .mp-content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.mp-content th { background: #f3efe6; }
.mp-content blockquote { margin: 1.2em 0; padding: 10px 16px; border-left: 4px solid var(--brand); background: var(--card); }
.mp-pending { border: 1.5px dashed #8a6a1f; background: #fbf3df; border-radius: 8px; padding: 2px 14px; margin: 1em 0; font-size: .95rem; }
.mp-pending p { margin: .7em 0; }
.mp-byline { font-size: .9rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 18px; }
/* Hero sits on a dark gradient, so the byline needs its own light colours there. */
.mp-byline--hero { color: rgba(243, 240, 232, .88); border-bottom-color: rgba(255, 255, 255, .28); margin: 0 0 16px; }
.mp-byline--hero a { color: #fff; text-decoration: underline; }
.mp-byline--hero a:hover, .mp-byline--hero a:focus { text-decoration: none; }

.mp-related { margin-top: 36px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.mp-related__title { margin: 0 0 8px; font-size: 1.15rem; }
.mp-related ul { margin: 0; padding-left: 1.2em; }

/* Page header */
.mp-pagehead { background: var(--card); border-bottom: 1px solid var(--line); padding: 22px 0 14px; }
.mp-pagehead h1 { margin: 6px 0 0; }
.mp-crumbs { font-size: .88rem; color: var(--muted); }
.mp-crumbs a { color: var(--muted); }

/* Casino showcase */
.mp-section--show, .mp-section--faq, .mp-section--rg { padding: 8px 0 0; }
.mp-show {
	background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 18px;
	border-top: 4px solid var(--ink);
}
.mp-show__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mp-show__head h3 { margin: 0; }
.mp-show__rank {
	display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800;
}
.mp-show__logo { width: 132px; aspect-ratio: 480 / 220; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; }
.mp-show__facts { display: grid; gap: 8px; margin: 14px 0; }
.mp-show__facts div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.mp-show__facts dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mp-show__facts dd { margin: 0; }
.mp-show__pc { display: grid; gap: 12px; }
.mp-show__pc h4 { margin: 0 0 4px; }
.mp-show__pc ul { margin: 0; padding-left: 1.2em; }
.mp-show__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }
.mp-show__disc { margin: 0; font-size: .82rem; color: var(--muted); }
@media (min-width: 760px) {
	.mp-show__pc { grid-template-columns: 1fr 1fr; }
}

/* FAQ */
.mp-faq__item { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.mp-faq__item summary { cursor: pointer; padding: 12px 14px; font-weight: 700; }
.mp-faq__a { padding: 0 14px 4px; }

/* Responsible gambling */
.mp-section--rg { margin-top: 24px; }
.mp-section--rg { background: var(--check-bg); border: 1px solid #cfe3db; border-radius: var(--radius); padding: 4px 18px 10px; }
.mp-section--rg h2 { margin-top: 16px; }
.mp-toplist__note { margin-top: 18px; max-width: 78ch; font-size: .95rem; color: var(--ink-soft); }
.mp-toplist__note h3 { margin-top: 0; font-size: 1.1rem; }

/* Lists, author */
.mp-list { padding-left: 1.2em; }
.mp-author { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.mp-author__photo { border-radius: 50%; object-fit: cover; }
.mp-author__role { margin: 4px 0 0; color: var(--muted); }

/* Footer */
.mp-foot { background: var(--head); color: #d9d5cc; padding: 32px 0 20px; margin-top: 24px; font-size: .92rem; }
.mp-foot a { color: #fff; }
.mp-foot__grid { display: grid; gap: 18px; }
.mp-foot__brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 1.2rem; color: #fff; margin: 0 0 6px; }
.mp-foot__mark { display: block; flex: 0 0 auto; width: 28px; height: 28px; }
.mp-foot__note { margin: 0; max-width: 46ch; }
.mp-foot__links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.mp-foot__legal { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 22px; padding-top: 16px; }
.mp-age-badge--light { border-color: #fff; color: #fff; background: transparent; margin-right: 6px; }
.mp-foot__copy { margin: 10px 0 0; color: #aaa59b; }
@media (min-width: 760px) {
	.mp-foot__grid { grid-template-columns: 1fr 1.4fr; }
	.mp-foot__links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
