/*
Theme Name: Shelter Bookcase
Theme URI: https://shelterporn.com/
Author: Rene Chun / Muse
Author URI: https://shelterporn.com/
Description: A design-showcase theme for shelterporn.com. One photograph and one short nugget of text per post, arranged as the compartments of a modernist bookcase: warm oak shelving, plaster compartments, muted lacquer accents, and the requisite negative space. Bauhaus to mid-century to contemporary, with clean lines throughout.
Version: 1.3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shelter-bookcase
Tags: one-column, custom-menu, featured-images, minimal, design
*/

/* ============================================================
   Shelter Bookcase
   Plaster ground, warm ink, oak shelving, lacquer accents —
   one colour at a time.
   ============================================================ */

:root {
	--plaster: #F3EEE6;
	--ink: #26221C;
	--oak: #8A5A3B;
	--oak-light: #C8A87E;
	--red: #A63D2E;    /* dusty red lacquer */
	--slate: #3E5C76;  /* slate blue lacquer */
	--ochre: #C08A2D;  /* ochre lacquer */
	--sage: #7D8C6F;   /* sage lacquer */
	--gap: clamp(10px, 1.4vw, 16px);
}

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

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

body {
	margin: 0;
	background: var(--plaster);
	color: var(--ink);
	font-family: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 17px;
	line-height: 1.6;
}

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

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

a:focus-visible,
button:focus-visible {
	outline: 2px solid var(--slate);
	outline-offset: 3px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--ink);
	color: var(--plaster);
	padding: 10px 18px;
	font-family: "Jost", sans-serif;
	font-size: 13px;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	z-index: 100;
}

.skip-link:focus {
	left: 12px;
	top: 12px;
}

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

/* ---------- Header: the top rail of the bookcase ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--plaster);
}

.header-inner {
	max-width: 1320px;
	margin: 0 auto;
	padding: 20px clamp(18px, 4vw, 48px) 16px;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
	border-bottom: 2px solid var(--oak);
	box-shadow: 0 1px 0 var(--plaster), 0 4px 0 -2px var(--oak-light);
}

.site-title {
	margin: 0;
	font-family: "Jost", "Futura", sans-serif;
	font-weight: 600;
	font-size: clamp(24px, 3.4vw, 36px);
	letter-spacing: 0.32em;
	text-transform: uppercase;
	line-height: 1;
}

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

.site-tagline {
	margin: 7px 0 0;
	font-family: "Jost", "Futura", sans-serif;
	font-weight: 400;
	font-size: 13.5px;
	letter-spacing: 0.14em;
	line-height: 1.3;
	color: rgba(38, 34, 28, 0.68);
}

.site-nav .primary-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: clamp(16px, 3vw, 36px);
	flex-wrap: wrap;
}

.site-nav .primary-menu a {
	font-family: "Jost", sans-serif;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	padding-bottom: 3px;
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease;
}

.site-nav .primary-menu a:hover,
.site-nav .primary-menu .current-menu-item > a,
.site-nav .primary-menu .current_page_item > a {
	border-bottom-color: var(--oak);
}

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

.site-main {
	max-width: 1320px;
	margin: 0 auto;
	padding: clamp(28px, 4vw, 52px) clamp(18px, 4vw, 48px) clamp(48px, 6vw, 80px);
}

/* ---------- The bookcase ----------

   The container is oak; the grid gaps expose it, so the spaces
   between compartments read as uprights and rails. Each post
   sits inside its own plaster compartment. A repeating 7-item
   rhythm varies the spans — a wide piece, a tall piece, a piece
   whose photograph rests in plaster margins — modernist
   asymmetry rather than a uniform grid. Not every cell shouts:
   compartments carry generous inner whitespace. */

.bookcase {
	background: var(--oak);
	padding: var(--gap);
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--gap);
	grid-auto-flow: dense;
	box-shadow: inset 0 0 0 1px rgba(38, 34, 28, 0.25);
}

.shelf-item {
	background: var(--plaster);
	padding: clamp(14px, 1.6vw, 22px);
	display: flex;
	flex-direction: column;
	min-width: 0;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.shelf-item:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(38, 34, 28, 0.28);
}

.shelf-item:nth-child(7n+1) {
	grid-column: span 2;
}

.shelf-item:nth-child(7n+3) {
	grid-row: span 2;
}

.shelf-media {
	display: block;
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--oak-light);
	margin-bottom: 16px;
}

.shelf-item:nth-child(7n+1) .shelf-media {
	aspect-ratio: 16 / 9;
}

.shelf-item:nth-child(7n+3) .shelf-media {
	aspect-ratio: auto;
	flex: 1 1 auto;
	min-height: 240px;
}

.shelf-item:nth-child(7n+5) .shelf-media {
	margin: 12px 12px 16px;
}

.shelf-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.shelf-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.shelf-title {
	margin: 0;
	font-family: "Jost", sans-serif;
	font-weight: 500;
	font-size: clamp(19px, 1.6vw, 22px);
	line-height: 1.25;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.shelf-title a:hover {
	text-decoration: underline;
	text-decoration-color: var(--oak);
	text-underline-offset: 4px;
}

.shelf-nugget {
	font-size: 15.5px;
	line-height: 1.65;
	color: var(--ink);
}

.shelf-nugget p {
	margin: 0;
}

/* Typographic compartment: a post with no photograph still
   belongs on the shelf — lacquer rule, title, nugget. */

.shelf-item.no-thumb .shelf-body {
	padding-top: 6px;
}

.shelf-rule {
	display: block;
	width: 56px;
	height: 4px;
	background: var(--red);
	margin-bottom: 10px;
}

.shelf-item.no-thumb:nth-child(4n+2) .shelf-rule {
	background: var(--slate);
}

.shelf-item.no-thumb:nth-child(4n+3) .shelf-rule {
	background: var(--ochre);
}

.shelf-item.no-thumb:nth-child(4n) .shelf-rule {
	background: var(--sage);
}

/* ---------- Category chips: one lacquer at a time ---------- */

.chip-row {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.chip {
	font-family: "Jost", sans-serif;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	line-height: 1;
	padding: 6px 9px 5px;
	border: 1px solid var(--sage);
	color: var(--sage);
}

.chip-interiors {
	border-color: var(--red);
	color: var(--red);
}

.chip-architecture {
	border-color: var(--slate);
	color: var(--slate);
}

.chip-objects {
	border-color: var(--ochre);
	color: var(--ochre);
}

a.chip:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Archive rail ---------- */

.archive-header {
	margin-bottom: clamp(20px, 3vw, 32px);
	padding-bottom: 14px;
	border-bottom: 2px solid var(--oak);
}

.archive-title {
	margin: 0;
	font-family: "Jost", sans-serif;
	font-weight: 500;
	font-size: clamp(26px, 3vw, 38px);
	letter-spacing: 0.2em;
	text-transform: uppercase;
	line-height: 1.15;
}

.archive-description {
	margin-top: 10px;
	max-width: 65ch;
	font-size: 16px;
}

.archive-description p {
	margin: 0;
}

/* ---------- Single post ---------- */

.single-post {
	max-width: 1080px;
	margin: 0 auto;
}

.single-header {
	text-align: left;
	margin-bottom: clamp(20px, 3vw, 30px);
}

.single-header .chip-row {
	margin-bottom: 14px;
}

.single-title {
	margin: 0 0 10px;
	font-family: "Jost", sans-serif;
	font-weight: 500;
	font-size: clamp(30px, 4vw, 46px);
	line-height: 1.12;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.single-meta {
	margin: 0;
	font-family: "Jost", sans-serif;
	font-size: 12.5px;
	font-weight: 500;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--oak);
}

.single-frame {
	margin: 0 0 clamp(24px, 3.5vw, 40px);
	background: var(--oak);
	padding: clamp(10px, 1.6vw, 18px);
	box-shadow: inset 0 0 0 1px rgba(38, 34, 28, 0.25);
}

.single-frame img {
	display: block;
	width: 100%;
}

.single-content {
	max-width: 65ch;
	margin: 0 auto;
	font-size: 18px;
	line-height: 1.75;
}

.single-content p {
	margin: 0 0 1.4em;
}

.single-content img {
	margin: 1.5em 0;
}

.single-content figure {
	margin: 1.5em 0;
}

.single-content figcaption {
	font-size: 14px;
	color: var(--oak);
	margin-top: 8px;
}

.post-nav {
	max-width: 65ch;
	margin: clamp(36px, 5vw, 56px) auto 0;
	padding-top: 18px;
	border-top: 1px solid var(--oak-light);
	display: flex;
	justify-content: space-between;
	gap: 24px;
	font-family: "Jost", sans-serif;
	font-size: 13.5px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.post-nav a:hover {
	text-decoration: underline;
	text-decoration-color: var(--oak);
	text-underline-offset: 4px;
}

.post-nav-next {
	text-align: right;
	margin-left: auto;
}

/* ---------- Pagination ---------- */

.pagination {
	margin-top: clamp(28px, 4vw, 44px);
	text-align: center;
}

.pagination .nav-links {
	display: inline-flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: center;
}

.pagination .page-numbers {
	font-family: "Jost", sans-serif;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	padding: 9px 14px;
	border: 1px solid var(--oak-light);
}

.pagination .page-numbers.current {
	background: var(--oak);
	border-color: var(--oak);
	color: var(--plaster);
}

.pagination a.page-numbers:hover {
	border-color: var(--oak);
}

/* ---------- Empty state ---------- */

.empty-note {
	text-align: center;
	padding: clamp(40px, 8vw, 90px) 20px;
	border: 1px solid var(--oak-light);
}

.empty-note h1 {
	font-family: "Jost", sans-serif;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-size: clamp(22px, 3vw, 30px);
	margin: 0 0 12px;
}

.empty-note p {
	margin: 0;
}

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

.site-footer {
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 clamp(18px, 4vw, 48px) 44px;
	text-align: center;
}

.footer-rule {
	height: 2px;
	background: var(--oak);
	margin-bottom: 22px;
	box-shadow: 0 3px 0 -1px var(--oak-light);
}

.footer-line {
	margin: 0 0 6px;
	font-family: "Jost", sans-serif;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.28em;
	text-transform: uppercase;
}

.footer-copy {
	margin: 0;
	font-size: 13px;
	color: var(--oak);
}

/* ---------- Responsive: the shelves narrow gracefully ---------- */

@media (max-width: 1024px) {
	.bookcase {
		grid-template-columns: repeat(2, 1fr);
	}

	.shelf-item:nth-child(7n+3) {
		grid-row: span 1;
	}

	.shelf-item:nth-child(7n+3) .shelf-media {
		aspect-ratio: 4 / 3;
		flex: none;
		min-height: 0;
	}
}

@media (max-width: 640px) {
	.bookcase {
		grid-template-columns: 1fr;
	}

	.shelf-item:nth-child(7n+1) {
		grid-column: span 1;
	}

	.shelf-item:nth-child(7n+1) .shelf-media {
		aspect-ratio: 4 / 3;
	}

	.header-inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.site-title {
		letter-spacing: 0.22em;
	}

	.post-nav {
		flex-direction: column;
		gap: 10px;
	}

	.post-nav-next {
		text-align: left;
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.shelf-item {
		transition: none;
	}

	.shelf-item:hover {
		transform: none;
	}
}

/* ============================================================
   v1.1 — Shelves: the Nuage rhythm

   The homepage and archives are a shelving unit. Each shelf is
   a horizontal band of compartments of unequal widths, resting
   on a continuous oak plank; the compartment columns stagger
   from shelf to shelf, exactly as the sliding panels of the
   reference bookcase never quite line up. Photographs sit in
   the open compartments; posts without a photograph are the
   closed compartments — solid lacquer panels in deep red,
   ochre, charcoal and cream. Some compartments are left open
   on purpose: the voids are part of the furniture.
   ============================================================ */

:root {
	--cream: #E7DCC3;   /* cream lacquer panel */
	--oak-dark: #6E452B;
	--plank: 14px;
}

.shelves {
	background: var(--plaster);
	border-top: var(--plank) solid var(--oak);
	border-left: 10px solid var(--oak);
	border-right: 10px solid var(--oak);
}

.shelf {
	display: flex;
	align-items: stretch;
	height: 400px;
	border-bottom: var(--plank) solid var(--oak);
	box-shadow: 0 18px 14px -18px rgba(38, 34, 28, 0.55);
}

.shelf-1 {
	height: 460px;
}

.shelf-3 {
	height: 350px;
}

.slot {
	position: relative;
	min-width: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-right: 2px solid rgba(138, 90, 59, 0.35);
}

.shelf .slot:last-child {
	border-right: 0;
}

/* An open, empty compartment: quiet plaster shadow, nothing in it. */
.slot-void {
	background: #EAE1CF;
	box-shadow: inset 0 0 38px rgba(138, 90, 59, 0.18);
}

/* An open compartment with a photograph in it. */
.slot-media {
	flex: 1 1 auto;
	display: block;
	min-height: 0;
}

.slot-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.slot-caption {
	flex: 0 0 auto;
	background: var(--plaster);
	border-top: 2px solid rgba(138, 90, 59, 0.35);
	padding: 10px 14px 12px;
}

.slot-caption .chip-row {
	margin: 0 0 2px;
}

.slot-caption .shelf-title {
	font-size: 19px;
	margin: 0;
}

/* A closed compartment: a lacquer panel with the words on it. */
.slot-panel {
	padding: clamp(18px, 2.4vw, 30px);
	justify-content: flex-end;
}

.slot-panel .shelf-title {
	font-size: clamp(21px, 2.1vw, 27px);
	margin: 6px 0 0;
}

.slot-panel .shelf-title a {
	color: inherit;
}

.slot-panel .chip-row {
	margin: 0;
}

.slot-panel .chip {
	color: inherit;
	border-color: currentColor;
}

.slot-nugget {
	margin-top: 8px;
	font-size: 14.5px;
	line-height: 1.55;
	opacity: 0.92;
}

.panel-red {
	background: var(--red);
	color: var(--plaster);
}

.panel-ochre {
	background: var(--ochre);
	color: var(--ink);
}

.panel-charcoal {
	background: var(--ink);
	color: var(--plaster);
}

.panel-cream {
	background: var(--cream);
	color: var(--ink);
}

/* Shelves stack on small screens: one compartment at a time,
   and the voids step aside entirely. */
@media (max-width: 860px) {
	.shelf {
		flex-direction: column;
		height: auto;
	}

	.slot {
		flex-basis: auto !important;
		border-right: 0;
		border-bottom: 2px solid rgba(138, 90, 59, 0.35);
	}

	.shelf .slot:last-child {
		border-bottom: 0;
	}

	.slot-photo {
		height: 320px;
	}

	.slot-panel {
		min-height: 210px;
	}

	.slot-void {
		display: none;
	}
}

/* ============================================================
   v1.2 — The Unit: the bookcase stands as furniture

   v1.1 dealt shelves only as far as the posts reached, so an
   empty site showed a single band. v1.2 builds the whole piece
   of furniture first — a crowned case of four levels on a
   plinth, standing on legs — and lets the posts take their
   places inside it. Fixed lacquer doors and open voids are
   part of the piece at zero posts; the levels vary in height
   so the compartments stagger vertically as well as across.
   ============================================================ */

.unit {
	margin: 6px auto 72px;
}

/* The case: oak sides, a deep crown on top, the levels inside. */
.unit-case {
	background: var(--plaster);
	border-top: 22px solid var(--oak);
	border-left: 12px solid var(--oak);
	border-right: 12px solid var(--oak);
	box-shadow: 0 26px 30px -26px rgba(38, 34, 28, 0.5);
}

.unit .shelf {
	border-bottom: var(--plank) solid var(--oak);
	box-shadow: 0 16px 12px -16px rgba(38, 34, 28, 0.5);
}

.unit .shelf:first-child {
	border-top: 3px solid rgba(110, 69, 43, 0.5);
}

/* The lowest level rests on the plinth: a deeper, darker board. */
.unit .shelf:last-child {
	border-bottom: 20px solid var(--oak-dark);
	box-shadow: none;
}

/* Real uprights between compartments — the rhythm never vanishes. */
.unit .slot {
	border-right: 10px solid var(--oak);
}

.unit .shelf .slot:last-child {
	border-right: 0;
}

/* Level heights — no two adjacent levels the same depth. */
.level-a {
	height: 380px;
}

.level-b {
	height: 300px;
}

.level-c {
	height: 360px;
}

.level-d {
	height: 260px;
}

/* A fixed lacquer door: a quiet inset line, like a panel moulding. */
.slot-fixed {
	position: relative;
}

.slot-fixed-inner {
	position: absolute;
	inset: 12px;
	display: block;
	border: 1px solid rgba(38, 34, 28, 0.25);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.panel-red .slot-fixed-inner,
.panel-charcoal .slot-fixed-inner {
	border-color: rgba(243, 238, 230, 0.32);
}

/* Legs: the unit stands on the page, clear of the floor shadow. */
.unit-legs {
	display: flex;
	justify-content: space-between;
	padding: 0 7%;
}

.unit-legs span {
	display: block;
	width: 18px;
	height: 54px;
	background: linear-gradient(90deg, var(--oak-dark), var(--oak) 55%, var(--oak-dark));
	box-shadow: 0 12px 10px -8px rgba(38, 34, 28, 0.55);
}

/* Small screens: the levels unstack as before (v1.1 rules), the
   fixed doors step aside, and the legs shorten. */
@media (max-width: 860px) {
	.unit {
		margin-bottom: 48px;
	}

	.level-a,
	.level-b,
	.level-c,
	.level-d {
		height: auto;
	}

	.unit .slot {
		border-right: 0;
	}

	.slot-fixed {
		display: none;
	}

	.unit-legs span {
		width: 14px;
		height: 34px;
	}
}
