/* Cookathon Custom – all site CSS lives here (look and feel, feature styles).
   Loaded after the theme, versioned by file modification time.
   One commented section per feature. The child theme style.css stays empty. */

/* Recipe submission form (module inc/20-recipe-submission-form.php) */
.wpzrcb-submit-form .cookathon-rs-hint {
	margin: 0 0 0.75em;
	font-size: 0.9em;
	opacity: 0.8;
}

/* Even spacing between form sections. The plugin's other sections end with an
   element that has a 50px bottom margin; the Food Labels list (the plugin's bare
   <select>, or the fixed list of module inc/35-recipe-submission-food-labels.php)
   has none, so the Ingredients heading overlapped it. */
.wpzrcb-submit-form .wpzrcb-submit-form-fields > fieldset > select:last-child,
.wpzrcb-submit-form .wpzrcb-submit-form-fields > fieldset > .cookathon-food-labels:last-child {
	margin-bottom: 50px;
}

/* Food Labels: seven choices in the plugin's pill style (as Difficulty); they wrap
   onto further rows instead of running off a narrow screen. */
.wpzrcb-submit-form .wpzrcb-submit-form-fields .wpzrcb-label-radios.cookathon-food-labels {
	flex-wrap: wrap;
	gap: 12px;
}
.wpzrcb-submit-form .wpzrcb-submit-form-fields .cookathon-food-labels label {
	flex: 0 0 auto;
	width: auto; /* the plugin makes every label of the form full width */
	white-space: nowrap;
}
.wpzrcb-submit-form .wpzrcb-submit-form-fields .cookathon-food-labels label input:focus-visible {
	outline: 2px solid #212121;
	outline-offset: 2px;
}

/* Recipe submission consent (module inc/40-recipe-submission-consent.php)
   Selectors include .wpzrcb-submit-form-fields to match the plugin's own field rules,
   which otherwise turn every label and input into a full-width block. */
.wpzrcb-submit-form .wpzrcb-submit-form-fields label.cookathon-consent-check {
	display: flex;
	align-items: flex-start;
	gap: 0.75em;
	font-weight: 400;
	line-height: 1.5;
}
.wpzrcb-submit-form .wpzrcb-submit-form-fields .cookathon-consent-check input[type="checkbox"] {
	flex: 0 0 18px;
	margin: 0.2em 0 0;
}
.wpzrcb-submit-form .wpzrcb-submit-form-fields .cookathon-consent-age {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em 1.5em;
	margin: 0 0 30px;
}
.wpzrcb-submit-form .wpzrcb-submit-form-fields label.cookathon-consent-radio {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	width: auto;
	margin: 0;
	cursor: pointer;
}
.wpzrcb-submit-form .wpzrcb-submit-form-fields .cookathon-consent-radio input[type="radio"] {
	display: inline-block;
	width: 18px;
	height: 18px;
	margin: 0;
	padding: 0;
	accent-color: var(--wpzrcb-accent-color, #fc7e00);
	cursor: pointer;
}
.wpzrcb-submit-form .cookathon-consent-guardian[hidden] {
	display: none;
}
.wpzrcb-submit-form .wpzrcb-submit-form-submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Recipe likes (module inc/50-recipe-likes.php)
   .cookathon-like-row is the rating's parent (set by custom.js): rating and Like side by side. */
.cookathon-like-row,
.wp-block-wpzoom-recipe-card-block-recipe-card .recipe-card-heading .recipe-card-rating-wrap.cookathon-like-row {
	/* The second selector matches the recipe card skin's own grid rule for the rating wrap. */
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: 0.75em;
}
.cookathon-like {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	margin: 0.25em 0;
	padding: 0.3em 0.8em;
	border: 1px solid #d9d9d9;
	border-radius: 999px;
	background: #fff;
	color: #333;
	font: inherit;
	font-size: 0.9em;
	line-height: 1.2;
	vertical-align: middle;
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.cookathon-like[hidden] {
	display: none;
}
.cookathon-like svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}
/* Full border and background in every state: the theme's button:hover sets a grey
   background and removes the border. */
.cookathon-like:hover,
.cookathon-like:focus-visible {
	border: 1px solid #fc7e00;
	background: #fff;
	color: #fc7e00;
}
.cookathon-like.is-liked,
.cookathon-like.is-liked:hover,
.cookathon-like.is-liked:focus-visible {
	border: 1px solid #fc7e00;
	background: #fff4ea;
	color: #fc7e00;
}
.cookathon-like.is-liked svg {
	fill: currentColor;
}
.cookathon-like:disabled {
	opacity: 0.6;
	cursor: progress;
}
.cookathon-like .cookathon-like-count {
	font-weight: 600;
}
/* Compact button inside the recipe card, where the rating column is narrow (about 300px). */
.wp-block-wpzoom-recipe-card-block-recipe-card .recipe-card-heading .recipe-card-rating-wrap.cookathon-like-row {
	column-gap: 0.5em;
}
.wp-block-wpzoom-recipe-card-block-recipe-card .cookathon-like {
	gap: 0.3em;
	padding: 0.2em 0.6em;
	font-size: 0.85em;
}
.wp-block-wpzoom-recipe-card-block-recipe-card .cookathon-like svg {
	width: 15px;
	height: 15px;
}

/* Mobile and tablet (theme look) -------------------------------------------------
   Header logo: below 979px the theme sets the logo image to width:auto; the SVG logo has
   no intrinsic width, so inside the shrink-to-fit header it collapsed to 0px and the logo
   disappeared on phones and tablets. A fixed width (desktop size) brings it back. */
@media screen and (max-width: 979px) {
	.headroom .navbar-brand-wpz img.custom-logo {
		width: 180px;
		max-width: none;
	}
}

/* Recipe submission form on phones (modules inc/20 and inc/40) */
@media screen and (max-width: 600px) {
	/* Ingredient rows: the name is the longest value, give it half of the row. */
	.wpzrcb-submit-form .wpzrcb-submit-form-field-ingredients th:first-child,
	.wpzrcb-submit-form .wpzrcb-submit-form-field-ingredients td:first-child {
		width: 50%;
	}
	/* "Are you under 16?": question on its own line, Yes and No together below it. */
	.wpzrcb-submit-form .wpzrcb-submit-form-fields .cookathon-consent-question {
		flex-basis: 100%;
	}
	/* Guardian name and email one below the other: the long email label wrapped to three
	   lines in two columns and pushed its field out of line. */
	.wpzrcb-submit-form .wpzrcb-submit-form-fields .cookathon-consent-guardian .two-columns {
		grid-template-columns: 1fr;
		gap: 0;
	}
}

/* Touch screens have no hover: the plugin shows the "Remove" button of an ingredient row or
   step only on hover or while a field of that row has focus, so on phones an extra empty row
   could not be found to remove (and an empty required ingredient row blocks submitting). */
@media (hover: none) {
	.wpzrcb-submit-form .button.wpzrcb-field-remove {
		opacity: 1;
	}
}

/* Previous / next post at the bottom of a post: the theme draws the < and > arrows as
   decoration outside the links, so clicking them did nothing. The title link is stretched
   over the whole half (arrow, image, title), so any click there opens that post. */
.prevnext .prevnext_container .prevnext_title {
	position: static;
}
.prevnext .prevnext_container .prevnext_title::after {
	content: "";
	position: absolute;
	inset: 0;
}
.prevnext .prevnext_container:hover .prevnext_title {
	text-decoration: underline;
}
/* Below 1200 px the theme hides the "next post" half (media-queries.min.css), so on tablets and
   phones one could only go back. Both halves stay, one below the other. */
@media screen and (max-width: 1200px) {
	.prevnext div.next_post_pag {
		display: block;
		float: none;
		width: 100%;
		padding-left: 0;
		border-left: 0;
		border-top: 1px solid #eee;
		margin-top: 20px;
		padding-top: 20px;
	}
}

/* Recipe submission feedback (module inc/45-recipe-submission-feedback.php)
   1. Result notice above the form: the plugin's notice was plain text on white and the page
      scrolled it under the fixed menu bar, so neither the confirmation nor an error was seen. */
.wpzrcb-submit-form #wpzrcb-notice {
	scroll-margin-top: 140px;
	margin: 0 0 30px;
	padding: 18px 22px;
	border: 1px solid #c62828;
	border-left-width: 6px;
	border-radius: 6px;
	background: #fdecea;
	color: #5f1412;
	font-size: 17px;
	line-height: 1.5;
}
.wpzrcb-submit-form #wpzrcb-notice.success {
	border-color: #2e7d32;
	background: #edf7ed;
	color: #1b3d1e;
}
.wpzrcb-submit-form #wpzrcb-notice:focus {
	outline: none;
}
.wpzrcb-submit-form #wpzrcb-notice p {
	margin: 0;
}
.wpzrcb-submit-form #wpzrcb-notice p + p {
	margin-top: 6px;
}
.wpzrcb-submit-form #wpzrcb-notice.success p:first-child::before {
	content: "\2713";
	display: inline-block;
	margin-right: 10px;
	font-weight: 700;
}

/* 2. Submit button while the recipe is being sent: the darker part grows with the upload. */
.wpzrcb-submit-form .wpzrcb-submit-form-submit.is-uploading,
.wpzrcb-submit-form .wpzrcb-submit-form-submit.is-uploading:disabled {
	min-width: 15em;
	opacity: 1;
	filter: none;
	cursor: progress;
	background-image: linear-gradient( to right, rgba( 0, 0, 0, 0.28 ) var( --cookathon-upload, 0% ), rgba( 0, 0, 0, 0 ) var( --cookathon-upload, 0% ) );
}
.wpzrcb-submit-form .cookathon-rs-status {
	display: block;
	margin: -8px 0 20px;
	font-size: 15px;
	color: #555;
}
.wpzrcb-submit-form .cookathon-rs-status:empty {
	display: none;
}
.wpzrcb-submit-form .cookathon-rs-status.is-error {
	color: #c62828;
	font-weight: 600;
}

/* Recipe title lists: Latest Recipes widget (module inc/90-latest-recipes-widget.php) and the
   theme's Most Viewed / Most Popular list in the footer
   --------------------------------------------------------------------------- */
/* A thin line between the items, as the theme draws it between the items of the Most Viewed
   tab in the sidebar (.widget .tabbertab li: 10px padding and margin below, 1px #f0f0f0 line).
   The theme leaves the line out when the list stands on its own, outside the tabs. */
.widget.cookathon-latest-recipes ol li,
.footer-widgets .widget.popular-recipes ol li {
	position: relative;
	padding-bottom: 10px;
	margin-bottom: 10px;
}
.widget.cookathon-latest-recipes ol li::after,
.footer-widgets .widget.popular-recipes ol li::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	border-bottom: 1px solid #f0f0f0;
}
.widget.cookathon-latest-recipes ol li:last-child,
.footer-widgets .widget.popular-recipes ol li:last-child {
	padding-bottom: 0;
	margin-bottom: 0;
}
.widget.cookathon-latest-recipes ol li:last-child::after,
.footer-widgets .widget.popular-recipes ol li:last-child::after {
	border-bottom: none;
}
