/*
 Theme Name:  Sandalan TT5 Child (v2.3 Header/Footer Patterns)
 Template:    twentytwentyfive
 Author:      Sandalan
 Version:     1.3.0
 Description: Adds Header/Footer block patterns scoped to template-part editors + full-width + table fixes.
 Text Domain: sandalan-tt5-child
*/


/* === SOA Full-width + Footer Pin Fix (2025-10-10) =========================
   Scope: only the Sandalan Online Application area.
   - Makes header/body full-width with modest inline padding
   - Ensures page area fills viewport height so footer doesn't float
============================================================================ */

/* Tunables */
:root {
  --soa-pad-inline: clamp(12px, 2vw, 24px);
  --soa-max-width: 100%;
}

/* App root wrapper (support multiple selectors to be safe) */
#soa-app, .soa-app, .sandalan-online-application, [data-soa-root="true"] {
  width: 100%;
  max-width: var(--soa-max-width);
  margin: 0;
  padding-left: var(--soa-pad-inline);
  padding-right: var(--soa-pad-inline);
  box-sizing: border-box;

  /* Footer pin structure */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* Header inside app */
#soa-app .soa-header,
.soa-app .soa-header,
.sandalan-online-application .soa-header,
[data-soa-root="true"] .soa-header {
  width: 100%;
  max-width: var(--soa-max-width);
  margin: 0;
  padding-left: var(--soa-pad-inline);
  padding-right: var(--soa-pad-inline);
  box-sizing: border-box;
}

/* Main grows to push footer down */
#soa-app .soa-main,
.soa-app .soa-main,
.sandalan-online-application .soa-main,
[data-soa-root="true"] .soa-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--soa-max-width);
  padding-left: var(--soa-pad-inline);
  padding-right: var(--soa-pad-inline);
  box-sizing: border-box;
}

/* Footer stays at bottom */
#soa-app .soa-footer,
.soa-app .soa-footer,
.sandalan-online-application .soa-footer,
[data-soa-root="true"] .soa-footer {
  margin-top: auto;
  width: 100%;
  max-width: var(--soa-max-width);
  padding-left: var(--soa-pad-inline);
  padding-right: var(--soa-pad-inline);
  box-sizing: border-box;
}

/* Escape boxed page wrappers only on pages containing the app */
.page .entry-content .wp-block-group:has(.sandalan-online-application),
.page .entry-content .wp-block-group:has(.soa-app) {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* In case the theme applies container constraints directly */
.entry-content > .sandalan-online-application,
.entry-content > .soa-app {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
/* === end SOA patch ======================================================== */




/* === SOA Full-bleed overrides for TT5 constrained containers (v2) ========
   Some TT5 wrappers apply max-width via .is-layout-constrained / .alignwide / .alignfull.
   When ANY of those wrappers contain our app root, break out to true full width.
============================================================================ */

/* Break out common WP block wrappers if they CONTAIN the app */
.wp-site-blocks .is-layout-constrained:has(.sandalan-online-application),
.wp-site-blocks .is-layout-constrained:has(.soa-app),
.wp-site-blocks .is-layout-flow:has(.sandalan-online-application),
.wp-site-blocks .is-layout-flow:has(.soa-app),
.wp-site-blocks .wp-block-group:has(.sandalan-online-application),
.wp-site-blocks .wp-block-group:has(.soa-app),
.wp-site-blocks .alignwide:has(.sandalan-online-application),
.wp-site-blocks .alignwide:has(.soa-app),
.wp-site-blocks .alignfull:has(.sandalan-online-application),
.wp-site-blocks .alignfull:has(.soa-app) {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Also handle inner containers that TT5 adds inside content */
.entry-content:has(.sandalan-online-application),
.entry-content:has(.soa-app) {
  --wp--style--global--content-size: 100vw;
  --wp--style--global--wide-size: 100vw;
}

/* Last resort: if a direct parent sets inline --content-size vars, neutralize them when housing the app */
.sandalan-online-application,
.soa-app {
  --wp--style--global--content-size: 100vw !important;
  --wp--style--global--wide-size: 100vw !important;
}
/* ======================================================================== */

