/*
Theme Name: Quiet Journal
Theme URI: https://zandy.blog
Author: Zandy
Description: A quiet, readable block theme for Revelry Reverie. Warm paper, one serif reading column, generous space.
Version: 0.1.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: quiet-journal
*/

/* Most styling lives in theme.json. This file holds the few things it can't express. */

/* Fraunces: a soft, characterful setting for display, a plain one for reading. */
body { font-optical-sizing: auto; font-variation-settings: 'SOFT' 0, 'WONK' 0; }
h1, h2, h3, h4, .wp-block-post-title, .wp-block-site-title { font-variation-settings: 'SOFT' 50, 'WONK' 1; }
h1, .wp-block-post-title { font-variation-settings: 'SOFT' 50, 'WONK' 1; }
.wp-block-site-title { font-variation-settings: 'SOFT' 50, 'WONK' 0; }

.qj-earlier .wp-block-post-template { list-style: none; margin: 0; padding: 0; }
.qj-earlier .wp-block-post-template > li { padding: 0.9rem 0; border-bottom: 1px solid var(--wp--preset--color--rule); margin: 0; }
.qj-earlier .wp-block-post-title { margin: 0; line-height: 1.1; }

.wp-block-post-excerpt__more-link {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.9375rem;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
}

.wp-block-site-title a:hover,
.wp-block-post-title a:hover,
.wp-block-navigation a:hover { color: var(--wp--preset--color--accent); }

/* Comment form */
.wp-block-post-comments-form label { display: block; font-family: var(--wp--preset--font-family--sans); font-size: 0.875rem; margin-bottom: 0.375rem; }
.wp-block-post-comments-form input[type="text"],
.wp-block-post-comments-form input[type="email"],
.wp-block-post-comments-form input[type="url"],
.wp-block-post-comments-form textarea {
	width: 100%; box-sizing: border-box; padding: 0.75rem;
	font-family: var(--wp--preset--font-family--sans); font-size: 1rem;
	color: var(--wp--preset--color--ink); background: #FBF9F5; border: 1px solid #B9AF9D; border-radius: 0;
}
.wp-block-post-comments-form .comment-form-cookies-consent { font-family: var(--wp--preset--font-family--sans); font-size: 0.875rem; }
.wp-block-post-comments-form .comment-form-cookies-consent label { display: inline; }
.wp-block-post-comments-form input[type="submit"] {
	min-height: 44px; padding: 0.875rem 1.75rem; border: 0; border-radius: 0; cursor: pointer;
	background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper);
	font-family: var(--wp--preset--font-family--sans); font-size: 0.9375rem;
}

:where(a, button, input, textarea):focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* ---------- Archive page ---------- */
.qj-arch { display: flex; flex-direction: column; gap: 4rem; font-family: var(--wp--preset--font-family--sans); }
.qj-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.qj-eyebrow { font-family: var(--wp--preset--font-family--sans); font-size: 0.8125rem !important; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wp--preset--color--muted); margin: 0 0 1.25rem; }

.qj-arch-count { font-family: var(--wp--preset--font-family--serif); font-size: var(--wp--preset--font-size--large); line-height: 1.3; margin: 0 0 1.5rem; }
.qj-arch-count strong { font-weight: 600; }
.qj-arch-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.qj-arch-actions > * { margin: 0 !important; }
.qj-btn { box-sizing: border-box; display: inline-flex; align-items: center; height: 48px; padding: 0 1.75rem; line-height: 1; background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper) !important; font-size: 0.9375rem; font-weight: 500; text-decoration: none !important; }
.qj-btn:hover { background: var(--wp--preset--color--accent); }
.qj-search { flex: 1 1 240px; max-width: 360px; }
.qj-search { display: flex; }
.qj-search input { display: block; margin: 0; width: 100%; box-sizing: border-box; height: 48px; padding: 0 0.875rem; line-height: 1; font-family: inherit; font-size: 1rem; color: var(--wp--preset--color--ink); background: #FBF9F5; border: 1px solid #B9AF9D; border-radius: 0; }

.qj-stacks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem; }
.qj-card { border-top: 1px solid var(--wp--preset--color--rule); padding-top: 1rem; }
.qj-card time { display: block; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wp--preset--color--muted); margin-bottom: 0.5rem; }
.qj-card h3 { font-family: var(--wp--preset--font-family--serif); font-size: 1.625rem; font-weight: 600; line-height: 1.15; margin: 0 0 0.5rem; }
.qj-card p { font-family: var(--wp--preset--font-family--serif); font-size: 1rem; line-height: 1.55; margin: 0; color: var(--wp--preset--color--muted); }

.qj-legend { display: flex; align-items: center; gap: 4px; margin: 0 0 1.5rem; font-size: 0.8125rem; color: var(--wp--preset--color--muted); }
.qj-legend span { margin: 0 0.5rem; }
.qj-legend .qj-m { width: 16px; height: 16px; aspect-ratio: auto; }

.qj-year { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 1.5rem; align-items: center; padding: 0.625rem 0; border-top: 1px solid var(--wp--preset--color--rule); }
.qj-year.qj-head { border-top: 0; padding: 0 0 0.25rem; font-size: 0.75rem; font-weight: 500; color: var(--wp--preset--color--muted); }
.qj-year.qj-head .qj-months span { text-align: center; }
.qj-year-label { display: flex; flex-direction: column; line-height: 1; }
.qj-year-label a { font-family: var(--wp--preset--font-family--serif); font-size: 2.5rem; font-weight: 600; letter-spacing: -0.02em; font-variation-settings: 'SOFT' 50, 'WONK' 1; text-decoration: none; }
.qj-year-label span { font-size: 0.8125rem; color: var(--wp--preset--color--muted); margin-top: 0.375rem; }
.qj-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }

.qj-m { display: block; aspect-ratio: 1; position: relative; background: transparent; }
.qj-m.t0 { border: 1px dashed #CFC6B6; box-sizing: border-box; }
.qj-m.t0.is-future { border-color: transparent; }
.qj-m.t1 { background: #E7D3C2; }
.qj-m.t2 { background: #D3A47F; }
.qj-m.t3 { background: #B5693B; }
.qj-m.t4 { background: #8A3B12; }
.qj-m a { position: absolute; inset: 0; display: block; }
.qj-m a:hover, .qj-m a:focus-visible { outline: 2px solid var(--wp--preset--color--ink); outline-offset: 1px; z-index: 1; }

@media (max-width: 640px) {
	.qj-year { grid-template-columns: 1fr; gap: 0.5rem; }
	.qj-year.qj-head > span { display: none; }
	.qj-year-label { flex-direction: row; align-items: baseline; gap: 0.75rem; }
	.qj-year-label a { font-size: 2rem; }
}

/* Hover preview: one random photo from the month, drawn as the top of a pile */
.qj-arch { position: relative; }
.qj-peek { position: absolute; z-index: 5; isolation: isolate; width: 240px; padding: 6px 6px 10px; background: #FBF9F5; box-shadow: 0 6px 16px rgba(28, 26, 23, 0.18); pointer-events: none; opacity: 0; transition: opacity 0.35s ease; }
.qj-peek::before, .qj-peek::after { content: ""; position: absolute; inset: 0; z-index: -1; background: #F1EBDF; box-shadow: 0 3px 8px rgba(28, 26, 23, 0.14); }
.qj-peek::before { transform: rotate(-3.5deg); }
.qj-peek::after { transform: rotate(2.5deg); background: #EAE2D3; }
.qj-peek.is-on { opacity: 1; }
.qj-peek img { display: block; width: 100%; height: 170px; object-fit: cover; filter: sepia(0.85) contrast(1.03); }
.qj-peek span { display: block; padding: 0 2px; line-height: 1.35; }
.qj-peek-kicker { margin-top: 10px; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wp--preset--color--accent); }
.qj-peek-title { margin-top: 2px; font-family: var(--wp--preset--font-family--serif); font-size: 1rem; font-weight: 600; line-height: 1.25 !important; color: var(--wp--preset--color--ink); }
.qj-peek-more { margin-top: 6px; font-size: 0.75rem; color: var(--wp--preset--color--muted); }
@media (prefers-reduced-motion: reduce) { .qj-peek { transition: none; } }

/* ---------- Month and year pages ---------- */
.qj-mo { font-family: var(--wp--preset--font-family--sans); }
.qj-mo-back { margin: 0 0 1.5rem; font-size: 0.9375rem; font-weight: 500; }
.qj-mo-head { display: flex; flex-wrap: wrap; gap: 2.5rem 4rem; align-items: flex-end; justify-content: space-between; margin-bottom: 3rem; }
.qj-mo-titlewrap { flex: 1 1 480px; min-width: 0; }
.qj-mo-title { margin: 0; font-family: var(--wp--preset--font-family--serif); font-weight: 600; font-size: clamp(3.5rem, 13vw, 9rem) !important; line-height: 0.92 !important; letter-spacing: -0.035em; font-variation-settings: 'SOFT' 50, 'WONK' 1; overflow-wrap: anywhere; }
.qj-mo-title em { font-style: italic; font-weight: 400; color: var(--wp--preset--color--accent); letter-spacing: -0.02em; }
.qj-mo-stats { margin: 1.25rem 0 1.5rem; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wp--preset--color--muted); }
.qj-mo-nav { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.qj-mo-nav-end { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--wp--preset--color--rule); }
.qj-navbtn { display: inline-flex; align-items: center; box-sizing: border-box; height: 48px; padding: 0 1.25rem; border: 1px solid var(--wp--preset--color--ink); font-size: 0.9375rem; font-weight: 500; text-decoration: none !important; }
.qj-navbtn:hover { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper) !important; }

/* Calendar */
.qj-cal { flex: 0 1 300px; }
.qj-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.qj-cal-wd { margin-bottom: 4px; font-size: 0.6875rem; font-weight: 500; text-align: center; color: var(--wp--preset--color--muted); }
.qj-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 0.8125rem; color: #8F867A; box-sizing: border-box; text-decoration: none !important; }
.qj-day.is-pad { visibility: hidden; }
.qj-day.has { position: relative; background: var(--wp--preset--color--accent); color: var(--wp--preset--color--paper) !important; font-weight: 600; transition: transform 0.15s ease; }
.qj-day.has:hover, .qj-day.has:focus-visible { transform: scale(1.12); z-index: 1; }

/* Photo mosaic */
.qj-mosaic { display: grid; gap: 6px; margin-bottom: 4rem; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 170px; }
.qj-mosaic a { display: block; overflow: hidden; background: var(--wp--preset--color--photo); }
.qj-mosaic a:first-child { grid-column: span 2; grid-row: span 2; }
.qj-mosaic img, .qj-entry-thumb img, .qj-mcard-img img { display: block; width: 100%; height: 100%; object-fit: cover; filter: sepia(0.85) contrast(1.03); transition: filter 0.4s ease, transform 0.6s ease; }
.qj-mosaic a:hover img, .qj-mosaic a:focus-visible img, .qj-entry:hover .qj-entry-thumb img, .qj-mcard:hover img, .qj-mcard:focus-visible img { filter: none; transform: scale(1.03); }
.qj-mosaic-3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qj-mosaic-3 a:nth-child(n+2) { grid-column: span 2; }

/* Entries */
.qj-entry { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 2rem; padding: 2.25rem 0; border-top: 1px solid var(--wp--preset--color--rule); scroll-margin-top: 1.5rem; }
.qj-entry.has-thumb { grid-template-columns: 8rem minmax(0, 1fr) 240px; }
.qj-entry:target { background: linear-gradient(90deg, rgba(138, 59, 18, 0.07), transparent); }
.qj-entry-day { display: flex; flex-direction: column; }
.qj-entry-num { font-family: var(--wp--preset--font-family--serif); font-size: 4.5rem; font-weight: 600; line-height: 0.85; letter-spacing: -0.03em; color: var(--wp--preset--color--accent); font-variation-settings: 'SOFT' 50, 'WONK' 1; }
.qj-entry-wd { margin-top: 0.5rem; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wp--preset--color--muted); }
.qj-entry-body h2 { margin: 0 0 0.75rem; font-family: var(--wp--preset--font-family--serif); font-size: clamp(1.75rem, 3.2vw, 2.5rem) !important; font-weight: 600; line-height: 1.08 !important; letter-spacing: -0.02em; }
.qj-entry-body p { margin: 0 0 1rem; font-family: var(--wp--preset--font-family--serif); font-size: 1.125rem; line-height: 1.6; color: var(--wp--preset--color--muted); }
.qj-more { font-size: 0.9375rem; font-weight: 500; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.qj-entry-thumb { display: block; align-self: start; aspect-ratio: 4 / 3; overflow: hidden; background: var(--wp--preset--color--photo); }

/* Year page */
.qj-yr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2rem 1.5rem; }
.qj-mcard { display: flex; flex-direction: column; text-decoration: none !important; }
.qj-mcard-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--wp--preset--color--photo); margin-bottom: 0.75rem; }
.qj-mcard-name { font-family: var(--wp--preset--font-family--serif); font-size: 2rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em; font-variation-settings: 'SOFT' 50, 'WONK' 1; }
.qj-mcard-n { margin-top: 0.375rem; font-size: 0.8125rem; color: var(--wp--preset--color--muted); }
.qj-mcard.is-empty { border-top: 1px dashed #CFC6B6; padding-top: 0.75rem; opacity: 0.6; }
.qj-mcard.is-empty .qj-mcard-name { font-size: 1.25rem; font-weight: 400; color: #8F867A; }

@media (max-width: 760px) {
	.qj-entry, .qj-entry.has-thumb { grid-template-columns: 1fr; gap: 1rem; }
	.qj-entry-day { flex-direction: row; align-items: baseline; gap: 0.75rem; }
	.qj-entry-num { font-size: 3rem; }
	.qj-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 140px; }
	.qj-mosaic a:first-child { grid-column: span 2; }
	.qj-mosaic-3 a:nth-child(n+2) { grid-column: span 1; }
}
@media (prefers-reduced-motion: reduce) { .qj-mosaic img, .qj-entry-thumb img, .qj-mcard-img img, .qj-day.has { transition: none; } }
