/*
 * Section presets chosen in the block editor ("Section style" panel, includes/sections.php).
 * Loaded on the website AND inside the editor, so what Prachi sees is what visitors get.
 * Colours come from the colour theme (Satvic › Design), so every combination keeps
 * the contrast checked for that theme: dark backgrounds use the darker greens with white text.
 */

/* Backgrounds */
.sec-bg-cream { background-color: var(--wp--preset--color--cream, #FBF6EE) !important; }
.sec-bg-white { background-color: var(--wp--preset--color--white, #FFFFFF) !important; }
.sec-bg-blush { background-color: var(--wp--preset--color--blush, #F2D4CF) !important; }
.sec-bg-sage { background-color: var(--wp--preset--color--sage-dark, #4A6541) !important; color: #FFFFFF !important; }
.sec-bg-dark { background-color: var(--wp--preset--color--leaf, #2E3B2C) !important; color: #FFFFFF !important; }

/* Text on the two dark backgrounds: white (cards inside keep their own light background). */
:is(.sec-bg-sage, .sec-bg-dark) :is(h1, h2, h3, h4, h5, h6, p, li, figcaption, summary, blockquote, cite, .is-style-eyebrow, .section-title):not(.is-style-card *):not(.wp-block-button__link) { color: #FFFFFF; }
:is(.sec-bg-sage, .sec-bg-dark) a:not(.wp-block-button__link):not(.button):not(.is-style-card *) { color: #FFFFFF; text-decoration-color: currentColor; }
:is(.sec-bg-sage, .sec-bg-dark) .wp-block-button__link { background-color: #FFFFFF !important; color: var(--wp--preset--color--leaf, #2E3B2C) !important; border-color: #FFFFFF !important; }
:is(.sec-bg-sage, .sec-bg-dark) .is-style-outline .wp-block-button__link { background-color: transparent !important; color: #FFFFFF !important; border-color: #FFFFFF !important; }
:is(.sec-bg-sage, .sec-bg-dark) .is-style-card { color: var(--wp--preset--color--leaf, #2E3B2C); }
:is(.sec-bg-sage, .sec-bg-dark) :is(.wp-block-separator, hr) { border-color: rgba(255, 255, 255, 0.5); }

/* Cards stand out from their section. */
.sec-bg-white .is-style-card { background-color: var(--wp--preset--color--cream, #FBF6EE); }
:is(.sec-bg-blush, .sec-bg-cream) .is-style-card { background-color: var(--wp--preset--color--white, #FFFFFF); }

/* A coloured box that is not full width gets rounded corners and inner space. */
.wp-block-group[class*="sec-bg-"]:not(.alignfull):not(.is-style-card) { padding: clamp(1.25rem, 3vw, 2rem); border-radius: 20px; }
/* A full-width coloured section without the "Section" style still gets breathing room. */
.wp-block-group.alignfull[class*="sec-bg-"]:not(.is-style-section):not([class*="sec-pad-"]) { padding-block: clamp(2.5rem, 6vw, 4rem); }

/* Spacing */
.sec-pad-compact { padding-block: clamp(1.75rem, 4vw, 2.5rem) !important; }
.sec-pad-normal { padding-block: clamp(3rem, 8vw, 5.5rem) !important; }
.sec-pad-roomy { padding-block: clamp(4.5rem, 11vw, 8rem) !important; }

/* Alignment */
.sec-align-center { text-align: center; }
.sec-align-center :is(h1, h2, h3, h4, p) { text-align: center; margin-inline: auto; }
.sec-align-center .wp-block-buttons { justify-content: center; }
.sec-align-center :is(ul, ol) { text-align: left; }
.sec-align-left, .sec-align-left :is(h1, h2, h3, h4, p, .section-title) { text-align: left; }
.sec-align-left .wp-block-buttons { justify-content: flex-start; }
.sec-align-left .section-title::after { margin-left: 0; }

/* Image position for two columns: swap the sides on wider screens (phones always stack). */
@media (min-width: 782px) {
	.wp-block-columns.sec-swap { flex-direction: row-reverse; }
}
