/**
 * Gardo & Morris Age & Consent Gate
 * Sage green (#88a685) background, white serif wordmark, white roundel,
 * bilingual EN / SV with the Swedish version in parentheses.
 */

.gmgate-root {
	/* Brand palette ---------------------------------------------------- */
	--gmgate-bg-overlay:    rgba(0, 0, 0, 0.85);
	--gmgate-bg-card:       #88a685;          /* sage from brief */
	--gmgate-fg:            #ffffff;
	--gmgate-fg-muted:      rgba(255, 255, 255, 0.92);
	--gmgate-fg-faint:      rgba(255, 255, 255, 0.7);
	--gmgate-gold:          #d4b878;          /* luminous champagne */
	--gmgate-border:        rgba(255, 255, 255, 0.4);
	--gmgate-border-soft:   rgba(255, 255, 255, 0.22);

	/* Layout ----------------------------------------------------------- */
	--gmgate-radius:        2px;
	--gmgate-max-width:     520px;
	--gmgate-z:             999999;

	/* Typography ------------------------------------------------------- */
	--gmgate-font:          'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--gmgate-tracking-wide: 0.18em;
	--gmgate-tracking-mega: 0.32em;

	position: fixed;
	inset: 0;
	z-index: var(--gmgate-z);
	display: flex;
	overflow-y: auto;
	align-items: flex-start;
	justify-content: center;
	padding: 1rem;
	background: var(--gmgate-bg-overlay);
	font-family: var(--gmgate-font);
	color: var(--gmgate-fg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.gmgate-root[hidden] {
	display: none;
}

body.gmgate-locked {
	overflow: hidden;
}

/* Card ---------------------------------------------------------------- */

.gmgate-card {
	position: relative;
	background: var(--gmgate-bg-card);
	border-radius: var(--gmgate-radius);
	padding: 2.5rem 2.25rem 2rem;
	max-width: var(--gmgate-max-width);
	width: 100%;
	max-height: none;
	overflow: visible;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
	text-align: center;
	margin-top: auto;
	margin-bottom: auto;
}

/* Inner hairline frame echoing the bottle label's inner border */
.gmgate-card::before {
	content: '';
	position: absolute;
	inset: 0.5rem;
	border: 1px solid var(--gmgate-border-soft);
	border-radius: var(--gmgate-radius);
	pointer-events: none;
}

/* Roundel + wordmark -------------------------------------------------- */

.gmgate-roundel {
	display: block;
	width: 96px;
	height: 96px;
	margin: 0 auto 1.5rem;
}

.gmgate-roundel--small {
	width: 64px;
	height: 64px;
	margin-bottom: 1rem;
}

.gmgate-wordmark {
	display: block;
	height: auto;
	width: 240px;
	max-width: 80%;
	margin: 0 auto 2rem;
}

.gmgate-wordmark--small {
	width: 180px;
	margin-bottom: 1rem;
}

/* Typography ---------------------------------------------------------- */

.gmgate-headline {
	margin: 0 0 1.25rem;
	color: var(--gmgate-fg);
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: var(--gmgate-tracking-wide);
	text-transform: uppercase;
	line-height: 1.4;
}

.gmgate-headline--small {
	margin: 0.5rem 0 1rem;
	font-size: 0.95rem;
}

.gmgate-lead {
	margin: 0 0 1.75rem;
	color: var(--gmgate-fg-muted);
	font-size: 0.875rem;
	line-height: 1.6;
	font-weight: 500;
}

.gmgate-fineprint {
	margin: 1.5rem 0 0;
	color: var(--gmgate-fg-faint);
	font-size: 0.72rem;
	font-weight: 400;
	letter-spacing: 0.05em;
	line-height: 1.5;
}

/* Bilingual translation ---------------------------------------------- */
/*
 * The Swedish text appears below the English in parentheses, set in
 * a slightly smaller size, italic, and gold-tinted to differentiate
 * it from the primary English copy without being noisy.
 */
.gmgate-translation {
	display: block;
	margin-top: 0.4em;
	color: #f0deaa;                /* lighter than main gold for legibility */
	font-size: 0.82em;
	font-style: italic;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0;
	line-height: 1.45;
	opacity: 0.95;
}

/* In headlines, the translation should not inherit the heavy uppercase
 * styling — keep it readable at sentence case. */
.gmgate-headline .gmgate-translation {
	font-weight: 500;
	font-size: 0.7em;
}

/* Inside the cookie category title (which is uppercase + bold), the
 * Swedish translation goes inline and looks lighter. */
.gmgate-category__title .gmgate-translation {
	display: inline;
	margin-left: 0.4em;
	font-size: 0.92em;
}

/* Fineprint sits on its own muted line — without an override the
 * Swedish translation inherits the muted color and disappears. */
.gmgate-fineprint .gmgate-translation {
	color: #f0deaa;
	opacity: 0.85;
}

/* Categories (cookie step) ------------------------------------------- */

.gmgate-categories {
	border: 0;
	margin: 0 0 1.5rem;
	padding: 0;
	display: grid;
	gap: 0.5rem;
	text-align: left;
}

.gmgate-category {
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-rows: auto auto;
	column-gap: 0.75rem;
	row-gap: 0.25rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--gmgate-border-soft);
	border-radius: var(--gmgate-radius);
	cursor: pointer;
	transition: border-color 150ms ease, background 150ms ease;
}

.gmgate-category:hover {
	border-color: var(--gmgate-border);
}

.gmgate-category:has(input:checked) {
	border-color: var(--gmgate-gold);
	background: rgba(255, 255, 255, 0.06);
}

.gmgate-category:has(input:disabled) {
	cursor: default;
	opacity: 0.85;
}

.gmgate-category input[type="checkbox"] {
	grid-row: 1 / 3;
	margin-top: 0.2rem;
	accent-color: var(--gmgate-gold);
	width: 1rem;
	height: 1rem;
	cursor: inherit;
}

.gmgate-category__title {
	font-weight: 700;
	font-size: 0.78rem;
	letter-spacing: var(--gmgate-tracking-wide);
	text-transform: uppercase;
	color: var(--gmgate-fg);
}

.gmgate-category__desc {
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--gmgate-fg-muted);
	line-height: 1.5;
}

/* Buttons ------------------------------------------------------------- */

.gmgate-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
}

.gmgate-actions--cookies {
	flex-direction: column;
}

.gmgate-btn {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.75rem 1.25rem;
	border: 1px solid var(--gmgate-fg);
	border-radius: var(--gmgate-radius);
	font-family: inherit;
	cursor: pointer;
	transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	align-items: center;
}

.gmgate-btn__primary {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: var(--gmgate-tracking-wide);
	text-transform: uppercase;
}

.gmgate-btn__secondary {
	font-size: 0.7rem;
	font-weight: 500;
	font-style: italic;
	letter-spacing: 0;
	text-transform: none;
	opacity: 0.85;
}

.gmgate-btn--primary {
	background: var(--gmgate-fg);
	color: var(--gmgate-bg-card);
	border-color: var(--gmgate-fg);
}

.gmgate-btn--primary:hover {
	background: var(--gmgate-gold);
	border-color: var(--gmgate-gold);
	color: var(--gmgate-fg);
}

.gmgate-btn--secondary {
	background: transparent;
	color: var(--gmgate-fg);
	border-color: var(--gmgate-border);
}

.gmgate-btn--secondary:hover {
	border-color: var(--gmgate-fg);
	background: rgba(255, 255, 255, 0.08);
}

.gmgate-btn:focus-visible {
	outline: 2px solid var(--gmgate-gold);
	outline-offset: 3px;
}

/* Reopen link in footer ---------------------------------------------- */

.gmgate-reopen-link {
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
}

/* Screen reader helper ----------------------------------------------- */

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

/* Mobile -------------------------------------------------------------- */

@media (max-width: 480px) {
	.gmgate-card {
		padding: 2rem 1.25rem 1.5rem;
	}

	.gmgate-card::before {
		inset: 0.4rem;
	}

	.gmgate-roundel {
		width: 80px;
		height: 80px;
		margin-bottom: 1rem;
	}

	.gmgate-headline {
		font-size: 1rem;
	}

	.gmgate-actions {
		flex-direction: column;
	}

	.gmgate-btn {
		width: 100%;
	}
}


/* ==========================================================
   Cookie details table (overlay-cookies.php)
   ========================================================== */

.gmgate-cookie-details {
	margin-top: 2px;
	margin-bottom: 14px;
	font-size: .85em;
}

.gmgate-cookie-details summary {
	cursor: pointer;
	color: #ffffff;
	font-size: 0.75rem;
	text-decoration: none;
	list-style: none;
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	cursor: pointer;
}

.gmgate-cookie-details summary::-webkit-details-marker {
	display: none;
}

.gmgate-cookie-details > summary::before {
	content: "";
	width: 0; height: 0;
	border-left: 5px solid currentColor;
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	transition: transform .15s ease;
	flex: 0 0 auto;
}
.gmgate-cookie-details[open] > summary::before { transform: rotate(90deg); }

.gmgate-cookie-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: .5rem;
	font-size: .9em;
}

.gmgate-cookie-details .gmgate-cookie-table {
	display: block;
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	font-size: 0.72rem;
}

.gmgate-cookie-table th,
.gmgate-cookie-table td {
	text-align: left;
	padding: .35rem .5rem;
	border-bottom: 1px solid rgba(0,0,0,.1);
	vertical-align: top;
}

.gmgate-cookie-table th {
	font-weight: 600;
	background: rgba(0,0,0,.04);
}

.gmgate-cookie-table code {
	font-size: .85em;
	background: rgba(0,0,0,.06);
	padding: .1em .3em;
	border-radius: 3px;
	word-break: break-all;
}
/* Mobil: stapla varje cookie som ett kort så inget spiller ut */
@media (max-width: 480px) {
	.gmgate-cookie-details .gmgate-cookie-table,
	.gmgate-cookie-details .gmgate-cookie-table tbody,
	.gmgate-cookie-details .gmgate-cookie-table tr,
	.gmgate-cookie-details .gmgate-cookie-table td {
		display: block;
		width: auto;
	}
	.gmgate-cookie-details .gmgate-cookie-table thead { display: none; }
	.gmgate-cookie-details .gmgate-cookie-table tr {
		margin-bottom: 10px;
		border: 1px solid rgba(255,255,255,0.25);
		padding: 6px 8px;
	}
	.gmgate-cookie-details .gmgate-cookie-table td {
		padding: 2px 0;
		text-align: left;
		white-space: normal;
		word-break: break-word;
	}
	.gmgate-cookie-details .gmgate-cookie-table td::before {
		content: attr(data-label);
		display: block;
		font-weight: 700;
		opacity: 0.75;
		font-size: 0.65rem;
		text-transform: uppercase;
		letter-spacing: 0.04em;
	}
}
