/* ==========================================================================
   Jämför Fackförbund – theme styles
   Colours/typography come from theme.json; this file adds the finishing touches.
   ========================================================================== */

:root {
	--jff-line: #E3E8F0;
	--jff-radius: 20px;
	--jff-radius-sm: 12px;
	--jff-shadow: 0 1px 2px rgba(11, 27, 51, .06), 0 8px 24px -12px rgba(11, 27, 51, .18);
	--jff-shadow-lift: 0 2px 4px rgba(11, 27, 51, .06), 0 22px 44px -18px rgba(36, 83, 230, .38);
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

::selection { background: var(--wp--preset--color--accent-2); color: var(--wp--preset--color--contrast); }

a { text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

/* Content rhythm on long guide pages ------------------------------------ */
.entry-content > h2,
.wp-block-post-content > h2 { margin-top: var(--wp--preset--spacing--50); }
.entry-content > h3,
.wp-block-post-content > h3 { margin-top: var(--wp--preset--spacing--30); }
.wp-block-post-content > p:first-child,
.jff-lead { font-size: clamp(1.125rem, 1rem + .4vw, 1.3rem); line-height: 1.6; color: var(--wp--preset--color--contrast-2); }

.wp-block-post-content ul:not([class*="is-style"]),
.wp-block-post-content ol:not([class*="is-style"]):not(.jff-steps) { padding-left: 1.25em; }
.wp-block-post-content li::marker { color: var(--wp--preset--color--accent); font-weight: 700; }
.wp-block-post-content li + li { margin-top: .35em; }
.wp-block-post-content ol.jff-steps > li::marker { content: none; }

/* Header ----------------------------------------------------------------- */
.jff-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, .82);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid var(--jff-line);
}
.admin-bar .jff-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .jff-header { top: 46px; } }

.jff-header .wp-block-site-logo img { border-radius: 10px; }
.jff-header .wp-block-navigation .wp-block-navigation-item__content {
	padding: .45rem .7rem;
	border-radius: 999px;
	color: var(--wp--preset--color--contrast);
	transition: background-color .15s ease, color .15s ease;
}
.jff-header .wp-block-navigation .wp-block-navigation-item__content:hover,
.jff-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	background: var(--wp--preset--color--accent-2);
	color: var(--wp--preset--color--accent);
}
.jff-header .wp-block-navigation__container { gap: .15rem; }
.jff-header .wp-block-button__link { padding: .6rem 1.1rem; font-size: .9rem; }
.jff-logo-mark {
	display: inline-grid; place-items: center;
	width: 34px; height: 34px; border-radius: 10px;
	background: var(--wp--preset--color--accent); color: #fff;
	font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: .95rem; letter-spacing: -.03em;
	margin: 0 !important;
}
@media (max-width: 1100px) { .jff-header .jff-header-cta { display: none; } }
.wp-block-navigation__responsive-container.is-menu-open { padding: var(--wp--preset--spacing--30); }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 1.25rem; padding: .5rem 0 !important; }

/* Page hero band -------------------------------------------------------- */
.jff-page-hero {
	background: linear-gradient(160deg, #E9EEFF 0%, #F5F7FB 55%, #E6F6EF 100%);
	border-bottom: 1px solid var(--jff-line);
	position: relative;
	overflow: hidden;
}
.jff-page-hero::after {
	content: "";
	position: absolute; right: -120px; top: -160px;
	width: 420px; height: 420px; border-radius: 50%;
	background: radial-gradient(circle, rgba(36, 83, 230, .16), rgba(36, 83, 230, 0) 70%);
	pointer-events: none;
}
.jff-page-hero > * { position: relative; z-index: 1; }

/* Eyebrow / pills ------------------------------------------------------- */
.is-style-jff-eyebrow,
.jff-eyebrow {
	display: block;
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: .8rem !important; font-weight: 600 !important;
	letter-spacing: .08em !important; text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}
.jff-pill {
	display: inline-block;
	padding: .35rem .8rem; border-radius: 999px;
	background: var(--wp--preset--color--base-2);
	border: 1px solid var(--jff-line);
	font-size: .8rem; font-weight: 600; color: var(--wp--preset--color--contrast-2);
	box-shadow: var(--jff-shadow);
}

/* Cards ----------------------------------------------------------------- */
.is-style-jff-card {
	background: var(--wp--preset--color--base-2);
	border: 1px solid var(--jff-line);
	border-radius: var(--jff-radius);
	padding: clamp(1.25rem, 1rem + 1vw, 2rem);
	box-shadow: var(--jff-shadow);
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.is-style-jff-card:hover { transform: translateY(-3px); box-shadow: var(--jff-shadow-lift); border-color: #C9D5F7; }
.is-style-jff-card > :first-child { margin-top: 0; }
.is-style-jff-card > :last-child { margin-bottom: 0; }
.is-style-jff-card h3 a, .is-style-jff-card h4 a { color: inherit; text-decoration: none; }
.is-style-jff-card h3 a::after, .is-style-jff-card h4 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.is-style-jff-card:has(h3 a, h4 a) { position: relative; cursor: pointer; }
.jff-card-arrow { color: var(--wp--preset--color--accent); font-weight: 600; font-size: .9rem; }
.jff-card-arrow::after { content: " →"; transition: margin .2s ease; }
.is-style-jff-card:hover .jff-card-arrow::after { margin-left: .25rem; }

.jff-icon {
	display: inline-grid; place-items: center;
	width: 44px; height: 44px; border-radius: 12px;
	background: var(--wp--preset--color--accent-2);
	color: var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700; font-size: 1rem;
	margin-bottom: .25rem !important;
}
.jff-icon.is-mint { background: var(--wp--preset--color--accent-4); color: #0F7A55; }
.jff-icon.is-butter { background: var(--wp--preset--color--accent-5); color: #9A6400; }
.jff-icon.is-coral { background: #FFE6E0; color: #C2412A; }

/* Org cards (LO / TCO / Saco) with a coloured top bar */
.jff-org { border-top-width: 5px !important; }
.jff-org.is-lo { border-top-color: #E5533D !important; }
.jff-org.is-tco { border-top-color: #2453E6 !important; }
.jff-org.is-saco { border-top-color: #12A273 !important; }

/* Callout / Ordlista ---------------------------------------------------- */
.is-style-jff-callout,
.is-style-jff-tip {
	border-radius: var(--jff-radius-sm);
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30) !important;
	border-left: 4px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--accent-2);
}
.is-style-jff-tip { border-left-color: #12A273; background: var(--wp--preset--color--accent-4); }
.is-style-jff-callout > :first-child, .is-style-jff-tip > :first-child { margin-top: 0; }
.is-style-jff-callout > :last-child, .is-style-jff-tip > :last-child { margin-bottom: 0; }
.is-style-jff-callout strong:first-child,
.is-style-jff-tip strong:first-child { color: var(--wp--preset--color--contrast); }

/* Lists ----------------------------------------------------------------- */
ul.is-style-checkmark-list { list-style: none; padding-left: 0; }
ul.is-style-checkmark-list li { position: relative; padding-left: 2rem !important; padding-inline-start: 2rem !important; }
ul.is-style-checkmark-list li + li { margin-top: .6rem; }
ul.is-style-checkmark-list li::before {
	content: ""; position: absolute; left: 0; top: .2em;
	width: 1.3rem; height: 1.3rem; border-radius: 50%;
	background: var(--wp--preset--color--accent-4) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%230F7A55' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7'/%3E%3C/svg%3E") center / 72% no-repeat;
}

ul.is-style-jff-links { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--jff-line); }
ul.is-style-jff-links li { margin: 0 !important; border-bottom: 1px solid var(--jff-line); }
ul.is-style-jff-links a {
	display: flex; justify-content: space-between; align-items: center; gap: 1rem;
	padding: 1rem .25rem; text-decoration: none; font-weight: 600;
	color: var(--wp--preset--color--contrast);
	transition: color .15s ease, padding .2s ease;
}
ul.is-style-jff-links a::after { content: "→"; color: var(--wp--preset--color--accent); transition: transform .2s ease; }
ul.is-style-jff-links a:hover { color: var(--wp--preset--color--accent); padding-left: .6rem; }
ul.is-style-jff-links a:hover::after { transform: translateX(4px); }

/* Steps (numbered) ------------------------------------------------------ */
ol.jff-steps { list-style: none; counter-reset: jff; padding: 0; display: grid; gap: 1rem; }
ol.jff-steps > li {
	counter-increment: jff; position: relative;
	padding: 1.1rem 1.25rem 1.1rem 4.25rem;
	background: var(--wp--preset--color--base-2);
	border: 1px solid var(--jff-line); border-radius: var(--jff-radius-sm);
	margin: 0 !important;
}
ol.jff-steps > li::before {
	content: counter(jff);
	position: absolute; left: 1.1rem; top: 1rem;
	width: 2.1rem; height: 2.1rem; border-radius: 50%;
	display: grid; place-items: center;
	background: var(--wp--preset--color--accent); color: #fff;
	font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: .95rem;
}

/* Tables ---------------------------------------------------------------- */
.wp-block-table table { border-collapse: separate; border-spacing: 0; width: 100%; }
.wp-block-table.is-style-jff-modern {
	border: 1px solid var(--jff-line); border-radius: var(--jff-radius-sm);
	overflow-x: auto; background: var(--wp--preset--color--base-2); box-shadow: var(--jff-shadow);
}
.wp-block-table.is-style-jff-modern table { min-width: 560px; }
.wp-block-table.is-style-jff-modern td,
.wp-block-table.is-style-jff-modern th { border: 0; border-bottom: 1px solid var(--jff-line); padding: .85rem .9rem; text-align: left; white-space: nowrap; }
.wp-block-table.is-style-jff-modern table { width: 100%; }
.wp-block-table.is-style-jff-modern thead th { white-space: normal; }
.wp-block-table.is-style-jff-modern thead { border: 0; }
.wp-block-table.is-style-jff-modern thead th {
	background: var(--wp--preset--color--accent-2);
	font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
	color: var(--wp--preset--color--contrast);
}
.wp-block-table.is-style-jff-modern tbody tr:last-child td { border-bottom: 0; }
.wp-block-table.is-style-jff-modern tbody tr:hover td { background: #FAFBFE; }
.wp-block-table.is-style-jff-modern td:first-child { font-weight: 600; }
.wp-block-table figcaption { font-size: .8rem; color: var(--wp--preset--color--contrast-2); margin-top: .75rem; }

/* FAQ (details) --------------------------------------------------------- */
.wp-block-details.is-style-jff-faq {
	background: var(--wp--preset--color--base-2);
	border: 1px solid var(--jff-line); border-radius: var(--jff-radius-sm);
	padding: 0; overflow: hidden; transition: box-shadow .2s ease;
}
.wp-block-details.is-style-jff-faq + .wp-block-details.is-style-jff-faq { margin-top: .75rem; }
.wp-block-details.is-style-jff-faq[open] { box-shadow: var(--jff-shadow); }
.wp-block-details.is-style-jff-faq summary {
	list-style: none; cursor: pointer;
	padding: 1.1rem 3.25rem 1.1rem 1.25rem; position: relative;
	font-weight: 600; font-family: var(--wp--preset--font-family--heading); font-size: 1.08rem;
}
.wp-block-details.is-style-jff-faq summary::-webkit-details-marker { display: none; }
.wp-block-details.is-style-jff-faq summary::after {
	content: "+"; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%);
	width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center;
	background: var(--wp--preset--color--accent-2); color: var(--wp--preset--color--accent);
	font-size: 1.15rem; font-weight: 500; transition: transform .2s ease;
}
.wp-block-details.is-style-jff-faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.wp-block-details.is-style-jff-faq > :not(summary) { padding: 0 1.25rem; margin-top: 0; }
.wp-block-details.is-style-jff-faq > :last-child { padding-bottom: 1.15rem; }

/* Images ---------------------------------------------------------------- */
.wp-block-image.is-style-jff-shadow img { border-radius: var(--jff-radius); box-shadow: var(--jff-shadow-lift); }
.wp-block-post-content .wp-block-image img { border-radius: var(--jff-radius); }

/* Buttons --------------------------------------------------------------- */
.wp-block-button__link { transition: background-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease; }
.wp-block-button__link:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(36, 83, 230, .6); }
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1.5px solid var(--jff-line) !important;
	background: var(--wp--preset--color--base-2) !important;
	color: var(--wp--preset--color--contrast) !important;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--contrast) !important;
	box-shadow: none;
}
.jff-dark .wp-block-button:not(.is-style-outline) > .wp-block-button__link { background: #fff; color: var(--wp--preset--color--contrast); }
.jff-dark .wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover { background: var(--wp--preset--color--accent-2); }
.jff-dark .wp-block-button.is-style-outline > .wp-block-button__link { background: transparent !important; color: #fff !important; border-color: rgba(255, 255, 255, .35) !important; }

/* Hero ------------------------------------------------------------------ */
.jff-hero { position: relative; overflow: hidden; }
.jff-hero::before {
	content: ""; position: absolute; inset: 0;
	background-image: radial-gradient(rgba(11, 27, 51, .07) 1px, transparent 1px);
	background-size: 22px 22px;
	-webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
	mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
	pointer-events: none;
}
.jff-hero > * { position: relative; }
.jff-hero h1 em, .jff-highlight {
	font-style: normal;
	background: linear-gradient(transparent 62%, rgba(255, 107, 74, .35) 62%);
	padding: 0 .08em;
}
.jff-quick a { text-decoration: none; }

/* Dark band (CTA + footer) ---------------------------------------------- */
.jff-dark { color: #C9D3E3; }
.jff-dark h1, .jff-dark h2, .jff-dark h3, .jff-dark h4, .jff-dark .wp-block-site-title a { color: #fff; }
.jff-dark a { color: #fff; }
.jff-dark a:hover { color: #BFD0FF; }
.jff-cta { border-radius: 28px; overflow: hidden; position: relative; }
.jff-cta::after {
	content: ""; position: absolute; width: 360px; height: 360px; right: -90px; bottom: -180px; border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 107, 74, .45), rgba(255, 107, 74, 0) 70%);
	pointer-events: none;
}
.jff-cta > * { position: relative; z-index: 1; }

.jff-footer .wp-block-navigation a { color: #C9D3E3; text-decoration: none; }
.jff-footer .wp-block-navigation a:hover { color: #fff; }
.jff-footer .jff-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); }

/* Posts ----------------------------------------------------------------- */
.jff-post-card .wp-block-post-featured-image img { aspect-ratio: 16/10; object-fit: cover; }
.wp-block-query-pagination a { text-decoration: none; }

/* Search ---------------------------------------------------------------- */
.wp-block-search__input { border-radius: 999px !important; border: 1px solid var(--jff-line) !important; padding: .7rem 1.1rem !important; }
.wp-block-search__button { border-radius: 999px !important; }

/* Reduced motion -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; }
	.is-style-jff-card:hover, .wp-block-button__link:hover { transform: none; }
}

/* Spacing between stacked guide components */
.wp-block-post-content > .is-style-jff-callout,
.wp-block-post-content > .is-style-jff-tip,
.wp-block-post-content > .wp-block-quote,
.wp-block-post-content > .wp-block-table { margin-top: var(--wp--preset--spacing--30); margin-bottom: var(--wp--preset--spacing--30); }
.wp-block-post-content > .jff-eyebrow { margin-top: var(--wp--preset--spacing--40); }
.wp-block-table.is-style-jff-modern figcaption { padding: 0 1rem .9rem; margin-top: .75rem; }

/* Front page: existing guide text shown as a white "article" card -------- */
.jff-article {
	background: var(--wp--preset--color--base-2);
	border: 1px solid var(--jff-line);
	border-radius: 28px;
	box-shadow: var(--jff-shadow);
	max-width: 880px;
	margin-left: auto !important;
	margin-right: auto !important;
	padding: clamp(1.5rem, 1rem + 3vw, 4rem) clamp(1.25rem, .5rem + 3vw, 4rem);
}
.jff-article .wp-block-post-content > :first-child { margin-top: 0; }
.jff-article .wp-block-post-content > h1:first-child { font-size: var(--wp--preset--font-size--x-large); }
.jff-front-content + .wp-block-group { margin-top: 0; }

/* Header: keep it on one line; switch to the menu button below 1080px ---- */
.jff-header .wp-block-site-title { white-space: nowrap; }
.jff-header .wp-block-navigation-item__content { white-space: nowrap; }
@media (max-width: 1080px) {
	.jff-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
	.jff-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none !important; }
}
