/*
 * Sujok theme: component styles that theme.json cannot express.
 * Colours come from the palette (var(--wp--preset--color--*)), so changing a colour
 * in Appearance → Editor → Styles changes it here too.
 */

:root {
	--sj-green: var(--wp--preset--color--green);
	--sj-ochre: var(--wp--preset--color--ochre);
	--sj-line: var(--wp--preset--color--line);
	--sj-soft: var(--wp--preset--color--soft);
	--sj-card: var(--wp--preset--color--card);
	--sj-paper: var(--wp--preset--color--paper);
	--sj-paper-2: var(--wp--preset--color--paper-2);
	--sj-shadow: 0 8px 24px rgba(60, 40, 10, .10);
}

html { -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; }
img { height: auto; }
.wp-site-blocks > * + * { margin-block-start: 0; }

/* ---------- Block styles ---------- */
.is-style-kicker {
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--green-2);
	margin-bottom: .4rem !important;
}
.wp-block-group.is-style-card {
	background: var(--sj-card);
	border: 1px solid var(--sj-line);
	border-radius: 22px;
	padding: clamp(20px, 3vw, 28px);
	box-shadow: var(--sj-shadow);
}
.wp-block-button.is-style-light .wp-block-button__link {
	background: rgba(255, 250, 242, .94);
	color: var(--wp--preset--color--ink);
}
.wp-block-button.is-style-light .wp-block-button__link:hover { background: #fff; }
.wp-block-button.is-style-ochre .wp-block-button__link {
	background: var(--sj-ochre);
	color: var(--wp--preset--color--ink);
}
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--sj-green);
	border: 2px solid currentColor;
	padding-top: calc(.8rem - 2px);
	padding-bottom: calc(.8rem - 2px);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--sj-green); color: #fff; border-color: var(--sj-green); }
.wp-block-image.is-style-framed img {
	background: #fff;
	border-radius: 22px;
	padding: 20px;
	box-shadow: var(--sj-shadow);
}
.sj-more a { font-weight: 600; text-decoration: none; }
.sj-more a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.sj-topbar p { margin: 0; }
.sj-topbar a { text-decoration: none; }
.sj-topbar a:hover { text-decoration: underline; }
.sj-header { position: relative; z-index: 20; }
.sj-header .wp-block-site-title { white-space: nowrap; }
.sj-header .wp-block-navigation a:hover { color: var(--sj-green); }
.sj-header .wp-block-navigation .wp-block-navigation-item__content {
	padding-block: 4px;
	border-bottom: 2px solid transparent;
}
.sj-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.sj-header .wp-block-navigation .wp-block-navigation-item__content:hover { border-color: var(--sj-ochre); }
.sj-header .wc-block-mini-cart__button,
.sj-header .wc-block-customer-account a {
	border: 1px solid var(--sj-line);
	background: var(--sj-card);
	border-radius: 999px;
	padding: 7px 12px;
	color: var(--wp--preset--color--ink);
}
.sj-header .wc-block-customer-account a { display: inline-flex; padding: 7px; }
@media (max-width: 599px) {
.sj-header .wp-block-navigation__responsive-container-open {
	width: 40px; height: 40px;
	border: 1px solid var(--sj-line); border-radius: 50%;
	background: var(--sj-card);
	display: inline-flex; align-items: center; justify-content: center;
}
}
.wp-block-navigation__responsive-container.is-menu-open { padding: 24px 20px; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { font-size: 1.25rem; gap: 14px; }

@media (max-width: 600px) {
	.sj-topbar .sj-topbar__mail { display: none; }
	.sj-header .wp-block-site-title { font-size: 1.9rem !important; }
	.sj-header .wc-block-customer-account { display: none; }
}

/* ---------- Hero ---------- */
.sj-hero { overflow: hidden; }
.sj-hero::before {
	content: "";
	position: absolute; inset: 0; z-index: 1;
	background: linear-gradient(90deg, rgba(44, 30, 12, .72) 0%, rgba(44, 30, 12, .38) 45%, rgba(44, 30, 12, 0) 75%);
	pointer-events: none;
}
.sj-hero::after {
	/* soft wave into the page background */
	content: "";
	position: absolute; left: 0; right: 0; bottom: -1px; height: 90px; z-index: 2;
	background: var(--sj-paper);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 90' preserveAspectRatio='none'%3E%3Cpath d='M0 52 C 180 10 340 86 560 54 S 930 8 1200 46 V 90 H 0 Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 90' preserveAspectRatio='none'%3E%3Cpath d='M0 52 C 180 10 340 86 560 54 S 930 8 1200 46 V 90 H 0 Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
	pointer-events: none;
}
.wp-block-cover.sj-hero .wp-block-cover__inner-container { z-index: 3; width: 100% !important; max-width: var(--wp--style--global--wide-size) !important; margin-inline: auto !important; }
.sj-hero .wp-block-cover__inner-container > * { margin-left: 0 !important; max-width: none; }
.sj-hero p { margin: 0; }
.sj-hero__brand { line-height: .95 !important; text-shadow: 0 2px 14px rgba(0, 0, 0, .3); }
.sj-hero__tagline { font-family: var(--wp--preset--font-family--body, inherit) !important; font-weight: 500 !important; letter-spacing: .04em; line-height: 1.4 !important; margin: 14px 0 0 !important; text-shadow: none; }
.sj-hero__tagline::after { display: none !important; }
.sj-hero__claim { font-size: clamp(1.25rem, 2.4vw, 1.7rem); line-height: 1.35; margin-top: 26px !important; max-width: 24ch; }

@media (max-width: 600px) {
	.sj-hero { min-height: 560px !important; align-items: flex-end !important; padding-top: 60px !important; padding-bottom: 100px !important; }
	.sj-hero .wp-block-cover__image-background { object-position: 82% 40% !important; }
	.sj-hero::before { background: linear-gradient(0deg, rgba(44, 30, 12, .8) 0%, rgba(44, 30, 12, .35) 60%, rgba(44, 30, 12, .12) 100%); }
}

/* ---------- Three paths ---------- */
.sj-paths > .wp-block-column { display: flex; }
.sj-path { position: relative; flex: 1; min-height: 250px; transition: transform .2s ease, box-shadow .2s ease; }
.sj-path:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(60, 40, 10, .18); }
.sj-path p { margin: 0; }
.sj-path .sj-path__go { margin-top: auto !important; font-weight: 600; }
.sj-path .sj-path__go a { text-decoration: none; }
.sj-path .sj-path__go a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.sj-path .wp-block-heading { margin: 4px 0 0; }
.sj-path__icon { display: block; }
@media (max-width: 781px) {
	.sj-path { min-height: 0; }
}

/* ---------- Post cards ---------- */
.sj-cards { list-style: none; padding: 0; }
.sj-card { height: 100%; overflow: hidden; padding: 0 !important; transition: box-shadow .2s ease; }
.sj-card:hover { box-shadow: var(--sj-shadow); }
.sj-card > .wp-block-post-featured-image { margin: 0; }
.sj-card > .wp-block-post-featured-image img { transition: transform .4s ease; }
.sj-card:hover > .wp-block-post-featured-image img { transform: scale(1.03); }
.sj-card__body { flex: 1; }
.sj-card .wp-block-post-title { margin: 0; }
.sj-card .wp-block-post-excerpt { display: flex; flex-direction: column; flex: 1; margin: 0; }
.sj-card .wp-block-post-excerpt__excerpt { margin: 0 0 10px; }
.sj-card .wp-block-post-excerpt__more-text { margin-top: auto; margin-bottom: 0; }
.sj-card .wp-block-post-excerpt__more-link { color: var(--sj-green); font-weight: 600; font-size: .95rem; text-decoration: none; }
.sj-card__cat { font-size: .75rem !important; letter-spacing: .08em; text-transform: uppercase; }
.sj-card__cat a { color: var(--wp--preset--color--clay); text-decoration: none; }
.sj-card .wp-block-post-featured-image:not(:has(img)) { display: none; }

/* ---------- Page head, blog ---------- */
.sj-pagehead .wp-block-post-title,
.sj-pagehead .wp-block-query-title { margin: 0; }
.sj-catlist { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sj-catlist li a {
	display: inline-block; padding: 5px 14px; border-radius: 999px;
	background: var(--sj-card); border: 1px solid var(--sj-line);
	color: var(--wp--preset--color--ink); text-decoration: none; font-size: .9rem;
}
.sj-catlist li a:hover { border-color: var(--sj-green); color: var(--sj-green); }
.sj-pager a, .sj-pager span.page-numbers { text-decoration: none; padding: 6px 12px; border-radius: 999px; }
.sj-pager .page-numbers.current { background: var(--sj-green); color: #fff; }
.sj-pager a:hover { background: var(--sj-paper-2); }
.sj-tags { font-size: .9rem; color: var(--sj-soft); margin-bottom: 20px; }
.sj-author .wp-block-image { flex: none; margin: 0; }
.sj-author .wp-block-heading { margin: 0; }
.sj-author p { margin: 0; }

/* Post content: images and tables from old posts */
.wp-block-post-content img { border-radius: 14px; }
.wp-block-post-content .alignleft { float: left; margin: .3em 1.6em 1em 0; }
.wp-block-post-content .alignright { float: right; margin: .3em 0 1em 1.6em; }
.wp-block-post-content table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.wp-block-post-content th, .wp-block-post-content td { border: 1px solid var(--sj-line); padding: 8px 10px; text-align: left; }
.wp-block-post-content::after { content: ""; display: table; clear: both; }
@media (max-width: 600px) {
	.wp-block-post-content .alignleft,
	.wp-block-post-content .alignright { float: none; margin: 1em auto; display: block; }
}

/* ---------- Newsletter (Mailchimp for WP form 3118) ---------- */
.sj-news .wp-block-heading { margin-bottom: 8px; }
.sj-news p { margin: 0; }
.sj-news .mc4wp-form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sj-news .mc4wp-form-fields p { margin: 0; }
.sj-news .mc4wp-form-fields p:first-child,
.sj-news .mc4wp-form-fields p:last-child { grid-column: 1 / -1; }
.sj-news .mc4wp-form-fields label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sj-news .mc4wp-form input { box-sizing: border-box; }
.sj-news .mc4wp-form input[type="email"],
.sj-news .mc4wp-form input[type="text"] {
	width: 100%; font: inherit; font-size: 1rem;
	border: 0; border-radius: 999px; padding: 12px 18px;
	background: var(--sj-card); color: var(--wp--preset--color--ink);
}
.sj-news .mc4wp-form input[type="submit"] {
	width: 100%; font: 600 1rem var(--wp--preset--font-family--body);
	border: 0; border-radius: 999px; padding: 13px; cursor: pointer;
	background: var(--sj-ochre); color: var(--wp--preset--color--ink);
}
.sj-news .mc4wp-form input[type="submit"]:hover { filter: brightness(1.06); }
.sj-news .mc4wp-response { margin-top: 10px; }
@media (max-width: 600px) {
	.sj-news .mc4wp-form-fields { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.sj-footer { position: relative; }
.sj-footer::before {
	content: "";
	position: absolute; left: 0; right: 0; top: -59px; height: 60px;
	background: var(--sj-paper-2);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 34 C 220 0 420 58 660 30 S 1010 4 1200 28 V 60 H 0 Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 34 C 220 0 420 58 660 30 S 1010 4 1200 28 V 60 H 0 Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
	pointer-events: none;
}
.sj-footer p { margin: 0; }
.sj-footer a { text-decoration: none; }
.sj-footer a:hover { color: var(--sj-green); }
.sj-footer__menu { color: var(--wp--preset--color--ink); font-weight: 500; }
.sj-footer__contact a { color: var(--wp--preset--color--ink); font-weight: 500; }
.sj-footer__bottom a { color: inherit; }
.sj-ico a { display: inline-flex; align-items: center; gap: 9px; }
.sj-ico a::before {
	content: ""; width: 18px; height: 18px; flex: none;
	background: var(--sj-green);
	-webkit-mask: var(--sj-ico) center / contain no-repeat;
	mask: var(--sj-ico) center / contain no-repeat;
}
.sj-ico--phone { --sj-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2'/%3E%3C/svg%3E"); }
.sj-ico--mail { --sj-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E"); }
.sj-footer__bottom { padding-right: 84px; }
@media (max-width: 781px) {
	.sj-footer__top { flex-direction: column; text-align: center; gap: 18px; }
	.sj-footer__brand { align-items: center !important; }
	.sj-footer__contact { flex-direction: column; align-items: center; gap: 6px !important; }
	.sj-footer__bottom { padding-right: 70px; }
}

/* ---------- WooCommerce ---------- */
.woocommerce-page .wp-block-post-content,
.wc-block-components-product-name { font-family: var(--wp--preset--font-family--body); }
.wc-block-components-button:not(.is-link),
.woocommerce .button, .woocommerce button.button, .woocommerce a.button, .woocommerce input.button {
	background: var(--sj-green) !important;
	color: #fff !important;
	border-radius: 999px !important;
	font-weight: 600;
	border: 0;
}
.wc-block-components-button:not(.is-link):hover,
.woocommerce .button:hover { background: var(--wp--preset--color--green-2) !important; }
.wc-block-components-product-price, .woocommerce .price { color: var(--wp--preset--color--clay); font-weight: 600; }
.wc-block-components-sale-badge, .woocommerce span.onsale { background: var(--sj-ochre); color: var(--wp--preset--color--ink); border: 0; border-radius: 999px; }
.wc-block-product-template .wc-block-product,
.wp-block-woocommerce-product-template .wc-block-product {
	background: var(--sj-card); border: 1px solid var(--sj-line); border-radius: 20px; padding: 14px 14px 18px;
}
.wc-block-product .wc-block-components-product-image img { border-radius: 14px; }
.wp-block-woocommerce-product-collection .wp-block-post-title a { text-decoration: none; color: var(--wp--preset--color--ink); }
.wc-block-components-text-input input, .wc-block-components-textarea, .wc-blocks-components-select__select,
.woocommerce form .input-text { border-radius: 12px !important; border-color: var(--sj-line) !important; }

/* ---------- Legacy (Elementor) pages ---------- */
.sj-legacy-own-title .sj-pagehead,
.sj-own-title .sj-pagehead:not(.sj-pagehead--content) { display: none; }
.sj-legacy-page main > .wp-block-post-content { max-width: none !important; }
.sj-legacy-page .wp-block-post-content > .sj-legacy { max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }
.sj-legacy-page .wp-block-post-content { padding-top: 0 !important; }
.sj-legacy { margin-top: 0 !important; }

/* ---------- Soft transitions (fades) ---------- */

/* Beige band that fades in and out of the page background instead of a hard edge. */
.sj-band {
	background: linear-gradient(180deg, var(--sj-paper) 0%, var(--sj-paper-2) 18%, var(--sj-paper-2) 82%, var(--sj-paper) 100%);
}

/* Hand drawing beside the text (desktop) or tucked into the text (phone).
   multiply makes the white paper of the drawing disappear into the beige. */
.sj-corr { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); column-gap: clamp(32px, 5vw, 64px); align-items: start; }
.sj-corr > * { grid-column: 2; margin-block: 0 0.9rem; }
.sj-corr > .sj-corr__img { grid-column: 1; grid-row: 1 / span 7; align-self: center; margin: 0; position: relative; }
.sj-corr__img img { mix-blend-mode: multiply; border-radius: 0; max-height: 600px; width: auto; margin-inline: auto; }
@media (max-width: 781px) {
	.sj-corr { display: block; }
	.sj-corr > * { margin-block: 0 0.9rem; }
	.sj-corr > .sj-corr__img { float: right; width: 44%; max-width: 220px; margin: 4px 0 8px 16px; }
	.sj-corr::after { content: ""; display: table; clear: both; }
}

/* Page title bands fade into the page. */
.sj-pagehead { background: linear-gradient(180deg, var(--sj-paper-2) 0%, var(--sj-paper-2) 55%, var(--sj-paper) 100%) !important; }

/* Post header: the article photo with the same dark fade as the homepage. */
.sj-posthero { background: #3b3020; overflow: hidden; }
.sj-posthero::before {
	content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
	background: linear-gradient(0deg, rgba(36, 26, 12, .88) 0%, rgba(36, 26, 12, .55) 45%, rgba(36, 26, 12, .12) 100%);
}
.wp-block-cover.sj-posthero .wp-block-cover__inner-container { z-index: 3; width: 100% !important; max-width: var(--wp--style--global--content-size) !important; margin-inline: auto !important; }
.sj-posthero .wp-block-cover__inner-container > * { margin-left: 0 !important; max-width: none; }
.sj-posthero .wp-block-post-date, .sj-posthero .wp-block-post-author-name { color: inherit !important; }
.sj-posthero .wp-block-post-title { margin: 6px 0 10px; max-width: 22ch; text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.sj-posthero__cat a { color: #f0c27a; }
.sj-posthero__meta { color: rgba(255, 250, 242, .85); }
.sj-posthero__meta p { margin: 0; }
.sj-posthero::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 70px; z-index: 2; background: var(--sj-paper);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 90' preserveAspectRatio='none'%3E%3Cpath d='M0 52 C 180 10 340 86 560 54 S 930 8 1200 46 V 90 H 0 Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 90' preserveAspectRatio='none'%3E%3Cpath d='M0 52 C 180 10 340 86 560 54 S 930 8 1200 46 V 90 H 0 Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
}
.sj-posthero { padding-bottom: calc(var(--wp--preset--spacing--60) + 40px) !important; }

/* Blog cards: the photo melts into the card. */
.sj-card > .wp-block-post-featured-image { position: relative; }
.sj-card > .wp-block-post-featured-image::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; pointer-events: none;
	background: linear-gradient(180deg, rgba(255, 250, 242, 0), var(--sj-card));
}

/* Three paths: a little depth inside the coloured cards. */
.sj-path { background-image: linear-gradient(160deg, rgba(255, 255, 255, .10) 0%, rgba(255, 255, 255, 0) 40%, rgba(0, 0, 0, .18) 100%); }

/* Newsletter: the homepage photo behind a green fade. */
.sj-news {
	background-color: var(--sj-green) !important;
	background-image: linear-gradient(90deg, rgba(55, 94, 37, .98) 0%, rgba(55, 94, 37, .94) 45%, rgba(55, 94, 37, .62) 100%), url("../images/hero.jpg") !important;
	background-size: cover; background-position: right center;
}
@media (max-width: 781px) {
	.sj-news { background-image: linear-gradient(180deg, rgba(55, 94, 37, .97) 0%, rgba(55, 94, 37, .9) 60%, rgba(55, 94, 37, .7) 100%), url("../images/hero-phone.jpg") !important; background-position: center; }
}


/* ---------- Pages rebuilt in blocks ---------- */

/* Head band written into the page content: crumb, H1, lead. */
.sj-own-title main > .wp-block-post-content { padding-top: 0 !important; }
.wp-block-post-content > .sj-pagehead--content:first-child { margin-top: 0 !important; }
.sj-pagehead--content {
	padding-top: var(--wp--preset--spacing--50) !important;
	padding-bottom: var(--wp--preset--spacing--50) !important;
	margin-bottom: var(--wp--preset--spacing--40);
}
.sj-pagehead--content h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 .5rem; }
.sj-pagehead--content .sj-crumb { margin: 0 0 .6rem; }
.sj-pagehead--content .sj-crumb a { text-decoration: none; color: var(--sj-green); }
.sj-pagehead--content .sj-crumb a:hover { color: var(--wp--preset--color--clay); }
.sj-lead { font-size: 1.18rem; line-height: 1.6; color: var(--sj-soft); margin-top: .4rem; }

/* Pictures floated beside the text stay small; on phones they sit above it. */
.wp-block-post-content .wp-block-image.alignright,
.wp-block-post-content .wp-block-image.alignleft { max-width: min(300px, 42%); }
.wp-block-post-content .wp-block-image.alignright { margin: .3rem 0 1rem 1.6rem; }
.wp-block-post-content .wp-block-image.alignleft { margin: .3rem 1.6rem 1rem 0; }
.wp-block-post-content .wp-block-image img { border-radius: 14px; mix-blend-mode: multiply; }
.wp-block-post-content .wp-block-image:not(.alignleft):not(.alignright) { text-align: center; }
.wp-block-post-content .wp-block-image:not(.alignleft):not(.alignright) img { max-height: 520px; width: auto; }
@media (max-width: 599px) {
	.wp-block-post-content .wp-block-image.alignright,
	.wp-block-post-content .wp-block-image.alignleft { float: none; max-width: 100%; margin: 0 auto 1rem; text-align: center; }
}

/* "→ Related" line: links as soft pills. */
.sj-related { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .95rem; margin-top: var(--wp--preset--spacing--40) !important; }
.sj-related a {
	color: var(--wp--preset--color--ink); text-decoration: none;
	padding: 6px 14px; border-radius: 999px; background: var(--sj-card); border: 1px solid var(--sj-line);
}
.sj-related a:hover { border-color: var(--sj-green); color: var(--sj-green); }
.sj-related a:first-child::before { content: "→ "; color: var(--sj-green); }

/* Headings inside page text: a little ochre accent. */
.wp-block-post-content > h2.wp-block-heading { margin-top: var(--wp--preset--spacing--50); }
.wp-block-post-content > h2.wp-block-heading::after {
	content: ""; display: block; width: 46px; height: 3px; border-radius: 3px; margin-top: .45rem;
	background: var(--wp--preset--color--ochre);
}
.wp-block-post-content .wp-block-embed { margin-block: var(--wp--preset--spacing--40); }
.wp-block-post-content .wp-block-embed iframe { border-radius: 14px; }

/* Lesson calendar (was the Elementor price list). */
.sj-schedule { list-style: none; padding: 0; border-top: 1px solid var(--sj-line); }
.sj-schedule li { padding: 10px 2px; border-bottom: 1px dashed var(--sj-line); }
.sj-schedule li strong { color: var(--sj-green); font-weight: 600; }

/* Long words, links and old tables never push the page sideways on phones. */
.wp-block-post-content { overflow-wrap: anywhere; }
.wp-block-post-content table { display: block; max-width: 100%; overflow-x: auto; }

/* Comments under articles. */
.sj-comments { max-width: var(--wp--style--global--content-size); margin-inline: auto; }
.sj-comments .wp-block-comment-template { list-style: none; padding: 0; }
.sj-comments .wp-block-comment-template li { margin-bottom: 14px; }
.sj-comments .wp-block-comment-template ol { list-style: none; padding-left: 24px; margin-top: 14px; }
.sj-comments .comment-form input:not([type=submit]):not([type=checkbox]),
.sj-comments .comment-form textarea {
	width: 100%; box-sizing: border-box; padding: 10px 14px; border: 1px solid var(--sj-line);
	border-radius: 12px; background: var(--sj-card); font: inherit;
}
.sj-comments .comment-form label { display: block; font-size: .9rem; margin-bottom: 4px; color: var(--sj-soft); }
.sj-comments .comment-reply-title { font-family: var(--wp--preset--font-family--heading); font-size: 1.3rem; }

/* ---------- Inner pages in the homepage style ---------- */

/* Title band: section colour over the homepage photo, white text, wave into the page. */
.sj-hb {
	--sj-hb: 63, 107, 42;
	position: relative; overflow: hidden; color: #fff;
	background-color: rgb(var(--sj-hb)) !important;
	background-image: linear-gradient(90deg, rgba(var(--sj-hb), .97) 0%, rgba(var(--sj-hb), .92) 50%, rgba(var(--sj-hb), .55) 100%), url("../images/hero.jpg") !important;
	background-size: cover !important; background-position: right 40% !important;
	padding-top: clamp(48px, 7vw, 84px) !important;
	padding-bottom: clamp(84px, 10vw, 120px) !important;
	margin-bottom: var(--wp--preset--spacing--40);
}
.sj-hb--courses { --sj-hb: 160, 82, 48; }
.sj-hb--about { --sj-hb: 122, 92, 34; }
.sj-hb::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 70px; background: var(--sj-paper); pointer-events: none;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 90' preserveAspectRatio='none'%3E%3Cpath d='M0 52 C 180 10 340 86 560 54 S 930 8 1200 46 V 90 H 0 Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 90' preserveAspectRatio='none'%3E%3Cpath d='M0 52 C 180 10 340 86 560 54 S 930 8 1200 46 V 90 H 0 Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
}
.sj-hb > * { position: relative; z-index: 1; }
.sj-hb h1, .sj-hb .wp-block-post-title { color: #fff !important; text-shadow: 0 2px 14px rgba(0, 0, 0, .18); }
.sj-hb .sj-lead { color: rgba(255, 250, 242, .92); max-width: 62ch; }
.sj-hb .sj-lead a { color: #f6d9a6; }
.sj-hb .sj-crumb, .sj-hb .sj-crumb a { color: #f6d9a6 !important; }
.sj-hb .sj-crumb a:hover { color: #fff !important; }
.sj-has-band main > .wp-block-post-content { padding-top: 0 !important; }
@media (max-width: 781px) {
	.sj-hb { background-image: linear-gradient(180deg, rgba(var(--sj-hb), .96) 0%, rgba(var(--sj-hb), .9) 100%), url("../images/hero-phone.jpg") !important; background-position: center !important; }
	.sj-hb::after { height: 40px; }
}

/* Repeated short sections (h3 + text + link) become cards, like the three paths on the homepage. */
.sj-cards { gap: 20px !important; margin-block: 1.6rem 2.4rem !important; }
.sj-cards > .sj-card2 {
	position: relative; border-radius: 22px; padding: 28px 26px 24px; color: #fff;
	display: flex; flex-direction: column; gap: 10px;
	background-image: linear-gradient(160deg, rgba(255, 255, 255, .10) 0%, rgba(255, 255, 255, 0) 40%, rgba(0, 0, 0, .18) 100%);
	transition: transform .2s ease, box-shadow .2s ease;
}
.sj-cards > .sj-card2:nth-child(3n+1) { background-color: var(--wp--preset--color--clay); }
.sj-cards > .sj-card2:nth-child(3n+2) { background-color: var(--wp--preset--color--green); }
.sj-cards > .sj-card2:nth-child(3n+3) { background-color: var(--wp--preset--color--olive); }
.sj-cards > .sj-card2:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(60, 40, 10, .18); }
.sj-cards > .sj-card2 > * { margin: 0 !important; }
.sj-cards > .sj-card2 h3 { color: #fff; font-size: 1.35rem; }
.sj-cards > .sj-card2 h3::after { display: none; }
.sj-cards > .sj-card2 p { font-size: .98rem; line-height: 1.55; }
.sj-cards > .sj-card2 a { color: #fff; }
.sj-cards > .sj-card2 .sj-related { margin-top: auto !important; padding-top: 6px; display: block; }
.sj-cards > .sj-card2 .sj-related a { background: none; border: 0; padding: 0; font-weight: 600; text-decoration: none; color: #fff; }
.sj-cards > .sj-card2 .sj-related a:only-child::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

/* Newsletter band at the bottom of inner pages. */
.sj-page-news { margin-top: var(--wp--preset--spacing--60); }
.woocommerce-cart .sj-page-news, .woocommerce-checkout .sj-page-news, .woocommerce-account .sj-page-news { display: none; }
.wp-block-post-content > .sj-cards { max-width: var(--wp--style--global--wide-size) !important; }
.sj-cards > .sj-card2 .sj-related a::before { color: #fff !important; }
.sj-cards > .sj-card2 .sj-related { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sj-cards > .sj-card2 .sj-related a + a::before { content: "→ "; }
.sj-hb .sj-person { gap: clamp(24px, 4vw, 48px) !important; margin: 0; }
.sj-portrait { margin: 0 !important; }
.sj-portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 25%; border-radius: 22px; border: 4px solid rgba(255, 250, 242, .9); box-shadow: 0 14px 34px rgba(30, 20, 5, .3); mix-blend-mode: normal !important; max-height: none !important; }
@media (max-width: 781px) {
	.sj-hb .sj-person { flex-direction: column-reverse; align-items: flex-start !important; }
	.sj-hb .sj-person > .wp-block-column:last-child { flex-basis: auto !important; width: 170px; }
}
.sj-hb .wp-block-post-title { font-size: clamp(2rem, 4.4vw, 3rem) !important; }
.sj-cards > .sj-card2 { overflow: hidden; }
.sj-cards > .sj-card2 > .sj-card2__img { margin: -28px -26px 8px !important; max-width: none !important; width: calc(100% + 52px); }
.sj-cards > .sj-card2 > .sj-card2__img img { width: 100% !important; height: 180px; object-fit: cover; object-position: center 45%; display: block; mix-blend-mode: normal !important; max-height: none !important; border-radius: 0 !important; }
.wp-block-image.sj-card2__img { position: relative; }
.sj-cards > .sj-card2 > .sj-card2__img::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(180deg, transparent, rgba(0,0,0,.18)); pointer-events: none; }
.sj-ico--chat { --sj-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.8 7L4 20l1.1-4.6A8 8 0 1 1 21 12Z'/%3E%3C/svg%3E"); }

/* Submenu under "Chi siamo". */
.sj-header .wp-block-navigation__submenu-container { background: var(--sj-card) !important; border: 1px solid var(--wp--preset--color--line) !important; border-radius: 14px; padding: 8px 0 !important; box-shadow: 0 12px 28px rgba(60, 40, 10, .14); min-width: 240px !important; }
.sj-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 8px 18px !important; }
.sj-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { color: var(--sj-green); }

/* Teachers: cards with portrait. */
.sj-people { gap: 22px !important; margin-block: 1.4rem 2.4rem !important; }
.wp-block-post-content > .sj-people { max-width: var(--wp--style--global--wide-size) !important; }
.sj-person-card { position: relative; background: var(--sj-card); border: 1px solid var(--wp--preset--color--line); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease; }
.sj-person-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(60, 40, 10, .14); }
.sj-person-card > * { margin: 0 !important; padding-inline: 22px; }
.sj-person-card > .wp-block-image { padding: 0; }
.sj-person-card > .wp-block-image img { width: 100% !important; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 22%; display: block; mix-blend-mode: normal !important; max-height: none !important; border-radius: 0 !important; }
.sj-person-card h3 { padding-top: 18px; font-size: 1.3rem; }
.sj-person-card h3::after { display: none; }
.sj-person-card h3 a { text-decoration: none; color: inherit; }
.sj-person-card h3 a::after { content: ""; position: absolute; inset: 0; }
.sj-person-card p { font-size: .95rem; color: var(--sj-soft); padding-top: 6px; }
.sj-person-card .sj-person-card__go { padding: 12px 22px 20px; margin-top: auto !important; font-weight: 600; color: var(--sj-green); }
.sj-person-card__initials { aspect-ratio: 4 / 5; display: grid !important; place-items: center; background: var(--wp--preset--color--olive); color: #fff; font-family: var(--wp--preset--font-family--heading); font-size: 3.4rem; padding: 0 !important; }

/* Contact buttons and the practice note. */
.sj-note { background: var(--sj-card); border: 1px solid var(--wp--preset--color--line); border-left: 5px solid var(--wp--preset--color--clay); border-radius: 18px; padding: 22px 26px !important; margin-block: 1.6rem !important; }
.sj-note h2, .sj-note h3 { margin-top: 0 !important; }
.sj-note h2::after { display: none; }
.sj-person-card p.sj-person-card__initials { font-size: 3.4rem; color: #fff; font-family: var(--wp--preset--font-family--heading); padding: 0 !important; letter-spacing: .04em; }
.sj-ico--chat a + a::before { display: none; }
