/*
 * Forgotten Tools — page content styles.
 * Loaded on the site AND inside the WordPress editor, so pages look the same while editing.
 * Each style here is picked in the editor: select a block → Styles (right-hand panel).
 */

:root {
	--ftc-ink: #272320;
	--ftc-sand: #f3ecdc;
	--ftc-cream: #f9f6ef;
	--ftc-line: #e6dfd1;
	--ftc-yellow: #f5b800;
	--ftc-gold: #8a6a00;
	--ftc-muted: #6e675d;
	--ftc-red: #b3361f;
	--ftc-red-bg: #fbeae6;
	--ftc-green: #2f7d50;
	--ftc-green-bg: #e4f1e8;
	--ftc-display: "Barlow Condensed", "Arial Narrow", sans-serif;
}

/* ---------- Text ---------- */

.ft-prose h2 { font-size: clamp(26px, 3vw, 32px); }
.ft-prose h3 { font-size: 22px; }
.ft-prose h4 { font-size: 18px; letter-spacing: .03em; }

p.is-style-ft-lead {
	font-size: clamp(19px, 2.2vw, 22px);
	line-height: 1.55;
	font-weight: 500;
	color: var(--ftc-ink);
}

p.is-style-ft-big {
	font-family: var(--ftc-display);
	font-weight: 700;
	text-transform: uppercase;
	font-size: clamp(26px, 3.4vw, 36px);
	line-height: 1.08;
	letter-spacing: .01em;
	margin: 1.2em 0 .8em;
}
p.is-style-ft-big strong { color: var(--ftc-gold); }

p.is-style-ft-note {
	background: var(--ftc-sand);
	border-left: 4px solid var(--ftc-yellow);
	border-radius: 0 6px 6px 0;
	padding: 14px 18px;
	font-weight: 600;
}

h2.is-style-ft-eyebrow, h3.is-style-ft-eyebrow, h4.is-style-ft-eyebrow, p.is-style-ft-eyebrow {
	font-family: inherit;
	font-size: 13px !important;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--ftc-gold);
	margin-top: 0; margin-bottom: 8px;
}

/* ---------- Icon block ---------- */

.ft-icon-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #fcf1cc;
	color: var(--ftc-gold);
	margin-top: 0; margin-bottom: 12px;
}
.ft-icon-badge svg { display: block; }
.ft-icon-badge.is-size-sm { width: 38px; height: 38px; }
.ft-icon-badge.is-size-lg { width: 72px; height: 72px; }
.ft-icon-badge.is-tone-dark { background: var(--ftc-ink); color: var(--ftc-yellow); }
.ft-icon-badge.is-tone-red { background: var(--ftc-red-bg); color: var(--ftc-red); }
.ft-icon-badge.is-tone-green { background: var(--ftc-green-bg); color: var(--ftc-green); }
.ft-icon-badge.is-tone-plain { background: none; width: auto; height: auto; border-radius: 0; }
.wp-block-ft-icon.aligncenter, .ft-icon-badge.aligncenter { display: flex; margin-left: auto; margin-right: auto; width: max-content; }
.ft-icon-badge.aligncenter { width: 52px; }
.ft-icon-badge.aligncenter.is-size-sm { width: 38px; }
.ft-icon-badge.aligncenter.is-size-lg { width: 72px; }

/* ---------- Group styles ---------- */

.wp-block-group.is-style-ft-card,
.wp-block-group.is-style-ft-callout,
.wp-block-group.is-style-ft-warning,
.wp-block-group.is-style-ft-dark {
	margin-top: 0; margin-bottom: 22px;
	border-radius: 8px;
}

.wp-block-group.is-style-ft-card {
	background: #fff;
	border: 1px solid var(--ftc-line);
	padding: clamp(20px, 3vw, 30px) clamp(20px, 3.4vw, 34px);
	box-shadow: 0 1px 2px rgba(39, 35, 32, .04);
}

.wp-block-group.is-style-ft-callout {
	background: var(--ftc-sand);
	border-left: 5px solid var(--ftc-yellow);
	padding: 20px 24px;
	border-radius: 0 8px 8px 0;
}

.wp-block-group.is-style-ft-warning {
	background: var(--ftc-red-bg);
	border-left: 5px solid var(--ftc-red);
	padding: 20px 24px;
	border-radius: 0 8px 8px 0;
}
.wp-block-group.is-style-ft-warning :is(h2, h3, h4) { color: var(--ftc-red); }

.wp-block-group.is-style-ft-dark {
	background: var(--ftc-ink);
	color: #e9e4da;
	padding: clamp(26px, 4vw, 44px);
}
.wp-block-group.is-style-ft-dark :is(h2, h3, h4) { color: #fff; }
.wp-block-group.is-style-ft-dark strong { color: var(--ftc-yellow); }
.wp-block-group.is-style-ft-dark a { color: var(--ftc-yellow); }

/* Icon + heading side by side when a group starts with an Icon block. */
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark):has(> .wp-block-ft-icon:first-child) {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: 16px;
	align-items: start;
}
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark):has(> .wp-block-ft-icon:first-child) > * { grid-column: 1 / -1; }
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > .wp-block-ft-icon:first-child { grid-column: 1; }
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > .wp-block-ft-icon:first-child .ft-icon-badge,
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > .ft-icon-badge:first-child { margin: 0; }
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > .wp-block-ft-icon:first-child + * {
	grid-column: 2;
	align-self: center;
	margin: 0;
}
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > .wp-block-ft-icon:first-child + * + * { margin-top: 16px; }

.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > :first-child { margin-top: 0; }
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > :last-child { margin-bottom: 0; }
.wp-block-group.is-style-ft-card > .wp-block-group:is(.is-style-ft-callout, .is-style-ft-warning) { margin: 18px 0; }

/* ---------- List styles ---------- */

ul.is-style-ft-checks, ul.is-style-ft-crosses, ol.is-style-ft-checks, ol.is-style-ft-crosses {
	list-style: none;
	padding-left: 0;
	margin-top: 0; margin-bottom: 1.2em;
}
:is(ul, ol):is(.is-style-ft-checks, .is-style-ft-crosses) > li {
	position: relative;
	padding: 4px 0 4px 32px;
	break-inside: avoid;
}
:is(ul, ol):is(.is-style-ft-checks, .is-style-ft-crosses) > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .5em;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 12px;
}
:is(ul, ol).is-style-ft-checks > li::before {
	background-color: var(--ftc-green-bg);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f7d50' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
:is(ul, ol).is-style-ft-crosses > li::before {
	background-color: var(--ftc-red-bg);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3361f' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E");
}
@media (min-width: 640px) {
	:is(ul, ol).is-style-ft-crosses:has(> li:nth-child(7)),
	:is(ul, ol).is-style-ft-checks:has(> li:nth-child(7)) { columns: 2; column-gap: 32px; }
}

ul.is-style-ft-chips, ol.is-style-ft-chips {
	list-style: none;
	padding: 0;
	margin-top: 0; margin-bottom: 1.2em;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
:is(ul, ol).is-style-ft-chips > li {
	background: var(--ftc-cream);
	border: 1px solid var(--ftc-line);
	border-radius: 999px;
	padding: 5px 14px;
	font-size: 15px;
	line-height: 1.4;
	font-weight: 500;
	margin: 0;
}

/* ---------- FAQ (Details block) ---------- */

details.wp-block-details.is-style-ft-faq {
	background: #fff;
	border: 1px solid var(--ftc-line);
	border-radius: 8px;
	margin-top: 0; margin-bottom: 10px;
	padding: 0;
}
details.wp-block-details.is-style-ft-faq > summary {
	list-style: none;
	cursor: pointer;
	position: relative;
	padding: 16px 56px 16px 20px;
	font-weight: 600;
	font-size: 17px;
	line-height: 1.4;
}
details.wp-block-details.is-style-ft-faq > summary::-webkit-details-marker { display: none; }
details.wp-block-details.is-style-ft-faq > summary::after {
	content: "+";
	position: absolute;
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--ftc-sand);
	color: var(--ftc-ink);
	font-size: 20px;
	line-height: 28px;
	text-align: center;
	font-weight: 500;
}
details.wp-block-details.is-style-ft-faq[open] > summary::after { content: "–"; background: var(--ftc-yellow); }
details.wp-block-details.is-style-ft-faq[open] > summary { border-bottom: 1px solid var(--ftc-line); }
details.wp-block-details.is-style-ft-faq > :not(summary) { margin-left: 20px; margin-right: 20px; }
details.wp-block-details.is-style-ft-faq > :nth-child(2) { margin-top: 14px; }
details.wp-block-details.is-style-ft-faq > :last-child { margin-bottom: 18px; }

/* ---------- Columns: card grid ---------- */

.wp-block-columns.is-style-ft-grid { gap: 18px; margin-top: 0; margin-bottom: 22px; }
.wp-block-columns.is-style-ft-grid > .wp-block-column {
	background: #fff;
	border: 1px solid var(--ftc-line);
	border-radius: 8px;
	padding: 22px 22px 18px;
}
.wp-block-columns.is-style-ft-grid > .wp-block-column > :first-child { margin-top: 0; }
.wp-block-columns.is-style-ft-grid > .wp-block-column > :last-child { margin-bottom: 0; }
.wp-block-columns.is-style-ft-grid :is(h3, h4) { font-size: 20px; margin-bottom: .4em; }

/* Text + photo rows: if no photo has been chosen yet, the text takes the full width. */
.wp-block-columns > .wp-block-column:empty { display: none; }
.wp-block-columns:has(> .wp-block-column:empty) > .wp-block-column { flex-basis: 100% !important; }

/* ---------- Images ---------- */

figure.wp-block-image.is-style-ft-photo img {
	border-radius: 8px;
	border: 6px solid #fff;
	box-shadow: 0 6px 24px rgba(39, 35, 32, .12);
	display: block;
}
figure.wp-block-image figcaption { font-size: 14px; color: var(--ftc-muted); text-align: center; }

/* ---------- Separators ---------- */

.ft-prose hr.wp-block-separator {
	border: 0;
	height: 3px;
	width: 64px;
	background: var(--ftc-yellow);
	margin: 40px 0;
	opacity: 1;
}

/* ---------- "Page with contents list" template ---------- */

.ft-doc { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; align-items: start; }
.ft-doc__toc {
	position: sticky;
	top: calc(var(--ft-header-h, 72px) + 20px);
	max-height: calc(100vh - var(--ft-header-h, 72px) - 40px);
	overflow: auto;
	background: #fff;
	border: 1px solid var(--ftc-line);
	border-radius: 8px;
	padding: 18px 8px 14px 18px;
}
.ft-doc__toc-title { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ftc-gold); margin-top: 0; margin-bottom: 10px; }
.ft-doc__toc ol { list-style: none; margin: 0; padding: 0; }
.ft-doc__toc li { margin: 0; }
.ft-doc__toc a {
	display: block;
	padding: 6px 10px 6px 0;
	font-size: 14px;
	line-height: 1.35;
	color: var(--ftc-muted);
	text-decoration: none;
	border-left: 2px solid transparent;
}
.ft-doc__toc a:hover, .ft-doc__toc a.is-active { color: var(--ftc-ink); }
.ft-doc__toc a.is-active { font-weight: 600; }
.ft-doc .ft-prose :is(h2, h3)[id] { scroll-margin-top: calc(var(--ft-header-h, 72px) + 20px); }
.ft-doc__mobile-toc { display: none; }

@media (max-width: 900px) {
	.ft-doc { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.ft-doc__toc { display: none; }
	.ft-doc__mobile-toc { display: block; margin-top: 0; margin-bottom: 22px; background: #fff; border: 1px solid var(--ftc-line); border-radius: 8px; }
	.ft-doc__mobile-toc summary { padding: 14px 18px; font-weight: 700; cursor: pointer; }
	.ft-doc__mobile-toc ol { margin: 0; padding: 0 18px 14px 36px; }
	.ft-doc__mobile-toc li { padding: 4px 0; }
	.ft-doc__mobile-toc a { color: var(--ftc-ink); }
}

/* Back to top link at the end of long pages. */
.ft-doc__top { display: inline-block; margin-top: 18px; font-weight: 600; color: var(--ftc-gold); }
.ft-doc--no-toc { grid-template-columns: minmax(0, 860px); justify-content: center; }

/* Classic themes: WordPress wraps group contents in an extra container — let the styles see straight through it. */
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > .wp-block-group__inner-container { display: contents; }
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark):has(> .wp-block-group__inner-container > .wp-block-ft-icon:first-child) {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: 16px;
	align-items: start;
}
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > .wp-block-group__inner-container > * { grid-column: 1 / -1; }
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > .wp-block-group__inner-container > .wp-block-ft-icon:first-child { grid-column: 1; margin: 0; }
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > .wp-block-group__inner-container > .wp-block-ft-icon:first-child + * { grid-column: 2; align-self: center; margin: 0; }
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > .wp-block-group__inner-container > .wp-block-ft-icon:first-child + * + * { margin-top: 16px; }
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > .wp-block-group__inner-container > :first-child { margin-top: 0; }
.wp-block-group:is(.is-style-ft-card, .is-style-ft-callout, .is-style-ft-warning, .is-style-ft-dark) > .wp-block-group__inner-container > :last-child { margin-bottom: 0; }
.wp-block-group.is-style-ft-card > .wp-block-group__inner-container > .wp-block-group:is(.is-style-ft-callout, .is-style-ft-warning) { margin: 18px 0; }

/* FAQ answers inside a card: stacked rows instead of separate boxes. */
.wp-block-group.is-style-ft-card details.wp-block-details.is-style-ft-faq { border: 0; border-top: 1px solid var(--ftc-line); border-radius: 0; margin: 0; }
.wp-block-group.is-style-ft-card details.wp-block-details.is-style-ft-faq > summary { padding-left: 0; }
.wp-block-group.is-style-ft-card details.wp-block-details.is-style-ft-faq > :not(summary) { margin-left: 0; }
.wp-block-group.is-style-ft-card > .wp-block-group__inner-container > .wp-block-ft-icon:first-child + h2 + details,
.wp-block-group.is-style-ft-card > .wp-block-ft-icon:first-child + h2 + details { margin-top: 18px; }

/* Even paragraph spacing inside cards. */
.wp-block-group[class*="is-style-ft-"] > .wp-block-group__inner-container > *,
.wp-block-group[class*="is-style-ft-"] > :not(.wp-block-group__inner-container) { margin-top: 0; margin-bottom: 14px; }
.wp-block-group[class*="is-style-ft-"] > .wp-block-group__inner-container > .wp-block-ft-icon:first-child + * { margin-bottom: 0; }
.wp-block-group[class*="is-style-ft-"] > .wp-block-group__inner-container > .wp-block-ft-icon:first-child + * + * { margin-top: 16px; }
.wp-block-group[class*="is-style-ft-"] > .wp-block-group__inner-container > .wp-block-group[class*="is-style-ft-"] { margin-top: 6px; margin-bottom: 18px; }
.wp-block-group[class*="is-style-ft-"] > .wp-block-group__inner-container > :last-child { margin-bottom: 0; }
.wp-block-group[class*="is-style-ft-"] > .wp-block-group__inner-container > p.is-style-ft-big { margin-top: 10px; }
