/*
 * PageTree default blocks - Section (container with columns).
 * Zero specificity (:where) so a theme can override any rule.
 */

:where(.ptb-section) {
    position: relative;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* Vertical spacing */
:where(.ptb-section--space-none) { padding-block: 0; }
:where(.ptb-section--space-s) { padding-block: var(--ptb-space-s); }
:where(.ptb-section--space-m) { padding-block: var(--ptb-space-m); }
:where(.ptb-section--space-l) { padding-block: var(--ptb-space-l); }
:where(.ptb-section--space-xl) { padding-block: var(--ptb-space-xl); }

/* Width of the content */
:where(.ptb-section__inner) {
    position: relative;
    padding-inline: var(--ptb-space-s);
}

:where(.ptb-section--width-contained) :where(.ptb-section__inner) {
    max-width: var(--ptb-container);
    margin-inline: auto;
}

/* Background image overlay, for text readability */
:where(.ptb-section--has-image)::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

:where(.ptb-section--overlay-dark) { color: #ffffff; }
:where(.ptb-section--overlay-dark)::before { background-color: rgba(0, 0, 0, 0.5); }
:where(.ptb-section--overlay-light) { color: #111827; }
:where(.ptb-section--overlay-light)::before { background-color: rgba(255, 255, 255, 0.7); }

/* Grid of columns */
:where(.ptb-section__grid) {
    display: grid;
    gap: var(--ptb-gap);
}

:where(.ptb-section__grid--gap-s) { gap: var(--ptb-space-s); }
:where(.ptb-section__grid--gap-m) { gap: var(--ptb-gap); }
:where(.ptb-section__grid--gap-l) { gap: var(--ptb-space-l); }

:where(.ptb-section__grid--align-stretch) { align-items: stretch; }
:where(.ptb-section__grid--align-start) { align-items: start; }
:where(.ptb-section__grid--align-center) { align-items: center; }
:where(.ptb-section__grid--align-end) { align-items: end; }

:where(.ptb-section__cell) { min-width: 0; }

/* Columns stack below the chosen screen width (same classes as GridContainer) */
@media (max-width: 991.98px) {
    .ptb-section__grid.grid-stack-lg { grid-template-columns: minmax(0, 1fr) !important; }
    .ptb-section__grid.grid-stack-lg > .pagetree-grid-cell { grid-column: auto !important; grid-row: auto !important; }
}

@media (max-width: 767.98px) {
    .ptb-section__grid.grid-stack-md { grid-template-columns: minmax(0, 1fr) !important; }
    .ptb-section__grid.grid-stack-md > .pagetree-grid-cell { grid-column: auto !important; grid-row: auto !important; }
}

@media (max-width: 575.98px) {
    .ptb-section__grid.grid-stack-sm { grid-template-columns: minmax(0, 1fr) !important; }
    .ptb-section__grid.grid-stack-sm > .pagetree-grid-cell { grid-column: auto !important; grid-row: auto !important; }
}
