/*
Theme Name:   Advenz
Description:  A quiet, minimalist block theme for advenz.com: resources, reflections, sermons, music and the Advenz apps, in soft blues.
Author:       Advenz
Version:      0.1.4
Requires at least: 6.5
Requires PHP: 8.1
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  advenz
*/

/* ---- Cards: the topic and app tiles on the home page and the post cards ---- */
.advenz-topic, .advenz-app {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
	transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.advenz-topic:hover, .advenz-topic:focus-within, .advenz-app:hover, .advenz-app:focus-within {
	border-color: var(--wp--preset--color--sky-deep);
	box-shadow: 0 8px 22px rgba(20, 52, 79, .08);
	transform: translateY(-2px);
}
.advenz-topic h3 a, .advenz-app h3 a { text-decoration: none; color: inherit; }
.advenz-topic h3 a::after { content: ""; position: absolute; inset: 0; } /* the whole tile is the link */
.advenz-topic { position: relative; }
.advenz-card .wp-block-post-featured-image img { transition: transform .25s ease; }
.advenz-card:hover .wp-block-post-featured-image img { transform: scale(1.02); }
.advenz-card .wp-block-post-featured-image { overflow: hidden; border-radius: var(--wp--custom--radius); background: var(--wp--preset--color--sky); }
/* Pictures come in every shape (posters, banners, squares): the box keeps one shape so the grid stays tidy, the picture
   inside is shown WHOLE, and a blurred copy of it fills the rest of the box (functions.php sets --advenz-bg). */
.advenz-card .wp-block-post-featured-image, .advenz-single-image { position: relative; isolation: isolate; }
.advenz-card .wp-block-post-featured-image::before, .advenz-single-image::before {
	content: ""; position: absolute; inset: -16px; z-index: -1;
	background: var(--advenz-bg, none) center / cover no-repeat;
	filter: blur(18px) saturate(1.1); opacity: .6;
}
.advenz-card .wp-block-post-featured-image a { display: block; }
.advenz-card .wp-block-post-featured-image img { object-fit: contain !important; width: 100% !important; height: 100% !important; aspect-ratio: auto !important; }
.advenz-card .wp-block-post-featured-image { aspect-ratio: 16 / 10; }
.advenz-card .wp-block-post-featured-image a, .advenz-card .wp-block-post-featured-image > img { height: 100%; }
.advenz-card .wp-block-post-terms a { text-decoration: none; }
.advenz-card .wp-block-post-title { margin-block: 0; }
.advenz-card .wp-block-post-title a { text-decoration: none; }

/* ---- Small things ---- */
.advenz-plain-list { list-style: none; padding: 0; margin: .5rem 0 0; }
.advenz-plain-list li { margin: .35rem 0; }
.advenz-plain-list a { text-decoration: none; color: var(--wp--preset--color--ink); }
.advenz-plain-list a:hover { color: var(--wp--preset--color--blue); text-decoration: underline; }
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--blue);
	border: 2px solid var(--wp--preset--color--blue);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--blue); color: #fff; }
.wp-block-query-pagination { gap: .5rem; font-weight: 600; }
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers { text-decoration: none; padding: .25rem .6rem; border-radius: 6px; }
.wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--sky-deep); }
:where(a, button, input, .wp-block-search__button):focus-visible { outline: 3px solid var(--wp--preset--color--sky-deep); outline-offset: 2px; border-radius: 4px; }
.wp-block-search__inside-wrapper { border-radius: 999px; }
.wp-block-search__input { border-radius: 999px; border: 1px solid var(--wp--preset--color--line); padding: .5rem 1rem; background: #fff; }

/* ---- Years of posts written in older editors: keep their pictures, videos and tables inside the page ---- */
.advenz-content img { max-width: 100%; height: auto; border-radius: 6px; }
.advenz-content iframe, .advenz-content video, .advenz-content embed, .advenz-content object { max-width: 100%; }
.advenz-content iframe[src*="youtube"], .advenz-content iframe[src*="vimeo"] { width: 100%; aspect-ratio: 16 / 9; height: auto; }
.advenz-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.advenz-content td, .advenz-content th { padding: .4rem .6rem; border: 1px solid var(--wp--preset--color--line); }
.advenz-content .aligncenter, .advenz-content img.aligncenter { display: block; margin-inline: auto; }
.advenz-content .alignleft { float: left; margin: .25rem 1.25rem 1rem 0; max-width: 50%; }
.advenz-content .alignright { float: right; margin: .25rem 0 1rem 1.25rem; max-width: 50%; }
.advenz-content .wp-caption { max-width: 100%; }
.advenz-content .wp-caption-text, .advenz-content figcaption { font-size: .875rem; color: var(--wp--preset--color--muted); text-align: center; }
.advenz-content h2, .advenz-content h3 { margin-top: 2.2rem; }
.advenz-content::after { content: ""; display: table; clear: both; }
@media (max-width: 600px) {
	.advenz-content .alignleft, .advenz-content .alignright { float: none; display: block; margin: 1rem auto; max-width: 100%; }
}

/* ---- Posts without a picture (most sermons) get a quiet text card instead of an empty box ---- */
.advenz-card .wp-block-post-featured-image:not(:has(img)) { display: none; }
.advenz-card:not(:has(img)) {
	padding: 1.25rem 1.4rem 1.3rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-left: 4px solid var(--wp--preset--color--sky-deep);
	border-radius: var(--wp--custom--radius);
}
.advenz-card:not(:has(img)):hover { border-left-color: var(--wp--preset--color--blue); }

/* ---- Card grids: 3 columns on a wide screen, 2 on a tablet, 1 on a phone (the sizes hint above assumes this) ---- */
@media (max-width: 899px) { .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .wp-block-post-template.is-layout-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- The featured picture at the top of a post: shown whole (posters are often tall), on a soft blue ground ---- */
.advenz-single-image { margin-block: .5rem 1rem; background: var(--wp--preset--color--sky); border-radius: var(--wp--custom--radius); overflow: hidden; }
.advenz-single-image img { display: block; width: auto !important; height: auto !important; max-width: 100%; max-height: min(72vh, 620px); aspect-ratio: auto !important; margin-inline: auto; object-fit: contain !important; }

/* ---- A list of cards needs the wide column, not the reading one ---- */
.advenz-content > .advenz-list { max-width: var(--wp--style--global--wide-size, 1120px); }

/* ---- The Advenz Tech catalog ([advenz_apps], plugin advenz-site): jump links, then a wide card area per platform ---- */
.advenz-apps-nav { display: flex; flex-wrap: wrap; gap: .6rem; margin: 2rem auto 1rem; max-width: var(--wp--style--global--content-size, 700px); }
.advenz-apps-nav a {
	padding: .45rem 1.1rem;
	font-size: .95rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--wp--preset--color--blue);
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.advenz-apps-nav a:hover, .advenz-apps-nav a:focus-visible { color: #fff; background: var(--wp--preset--color--blue); border-color: var(--wp--preset--color--blue); }
.advenz-content > .advenz-apps-section { max-width: var(--wp--style--global--wide-size, 1120px); margin-top: 2.5rem; scroll-margin-top: 1.5rem; }
.advenz-apps-section > h2, .advenz-apps-section > .advenz-apps-lead { max-width: var(--wp--style--global--content-size, 700px); margin-inline: auto; }
.advenz-apps-section > h2 { margin-top: 0; }
.advenz-apps-lead { color: var(--wp--preset--color--muted); margin-bottom: 1.2rem; }

/* ---- Comments (single.html): a thread of quiet cards, replies indented under their parent ---- */
.advenz-comments { margin-top: 2.5rem; }
.advenz-comments .wp-block-comments-title { font-size: 1.5rem; margin-bottom: 1.25rem; }
.advenz-comments .wp-block-comment-template { list-style: none; margin: 0; padding: 0; }
.advenz-comments .wp-block-comment-template > li { margin: 0 0 1rem; }
.advenz-comments .wp-block-comment-template ol { list-style: none; margin: 1rem 0 0; padding: 0 0 0 1.25rem; border-left: 3px solid var(--wp--preset--color--sky-deep); }
.advenz-comments .wp-block-comment-template ol > li { margin: 0 0 .85rem; }
.advenz-comment {
	padding: 1rem 1.15rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
	overflow-wrap: anywhere;
}
.advenz-comment .wp-block-avatar img { border-radius: 50%; display: block; }
.advenz-comment .wp-block-comment-author-name { font-weight: 700; font-size: .98rem; line-height: 1.2; }
.advenz-comment .wp-block-comment-author-name a { color: inherit; text-decoration: none; }
.advenz-comment .wp-block-comment-date, .advenz-comment .wp-block-comment-date a { font-size: .8rem; color: var(--wp--preset--color--muted); text-decoration: none; }
.advenz-comment .wp-block-comment-content { margin-top: .6rem; font-size: .98rem; }
.advenz-comment .wp-block-comment-content p { margin: 0 0 .6rem; }
.advenz-comment .wp-block-comment-content img { max-width: 100%; height: auto; }
.advenz-comment .wp-block-comment-reply-link a, .advenz-comment .wp-block-comment-edit-link a { font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--wp--preset--color--blue); }
.advenz-comment .wp-block-comment-reply-link a:hover { text-decoration: underline; }
.advenz-comment .wp-block-comment-edit-link { font-size: .85rem; }
.advenz-comments .wp-block-comments-pagination { margin: 1.25rem 0; gap: 1rem; font-weight: 600; }
.advenz-comments .wp-block-comments-pagination a { text-decoration: none; }
.advenz-comments .comment-respond { margin-top: 2rem; padding: 1.4rem; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius); }
.advenz-comments .comment-reply-title { font-family: var(--wp--preset--font-family--heading, inherit); font-size: 1.3rem; margin: 0 0 .75rem; }
.advenz-comments .comment-reply-title small { font-size: .85rem; margin-left: .5rem; }
.advenz-comments .comment-form { display: grid; gap: .9rem; }
.advenz-comments .comment-form p { margin: 0; }
.advenz-comments .comment-notes, .advenz-comments .logged-in-as { font-size: .88rem; color: var(--wp--preset--color--muted); }
.advenz-comments .comment-form label { display: block; margin-bottom: .3rem; font-weight: 600; font-size: .92rem; }
.advenz-comments .comment-form-cookies-consent { display: flex; gap: .5rem; align-items: baseline; font-size: .88rem; }
.advenz-comments .comment-form-cookies-consent label { display: inline; font-weight: 400; margin: 0; }

/* ---- Forms: text fields, the comment form and the Jetpack contact form share one look ---- */
.advenz-comments .comment-form :is(input[type=text], input[type=email], input[type=url], textarea),
.jetpack-contact-form-container :is(input.grunion-field, textarea.grunion-field, select) {
	width: 100%; box-sizing: border-box; padding: .7rem .9rem;
	font: inherit; color: var(--wp--preset--color--ink);
	background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 8px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.advenz-comments .comment-form textarea, .jetpack-contact-form-container textarea.grunion-field { min-height: 8.5rem; resize: vertical; }
.advenz-comments .comment-form :is(input, textarea):focus, .jetpack-contact-form-container :is(input, textarea, select):focus {
	outline: none; border-color: var(--wp--preset--color--blue); box-shadow: 0 0 0 3px rgba(36, 93, 148, .18);
}
.advenz-comments .comment-form .form-submit .submit, .jetpack-contact-form-container .pushbutton-wide, .jetpack-contact-form-container .contact-submit button {
	padding: .75rem 1.6rem; font: inherit; font-weight: 700; color: #fff; cursor: pointer;
	background: var(--wp--preset--color--blue); border: 0; border-radius: 999px;
	transition: background-color .15s ease, transform .15s ease;
}
.advenz-comments .comment-form .form-submit .submit:hover, .jetpack-contact-form-container .pushbutton-wide:hover { background: var(--wp--preset--color--blue-dark); transform: translateY(-1px); }

.jetpack-contact-form-container { max-width: 640px; margin-inline: auto; padding: 1.6rem; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(20, 52, 79, .06); }
.jetpack-contact-form-container form.contact-form { display: grid; gap: 1.1rem; margin: 0; }
.jetpack-contact-form-container .grunion-field-wrap { margin: 0; }
.jetpack-contact-form-container .grunion-field-label { display: block; margin: 0 0 .35rem; font-weight: 600; font-size: .92rem; color: var(--wp--preset--color--blue-dark); }
.jetpack-contact-form-container .grunion-label-required { margin-left: .35rem; font-weight: 400; font-size: .78rem; color: var(--wp--preset--color--muted); }
.jetpack-contact-form-container .contact-form__select-element-wrapper { position: relative; display: block; }
.jetpack-contact-form-container .contact-form__select-wrapper { padding: 0; border: 0; background: none; }
/* Jetpack styles its own select and arrow with rules of its own: these need the extra weight */
.jetpack-contact-form-container form.contact-form .contact-form__select-wrapper select { appearance: none !important; -webkit-appearance: none !important; display: block; width: 100% !important; height: auto !important; min-height: 0 !important; margin: 0; padding: .7rem 2.4rem .7rem .9rem !important; font: inherit; color: var(--wp--preset--color--ink); background: #fff !important; border: 1px solid var(--wp--preset--color--line) !important; border-radius: 8px !important; box-sizing: border-box; }
.jetpack-contact-form-container form.contact-form .contact-form__select-wrapper select:focus { outline: none; border-color: var(--wp--preset--color--blue) !important; box-shadow: 0 0 0 3px rgba(36, 93, 148, .18); }
.jetpack-contact-form-container .contact-form__select-wrapper { margin: 0; padding: 0 !important; border: 0 !important; background: none !important; }
.jetpack-contact-form-container .contact-form__select-element-wrapper { position: relative; display: block; width: 100%; }
.jetpack-contact-form-container .jetpack-field-dropdown__icon { position: absolute !important; right: 1.1rem !important; left: auto !important; top: 50% !important; width: .55rem !important; height: .55rem !important; margin: -.45rem 0 0 !important; background: none !important; border: solid var(--wp--preset--color--muted) !important; border-width: 0 2px 2px 0 !important; transform: rotate(45deg); pointer-events: none; }
.jetpack-contact-form-container .jetpack-field-dropdown__icon::before, .jetpack-contact-form-container .jetpack-field-dropdown__icon::after { display: none !important; }
.jetpack-contact-form-container .contact-form__input-error { color: #a3261d; font-size: .85rem; margin-top: .3rem; }
.jetpack-contact-form-container .contact-form__warning-icon { display: none; }
.jetpack-contact-form-container .contact-form__input-error.has-errors .contact-form__warning-icon { display: inline-block; vertical-align: -2px; margin-right: .25rem; fill: currentColor; }
.jetpack-contact-form-container .contact-form__error { color: #a3261d; }
.jetpack-contact-form-container .contact-submit { margin: 0; }
.jetpack-contact-form-container .contact-form-submission { padding: 1rem 0; text-align: center; }
.jetpack-contact-form-container .contact-form-submission .go-back-message { text-align: left; font-size: .9rem; }
.jetpack-contact-form-container .contact-form-submission h4 { font-size: 1.3rem; color: var(--wp--preset--color--blue-dark); }
@media (max-width: 600px) { .jetpack-contact-form-container { padding: 1.1rem; border-radius: 10px; } }

/* ---- Advenz Records page (plain HTML in the page, so the classic editor can still edit it; see setup/advenz-records-page.php) ---- */
.advenz-content > .rec-wide { max-width: var(--wp--style--global--wide-size, 1120px); margin-top: 2.5rem; }
.rec-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center; padding: 2rem; background: var(--wp--preset--color--sky); border-radius: 16px; }
.rec-hero > div > * { margin-block: 0 1rem; }
.rec-eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--wp--preset--color--blue); }
.rec-hero h2 { margin-top: 0 !important; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.15; }
.rec-hero p { font-size: 1.05rem; }
.rec-hero img { width: 100%; height: auto; border-radius: 12px; display: block; box-shadow: 0 14px 34px rgba(20, 52, 79, .18); }
.rec-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 0 !important; }
.rec-btn { display: inline-block; padding: .7rem 1.5rem; font-weight: 700; text-decoration: none; border-radius: 999px; color: #fff; background: var(--wp--preset--color--blue); border: 2px solid var(--wp--preset--color--blue); transition: background-color .15s ease, color .15s ease; }
.rec-btn:hover { background: var(--wp--preset--color--blue-dark); border-color: var(--wp--preset--color--blue-dark); color: #fff; }
.rec-btn.is-ghost { background: transparent; color: var(--wp--preset--color--blue); }
.rec-btn.is-ghost:hover { background: var(--wp--preset--color--blue); color: #fff; }
.rec-section > h2 { margin-top: 0; }
.rec-section > h2 + p { color: var(--wp--preset--color--muted); max-width: 46rem; }
.rec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }
@media (max-width: 899px) { .rec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .rec-grid { grid-template-columns: minmax(0, 1fr); } }
.rec-card { padding: 1.3rem 1.35rem; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.rec-card:hover { border-color: var(--wp--preset--color--sky-deep); box-shadow: 0 8px 22px rgba(20, 52, 79, .08); transform: translateY(-2px); }
.rec-card .rec-icon { font-variant-emoji: emoji; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; margin-bottom: .7rem; font-size: 1.35rem; background: var(--wp--preset--color--sky); border-radius: 10px; }
.rec-card h3 { margin: 0 0 .35rem; font-size: 1.12rem; }
.rec-card p { margin: 0; font-size: .95rem; color: var(--wp--preset--color--muted); }
.rec-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.rec-split > div { padding: 1.5rem; border-radius: 14px; background: var(--wp--preset--color--sky); }
.rec-split > div:last-child { background: var(--wp--preset--color--blue-dark); color: #fff; }
.rec-split > div:last-child h3, .rec-split > div:last-child li::marker { color: #fff; }
.rec-split h3 { margin: 0 0 .5rem; }
.rec-split ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.rec-split li { margin: .3rem 0; }
.rec-steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: 1rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.rec-steps li { counter-increment: step; position: relative; padding: 1.1rem 1.1rem 1.1rem 1.1rem; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius); font-size: .95rem; }
.rec-steps li::before { content: counter(step); display: grid; place-items: center; width: 1.9rem; height: 1.9rem; margin-bottom: .55rem; font-weight: 700; color: #fff; background: var(--wp--preset--color--blue); border-radius: 50%; }
.rec-steps strong { display: block; margin-bottom: .2rem; font-size: 1.02rem; }
.rec-contact { text-align: center; scroll-margin-top: 1.5rem; }
.rec-contact > h2, .rec-contact > p { max-width: 40rem; margin-inline: auto; }
.rec-contact > p { color: var(--wp--preset--color--muted); }
@media (max-width: 780px) { .rec-hero { grid-template-columns: 1fr; padding: 1.4rem; } }
@media (max-width: 600px) { .advenz-comments .wp-block-comment-template ol { padding-left: .6rem; } .advenz-comment { padding: .85rem .9rem; } }
.jetpack-contact-form-container .contact-form__error.show-errors { margin: 0; padding: .7rem 1rem; color: #8a1f17 !important; background: #fdecea !important; border: 1px solid #f3c1bb; border-radius: 8px; }
