/*
Theme Name: An Evening At
Theme URI: https://aneveningat.vip
Description: Sloane's notes on New York after dark. Cream Baskerville on black, the wordmark lockup, plain underlined links. Needs the "An Evening At, core" plugin for places and chapters.
Author: An Evening At
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: aneveningat
*/

/* Colors, type and spacing live in theme.json. This file holds what theme.json cannot say: the wordmark,
   the journal cards, the place pages and the lists. No small capitals, numbered kickers or hairline rules. */

:root {
	--aea-line: rgba(248, 243, 232, 0.45);
	--aea-soft: var(--wp--preset--color--cream-soft);
	--aea-faint: var(--wp--preset--color--cream-faint);
}

body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a { text-decoration-color: var(--aea-line); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--wp--preset--color--cream); outline-offset: 3px; }
img { height: auto; }

/* ---------------------------------------------------------------- masthead */

.masthead { padding-top: calc(2rem + env(safe-area-inset-top)); }
.wordmark { margin: 0; line-height: 1; white-space: nowrap; }
.wordmark a { text-decoration: none; }
/* Shrinks with the screen below about 375px wide, so the smallest phones keep it on one line */
.wordmark em { font-size: min(1.55rem, 6.6vw); }
.wordmark strong { font-weight: 400; font-size: min(2.6rem, 11.1vw); letter-spacing: 0.01em; margin: 0 0.12em; }
.byline { margin-top: 0.55rem !important; font-style: italic; color: var(--aea-soft); font-size: 1.125rem; }

.wp-block-navigation.nav { margin-top: 1.1rem; gap: 0.25rem 1.4rem; font-size: 1.0625rem; }
.wp-block-navigation.nav a { text-decoration: none; padding: 0.35rem 0; color: var(--aea-soft); }
.wp-block-navigation.nav a:hover,
.wp-block-navigation.nav .current-menu-item > a,
.wp-block-navigation.nav a[aria-current] { color: var(--wp--preset--color--cream); text-decoration: underline; text-decoration-color: var(--aea-line); text-underline-offset: 0.3em; }

/* ---------------------------------------------------------------- home */

.hello { margin-top: 2.5rem !important; }
.hello .wp-block-image { margin: 0; }
.hello .wp-block-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: 30% 50%; }
.hello h1 { margin-top: 0; font-size: 1.75rem; }
.hello h1 + p { margin-top: 0.6rem; }

.journal-title, .list-title, .letters h2 { margin-top: 3.25rem !important; }

/* The journal: newest first; the newest leads with its photo full width */
.posts { display: grid; gap: 2rem; margin-top: 1.25rem; }
.post-card { display: grid !important; grid-template-columns: 1fr 6.5rem; gap: 1rem; align-items: start; }
.post-card > * { margin: 0 !important; }
.post-card .wp-block-post-title { margin: 0.15rem 0 0 !important; font-size: 1.45rem; }
.post-card .wp-block-post-title a { text-decoration: none; }
.post-card .wp-block-post-title a:hover { text-decoration: underline; text-decoration-color: var(--aea-line); }
.post-card .wp-block-post-excerpt { margin-top: 0.35rem; font-size: 1.0625rem; line-height: 1.45; }
.post-card .wp-block-post-excerpt__excerpt { margin: 0; }
.post-card .wp-block-post-featured-image { width: 6.5rem; }
.post-card .wp-block-post-featured-image img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.posts > li:first-child .post-card,
.post-card:not(:has(.wp-block-post-featured-image)) { grid-template-columns: 1fr; }
.posts > li:first-child .wp-block-post-featured-image { order: -1; width: 100%; margin-bottom: 0.5rem !important; }
.posts > li:first-child .wp-block-post-featured-image img { aspect-ratio: 3 / 2; }
.posts > li:first-child .wp-block-post-title { font-size: 1.9rem; }

/* The contents: each chapter's name, its line beneath, an arrow */
.contents { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 1.1rem; }
.contents a { display: grid; text-decoration: none; padding-right: 2rem; position: relative; }
.contents a::after { content: "→"; position: absolute; right: 0; top: 0.2rem; color: var(--aea-soft); }
.contents .title { font-style: italic; font-size: 1.5rem; line-height: 1.2; text-decoration: underline; text-decoration-color: var(--aea-line); text-underline-offset: 0.2em; }
.contents .line { color: var(--aea-soft); font-size: 1.0625rem; }

/* Thursday notes */
.letters p { color: var(--aea-soft); }
.letters form { display: flex; gap: 1rem; align-items: flex-end; max-width: 28rem; margin-top: 1rem; }
.letters input { flex: 1; min-width: 0; font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--aea-line); padding: 0.4rem 0; border-radius: 0; }
.letters input::placeholder { color: var(--aea-faint); }
.letters button { font: inherit; color: inherit; background: none; border: 0; padding: 0.4rem 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--aea-line); text-underline-offset: 0.22em; }

/* ---------------------------------------------------------------- a post, a page */

.entry { margin-top: 2.5rem !important; }
.entry .wp-block-post-title { margin-top: 0.25rem; }
.entry .wp-block-post-content > p:first-of-type:not(.made-by) { font-size: var(--wp--preset--font-size--lede); line-height: 1.45; }
.made-by { font-style: italic; color: var(--aea-soft); font-size: 1.0625rem !important; line-height: 1.5 !important; }
.made-by + p { font-size: var(--wp--preset--font-size--lede); line-height: 1.45; }
.wp-block-image figcaption, .wp-block-embed figcaption { margin-top: 0.5rem; }
.wp-block-image.is-tall { max-width: 26rem; }
.wp-block-image.alignwide img { width: 100%; }
.wp-block-embed { margin: 1.75rem 0; }
.wp-block-embed__wrapper { background: #000; }
.signoff { font-style: italic; font-size: 1.5rem; margin-top: 1.75rem !important; }
.about-this { margin-top: 3rem; color: var(--aea-soft); font-size: 1rem; line-height: 1.5; }
.about-this h2 { font-size: 1.1875rem; margin: 0 0 0.6rem; color: var(--wp--preset--color--cream); }
.about-this p { margin: 0.6rem 0 0; }
.more-journal { margin-top: 3rem; }
.more-journal h2 { margin-top: 0; }
.more-journal ul { padding-left: 1.1rem; margin: 0.6rem 0 0; }
.more-journal li { margin: 0.3rem 0; }

/* ---------------------------------------------------------------- a place */

.place-line { color: var(--aea-soft); font-style: italic; margin-top: 0.4rem !important; }
.place-line a { color: inherit; }
.place .wp-block-post-excerpt { color: var(--wp--preset--color--cream); font-size: var(--wp--preset--font-size--lede); line-height: 1.45; margin-top: 1rem; }
.place .wp-block-post-excerpt__excerpt { margin: 0; }
.place-photo { margin: 1.75rem 0; }
.place-photo img { width: 100%; }
.place-photo figcaption { margin-top: 0.5rem; font-style: italic; color: var(--aea-faint); font-size: 1rem; }
.place-glance { margin: 1.5rem 0 0; display: grid; gap: 0.5rem; }
.place-glance .row { display: grid; grid-template-columns: 6.75rem 1fr; gap: 1rem; }
.place-glance dt { color: var(--aea-faint); font-style: italic; }
.place-glance dd { margin: 0; }
.place .wp-block-post-content ul { padding-left: 1.1rem; }
.place .wp-block-post-content li { margin: 0.3rem 0; }
.place-more { margin-top: 3rem; }
.place-more h2 { margin-top: 0; }
.place-more ul { padding-left: 1.1rem; margin: 0.6rem 0; }

/* ---------------------------------------------------------------- a chapter */

.chapter-line { color: var(--aea-soft); margin-top: 0.4rem !important; }
.listings { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 2rem; }
.listing .name { margin: 0; font-size: 1.6rem; }
.listing .name a { text-decoration: none; }
.listing .where { margin: 0.15rem 0 0; font-style: italic; color: var(--aea-soft); font-size: 1.0625rem; }
.listing .note { margin: 0.35rem 0 0; }
.listing .actions { margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: 1.0625rem; }

/* ---------------------------------------------------------------- footer */

.foot { margin-top: 4rem !important; padding-bottom: calc(3rem + env(safe-area-inset-bottom)); color: var(--aea-faint); font-size: 1rem; }
.foot p { margin: 0.4rem 0 0; }

/* ---------------------------------------------------------------- wider screens */

@media (min-width: 48rem) {
	.masthead { padding-top: 3rem; }
	.wordmark em { font-size: 1.9rem; }
	.wordmark strong { font-size: 3.2rem; }
	.hello { margin-top: 3rem !important; }
	.hello .wp-block-image img { aspect-ratio: 4 / 5; }
	.post-card { grid-template-columns: 1fr 9rem; gap: 1.5rem; }
	.post-card .wp-block-post-featured-image { width: 9rem; }
	h1.wp-block-post-title, .entry h1 { font-size: 2.75rem; }
}

/* Phones get the short version: text marked "desktop-only" in the editor is hidden below the breakpoint */
@media (max-width: 47.99rem) {
	.desktop-only { display: none; }
	.hello.wp-block-columns { gap: 1.1rem; }
}
