/*
Theme Name: Little Note Tote
Theme URI: https://littlenotetote.com
Author: Reeves Little
Description: Custom theme for the Little Note Tote blog and store.
Version: 1.2.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: little-note-tote
*/

/* -----------------------------------------------------------------------
   Tokens

   Working defaults. Nothing should hardcode a color, family, or size
   outside this block, so the design pass is a matter of changing values
   here rather than hunting through components.
   ----------------------------------------------------------------------- */

:root {
	--color-bg: #faf5f1;
	--color-text: #5a5a5a;
	--color-heading: #202020;
	--color-muted: rgba(90, 90, 90, 0.5);
	--color-rule: #e9d8c9;
	--color-link: #202020;

	--font-display: Georgia, "Times New Roman", serif;
	--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

	--step--1: 0.833rem;
	--step-0: 1.0625rem;
	--step-1: 1.25rem;
	--step-2: 1.5rem;
	--step-3: 1.875rem;
	--step-4: 2.25rem;
	--step-5: 3rem;

	--space-3xs: 0.25rem;
	--space-2xs: 0.5rem;
	--space-xs: 0.75rem;
	--space-s: 1rem;
	--space-m: 1.5rem;
	--space-l: 2.5rem;
	--space-xl: 4rem;
	--space-2xl: 6rem;

	--measure: 68ch;
	--content-max: 1080px;
	--content-inner: 1000px;

	--tracking-label: 0.1em;
	--leading-body: 1.6;
	--leading-tight: 1.2;

	--link-underline-thickness: 0.75px;
}

/* -----------------------------------------------------------------------
   Reset and base
   ----------------------------------------------------------------------- */

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

body {
	margin: 0;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--step-0);
	line-height: var(--leading-body);
}

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

a {
	color: var(--color-link);
	text-decoration: none;
}

a:hover,
a:focus {
	text-decoration: underline;
	text-decoration-thickness: var(--link-underline-thickness);
}

/* -----------------------------------------------------------------------
   Typography
   ----------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
	font-family: var(--font-display);
	color: var(--color-heading);
	font-weight: 400;
	line-height: var(--leading-tight);
}

.label {
	font-size: var(--step--1);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--color-muted);
}

/* -----------------------------------------------------------------------
   Layout
   ----------------------------------------------------------------------- */

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	overflow-x: clip;
}

.site-content {
	flex: 1;
	width: 100%;
	max-width: var(--content-inner);
	margin: 0 auto;
	padding: var(--space-l) var(--space-m);
}

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

   The same bar at every width: [toggle][wordmark][cart], with .site-drawer
   as a collapsible row beneath.
   ----------------------------------------------------------------------- */

.skip-link:focus {
	position: fixed;
	top: var(--space-2xs);
	left: var(--space-2xs);
	z-index: 100;
	width: auto;
	height: auto;
	margin: 0;
	padding: var(--space-2xs) var(--space-s);
	clip: auto;
	clip-path: none;
	background: var(--color-bg);
	color: var(--color-heading);
	border: 1px solid var(--color-rule);
}

.site-header {
	width: 100%;
	max-width: var(--content-max);
	margin: 0 auto;
	padding: var(--space-m) var(--space-m) 0;
}

@media (min-width: 48em) {
	.site-header {
		padding-top: var(--space-l);
	}
}

.site-header__bar {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	grid-template-areas:
		"toggle brand cart"
		"drawer drawer drawer";
	align-items: center;
	column-gap: var(--space-2xs);
}

.site-header a:focus-visible,
.site-header button:focus-visible,
.skip-link:focus-visible {
	outline: 1px solid var(--color-heading);
	outline-offset: 3px;
}

.menu-toggle {
	grid-area: toggle;
	justify-self: start;
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: var(--space-2xs);
	border: 0;
	background: none;
	color: var(--color-heading);
	line-height: 0;
	cursor: pointer;
}

/* An unscripted toggle would be an inert control, so it is not shown at all. */
html:not(.js) .menu-toggle {
	display: none;
}

.menu-toggle__close,
.menu-toggle[aria-expanded="true"] .menu-toggle__open {
	display: none;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__close {
	display: block;
}

.site-branding {
	grid-area: brand;
	text-align: center;
	min-width: 0;
}

.site-title {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--step-1);
	font-weight: 400;
	line-height: var(--leading-tight);
	letter-spacing: 0.02em;
	/* A long single-word site name must wrap rather than push into the cart glyph. */
	overflow-wrap: anywhere;
}

.site-title a {
	color: var(--color-heading);
}

.custom-logo-link {
	display: inline-block;
}

.custom-logo {
	max-height: 3.5rem;
	width: auto;
}

.cart-stub {
	grid-area: cart;
	justify-self: end;
	margin: 0;
	padding: var(--space-2xs);
	color: var(--color-heading);
	line-height: 0;
}

.site-drawer {
	grid-area: drawer;
}

/* Without the js class the drawer stays open, so the menu never disappears. */
.site-drawer[hidden] {
	display: block;
}

.js .site-drawer[hidden] {
	display: none;
}

.primary-menu,
.utility-links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-menu a,
.utility-links a {
	display: inline-block;
	padding: var(--space-3xs) 0;
	font-size: var(--step--1);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--color-heading);
}

.site-drawer {
	margin-top: var(--space-s);
	padding: var(--space-s) 0;
	border-top: 1px solid var(--color-rule);
}

/*
 * Scripted, the drawer floats over the page from the bottom edge of the bar,
 * so opening it never shifts the content underneath. It bleeds past the
 * header padding to sit edge to edge. Unscripted it stays in flow: there is
 * no toggle to dismiss it, so it must not cover anything.
 */
.js .site-drawer {
	position: absolute;
	top: 100%;
	right: calc(var(--space-m) * -1);
	left: calc(var(--space-m) * -1);
	z-index: 50;
	margin-top: 0;
	padding: var(--space-s) var(--space-m) var(--space-m);
	background: var(--color-bg);
	border-bottom: 1px solid var(--color-rule);
}

.primary-menu,
.utility-links {
	display: grid;
	gap: var(--space-2xs);
}

.utility-links {
	margin-top: var(--space-s);
	padding-top: var(--space-s);
	border-top: 1px solid var(--color-rule);
}

@media (min-width: 30em) {
	.site-title {
		font-size: var(--step-2);
	}
}

@media (min-width: 64em) {
	.site-title {
		font-size: var(--step-3);
	}
}

/* -----------------------------------------------------------------------
   Divider

   No color of its own: the ornament inherits currentColor from whatever it
   sits inside, and is sized in em so it tracks the surrounding type.
   ----------------------------------------------------------------------- */

.divider {
	display: flex;
	justify-content: center;
	margin: var(--space-m) 0;
}

.divider__mark {
	display: block;
	width: 14em;
	max-width: 100%;
	height: auto;
}

.divider--footer {
	margin: var(--space-xl) 0 0;
}

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

.site-footer {
	width: 100%;
	max-width: var(--content-max);
	margin: 0 auto;
	padding: 0 var(--space-m) var(--space-xl);
}

.site-footer__inner {
	display: grid;
	gap: var(--space-l);
	margin-top: var(--space-l);
}

.footer-nav {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
	gap: var(--space-m);
}

.footer-nav__heading {
	margin: 0 0 var(--space-2xs);
}

.footer-nav__heading a {
	color: inherit;
}

.footer-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--space-3xs);
}

.footer-nav__list a,
.site-footer__about p {
	font-size: var(--step--1);
}

.site-footer__about p {
	margin: 0;
	max-width: var(--measure);
}

.site-footer__legal {
	margin: var(--space-l) 0 0;
	font-size: var(--step--1);
	color: var(--color-muted);
	text-align: center;
}

.site-footer a:focus-visible {
	outline: 1px solid var(--color-heading);
	outline-offset: 3px;
}

@media (min-width: 48em) {
	.site-footer__inner {
		grid-template-columns: 2fr 1fr;
		align-items: start;
		gap: var(--space-xl);
	}

	/* Keeps a column of loose links level with the linked rows, not the headings. */
	.footer-nav__column--unheaded {
		padding-top: calc(var(--step--1) * var(--leading-body) + var(--space-2xs));
	}
}

/* -----------------------------------------------------------------------
   Series listing
   ----------------------------------------------------------------------- */

/* Full bleed out of the centered content column. .site clips the sliver a
   vertical scrollbar would otherwise add to 100vw. */
.home-hero {
	width: 100vw;
	margin: 0 calc(50% - 50vw) var(--space-l);
}

.home-hero__image {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.home-intro {
	max-width: var(--measure);
	margin: 0 auto var(--space-xl);
	text-align: center;
}

.series-listing {
	display: flex;
	flex-direction: column;
	gap: var(--space-xl);
}

.series-listing__more {
	display: flex;
	justify-content: center;
	margin: 0;
}

.button-outline {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: var(--space-xs) 2rem;
	border: 1px solid var(--color-heading);
	font-size: var(--step--1);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--color-heading);
}

.button-outline:hover,
.button-outline:focus {
	text-decoration: none;
	background: var(--color-heading);
	color: var(--color-bg);
}

/* Editorial block. Single column on small screens, image first regardless of
   side, so the alternation never strands a heading above nothing. */

.editorial {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-m);
	align-items: center;
}

.editorial__media {
	margin: 0;
}

.editorial__image {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.editorial__eyebrow {
	margin: 0 0 var(--space-2xs);
}

.editorial__title {
	margin: 0 0 var(--space-s);
	font-size: var(--step-3);
}

.editorial__text {
	margin: 0 0 var(--space-s);
	max-width: var(--measure);
}

.editorial__link {
	margin: 0;
}

.editorial__link a {
	font-size: var(--step--1);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	border-bottom: 1px solid var(--color-rule);
	padding-bottom: var(--space-3xs);
}

.editorial__link a:hover,
.editorial__link a:focus {
	text-decoration: none;
	border-bottom-color: currentColor;
}

@media (min-width: 48em) {
	.editorial {
		grid-template-columns: 1fr 1fr;
		gap: var(--space-l);
	}

	.editorial--image-right .editorial__media {
		order: 2;
	}

	/* A series with no photography emits no media element, so the block
	   collapses to one full-width text column rather than leaving a hole. */
	.editorial--no-image {
		grid-template-columns: 1fr;
	}
}

/* Series archive */

.series-archive__header {
	margin-bottom: var(--space-l);
	text-align: center;
}

.series-archive__title {
	margin: 0 0 var(--space-s);
	font-size: var(--step-4);
}

.series-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-l) var(--space-m);
}

@media (min-width: 768px) {
	.series-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.series-card {
	display: flex;
	flex-direction: column;
}

.series-card__media {
	display: block;
	margin-bottom: var(--space-s);
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.series-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.series-card__media:hover .series-card__image {
	transform: scale(1.03);
}

.series-card__placeholder {
	border: 1px solid var(--color-rule);
}

.series-card__state {
	margin: 0 0 var(--space-3xs);
}

.series-card__name {
	margin: 0 0 var(--space-2xs);
	font-size: var(--step-1);
}

.series-card__name a {
	color: var(--color-heading);
}

.series-card__excerpt {
	margin: 0 0 var(--space-xs);
}

.series-card__more {
	font-size: var(--step--1);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--color-heading);
	align-self: flex-start;
}

/* -----------------------------------------------------------------------
   Series single
   ----------------------------------------------------------------------- */

.series-single__hero {
	margin-bottom: var(--space-l);
}

.series-single__hero-image {
	width: 100%;
}

.series-single__header {
	text-align: center;
	margin-bottom: var(--space-l);
}

.series-single__state {
	margin: 0 0 var(--space-2xs);
}

.series-single__title {
	margin: 0;
	font-size: var(--step-4);
}

.series-single__content {
	max-width: var(--measure);
	margin: 0 auto var(--space-xl);
}

/* State treatment is deliberately minimal. The classes exist so the design
   pass has somewhere to land; only the label is styled for now. */

.series--sold-out .series-single__state {
	color: var(--color-heading);
}

.series--coming-soon .series-single__hero {
	opacity: 0.85;
}

.series-bags {
	margin-bottom: var(--space-xl);
}

.series-bags__title {
	margin: 0 0 var(--space-m);
	text-align: center;
}

.series-bags__empty {
	text-align: center;
	color: var(--color-muted);
	margin-bottom: var(--space-xl);
}

.series-single__back {
	text-align: center;
	font-size: var(--step--1);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
}

/* -----------------------------------------------------------------------
   Bag card
   ----------------------------------------------------------------------- */

.bag-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
	gap: var(--space-l) var(--space-m);
}

.bag-card__link {
	display: block;
}

.bag-card__link:hover,
.bag-card__link:focus {
	text-decoration: none;
}

.bag-card__media {
	display: block;
	position: relative;
	aspect-ratio: 4 / 5;
	overflow: hidden;
}

.bag-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bag-card__placeholder {
	display: block;
	height: 100%;
	border: 1px solid var(--color-rule);
}

.bag-card__name {
	display: block;
	margin-top: var(--space-xs);
	font-family: var(--font-display);
	color: var(--color-heading);
	font-size: var(--step-0);
}

.bag-card__link:hover .bag-card__name,
.bag-card__link:focus .bag-card__name {
	text-decoration: underline;
	text-decoration-thickness: var(--link-underline-thickness);
}

.bag-card__price {
	display: block;
	margin-top: var(--space-3xs);
	font-size: var(--step--1);
}

.bag-card__status {
	display: block;
	margin-top: var(--space-3xs);
	font-size: var(--step--1);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--color-muted);
}

/* Sold has to read at a glance, so the photograph is lightened (staying in
   color) and states itself in the open rather than relying on a small badge. */

.bag-card--sold .bag-card__media {
	opacity: 0.85;
}

.bag-card--sold .bag-card__name {
	color: var(--color-heading);
}

.bag-card--sold .bag-card__price {
	color: var(--color-muted);
	text-decoration: line-through;
}

.bag-card--sold .bag-card__status {
	color: var(--color-heading);
	border-top: 1px solid var(--color-rule);
	padding-top: var(--space-3xs);
}

/* -----------------------------------------------------------------------
   Blog
   ----------------------------------------------------------------------- */

.page-header {
	margin-bottom: var(--space-l);
}

.page-title {
	font-size: var(--step-4);
	margin-bottom: var(--space-xs);
}

.archive-description {
	color: var(--color-text);
	max-width: var(--measure);
}

.no-results {
	max-width: var(--measure);
}

.no-results h2 {
	font-size: var(--step-2);
}

/* Single post / page: wide lead image, body copy held to --measure. */

.entry--single .entry-header,
.entry--page .entry-header {
	max-width: var(--measure);
	margin-inline: auto;
	margin-bottom: var(--space-m);
}

.entry--single .entry-title,
.entry--page .entry-title {
	font-size: var(--step-4);
}

.entry--single .entry-meta {
	font-size: var(--step--1);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--color-muted);
	margin-top: var(--space-2xs);
}

.entry--single .entry-thumbnail,
.entry--page .entry-thumbnail {
	margin-bottom: var(--space-l);
}

.entry--single .entry-thumbnail img,
.entry--page .entry-thumbnail img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.entry--single .entry-content,
.entry--page .entry-content {
	max-width: var(--measure);
	margin-inline: auto;
}

.entry--single .entry-content > *,
.entry--page .entry-content > * {
	margin-top: 0;
	margin-bottom: var(--space-m);
}

.entry--single .entry-content > *:last-child,
.entry--page .entry-content > *:last-child {
	margin-bottom: 0;
}

.entry--single .entry-content h2,
.entry--page .entry-content h2 {
	font-size: var(--step-2);
}

.entry--single .entry-content h3,
.entry--page .entry-content h3 {
	font-size: var(--step-1);
}

.entry--single .entry-content blockquote {
	margin: var(--space-m) 0;
	padding-left: var(--space-m);
	border-left: 2px solid var(--color-rule);
	font-family: var(--font-display);
	font-style: italic;
	color: var(--color-heading);
}

.entry--single .entry-content img {
	margin-bottom: var(--space-s);
}

/* Post teaser row: shared between the homepage "musings" block and the
   full blog listing (index.php / archive.php / search.php). */

.post-teasers {
	margin-top: var(--space-2xl);
}

.post-teasers__heading {
	margin-bottom: var(--space-m);
}

.post-teasers__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-l) var(--space-m);
}

@media (min-width: 768px) {
	.post-teasers__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.post-teaser {
	display: flex;
	flex-direction: column;
}

.post-teaser__thumbnail {
	display: block;
	margin-bottom: var(--space-s);
	overflow: hidden;
}

.post-teaser__thumbnail img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.post-teaser__thumbnail:hover img {
	transform: scale(1.03);
}

.post-teaser__title {
	font-size: var(--step-1);
	margin: 0 0 var(--space-2xs);
}

.post-teaser__title a {
	text-decoration: none;
}

.post-teaser__title a:hover,
.post-teaser__title a:focus {
	text-decoration: underline;
	text-decoration-thickness: var(--link-underline-thickness);
}

.post-teaser__excerpt {
	color: var(--color-text);
	margin-bottom: var(--space-xs);
}

.post-teaser__excerpt p {
	margin: 0;
}

.post-teaser__link {
	font-size: var(--step--1);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--color-heading);
	align-self: flex-start;
}

/* -----------------------------------------------------------------------
   Instagram
   ----------------------------------------------------------------------- */

/* -----------------------------------------------------------------------
   Utilities
   ----------------------------------------------------------------------- */

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
