/*
Theme Name: Weisser Cabin
Theme URI: https://weissercabin.com
Author: LunaTech NW
Description: A rustic, outdoorsy block theme for the Weisser family cabin in Chiniak, Kodiak Island, Alaska. Pairs with the Weisser Cabin Albums plugin for family photo galleries.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: weisser-cabin
*/

:root {
	--wc-ridge-h: clamp(28px, 4vw, 56px);
	--wc-radius: 6px;
	--wc-shadow: 0 1px 2px rgb(18 35 29 / 0.08), 0 8px 24px -8px rgb(18 35 29 / 0.25);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.wp-site-blocks { position: relative; }
h1, h2, h3, .wp-block-site-title { font-optical-sizing: auto; text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--wp--preset--color--ember); color: var(--wp--preset--color--spruce-deep); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--wp--preset--color--ember); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 20; }
.site-header a { text-decoration: none; }
.site-header .wp-block-site-title a { display: inline-flex; align-items: center; gap: 0.6rem; color: inherit; }
.site-header .wp-block-site-title a::before {
	content: "";
	width: 2.1rem;
	height: 2.1rem;
	flex: none;
	background: var(--wp--preset--color--ember);
	-webkit-mask: url(assets/img/logo-mark.svg) center / contain no-repeat;
	mask: url(assets/img/logo-mark.svg) center / contain no-repeat;
}
.site-header .wp-block-navigation-item__content { padding-block: 0.4rem; border-bottom: 2px solid transparent; transition: border-color 0.2s, color 0.2s; }
.site-header .wp-block-navigation-item__content:hover,
.site-header .current-menu-item > .wp-block-navigation-item__content { border-bottom-color: var(--wp--preset--color--ember); }

/* On the home page the header floats over the hero illustration. */
.home .site-header {
	position: absolute;
	inset: 0 0 auto;
	background: linear-gradient(rgb(10 18 16 / 0.55), transparent) !important;
}

/* ---------- Block style: eyebrow label ---------- */
.is-style-eyebrow {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.8rem !important;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	line-height: 1.4;
}
.is-style-eyebrow:not(.has-text-color) { color: var(--wp--preset--color--cedar); }

/* ---------- Block style: mountain ridge edge ----------
   The group's own background color rises into the section above as a ridge line. */
.is-style-ridge { position: relative; isolation: isolate; }
.is-style-ridge::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: calc(100% - 1px);
	height: var(--wc-ridge-h);
	background: inherit;
	-webkit-mask: url(assets/img/ridge.svg) left bottom / auto 100% repeat-x;
	mask: url(assets/img/ridge.svg) left bottom / auto 100% repeat-x;
	pointer-events: none;
}

/* ---------- Block style: topographic texture ---------- */
.is-style-topo { position: relative; isolation: isolate; }
.is-style-topo::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: currentColor;
	opacity: 0.07;
	-webkit-mask: url(assets/img/topo.svg) 0 0 / 520px repeat;
	mask: url(assets/img/topo.svg) 0 0 / 520px repeat;
	pointer-events: none;
}
.is-style-topo.is-style-ridge::after { top: 0; }

/* ---------- Block style: snapshot (old photo) ---------- */
.wp-block-image.is-style-snapshot img {
	background: #fffdf8;
	padding: 0.6rem 0.6rem 2.4rem;
	box-shadow: var(--wc-shadow);
	transform: rotate(-1.2deg);
	transition: transform 0.3s ease;
}
.wp-block-image.is-style-snapshot:nth-of-type(even) img { transform: rotate(1.4deg); }
.wp-block-image.is-style-snapshot img:hover { transform: rotate(0); }
.wp-block-image.is-style-snapshot figcaption {
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	text-align: center;
	margin-top: -1.9rem;
	position: relative;
}

/* ---------- Hero ---------- */
.wc-hero { overflow: hidden; }
.wc-hero .wp-block-cover__image-background { object-position: 68% 100%; }
.wc-hero h1 { text-shadow: 0 2px 24px rgb(10 18 16 / 0.5); }
.wc-hero .wp-block-cover__inner-container > * { animation: wc-rise 0.9s cubic-bezier(.2,.7,.2,1) both; }
.wc-hero .wp-block-cover__inner-container > *:nth-child(2) { animation-delay: 0.08s; }
.wc-hero .wp-block-cover__inner-container > *:nth-child(3) { animation-delay: 0.16s; }
.wc-hero .wp-block-cover__inner-container > *:nth-child(4) { animation-delay: 0.24s; }
@keyframes wc-rise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .wc-hero .wp-block-cover__inner-container > * { animation: none; } }

.wc-scroll-cue { opacity: 0.75; }
.wc-scroll-cue a { color: inherit !important; text-decoration: none; }

/* ---------- Cards (places + albums) ---------- */
.wc-card {
	border-radius: var(--wc-radius);
	overflow: hidden;
	box-shadow: var(--wc-shadow);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	height: 100%;
}
.wc-card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgb(18 35 29 / 0.1), 0 18px 40px -12px rgb(18 35 29 / 0.4); }
.wc-card .wp-block-image,
.wc-card .wp-block-post-featured-image { margin: 0; overflow: hidden; }
.wc-card .wp-block-image img,
.wc-card .wp-block-post-featured-image img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.6s ease; }
.wc-card:hover .wp-block-image img,
.wc-card:hover .wp-block-post-featured-image img { transform: scale(1.04); }
.wc-card h3 a, .wc-card h2 a { color: inherit; text-decoration: none; }
.wc-card h3 a::after, .wc-card h2 a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.wc-card { position: relative; }
.wc-card .wc-more { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.wc-card .wc-more::after { content: " →"; transition: margin 0.2s; }
.wc-card:hover .wc-more::after { margin-left: 0.3em; }
.wc-card .wp-block-post-terms a { position: relative; z-index: 1; }

.wc-cover-placeholder img { background: var(--wp--preset--color--sand); }

/* Post template grids stretch cards to equal height. */
.wp-block-post-template.is-layout-grid > li { display: flex; flex-direction: column; }
.wp-block-post-template.is-layout-grid > li > .wc-card { flex: 1; }

/* ---------- Place filter chips ---------- */
.wc-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.wc-chips li { margin: 0; }
.wc-chips a {
	display: inline-block;
	padding: 0.45rem 1rem;
	border: 1.5px solid var(--wp--preset--color--sand);
	border-radius: 999px;
	color: var(--wp--preset--color--spruce);
	background: var(--wp--preset--color--paper);
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.wc-chips a:hover { border-color: var(--wp--preset--color--cedar); color: var(--wp--preset--color--cedar); }
.wc-chips a.is-current { background: var(--wp--preset--color--spruce); border-color: var(--wp--preset--color--spruce); color: var(--wp--preset--color--paper); }
.wc-chips .wc-chip-count { opacity: 0.6; font-weight: 400; margin-left: 0.25em; }

/* ---------- Timeline ---------- */
.wc-timeline { position: relative; }
.wc-timeline > .wc-milestone { position: relative; padding-left: 2.75rem; }
.wc-timeline > .wc-milestone::before {
	content: "";
	position: absolute;
	left: 0.55rem;
	top: 0.5rem;
	bottom: -1.75rem;
	width: 2px;
	background: repeating-linear-gradient(to bottom, var(--wp--preset--color--sand) 0 6px, transparent 6px 12px);
}
.wc-timeline > .wc-milestone:last-child::before { display: none; }
.wc-timeline > .wc-milestone::after {
	content: "";
	position: absolute;
	left: 0;
	top: 0.3rem;
	width: 1.2rem;
	height: 1.2rem;
	border-radius: 50%;
	background: var(--wp--preset--color--paper);
	border: 3px solid var(--wp--preset--color--cedar);
	box-sizing: border-box;
}
.wc-milestone .wc-year { font-family: var(--wp--preset--font-family--heading); font-weight: 600; color: var(--wp--preset--color--cedar); line-height: 1.2; }

/* Horizontal timeline teaser on the home page. */
.wc-steps > .wp-block-column { position: relative; padding-top: 2.25rem; }
.wc-steps > .wp-block-column::before {
	content: "";
	position: absolute;
	top: 0.55rem;
	left: 0;
	right: -2rem;
	height: 2px;
	background: repeating-linear-gradient(to right, currentColor 0 6px, transparent 6px 12px);
	opacity: 0.3;
}
.wc-steps > .wp-block-column:last-child::before { right: 0; }
.wc-steps > .wp-block-column::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 1.2rem;
	height: 1.2rem;
	border-radius: 50%;
	border: 3px solid var(--wp--preset--color--ember);
	background: var(--wp--preset--color--spruce);
	box-sizing: border-box;
}

/* ---------- Facts list ---------- */
.wc-facts > * { border-top: 1px solid rgb(30 58 47 / 0.15); padding-top: 1rem; }
.wc-fact-num { font-family: var(--wp--preset--font-family--heading); font-weight: 600; line-height: 1; }

/* ---------- Galleries ---------- */
.wp-block-gallery.has-nested-images figure.wp-block-image img { border-radius: 3px; }
.wp-block-gallery.has-nested-images figure.wp-block-image { transition: filter 0.2s; }
.wp-block-gallery.has-nested-images figure.wp-block-image:hover { filter: brightness(1.06); }
.wp-lightbox-overlay .scrim { background-color: var(--wp--preset--color--spruce-deep) !important; }
.wc-empty-album {
	text-align: center;
	padding: var(--wp--preset--spacing--50);
	border: 2px dashed var(--wp--preset--color--sand);
	border-radius: var(--wc-radius);
	color: var(--wp--preset--color--driftwood);
}

/* ---------- Content niceties ---------- */
.entry-content > p:first-of-type.has-drop-cap::first-letter,
.has-drop-cap:not(:focus)::first-letter { font-family: var(--wp--preset--font-family--heading); color: var(--wp--preset--color--cedar); font-weight: 600; }
.wc-note {
	border-left: 3px solid var(--wp--preset--color--ember);
	background: rgb(232 220 198 / 0.45);
	border-radius: 0 var(--wc-radius) var(--wc-radius) 0;
}

/* ---------- Footer ---------- */
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--wp--preset--color--ember); }
.site-footer .wc-footer-mark {
	width: 3rem;
	height: 3rem;
	background: var(--wp--preset--color--ember);
	-webkit-mask: url(assets/img/logo-mark.svg) center / contain no-repeat;
	mask: url(assets/img/logo-mark.svg) center / contain no-repeat;
}

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.wc-steps > .wp-block-column::before { display: none; }
	.wc-steps > .wp-block-column { padding-top: 0; padding-left: 2.25rem; }
	.wc-steps > .wp-block-column::after { top: 0.35rem; }
}
.wc-plain-list { list-style: none; padding-left: 0; line-height: 2; }
.wc-footer-bottom { border-top: 1px solid rgb(255 255 255 / 0.12); margin-top: var(--wp--preset--spacing--50) !important; padding-top: var(--wp--preset--spacing--30); }

/* ---------- Media + text sections ---------- */
.wc-media .wp-block-media-text__media img { border-radius: var(--wc-radius); box-shadow: var(--wc-shadow); aspect-ratio: 4 / 3; object-fit: cover; }
.wc-media .wp-block-media-text__content { padding-inline: var(--wp--preset--spacing--50); }
@media (max-width: 600px) {
	.wc-media .wp-block-media-text__content { padding: var(--wp--preset--spacing--40) 0 0; }
}
.wp-block-quote cite { display: block; margin-top: 0.75rem; font-family: var(--wp--preset--font-family--body); font-style: normal; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--driftwood); }
.wp-block-quote cite em { font-style: italic; }
.wc-cover-placeholder img { width: 100%; height: 100% !important; object-fit: cover; }
.has-spruce-background-color .wc-chips a.is-current,
.has-spruce-deep-background-color .wc-chips a.is-current { background: var(--wp--preset--color--ember); border-color: var(--wp--preset--color--ember); color: var(--wp--preset--color--spruce-deep); }
