/* Mango Postal blog. Every color below is a value from the webapp's
   palette in src/index.css; nothing here is invented. */
:root {
	--mango: #ef8c12;
	--mango-mid: #fcba3f;
	--honey: #ffde9c;
	--cream: #fbf3d5;
	--butter: #ffebc3;
	--white: #ffffff;
	--bone: #e5ddc9;
	--ink: #33302b;
	--ink-soft: #5f5346;
	--ink-mild: #8a7d6d;
	--cacao: #1f0d02;
	--rust: #9f5719;
	--terracotta: #9e3b2b;

	/* Type mirrors the webapp's src/index.css: Teko brands the titles,
	   Kode Mono is the UI/label voice, Courier Prime carries reading copy,
	   Caveat writes the postcard lines. */
	--brand: "Teko", sans-serif;
	--terminal: "Kode Mono", ui-monospace, monospace;
	--mono: "Courier Prime", "Courier New", monospace;
	--hand: "Caveat", cursive;

	--measure: 42rem;
	--wide: 68rem;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--cream);
	color: var(--ink);
	font-family: var(--mono);
	font-size: 1.0625rem;
	line-height: 1.75;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
	font-family: var(--brand);
	font-weight: 500;
	letter-spacing: 0.005em;
	text-transform: uppercase;
}

a { color: var(--rust); text-underline-offset: 0.18em; }
a:hover { color: var(--terracotta); }

:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; }

.skip {
	position: absolute; left: -9999px; top: 0;
	background: var(--cacao); color: var(--butter); padding: 0.5rem 1rem;
}
.skip:focus { left: 1rem; }

.wrap { width: min(100% - 2rem, var(--wide)); margin-inline: auto; }
.prose-wrap { width: min(100% - 2rem, var(--measure)); margin-inline: auto; }

/* Header */
.site-header { border-bottom: 1px solid var(--bone); background: var(--cream); }
.site-header .wrap {
	display: flex; align-items: center; justify-content: space-between;
	gap: 1rem; padding-block: 0.75rem;
}
.brand {
	display: flex; align-items: center; gap: 0.5rem;
	color: var(--cacao); text-decoration: none;
	font-family: var(--brand); font-weight: 500; font-size: 1.75rem;
	line-height: 1; text-transform: uppercase; letter-spacing: 0.01em;
}
.brand img { width: auto; height: 2.5rem; }
.site-nav {
	display: flex; align-items: center; gap: 1.25rem;
	font-family: var(--terminal); font-weight: 600; font-size: 0.8rem;
	letter-spacing: 0.02em; text-transform: uppercase;
}
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--cacao); }

.btn {
	display: inline-block;
	background: var(--mango); color: var(--cacao);
	border: 2px solid var(--cacao); border-radius: 0.5rem;
	padding: 0.55rem 1.1rem;
	font-family: var(--terminal); font-weight: 600; font-size: 0.85rem; line-height: 1.3;
	letter-spacing: 0.02em; text-transform: uppercase;
	text-decoration: none;
	box-shadow: 3px 3px 0 var(--cacao);
	transition: transform 0.1s, box-shadow 0.1s;
}
.btn:hover { color: var(--cacao); transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--cacao); }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.site-nav .btn { color: var(--cacao); padding: 0.4rem 0.8rem; font-size: 0.75rem; }

/* Hero */
.hero { padding-block: 3.5rem 2.5rem; }
.eyebrow {
	font-family: var(--terminal); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.08em;
	text-transform: uppercase; color: var(--rust); margin: 0 0 0.5rem;
}
.hero h1 {
	font-size: clamp(2.9rem, 8vw, 4.8rem); line-height: 0.95;
	color: var(--cacao); margin: 0 0 1rem; text-wrap: balance;
}
/* Second clause of the headline: same brand face, picked out in rust. */
.hero h1 .accent { color: var(--rust); }
.hero p { font-size: 1.05rem; color: var(--ink-soft); margin: 0 0 1.5rem; }
@media (max-width: 47.99rem) {
	.hero { padding-block: 2rem 1rem; }
}

/* Post cards */
.section { padding-block: 2rem 3.5rem; }
.section-title {
	font-family: var(--terminal); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase;
	color: var(--ink-soft); margin: 0 0 1.25rem; font-weight: 700;
}
.post-grid {
	list-style: none; margin: 0; padding: 0;
	display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}
.post-card {
	position: relative; height: 100%;
	background: var(--white); border: 1px solid var(--bone); border-radius: 0.75rem;
	padding: 1.4rem 1.4rem 1.2rem;
	display: flex; flex-direction: column; gap: 0.5rem;
	transition: border-color 0.15s, transform 0.15s;
}
.post-card:hover { border-color: var(--mango); transform: translateY(-2px); }
.post-card h2, .post-card h3 { font-size: 1.7rem; line-height: 1.12; margin: 0; color: var(--cacao); }
.post-card h2 a, .post-card h3 a { color: inherit; text-decoration: none; }
/* Whole card is clickable via the heading link. */
.post-card h2 a::after, .post-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.post-card p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); line-height: 1.55; }
.post-meta { font-family: var(--terminal); font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-mild); }
/* Pinned to the foot of the card: needs to outrank ".post-card p { margin: 0 }",
   which otherwise cancels the auto top margin that does the pushing. */
.post-card .post-meta { margin-top: auto; padding-top: 0.75rem; font-size: 0.62rem; }

/* Article */
.breadcrumbs { font-family: var(--terminal); font-size: 0.75rem; color: var(--ink-mild); padding-top: 1.5rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 0.4rem; }
.breadcrumbs a { color: var(--ink-soft); }

.article-header { padding-block: 1.5rem 1rem; }
.article-header h1 {
	font-size: clamp(2.6rem, 7vw, 4rem); line-height: 0.98; color: var(--cacao);
	margin: 0 0 0.9rem;
}
.article-header .lede { font-size: 1.1rem; color: var(--ink-soft); margin: 0 0 1rem; }

.prose { padding-bottom: 2rem; }
.prose h2 { font-size: 2.2rem; line-height: 1.05; color: var(--cacao); margin: 2.5rem 0 0.75rem; }
.prose h3 { font-size: 1.6rem; line-height: 1.1; color: var(--cacao); margin: 1.75rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; }
.prose li { margin-bottom: 1.15rem; }
.prose li::marker { color: var(--rust); }
.prose strong { color: var(--cacao); }
.prose blockquote {
	margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.1rem;
	border-left: 4px solid var(--mango); color: var(--ink-soft);
}

/* Inline diagrams and photos inside article body copy */
.prose figure {
	margin: 1.5rem 0;
	background: var(--white); border: 1px solid var(--bone); border-radius: 0.75rem;
	padding: 0.75rem; overflow: hidden;
}
.prose .figure-title {
	font-family: var(--terminal); font-weight: 600; font-size: 0.8rem;
	letter-spacing: 0.08em; text-transform: uppercase; color: var(--cacao);
	margin: 0.15rem 0.25rem 0.7rem;
}
.prose figure img {
	border-radius: 0.4rem; margin-inline: auto;
	max-height: 75vh; width: auto;
}
.prose figcaption {
	font-size: 0.9rem; line-height: 1.5; color: var(--ink-soft);
	padding: 0.7rem 0.25rem 0.15rem;
}

/* Handwritten sample lines, like a message on a card */
.note {
	font-family: var(--hand); font-size: 1.55rem; line-height: 1.3; color: var(--ink);
	background: var(--white); border: 1px solid var(--bone); border-radius: 0.5rem;
	padding: 0.75rem 1.1rem; margin: 0 0 0.9rem;
}

.address {
	font-family: var(--mono); font-size: 1rem; line-height: 1.55;
	background: var(--white); border: 1px dashed var(--ink-mild); border-radius: 0.5rem;
	padding: 1rem 1.25rem; margin: 0 0 1.25rem; white-space: pre; overflow-x: auto;
}

.callout {
	background: var(--butter); border: 1px solid var(--mango-mid); border-radius: 0.75rem;
	padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }
.prose li .callout { margin: 0.9rem 0; }

.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--bone); vertical-align: top; }
.prose th { font-family: var(--terminal); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.table-scroll { overflow-x: auto; }

.toc {
	background: var(--white); border: 1px solid var(--bone); border-radius: 0.75rem;
	padding: 1rem 1.25rem; margin: 0 0 2rem; font-size: 0.95rem;
}
.toc p {
	font-family: var(--terminal); font-weight: 700; margin: 0 0 0.4rem; font-size: 0.75rem;
	letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft);
}
.toc ol { margin: 0; padding-left: 1.2rem; }

/* Call to action into the webapp */
.cta {
	background: var(--cacao); color: var(--butter);
	border-radius: 1rem; padding: 1.75rem 1.5rem; margin: 2.5rem 0;
	text-align: center;
}
.cta h2 { color: var(--mango-mid); margin: 0 0 0.5rem; font-size: 2.2rem; line-height: 1.05; }
.cta p { margin: 0 0 1.25rem; color: var(--butter); }
.cta .btn { box-shadow: 3px 3px 0 var(--mango-mid); border-color: var(--mango-mid); }

.faq details {
	background: var(--white); border: 1px solid var(--bone); border-radius: 0.6rem;
	padding: 0.8rem 1rem; margin-bottom: 0.6rem;
}
.faq summary { cursor: pointer; font-weight: 700; color: var(--cacao); }
.faq details p { margin: 0.6rem 0 0; }

.related { border-top: 1px solid var(--bone); padding-block: 2rem 3rem; }

/* Footer */
.site-footer { background: var(--cacao); color: var(--butter); padding-block: 2rem; font-family: var(--terminal); font-size: 0.8rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer a { color: var(--mango-mid); }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; }
.site-footer p { margin: 0; }

/* Decorative maple leaf after the "printed and mailed in Canada" line. Drawn
	 as a mask so the fill is set in one place and scales with the text. */
.site-footer p::after {
	content: "";
	display: inline-block;
	width: 0.95em;
	height: 0.95em;
	margin-left: 0.45em;
	vertical-align: -0.15em;
	background-color: var(--terracotta);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l1.35 2.9c.15.33.45.28.75.12l1.95-1-.7 3.35c-.15.7.3.9.55.62l2.1-2.35.53 1.35c.12.3.36.26.66.2l2.1-.45-1.32 2.8c-.12.27-.16.45.15.6l.9.42-4.1 3.4c-.33.26-.24.35-.12.72l.36 1.18-3.95-.47c-.32-.04-.54.04-.54.32l.25 4.5h-1.6l.25-4.5c0-.28-.22-.36-.54-.32l-3.95.47.36-1.18c.12-.37.21-.46-.12-.72l-4.1-3.4.9-.42c.31-.15.27-.33.15-.6l-1.32-2.8 2.1.45c.3.06.54.1.66-.2l.53-1.35 2.1 2.35c.25.28.7.08.55-.62l-.7-3.35 1.95 1c.3.16.6.21.75-.12z'/%3E%3C/svg%3E") no-repeat center / contain;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l1.35 2.9c.15.33.45.28.75.12l1.95-1-.7 3.35c-.15.7.3.9.55.62l2.1-2.35.53 1.35c.12.3.36.26.66.2l2.1-.45-1.32 2.8c-.12.27-.16.45.15.6l.9.42-4.1 3.4c-.33.26-.24.35-.12.72l.36 1.18-3.95-.47c-.32-.04-.54.04-.54.32l.25 4.5h-1.6l.25-4.5c0-.28-.22-.36-.54-.32l-3.95.47.36-1.18c.12-.37.21-.46-.12-.72l-4.1-3.4.9-.42c.31-.15.27-.33.15-.6l-1.32-2.8 2.1.45c.3.06.54.1.66-.2l.53-1.35 2.1 2.35c.25.28.7.08.55-.62l-.7-3.35 1.95 1c.3.16.6.21.75-.12z'/%3E%3C/svg%3E") no-repeat center / contain;
}

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