/*
Theme Name: Bankapp
Theme URI: https://bankapp.se
Author: Oleg
Author URI: https://bankapp.se
Description: Ett snabbt, skräddarsytt WordPress FSE-tema för Bankapp.se
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bankapp
Tags: full-site-editing, block-patterns, custom-colors, custom-typography
*/

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

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

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

body > .wp-site-blocks {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 100vh;
}

body > .wp-site-blocks > main,
body > .wp-site-blocks > .wp-block-group:has(> main),
.wp-site-blocks > main.wp-block-group {
	flex: 1;
}

.is-sticky-sidebar {
	position: sticky;
	top: 6rem;
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

::selection {
	background: var(--wp--preset--color--lime);
	color: var(--wp--preset--color--ink);
}

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
	background: color-mix(in srgb, var(--wp--preset--color--paper) 88%, transparent);
	backdrop-filter: blur(14px) saturate(1.2);
	-webkit-backdrop-filter: blur(14px) saturate(1.2);
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--border) 70%, transparent);
}

.bankapp-header {
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
	width: 100%;
}

.wp-block-navigation-item__content {
	color: var(--wp--preset--color--ink) !important;
	transition: color 0.2s ease;
}

.wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--accent) !important;
}

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

.wp-block-button__link {
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: var(--wp--custom--shadow--md);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--lime) !important;
	border-color: var(--wp--preset--color--ink);
}

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */

.bankapp-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	min-height: min(92vh, 860px);
	display: flex;
	align-items: flex-end;
	background:
		radial-gradient(ellipse 80% 60% at 85% 20%, color-mix(in srgb, var(--wp--preset--color--accent) 22%, transparent) 0%, transparent 55%),
		radial-gradient(ellipse 50% 40% at 10% 80%, color-mix(in srgb, var(--wp--preset--color--lime) 28%, transparent) 0%, transparent 50%),
		linear-gradient(165deg, var(--wp--preset--color--paper) 0%, var(--wp--preset--color--mist) 100%);
}

.bankapp-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	opacity: 0.35;
	background-image:
		linear-gradient(color-mix(in srgb, var(--wp--preset--color--ink) 6%, transparent) 1px, transparent 1px),
		linear-gradient(90deg, color-mix(in srgb, var(--wp--preset--color--ink) 6%, transparent) 1px, transparent 1px);
	background-size: 64px 64px;
	mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
	pointer-events: none;
}

.bankapp-hero__visual {
	position: absolute;
	right: max(4%, calc(50% - 560px));
	bottom: 8%;
	width: min(38vw, 340px);
	aspect-ratio: 720 / 900;
	z-index: 0;
	pointer-events: none;
	background: url("./assets/images/hero-device.svg") center / contain no-repeat;
	animation: bankapp-float 7s ease-in-out infinite;
	filter: drop-shadow(0 32px 48px rgb(12 22 18 / 0.22));
}

.bankapp-hero__content {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
	padding-block: clamp(5rem, 12vh, 8rem) clamp(4rem, 10vh, 7rem);
	animation: bankapp-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bankapp-hero__brand {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--hero);
	font-weight: 700;
	line-height: 0.95;
	letter-spacing: -0.05em;
	color: var(--wp--preset--color--ink);
	margin: 0 0 1.25rem;
}

.bankapp-hero__brand span {
	color: var(--wp--preset--color--accent);
}

.bankapp-hero .wp-block-buttons {
	margin-top: 0.5rem;
}

@media (max-width: 781px) {
	.bankapp-hero {
		min-height: auto;
		align-items: stretch;
	}

	.bankapp-hero__visual {
		position: relative;
		right: auto;
		bottom: auto;
		width: min(72%, 260px);
		margin: 0 auto 1.5rem;
		display: block;
		animation: none;
	}

	.bankapp-hero__content {
		padding-block: 4rem 3.5rem;
		text-align: center;
	}

	.bankapp-hero .wp-block-buttons {
		justify-content: center;
	}
}

@keyframes bankapp-rise {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes bankapp-float {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-12px);
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.bankapp-hero__content,
	.bankapp-hero__visual,
	.category-link,
	.wp-block-button__link {
		animation: none !important;
		transition: none !important;
	}
}

/* ------------------------------------------------------------------ */
/* Category links (interaction tiles, not decorative cards)            */
/* ------------------------------------------------------------------ */

.category-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.75rem;
}

@media (max-width: 781px) {
	.category-grid {
		grid-template-columns: 1fr;
	}
}

.category-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.35rem 1.5rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg);
	text-decoration: none !important;
	color: var(--wp--preset--color--ink) !important;
	transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.category-link:hover {
	border-color: var(--wp--preset--color--accent);
	background: var(--wp--preset--color--accent-soft);
	transform: translateX(4px);
}

.category-link__label {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--xl);
	font-weight: 500;
	letter-spacing: -0.03em;
	line-height: 1.2;
}

.category-link__meta {
	display: block;
	margin-top: 0.35rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--mute);
	font-weight: 400;
	letter-spacing: 0;
}

.category-link__arrow {
	flex-shrink: 0;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--lime);
	display: grid;
	place-items: center;
	font-size: 1rem;
	line-height: 1;
	transition: background-color 0.2s ease;
}

.category-link:hover .category-link__arrow {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--surface);
}

/* ------------------------------------------------------------------ */
/* Sections                                                            */
/* ------------------------------------------------------------------ */

.section-kicker {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin: 0 0 0.75rem;
}

.pull-quote {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--2xl);
	font-weight: 500;
	letter-spacing: -0.03em;
	line-height: 1.3;
	color: var(--wp--preset--color--ink);
	border: none;
	padding: 0;
	margin: 0;
}

.pull-quote cite {
	display: block;
	margin-top: 1.25rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--sm);
	font-style: normal;
	font-weight: 600;
	color: var(--wp--preset--color--mute);
	letter-spacing: 0;
}

.why-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.why-list li {
	position: relative;
	padding: 1.25rem 0 1.25rem 2.75rem;
	border-bottom: 1px solid var(--wp--preset--color--border);
	font-size: var(--wp--preset--font-size--lg);
	color: var(--wp--preset--color--ink);
}

.why-list li:first-child {
	border-top: 1px solid var(--wp--preset--color--border);
}

.why-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 1.45rem;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background: var(--wp--preset--color--lime);
	box-shadow: inset 0 0 0 5px var(--wp--preset--color--ink);
}

.cta-band {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
	border-radius: var(--wp--custom--radius--xl);
	overflow: hidden;
	position: relative;
}

.cta-band::after {
	content: "";
	position: absolute;
	inset: auto -10% -40% auto;
	width: 50%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--wp--preset--color--accent) 55%, transparent), transparent 70%);
	pointer-events: none;
}

.cta-band h2 {
	color: var(--wp--preset--color--surface) !important;
}

.cta-band p {
	color: color-mix(in srgb, var(--wp--preset--color--paper) 75%, transparent);
}

.cta-band .wp-block-button__link {
	background: var(--wp--preset--color--lime) !important;
	color: var(--wp--preset--color--ink) !important;
}

/* ------------------------------------------------------------------ */
/* App cards / listing surfaces                                        */
/* ------------------------------------------------------------------ */

.modern-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg);
	transition: border-color 0.2s ease, transform 0.2s ease;
	overflow: hidden;
}

.modern-card:hover {
	border-color: var(--wp--preset--color--accent);
	transform: translateY(-2px);
}

.modern-card a {
	text-decoration: none;
}

/* Post terms */
.is-style-pill .wp-block-post-terms a,
.wp-block-post-terms.is-style-pill a {
	display: inline-block;
	padding: 0.3rem 0.85rem;
	border-radius: var(--wp--custom--radius--full);
	background: var(--wp--preset--color--accent-soft);
	color: var(--wp--preset--color--accent) !important;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
}

.is-style-pill .wp-block-post-terms a:hover,
.wp-block-post-terms.is-style-pill a:hover {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--surface) !important;
}

/* ------------------------------------------------------------------ */
/* Shortcodes                                                          */
/* ------------------------------------------------------------------ */

.app-data-summary {
	display: grid;
	gap: 1rem;
}

.app-data-summary p {
	margin: 0;
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--wp--preset--color--border);
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--mute);
}

.app-data-summary p strong {
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 500;
}

.app-data-summary .app-pros,
.app-data-summary .app-cons {
	margin-top: 0.5rem;
	padding: 1rem;
	border-radius: var(--wp--custom--radius--md);
	font-size: var(--wp--preset--font-size--sm);
	line-height: 1.55;
}

.app-data-summary .app-pros {
	background: var(--wp--preset--color--accent-soft);
}

.app-data-summary .app-cons {
	background: var(--wp--preset--color--mist);
}

.app-data-summary .app-cta {
	margin-top: 0.5rem;
}

.app-data-summary .app-cta .wp-block-button__link {
	display: inline-block;
	width: 100%;
	text-align: center;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--lime);
	border-radius: var(--wp--custom--radius--full);
	padding: 0.875rem 1.25rem;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 500;
	font-size: var(--wp--preset--font-size--sm);
}

.app-top-pick {
	border: 1px solid var(--wp--preset--color--border);
	border-left: 4px solid var(--wp--preset--color--accent);
	padding: 1.5rem;
	border-radius: var(--wp--custom--radius--lg);
	display: flex;
	gap: 1.5rem;
	align-items: center;
	flex-wrap: wrap;
	background: var(--wp--preset--color--surface);
}

.app-top-pick__thumb {
	flex: 0 0 88px;
}

.app-top-pick__thumb img {
	border-radius: var(--wp--custom--radius--md);
	max-width: 100%;
	height: auto;
}

.app-top-pick__body {
	flex: 1;
	min-width: 200px;
}

.app-top-pick__body h3 {
	margin-top: 0;
	margin-bottom: 0.35rem;
}

.app-top-pick__meta {
	flex: 0 0 auto;
	text-align: right;
}

.app-top-pick__rating {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.75rem;
	font-weight: 700;
	letter-spacing: -0.03em;
	color: var(--wp--preset--color--accent);
	line-height: 1;
}

.app-top-pick__fee {
	margin: 0.5rem 0 1rem;
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--mute);
}

.app-comparison-table-wrapper {
	overflow-x: auto;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg);
	background: var(--wp--preset--color--surface);
}

.app-comparison-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
	margin: 0;
}

.app-comparison-table th,
.app-comparison-table td {
	padding: 1rem 1.25rem;
	white-space: nowrap;
}

.app-comparison-table thead tr {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
}

.app-comparison-table thead th {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 500;
	font-size: var(--wp--preset--font-size--sm);
	letter-spacing: 0.02em;
}

.app-comparison-table tbody tr {
	border-bottom: 1px solid var(--wp--preset--color--border);
	transition: background-color 0.15s ease;
}

.app-comparison-table tbody tr:last-child {
	border-bottom: none;
}

.app-comparison-table tbody tr:hover {
	background: var(--wp--preset--color--accent-soft);
}

.app-comparison-table a {
	color: var(--wp--preset--color--ink);
	font-weight: 600;
}

.app-comparison-table a:hover {
	color: var(--wp--preset--color--accent);
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

footer.wp-block-template-part {
	margin-top: auto;
}

.bankapp-footer a {
	color: color-mix(in srgb, var(--wp--preset--color--paper) 72%, transparent) !important;
	transition: color 0.2s ease;
}

.bankapp-footer a:hover {
	color: var(--wp--preset--color--lime) !important;
}

.bankapp-footer .wp-block-site-title a {
	color: var(--wp--preset--color--surface) !important;
}

.bankapp-footer h3 {
	color: var(--wp--preset--color--surface) !important;
}
