/* ==========================================================================
   Layout primitives shared by all section blocks (Semplice grid port).

   <section class="pg-section pg-reveal pg-section--bg-white [pg-section--boxed] [pg-section--gutter-none]">
     <div class="pg-container">
       <div class="pg-row [pg-row--justify-center|right] [pg-row--valign-center|top|bottom]">
         <div class="pg-col" style="--pg-col-xl:8;--pg-col-lg:7;--pg-col-md:7">
           ... module(s) with .pg-is-content ...

   Column width = calc(100% / 12 * N). N falls through xl -> lg -> md exactly
   like Semplice (a column without an md width uses the lg, then xl width).
   Below 768px every column is 100% (Semplice column-mode single).
   Use the PHP helper pg_col_style( array( 'xl' => 8, 'lg' => 7 ) ) in render.php.
   ========================================================================== */

.pg-main { position: relative; }

.pg-section {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	color: var(--pg-green-900);
}
/* The ONLY four background variants (attribute "bg" on every section block). */
.pg-section--bg-white  { background-color: var(--pg-white); }
.pg-section--bg-sage   { background-color: var(--pg-sage-100); }
.pg-section--bg-mist   { background-color: var(--pg-paper); }
.pg-section--bg-forest { background-color: var(--pg-green-900); color: var(--pg-paper); }
.pg-section--bg-forest .pg-is-content { color: var(--pg-paper); }

/* Container: fluid (full width) by default – most live sections are fluid. */
.pg-container {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
	padding: 0 var(--pg-container-px);
}
.pg-section--boxed .pg-container { max-width: var(--pg-container-max); }

.pg-row {
	display: flex;
	flex: auto;
	flex-direction: row;
	flex-wrap: wrap;
	width: 100%;
	margin: 0;
}
.pg-section--boxed .pg-row { margin-left: calc(-1 * var(--pg-gutter)); margin-right: calc(-1 * var(--pg-gutter)); }
.pg-row--justify-center { justify-content: center; }
.pg-row--justify-right  { justify-content: flex-end; }
.pg-row--justify-between { justify-content: space-between; }
.pg-row--valign-center { align-items: center; }
.pg-row--valign-top    { align-items: flex-start; }
.pg-row--valign-bottom { align-items: flex-end; }

.pg-col {
	position: relative;
	display: flex;
	flex-direction: row;
	word-wrap: break-word;
	padding-left: var(--pg-gutter);
	padding-right: var(--pg-gutter);
	--pg-col-n: var(--pg-col-xl, 12);
	width: calc(100% / 12 * var(--pg-col-n));
	max-width: calc(100% / 12 * var(--pg-col-n));
	flex: 0 0 auto;
	flex-basis: calc(100% / 12 * var(--pg-col-n));
}
.pg-col > .pg-col__inner { width: 100%; }
.pg-section--gutter-none .pg-col,
.pg-section--gutter-none .pg-container { padding-left: 0; padding-right: 0; }

@media (min-width: 992px) and (max-width: 1169.98px) {
	.pg-col { --pg-col-n: var(--pg-col-lg, var(--pg-col-xl, 12)); }
}
@media (min-width: 768px) and (max-width: 991.98px) {
	.pg-col { --pg-col-n: var(--pg-col-md, var(--pg-col-lg, var(--pg-col-xl, 12))); }
}
@media (max-width: 767.98px) {
	.pg-col { --pg-col-n: 12; }
}

/* A "module" = one content item inside a column (Semplice .column-content). */
.pg-module { position: relative; width: 100%; }

/* ==========================================================================
   Section padding (docs/SPACING.md §1/§2) – the ONLY vertical section paddings.
   Put ONE size class on the <section> (pg_section_attributes( …, array( 'pad' => 'm' ) )):
     pg-pad-s | pg-pad-m | pg-pad-l   top = bottom = --pg-section-s|m|l
     pg-pad-band                      top = bottom = --pg-section-band (dark footer band)
   Modifiers (combine with a size):
     pg-pad-first     top = --pg-section-first (first section under the fixed header)
     pg-pad-top-0     no top padding    (continues the previous section, same background)
     pg-pad-bottom-0  no bottom padding (continued by the next section, same background)
   Automatic: on pages with content offset "none", the first section of the page that has
   a size class gets --pg-section-first on top.
   ========================================================================== */
.pg-pad-s    { padding-top: var(--pg-section-s);    padding-bottom: var(--pg-section-s); }
.pg-pad-m    { padding-top: var(--pg-section-m);    padding-bottom: var(--pg-section-m); }
.pg-pad-l    { padding-top: var(--pg-section-l);    padding-bottom: var(--pg-section-l); }
.pg-pad-band { padding-top: var(--pg-section-band); padding-bottom: var(--pg-section-band); }
.pg-section.pg-pad-first,
.pg-offset--none .pg-main :is(.entry-content, .wp-block-post-content) > .pg-section:first-child:is(.pg-pad-s, .pg-pad-m, .pg-pad-l) { padding-top: var(--pg-section-first); }
.pg-section.pg-pad-top-0    { padding-top: 0; }
.pg-section.pg-pad-bottom-0 { padding-bottom: 0; }
