/*
Theme Name: Guldrush
Description: Eget blocktema för guld-rush.se – guldpris, köpa och sälja guld.
Version: 0.4.0
Requires at least: 6.6
Requires PHP: 7.4
Author: Webbstream Norden AB
Text Domain: guldrush
License: GNU General Public License v2 or later
*/

/* ---------- Typografi: en familj, bredden bär karaktären ---------- */
body {
	font-stretch: 100%;
	font-feature-settings: "kern" 1;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3,
.wp-block-site-title {
	font-stretch: 116%;
	letter-spacing: -0.012em;
	text-wrap: balance;
}

h1 { font-stretch: 122%; }

p, li { text-wrap: pretty; }

.gr-num,
table,
.wp-block-post-date {
	font-variant-numeric: tabular-nums;
}

:where(a):focus-visible,
:where(button):focus-visible,
.wp-block-button__link:focus-visible {
	outline: 2px solid var(--wp--preset--color--guld);
	outline-offset: 3px;
}

/* ---------- Sidhuvud ---------- */
.gr-header {
	border-bottom: 1px solid var(--wp--preset--color--silver);
	background: var(--wp--preset--color--vit);
}

.gr-header .wp-block-site-title a {
	text-decoration: none;
	color: var(--wp--preset--color--grafit);
}

.gr-header .wp-block-navigation a {
	text-decoration: none;
}

.gr-header .wp-block-navigation a:hover {
	text-decoration: underline;
	text-underline-offset: 0.3em;
	text-decoration-thickness: 2px;
	text-decoration-color: var(--wp--preset--color--guld);
}

/* Liten tackmarkering före namnet */
.gr-header .wp-block-site-title::before {
	content: "";
	display: inline-block;
	width: 0.9em;
	height: 0.55em;
	margin-right: 0.45em;
	vertical-align: 0.05em;
	border-radius: 2px;
	background: linear-gradient(135deg, #E6C870 0%, #C9A13B 50%, #A07A22 100%);
	clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
}

/* ---------- Tackan: sajtens enda dekorativa element ---------- */
.gr-plate {
	position: relative;
	aspect-ratio: 1.55 / 1;
	max-width: 440px;
	margin-left: auto;
	border-radius: 10px;
	color: #3B2C08;
	background:
		linear-gradient(160deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 38%),
		linear-gradient(135deg, #E9CC78 0%, #D3AE4C 40%, #B98F2E 75%, #9E7621 100%);
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.45),
		inset 0 0 0 12px rgba(120, 88, 20, 0.10),
		inset 0 0 0 13px rgba(255, 240, 200, 0.35);
	display: flex;
	flex-direction: column;
	justify-content: center;
	text-align: center;
}

.gr-plate p { margin: 0; }

.gr-plate .gr-plate-mark {
	font-size: 0.95rem;
	font-weight: 600;
	font-stretch: 125%;
	letter-spacing: 0.32em;
	text-transform: uppercase;
	padding-left: 0.32em; /* kompenserar spärrningen så att texten centreras */
}

.gr-plate .gr-plate-fineness {
	font-size: clamp(3rem, 7vw, 4.6rem);
	line-height: 1;
	font-weight: 800;
	font-stretch: 125%;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
	/* präglad känsla: ljus kant under, mörk ovan */
	text-shadow: 0 1px 0 rgba(255, 245, 210, 0.7), 0 -1px 0 rgba(90, 64, 10, 0.35);
	margin: 0.15em 0 0.1em;
}

.gr-plate .gr-plate-weight {
	font-size: 1.05rem;
	font-weight: 600;
	font-stretch: 112%;
}

.gr-plate-caption {
	max-width: 440px;
	margin-left: auto;
	color: var(--wp--preset--color--grafit-ljus);
}

/* ---------- Ärenden på startsidan ---------- */
.gr-route {
	border-top: 3px solid var(--wp--preset--color--grafit);
	padding-top: var(--wp--preset--spacing--30);
}

.gr-route.gr-route--primary {
	border-top-color: var(--wp--preset--color--guld);
}

.gr-route h2 a,
.gr-route h3 a {
	color: var(--wp--preset--color--grafit);
	text-decoration: none;
}

.gr-route h2 a:hover,
.gr-route h3 a:hover {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--guld);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

/* ---------- Artikellistor ---------- */
.gr-cards .wp-block-post {
	border-top: 1px solid var(--wp--preset--color--silver);
	padding-top: var(--wp--preset--spacing--20);
}

.gr-cards .wp-block-post-title a {
	color: var(--wp--preset--color--grafit);
	text-decoration: none;
}

.gr-cards .wp-block-post-title a:hover {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--guld);
}

/* ---------- Artikel ---------- */
.gr-byline {
	color: var(--wp--preset--color--grafit-ljus);
	border-top: 1px solid var(--wp--preset--color--silver);
	border-bottom: 1px solid var(--wp--preset--color--silver);
	padding-block: var(--wp--preset--spacing--10);
}

.gr-byline p,
.gr-byline .wp-block-post-date,
.gr-byline .wp-block-post-author-name { margin: 0; }

.gr-note {
	max-width: 760px;
	border-left: 4px solid var(--wp--preset--color--guld);
	background: var(--wp--preset--color--vit);
}

.entry-content table,
.wp-block-post-content table {
	border-collapse: collapse;
	width: 100%;
}

.wp-block-post-content th,
.wp-block-post-content td {
	border-bottom: 1px solid var(--wp--preset--color--silver);
	padding: 0.55em 0.6em;
	text-align: left;
}

/* Mellanrubriker i löptext: något mindre än sidans rubriker */
.wp-block-post-content h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2rem); }
.wp-block-post-content h3 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.5rem); }

/* ---------- Sidfot ---------- */
.gr-footer a {
	color: var(--wp--preset--color--vit);
}

.gr-footer .gr-footer-fine {
	color: #B9BEC5;
}

@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; transition: none !important; }
}

@media (max-width: 781px) {
	.gr-plate, .gr-plate-caption { margin-left: 0; }
}
