/*
 * layout.css — TT5 Layout Overrides + Block Defaults + Page Content Rules
 * CRCKC Child Theme
 * Covers: constrained-wrapper neutralisation, alignfull/alignwide fixes,
 *         header/footer backdrop, generic WP block rules (columns, separator,
 *         blockquote), and post-content structural rules used site-wide.
 */

/* ============================================================
   LAYOUT — neutralise TT5 constrained wrapper
   ============================================================
   TT5 nests every section inside a "constrained" layout group
   that sets --wp--style--global--content-size (~620px) as an
   inline style, overriding any class-level max-width rule.
   We must override the CSS custom property itself AND kill the
   max-width at every level of the nesting chain.
   ============================================================ */

/* Level 1: direct child of alignfull — the constrained wrapper */
.wp-block-group.alignfull > .wp-block-group,
.wp-block-group.alignfull > .wp-block-group.is-layout-constrained,
.wp-block-group.alignfull > .wp-block-group.is-layout-flow {
  --wp--style--global--content-size: var(--crckc-wide) !important;
  --wp--style--global--wide-size:    var(--crckc-wide) !important;
  max-width:     none  !important;
  width:         100%  !important;
  padding-left:  0     !important;
  padding-right: 0     !important;
}

/* Level 2: the alignwide content group inside the constrained wrapper */
.wp-block-group.alignfull > .wp-block-group > .wp-block-group.alignwide,
.wp-block-group.alignfull > .wp-block-group > .wp-block-group[class*="alignwide"] {
  --wp--style--global--content-size: var(--crckc-wide) !important;
  --wp--style--global--wide-size:    var(--crckc-wide) !important;
  max-width:    var(--crckc-wide) !important;
  width:        100% !important;
  margin-left:  auto !important;
  margin-right: auto !important;
  /* Comfortable side padding so content never touches screen edges */
  padding-left:  clamp(1.25rem, 4vw, 3.5rem) !important;
  padding-right: clamp(1.25rem, 4vw, 3.5rem) !important;
  box-sizing: border-box;
}

/* Catch-all: any is-layout-constrained anywhere on the page */
.is-layout-constrained {
  --wp--style--global--content-size: var(--crckc-wide) !important;
  --wp--style--global--wide-size:    var(--crckc-wide) !important;
}

/* alignfull groups must always span 100% */
.wp-block-group.alignfull,
.wp-site-blocks .wp-block-post-content > .alignfull,
.wp-site-blocks .wp-block-post-content > .wp-block-group.alignfull {
  max-width: none  !important;
  width:     100%  !important;
}

/* Header & footer use a frosted-glass transparent background */
header, footer {
  background: transparent;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ============================================================
   GENERIC WP BLOCK OVERRIDES
   ============================================================ */
.wp-block-columns  { gap: 2rem; }
.wp-block-separator { opacity: 1; border-color: rgba(62, 52, 40, 0.1); }

blockquote.wp-block-quote {
  border-left: 4px solid var(--crckc-accent);
  padding-left: 1.1rem;
  color: var(--crckc-text);
  font-style: normal;
}

/* ============================================================
   PAGE CONTENT STRUCTURAL RULES
   ============================================================
   Although originally labelled "Home Page Overrides", these
   rules govern alignfull section spacing, post-content
   max-widths, and query-block borders — patterns used on any
   full-width page template, not only the front page.
   ============================================================ */
.wp-block-post-content > .alignfull { padding-left: 0; padding-right: 0; }
.wp-block-post-content > .alignfull + .alignfull,
.wp-block-post-content > .alignfull + .wp-block-group.alignfull { margin-top: 0; }

.wp-block-post-content h1 { max-width: 100%; }
.wp-block-post-content h2 { max-width: 38ch; }
.wp-block-post-content p  { max-width: 72ch; }

.wp-block-post-content ul { padding-left: 1.2rem; }
.wp-block-post-content li { margin-bottom: 0.45rem; }

.wp-block-post-content .wp-block-query .wp-block-group {
  border-bottom: 1px solid rgba(62, 52, 40, 0.08);
}

.wp-block-post-content .wp-block-columns.are-vertically-aligned-center {
  align-items: center;
}

/* Post title & date used in query loops site-wide */
.wp-block-post-title a       { color: var(--crckc-text); text-decoration: none; }
.wp-block-post-title a:hover { color: var(--crckc-accent); }
.wp-block-post-date          { color: var(--crckc-text-muted); font-size: 0.92rem; }
