/*
Theme Name: TypeOfThings
Theme URI: https://typeofthings.com/
Author: TypeOfThings
Description: Lightweight, image-led theme for TypeOfThings: categories, topics and individual discoveries with structured facts.
Version: 0.2.0
Requires at least: 6.5
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: typeofthings
*/

:root {
	--navy: #162A3A;
	--navy-2: #223D53;
	--lime: #DDF28B;
	--lime-2: #C6E05A;
	--paper: #F6F5F0;
	--paper-2: #EDEBE3;
	--card: #FFFFFF;
	--ink: #162A3A;
	--muted: #53616D;
	--line: #E1DFD5;
	--radius: 18px;
	--shadow: 0 1px 2px rgba(22, 42, 58, .06), 0 8px 24px rgba(22, 42, 58, .08);
	--shadow-hover: 0 2px 4px rgba(22, 42, 58, .08), 0 18px 36px rgba(22, 42, 58, .14);
	--wrap: 1200px;
	--font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 750; }
h1 { font-size: clamp(2rem, 5.2vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--lime-2); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .wrap { padding-inline: 24px; } }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link {
	position: absolute; left: 12px; top: -80px; z-index: 100;
	background: var(--lime); color: var(--navy); padding: 10px 16px; border-radius: 10px; font-weight: 700;
}
.skip-link:focus { top: 12px; }
.eyebrow {
	font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
	color: var(--muted); margin-bottom: .75em;
}
.badge {
	display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	background: var(--lime); color: var(--navy); padding: 2px 8px; border-radius: 999px; margin-bottom: 6px;
}

/* Header */
.site-header { background: var(--navy); color: var(--paper); position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: 46px; }
@media (min-width: 783px) { .admin-bar .site-header { top: 32px; } }
.site-header__inner {
	display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "logo search" "nav nav";
	align-items: center; gap: 10px 16px; padding-block: 12px;
}
.site-header__inner > * { min-width: 0; }
.logo {
	grid-area: logo; display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
	font-weight: 800; font-size: 1.25rem; letter-spacing: -.03em; color: var(--paper);
}
.logo__mark { width: 28px; height: 28px; border-radius: 8px; background: var(--lime); position: relative; flex: none; }
.logo__mark::after {
	content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--navy);
}
.logo__text span { color: var(--lime); }
.primary-nav { grid-area: nav; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
.primary-nav::-webkit-scrollbar { display: none; }
.primary-nav ul { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.primary-nav a {
	display: block; white-space: nowrap; text-decoration: none; font-size: .92rem; font-weight: 600;
	padding: 7px 14px; border-radius: 999px; background: rgba(246, 245, 240, .08); color: var(--paper);
}
.primary-nav a:hover { background: rgba(246, 245, 240, .16); }
.primary-nav a[aria-current] { background: var(--lime); color: var(--navy); }
.header-search {
	grid-area: search; justify-self: end; display: flex; align-items: center; width: min(100%, 210px);
	background: rgba(246, 245, 240, .1); border-radius: 999px; padding: 3px 3px 3px 14px;
}
.header-search:focus-within { box-shadow: 0 0 0 2px var(--lime); }
.header-search input {
	flex: 1; min-width: 0; background: none; border: 0; color: var(--paper); font: inherit; font-size: .95rem; padding: 5px 0;
}
.header-search input::placeholder { color: rgba(246, 245, 240, .65); }
.header-search input:focus { outline: none; }
.header-search button {
	flex: none; border: 0; background: var(--lime); color: var(--navy); width: 34px; height: 34px;
	border-radius: 50%; display: grid; place-items: center; cursor: pointer;
}
@media (min-width: 960px) {
	.site-header__inner { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "logo nav search"; padding-block: 14px; }
	.primary-nav { margin: 0; padding: 0; }
	.primary-nav ul { justify-content: center; }
	.header-search { width: 230px; }
}

/* Hero (homepage) */
.hero { background: var(--navy); color: var(--paper); position: relative; overflow: hidden; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before {
	width: 560px; height: 560px; right: -180px; top: -220px;
	background: radial-gradient(circle, rgba(221, 242, 139, .22), rgba(221, 242, 139, 0) 70%);
}
.hero::after {
	width: 380px; height: 380px; left: -160px; bottom: -220px;
	background: radial-gradient(circle, rgba(221, 242, 139, .12), rgba(221, 242, 139, 0) 70%);
}
.hero__inner { position: relative; z-index: 1; padding-block: 48px 56px; }
.hero__text { max-width: 760px; }
.hero__art { display: none; }
@media (min-width: 1024px) {
	.hero__inner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 48px; align-items: center; }
	.hero__art { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; transform: rotate(-3deg); }
	.hero__art img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
	.hero__art img:nth-child(2), .hero__art img:nth-child(4) { transform: translateY(28px); }
}
.hero .eyebrow { color: var(--lime); }
.hero__title mark { background: none; color: var(--lime); }
.hero__lead { font-size: 1.15rem; color: rgba(246, 245, 240, .82); max-width: 36em; margin-bottom: 1.5em; }
@media (min-width: 768px) { .hero__inner { padding-block: 84px 92px; } }

/* Search form */
.search-form {
	display: flex; gap: 6px; background: var(--card); padding: 6px; border-radius: 999px;
	box-shadow: var(--shadow); max-width: 620px; border: 1px solid var(--line);
}
.search-form:focus-within { box-shadow: 0 0 0 3px var(--lime-2); }
.search-form__input {
	flex: 1; min-width: 0; border: 0; font: inherit; padding: 10px 14px; border-radius: 999px; color: var(--ink); background: transparent;
}
.search-form__input:focus { outline: none; }
.search-form__button {
	flex: none; border: 0; background: var(--navy); color: var(--paper); font: inherit; font-weight: 700;
	padding: 10px 20px; border-radius: 999px; cursor: pointer;
}
.search-form__button:hover { background: var(--navy-2); }
.hero .search-form { border: 0; }
.hero .search-form__button { background: var(--lime); color: var(--navy); }
.hero .search-form__button:hover { background: var(--lime-2); }
.suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; font-size: .9rem; color: rgba(246, 245, 240, .7); }
.suggest a {
	color: var(--paper); background: rgba(246, 245, 240, .1); padding: 5px 12px; border-radius: 999px; text-decoration: none;
}
.suggest a:hover { background: rgba(246, 245, 240, .2); }

/* Sections and grids */
.section { padding-block: 40px; }
.section--tight { padding-top: 8px; }
.section--alt { background: var(--paper-2); }
@media (min-width: 768px) { .section { padding-block: 60px; } .section--tight { padding-top: 12px; } }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 20px; }
.section__head h2 { margin: 0; }
.section__link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .95rem; text-decoration: none; }
.section__link:hover { text-decoration: underline; }
.empty { color: var(--muted); }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid { gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid--cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid--categories { grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid--categories { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid--categories { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid--topics { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid--topics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid--topics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Cards */
.card {
	background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
	transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.card__media { aspect-ratio: 4 / 3; background: var(--navy-2); overflow: hidden; }
.card--wide .card__media { aspect-ratio: 16 / 9; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__placeholder { display: grid; place-items: center; height: 100%; font-size: 3rem; font-weight: 800; color: var(--lime); }
.card__body { padding: 12px 14px 16px; }
.card__title { font-size: 1rem; margin: 0; }
@media (min-width: 640px) { .card__title { font-size: 1.1rem; } .card__body { padding: 14px 16px 18px; } }
.card__meta { margin: .25em 0 0; color: var(--muted); font-size: .875rem; }
.card__meta--sci { font-style: italic; }
.card__link:focus-visible { outline-offset: -3px; }

.card--category { position: relative; }
.card--category .card__media { aspect-ratio: 16 / 11; }
.card--category .card__body {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 18px 18px;
	background: linear-gradient(to top, rgba(22, 42, 58, .94), rgba(22, 42, 58, 0)); color: var(--paper);
}
.card--category .card__title { font-size: 1.35rem; }
.card--category .card__meta { color: var(--lime); font-weight: 600; }

/* Category and topic hero */
.page-hero { position: relative; isolation: isolate; overflow: hidden; background: var(--navy); color: var(--paper); }
.page-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.page-hero::after {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(90deg, rgba(22, 42, 58, .94) 0%, rgba(22, 42, 58, .78) 50%, rgba(22, 42, 58, .4) 100%);
}
.page-hero__inner { padding-block: 22px 40px; }
@media (min-width: 768px) { .page-hero__inner { padding-block: 32px 72px; } }
.page-hero__title { margin: .7em 0 .3em; max-width: 15em; }
.page-hero__lead { font-size: 1.15rem; max-width: 36em; color: rgba(246, 245, 240, .88); margin: 0; }
.page-hero__meta {
	display: inline-block; margin: 18px 0 0; background: var(--lime); color: var(--navy);
	font-weight: 700; font-size: .85rem; padding: 4px 12px; border-radius: 999px;
}

/* Breadcrumbs */
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: .875rem; }
.breadcrumbs li + li::before { content: "\203A"; margin-right: 6px; opacity: .6; }
.breadcrumbs a { text-decoration: none; opacity: .85; }
.breadcrumbs a:hover { text-decoration: underline; opacity: 1; }
.breadcrumbs [aria-current] { opacity: .7; }

/* Item page */
.item .breadcrumbs { color: var(--muted); padding-top: 20px; }
.item__layout { display: grid; gap: 24px; padding-block: 16px 24px; }
@media (min-width: 960px) {
	.item__layout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 44px; align-items: start; padding-bottom: 40px; }
	.item__summary { position: sticky; top: 96px; }
}
.item__figure { margin: 0; }
.item__figure img, .item__noimage {
	width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--navy-2);
}
.item__figure figcaption { font-size: .8rem; color: var(--muted); margin-top: 8px; }
.item__eyebrow a { text-decoration: none; }
.item__eyebrow a:hover { text-decoration: underline; }
.item__title { margin-bottom: .15em; }
.item__subtitle { color: var(--muted); font-size: 1.1rem; margin-bottom: 1em; }
.is-scientific { font-style: italic; }
.item__lead { font-size: 1.15rem; }

.facts { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px 8px; margin-top: 22px; }
.facts h2 { font-size: 1.05rem; display: flex; align-items: center; gap: 10px; margin-bottom: .6em; }
.facts h2::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--lime-2); }
.facts dl { margin: 0; display: grid; grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr); }
.facts dt, .facts dd { padding: 10px 0; border-top: 1px solid var(--line); margin: 0; }
.facts dt { color: var(--muted); font-size: .9rem; padding-right: 12px; }
.facts dd { font-weight: 600; }
.review-flag { margin: 14px 0 0; font-size: .85rem; background: #FFF2CF; color: #5E4200; border-radius: 10px; padding: 8px 12px; }

.prose { max-width: 44em; }
.prose a { text-decoration-color: var(--lime-2); text-decoration-thickness: .14em; }
.prose h2 { margin-top: 1.2em; }
.item__content { padding-bottom: 8px; }
.sources { font-size: .9rem; color: var(--muted); border-top: 1px solid var(--line); padding: 16px 0 40px; margin-top: 16px; max-width: 44em; }
.sources h2 { font-size: 1rem; color: var(--ink); }
.sources ul { padding-left: 1.2em; margin: 0 0 .8em; }

/* Plain pages, search, 404 */
.page-head { padding-block: 36px 12px; }
.page-head > p, .page-head .wrap > p { color: var(--muted); }
.page-head .search-form { margin-top: 18px; }
.search-count { margin-top: 14px; }
.page-plain { padding-bottom: 56px; }
.page-plain__img { border-radius: var(--radius); margin: 8px 0 24px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 20px 0 0; }
.chips a {
	display: block; text-decoration: none; font-weight: 600; font-size: .92rem; padding: 7px 14px;
	border-radius: 999px; background: var(--card); box-shadow: var(--shadow);
}
.chips a:hover { background: var(--lime); }
.nav-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.nav-links .page-numbers { padding: 6px 12px; border-radius: 10px; background: var(--card); text-decoration: none; }
.nav-links .current { background: var(--navy); color: var(--paper); }

/* Footer */
.site-footer { background: var(--navy); color: rgba(246, 245, 240, .8); padding-top: 44px; font-size: .95rem; }
.site-footer__inner { display: grid; gap: 28px; }
@media (min-width: 768px) { .site-footer__inner { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer__tagline { margin-top: 12px; max-width: 26em; }
.site-footer__heading { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--lime); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--paper); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__base { border-top: 1px solid rgba(246, 245, 240, .12); margin-top: 32px; padding-block: 18px; font-size: .85rem; }
.site-footer__base p { margin: 0; }

/* Collection cards (homepage, category pages) */
.section__intro { color: var(--muted); margin: -8px 0 22px; max-width: 40em; }
.collections-lead { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin-bottom: 16px; }
@media (min-width: 768px) {
	.collections-lead--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
}
.collections-more { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .collections-more { gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .collections-more { gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.collection-card {
	background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
	transition: transform .2s ease, box-shadow .2s ease;
}
.collection-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.collection-card__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.collection-card__link:focus-visible { outline-offset: -3px; }
.collection-card__media { aspect-ratio: 4 / 3; background: var(--navy-2); overflow: hidden; }
.collection-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.collection-card:hover .collection-card__media img { transform: scale(1.03); }
.collection-card__body { padding: 14px 16px 18px; }
.collection-card--large .collection-card__body { padding: 18px 22px 24px; }
.collection-card__meta {
	margin: 0 0 .35em; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.collection-card__title { margin: 0; font-size: 1.15rem; }
.collection-card--large .collection-card__title { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
.collection-card__names { margin: .45em 0 0; color: var(--muted); font-size: .92rem; }
.collection-card--large .collection-card__names { font-size: 1rem; }
@media (max-width: 559px) {
	.collection-card--small .collection-card__link { flex-direction: row; align-items: center; }
	.collection-card--small .collection-card__media { width: 40%; flex: none; align-self: stretch; aspect-ratio: auto; min-height: 96px; }
	.collection-card--small .collection-card__body { padding: 12px 14px; }
	.collection-card--small .collection-card__title { font-size: 1.02rem; }
	.collection-card--small .collection-card__names { display: none; }
}

/* Topic page header: collection image + introduction */
.topic-head { background: var(--navy); color: var(--paper); padding-block: 22px 40px; }
@media (min-width: 960px) { .topic-head { padding-block: 28px 64px; } }
.topic-head__title { margin: .55em 0 .6em; }
.topic-head__grid { display: grid; gap: 22px; }
@media (min-width: 960px) {
	.topic-head__grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 44px; align-items: start; }
}
.collection { margin: 0; }
.collection img, .collection__empty {
	width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius);
	background: var(--navy-2); box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
}
.collection figcaption { font-size: .8rem; color: rgba(246, 245, 240, .7); margin-top: 8px; }
.topic-head__intro .page-hero__meta { margin-top: 0; }
.topic-head__lead { font-size: 1.15rem; color: rgba(246, 245, 240, .9); margin: 14px 0 0; }
.type-list__heading {
	font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; color: var(--lime); margin: 24px 0 10px;
}
.type-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.type-list a {
	display: block; text-decoration: none; font-weight: 600; font-size: .92rem; padding: 6px 12px;
	border-radius: 999px; background: rgba(246, 245, 240, .1); color: var(--paper);
}
.type-list a:hover { background: var(--lime); color: var(--navy); }

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