/*
Theme Name: Dog Beside Us
Theme URI: https://dogbesideus.com
Author: Irma Bense
Description: A one-page block theme for selling "What Your Dog Is Telling You". Every section is editable in the Site Editor (Appearance > Editor). Give each book its own page with the Book sales page template. Any link to a Gumroad product opens Gumroad's checkout as a pop-up.
Version: 1.1.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dogbesideus
*/

/* Smooth jump to each book's buy section */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* Book cover image: a real object with weight */
.dbu-cover img {
	border-radius: 3px;
	box-shadow: var(--wp--custom--shadow-cover);
}

/* The one entrance on the page: the book settles into place */
@media (prefers-reduced-motion: no-preference) {
	.dbu-hero .dbu-cover img {
		animation: dbu-settle 900ms cubic-bezier(.2,.7,.2,1) 150ms both;
	}
	@keyframes dbu-settle {
		from { opacity: 0; transform: translateY(24px) rotate(1.5deg); }
		to   { opacity: 1; transform: none; }
	}
}

/* Small supporting text under buttons */
.dbu-note { opacity: .78; }

/* Dark sections */
.has-forest-background-color a:not(.wp-block-button__link),
.has-moss-background-color a:not(.wp-block-button__link) {
	color: var(--wp--preset--color--sage-light);
}

/* Light button variation for dark sections */
.wp-block-button.is-style-light .wp-block-button__link {
	background-color: var(--wp--preset--color--sage-light);
	color: var(--wp--preset--color--forest);
}
.wp-block-button.is-style-light .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--linen);
	color: var(--wp--preset--color--forest);
}

/* "Same signal" rows: a rule between each row */
.dbu-meaning + .dbu-meaning { border-top: 1px solid rgba(15,29,20,.16); }
.dbu-meaning { padding-block: 1.5rem; }
.dbu-meaning .dbu-label {
	font-style: italic;
	color: var(--wp--preset--color--moss);
	margin-bottom: .25rem;
}

/* Chapter numbers */
.dbu-chapter-num {
	font-family: var(--wp--preset--font-family--display);
	color: var(--wp--preset--color--sage);
	font-size: 3rem;
	line-height: 1;
}

/* Price */
.dbu-price {
	font-family: var(--wp--preset--font-family--display);
	line-height: 1;
}

/* FAQ */
.wp-block-details summary {
	cursor: pointer;
	font-weight: 650;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.3;
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
	content: "+";
	font-family: var(--wp--preset--font-family--display);
	color: var(--wp--preset--color--sage);
	transition: transform 200ms ease;
}
.wp-block-details[open] summary::after { transform: rotate(45deg); }
.wp-block-details > :not(summary) { margin-top: .75rem; }

/* Header */
.dbu-header { border-bottom: 1px solid rgba(15,29,20,.1); }
.dbu-header .wp-block-button__link { font-size: .95rem; padding: .7rem 1.2rem; }

/* Keyboard focus everywhere */
:where(a, summary, button):focus-visible {
	outline: 2px solid var(--wp--preset--color--spaniel);
	outline-offset: 3px;
}

/* Mobile tweaks */
@media (max-width: 781px) {
	.dbu-hero .dbu-cover { max-width: 300px; margin-inline: auto; }
	.dbu-buy .dbu-cover { max-width: 220px; }
	.dbu-header .wp-block-button__link { font-size: .85rem; padding: .6rem .9rem; letter-spacing: .05em; }
	.dbu-header .wp-block-site-title { letter-spacing: .2em; font-size: .9rem; }
}

/* Refinements */
h1, h2 { text-wrap: balance; }
.dbu-meaning .dbu-label + p { margin-top: .3rem; }
.dbu-photo img, .dbu-portrait img { border-radius: 3px; }
.wp-block-list li + li { margin-top: .4rem; }
.wp-block-details:first-child { border-top: 1px solid rgba(15,29,20,.18); }
.wp-block-details summary::after { font-size: 1.6rem; line-height: 1; }
@media (max-width: 781px) {
	.dbu-meaning.wp-block-columns { gap: .75rem; }
}

/* Sections sit flush against each other inside page content */
.dbu-landing > * { margin-block-start: 0; margin-block-end: 0; }

/* Header links */
.dbu-header-links a { text-decoration: none; color: inherit; }
.dbu-header-links a:hover { color: var(--wp--preset--color--moss); text-decoration: underline; }

/* Bookshelf */
.dbu-shelf-card .wp-block-image { margin-bottom: 0; }
.dbu-shelf-card h3 a { color: inherit; text-decoration: none; }
.dbu-shelf-card h3 a:hover { text-decoration: underline; }
.dbu-shelf-card { align-self: start; }
