/*
Theme Name: Well Vegan (Purple)
Description: Well Vegan's current look on top of the Purple theme.
Template: purple
Version: 0.1.0
Requires at least: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: purple-wellvegan
*/

/* Purple's page wrapper adds gaps between the header, content and footer. */
.wp-site-blocks > * { margin-block: 0; }
.wp-site-blocks :is(.site-inner, .content-sidebar-wrap, main.content) { margin-block: 0; }
.wp-site-blocks .wv-entry { margin-block: 0 37px; }
.wp-site-blocks .entry-content { display: block; }
/* Store pages use Purple's layout with Well Vegan's font. */
body.wp-theme-purple { font-family: "Ysabeau", "Gill Sans", sans-serif; font-weight: 500; }

/* Ysabeau's numbers dip below the line; recipe amounts are easier to read when they don't. */
.tasty-recipes { font-variant-numeric: lining-nums; }

/* Mobile header: logo left, menu button right. The open menu sits below the header. */
@media (max-width: 1199px) {
	/* Links within a page stop below the fixed header. Tasty Recipes scrolls by itself
	   and ignores scroll-padding, so its two targets are extended upward instead. */
	html { scroll-padding-top: 76px !important; }
	html:has(body.admin-bar) { scroll-padding-top: 122px !important; }
	body .tasty-recipes-jump-target { position: relative; top: calc(-12px - var(--wv-head) - var(--wv-bar)); scroll-margin-top: calc(-12px - var(--wv-head) - var(--wv-bar)); }
	body #respond { --wv-up: calc(12px + var(--wv-head) + var(--wv-bar)); padding-top: var(--wv-up); margin-top: calc(0px - var(--wv-up)); scroll-margin-top: calc(0px - var(--wv-up)); pointer-events: none; }
	body #respond > * { pointer-events: auto; }
	body { --wv-bar: 0px; --wv-head: 64px; }
	body.admin-bar { --wv-bar: 32px; }
	body .wp-site-blocks .feastmobilenavbar { display: flex; align-items: center; justify-content: space-between; position: fixed; top: var(--wv-bar); height: var(--wv-head); padding: 0 8px 0 12px; }
	body .wp-site-blocks .feastmobilenavbar > div { height: var(--wv-head); }
	body .wp-site-blocks { margin-top: var(--wv-head); }
	body .wp-site-blocks .feastmenulogo { order: 1; justify-content: flex-start; }
	body .wp-site-blocks .feastmenulogo img { width: 152px; height: 37px; max-width: none; margin: 4px 0 0 4px; }
	body .wp-site-blocks .feastmenutoggle { order: 2; }
	body .wp-site-blocks .feastmenutoggle a { display: flex; }
	body .wp-site-blocks .feastsearchtoggle { display: none; }

	body .feastmobilemenu-background { top: calc(var(--wv-head) + var(--wv-bar)); height: calc(100% - var(--wv-head) - var(--wv-bar)); }
	body .mmm-dialog .mmm-content { display: flex; flex-direction: column; contain: none; top: calc(var(--wv-head) + var(--wv-bar)); width: 65%; min-width: 250px; max-width: 340px; height: auto; max-height: calc(100% - var(--wv-head) - var(--wv-bar)); padding: 24px 20px; box-sizing: border-box; }
	body .mmm-content > * { flex-shrink: 0; }
	body .mmm-content > a:has(#mmmlogo) { display: none; }
	body .mmm-content #menu-feast-modern-mobile-menu { order: 1; margin: 0; padding: 0; }
	body .mmm-content #menu-feast-modern-mobile-menu li { min-height: 0; margin: 0; padding: 0; }
	body .mmm-content #menu-feast-modern-mobile-menu li a { display: block; padding: 10px 0; line-height: 1.3; }
	body .mmm-content #feast-mobile-search { order: 2; margin: 8px 0 0; }
	body .mmm-content #feast-mobile-menu-social-icons { order: 3; }
	body .mmm-content .closebtn { top: calc(var(--wv-bar) + 1px); left: auto; right: 8px; display: flex; align-items: center; justify-content: center; width: 50px; height: calc(var(--wv-head) - 2px); margin: 0; padding-bottom: 6px; box-sizing: border-box; background: #fff; font-weight: 400; line-height: 1; }
}
@media (max-width: 782px) {
	body.admin-bar { --wv-bar: 46px; }
	body.admin-bar #wpadminbar { position: fixed; }
	body.admin-bar .wp-site-blocks { margin-top: var(--wv-head); }
}

/* Homepage sections: even spacing between them. */
.home .entry-content > .wv-section { margin: 0; padding: 52px 0; }
.home .entry-content > .wv-section:first-child { padding-top: 37px; }
.home .wv-section > :first-child, .home .wv-section .wp-block-group, .home .wv-section .wp-block-group > h2:first-child { margin-top: 0; }
.home .wv-section > :last-child, .home .wv-section .wp-block-group, .home .wv-section .logo-grid { margin-bottom: 0; }
:is(.home .wv-section, .page-id-19 .entry-content) .fsri-list { row-gap: 28px; }
:is(.home .wv-section, .page-id-19 .entry-content) .fsri-list .listing-item { margin-bottom: 0; }
/* Square recipe images on the homepage. */
:is(.home, .page-id-19) .entry-content .fsri-list .listing-item img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
/* Homepage recipe cards: larger titles, text on the left. */
:is(.home, .page-id-19) .entry-content .fsri-list .listing-item { text-align: left; }
:is(.home, .page-id-19) .entry-content .fsri-list .fsri-title { padding: 6px 0 8px; font-size: 21px; line-height: 1.25; text-wrap: wrap; }
:is(.home, .page-id-19) .entry-content .fsri-list .fsri-comment-count { justify-content: flex-start; padding: 4px 0; }
:is(.home, .page-id-19) .entry-content .fsri-list .fsri-rating { place-self: end start; text-align: left; }
@media (max-width: 600px) {
	:is(.home, .page-id-19) .entry-content .fsri-list .fsri-title { font-size: 18px; }
}

/* Footer on phones and tablets: recipes in two columns, then More, then social icons. */
@media (max-width: 940px) {
	.wp-site-blocks #genesis-footer-widgets { padding: 32px 20px 24px; }
	.wp-site-blocks #genesis-footer-widgets .wrap { display: flex; flex-direction: column; gap: 28px; width: 100%; padding: 0; }
	.wp-site-blocks #genesis-footer-widgets .footer-widgets-1 { display: none; }
	.wp-site-blocks #genesis-footer-widgets .footer-widget-area { float: none; width: 100%; max-width: none; margin: 0; padding: 0; }
	.wp-site-blocks #genesis-footer-widgets .widget { margin: 0; padding: 0; }
	.wp-site-blocks #genesis-footer-widgets .widgettitle { margin: 0 0 14px; padding: 0; }
	.wp-site-blocks #genesis-footer-widgets .textwidget { margin: 0; padding: 0; }
	.wp-site-blocks #genesis-footer-widgets .footer-recipes .textwidget { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
	.wp-site-blocks #genesis-footer-widgets ul { float: none; width: 100%; margin: 0; padding: 0; }
	.wp-site-blocks #genesis-footer-widgets .textwidget li { margin: 0; padding: 5px 0; }
	.wp-site-blocks #genesis-footer-widgets .simple-social-icons ul { display: flex; gap: 8px; margin-left: -12px; }
	.wp-site-blocks #genesis-footer-widgets .simple-social-icons li { margin: 0 !important; }
	.wp-site-blocks .site-footer { padding-inline: 20px; }
}

/* One medium weight for all titles. */
body :is(h1, h2, h3, h4, .entry-title, .widgettitle, .fsri-title, .archive-title), body .entry-title a { font-weight: 600 !important; }
body .nav-primary .menu-item, body .nav-primary .menu-item a { font-weight: 700 !important; }
body .sidebar li a, body .testimonial { font-weight: 500 !important; }

@media (max-width: 782px) {
	/* Less space between the tagline and the first heading. */
	.home .entry-content > .wv-section:first-child { padding-top: 0; }
}

/* Leftover separator dot above Jump to Recipe. */
body .tasty-recipes-quick-links > span { display: none; }

/* The old product grid rule also shrinks single product pages on phones. */
body.single-product { width: auto !important; margin-left: 0 !important; }

/* Homepage and recipes page section headings: centered capitals. The indent balances the space added after the last letter. */
:is(.home .entry-content > .wv-section, .page-id-19 .entry-content) h2 { display: block; font-weight: 800 !important; text-align: center; text-transform: uppercase; font-size: 22px; line-height: 1.3; letter-spacing: 0.025em; text-indent: 0.025em; font-kerning: normal; text-wrap: balance; }
@media (max-width: 600px) {
	:is(.home .entry-content > .wv-section, .page-id-19 .entry-content) h2 { font-size: 19px; }
}
@media (min-width: 783px) {
	/* This one sits beside a photo, above left-aligned text. */
	.home .entry-content > .wv-section h2.home-heading-about { text-align: left; text-indent: 0; }
}

/* Hand-drawn divider between homepage sections. */
.home .entry-content > .wv-section:not(:last-child) { background: url(assets/images/squiggle.svg) center bottom / 96px 10px round no-repeat; }
/* These two already have some space after their last item. */
.home .entry-content > .wv-section:is(:first-child, :has(.home-heading-about)) { padding-bottom: 34px; }

/* Desktop header: logo left, menu and search right, one line underneath. */
@media (min-width: 1200px) {
	.wp-site-blocks > .wp-block-template-part:has(> .site-header) { display: flex; align-items: center; justify-content: space-between; height: 100px; padding: 0 max(37px, calc(50% - 548px)); border-bottom: 1px solid #ddd; box-sizing: border-box; }
	body .site-header, body .nav-primary { flex: none; width: auto; min-height: 0; }
	body .site-header .wrap, body .nav-primary .wrap { width: auto; max-width: none; margin: 0; padding: 0; background: none; }
	body.header-full-width .title-area, body.header-full-width .site-title { display: block; width: auto; padding: 0; line-height: 0; }
	body .site-title a { display: block; }
	body .site-title img { display: block; width: 223px; height: 55px; margin-top: 8px; }

	body .nav-primary .menu-primary { display: flex; align-items: center; gap: 36px; padding: 0; background: none; }
	body .nav-primary .menu-primary > .menu-item a { padding: 10px 0; font-size: 16px; letter-spacing: 0.025em; }

	/* Search is an icon until it's clicked, then it opens over the menu. */
	body .nav-primary .foodie-search { position: relative !important; width: 24px; height: 44px; margin-left: -8px; }
	body .nav-primary .foodie-search .search-form { position: absolute; top: 0; right: -10px; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; background: #fff; transition: width .2s; }
	body .nav-primary .foodie-search .search-form-input { width: 100%; height: 44px; padding: 0 44px 0 0; box-sizing: border-box; border: 1px solid transparent; background: url(assets/images/search-bold.svg) right 10px center / 24px no-repeat; font-size: 16px; cursor: pointer; }
	body .nav-primary .foodie-search .search-form-input::placeholder { color: transparent; }
	body .nav-primary .foodie-search .search-form:focus-within { width: 280px; z-index: 5; }
	body .nav-primary .foodie-search .search-form:focus-within .search-form-input { padding-left: 14px; border-color: #333; color: #333; cursor: text; }
	body .nav-primary .menu-primary:has(.search-form:focus-within) > .menu-item:not(.foodie-search) { opacity: 0; }
	body .nav-primary .foodie-search .search-form:focus-within .search-form-input::placeholder { color: #777; }
}

/* The homepage and recipes page had a fixed width that cut off the last photo on medium screens. */
body:is(.home, .page-id-19) main.content { width: 100% !important; max-width: 100% !important; }

/* Homepage: the same squiggle under the desktop header, and no line under the mobile one. */
.home .wp-site-blocks > .wp-block-template-part:has(> .site-header) { border-bottom: 0; background: url(assets/images/squiggle.svg) center bottom / 96px 10px round no-repeat content-box #fff; }
body.home .wp-site-blocks .feastmobilenavbar { border-bottom: 0; }

/* Homepage: even space above and below the tagline. */
@media (min-width: 783px) {
	.home .entry-header { padding-top: 14px; }
	.home .entry-content > .wv-section:first-child { padding-top: 3px; }
}
/* Lines the logo's lowercase letters up with the menu. */
@media (min-width: 1200px) {
	body .site-title img { position: relative; top: 5px; }
}

/* Keep the phone menu's close button solid, even when it's touched. */
body .mmm-content .closebtn, body .mmm-content .closebtn:is(:hover, :focus) { opacity: 1 !important; }
/* No list dots beside the Apple Pay and Google Pay buttons. */
body .wc-block-components-express-payment__event-buttons > li { list-style: none !important; }
body .wc-block-components-express-payment__event-buttons > li::marker { content: ""; }
body .wc-block-components-express-payment__event-buttons > li::before { display: none !important; }
