/* ============================================================================
   Football Arena — Layout width (full-bleed chrome, centred content)
   The theme's Site Width option is 100%, so header / hero / section and footer
   backgrounds run edge-to-edge. Here we re-constrain the CONTENT container to a
   comfortable reading measure, centred, so text and cards stay readable and
   aligned while those full-width backgrounds remain.

   This is the modern magazine pattern — immersive full-bleed chrome, boxed
   content — and it fixes both failure modes: the dated "floating boxed card"
   look AND the over-wide, sparse 100% stretch. Loaded after skin.css.
   ============================================================================ */

:root {
	/* Content measure. Jannah's tested default is 1200px; 1280 is a touch roomier
	   while keeping article line-length in the readable band. */
	--sa-content-w: 1280px;

	/* Sidebar rail, as a percentage of the content measure.

	   This used to be Jannah's `sidebar_width` option, which emitted the same two
	   rules from PHP (inc/custom-styles.php:1534-1550) and was the last layout
	   dimension living outside the token system: the content measure was a token
	   here, the rail beside it was a number in the database. Two doors for one
	   decision, and only one of them was greppable.

	   30% mirrors Jannah's own tie-col-md-4 / -8 split (33.3/66.6) pulled in
	   slightly, which suits our wider 1280px measure — the article column gets the
	   extra room rather than the rail. */
	--sa-sidebar-w: 30%;
}

/* Jannah's `.container` is the centred content wrapper. At Site Width 100% its
   inline rule is `max-width:100%`; our `#tie-wrapper .container` (id+class) beats
   that on specificity with no !important, capping content back to the measure
   and centring it. The full-width backgrounds live on ancestors (#theme-header,
   #tie-wrapper, .sa-prefooter, section bands), so they stay edge-to-edge. */
#tie-wrapper .container {
	max-width: var(--sa-content-w);
	margin-left: auto;
	margin-right: auto;
}

/* The sidebar split. Only from the desktop breakpoint up — below it Jannah
   stacks the rail under the article and these widths must not apply.
   Same breakpoint (992px) and same two selectors the PHP emitter used, so this
   is a like-for-like replacement rather than a new opinion about layout. */
@media (min-width: 992px) {

	#tie-wrapper .sidebar {
		width: var(--sa-sidebar-w);
	}

	#tie-wrapper .main-content {
		width: calc(100% - var(--sa-sidebar-w));
	}

	/* …EXCEPT where there is no rail to make room for.

	   A Theme Builder section without a sidebar hands its whole row to the main
	   column and says so with Jannah's own `tie-col-md-12`. The rule above is
	   `#tie-wrapper .main-content` — an id beats the base theme's
	   `.full-width .main-content { width: 100% }`, so a full-width section was
	   rendering at 70% with a ghost rail of empty space beside it. The width
	   only ever meant "leave room for the sidebar"; when the markup states there
	   is none, it must not apply. */
	#tie-wrapper .main-content.tie-col-md-12 {
		width: 100%;
	}

	/* …and the other half of that same bug, which the `tie-col-md-12` exception
	   above cannot reach: a section that ASKED for a rail and hasn't got one.

	   `framework/blocks.php` prints the `<aside>` only `if( is_active_sidebar() )`,
	   but the content column's classes come from `tie_content_column_attr()`,
	   which emits `tie-col-md-8` for EVERY section of a builder page and never
	   looks at whether that sidebar will actually render. The two never talk. So
	   switching a section to "Right sidebar" and not (yet) dropping a widget into
	   its widget area shrank the section's content to 70% and put 30% of nothing
	   beside it — which reads as "the sidebar setting broke my section", with no
	   sidebar anywhere to explain it.

	   The markup already states the truth: no `aside.sidebar` in the row means
	   there is no rail to leave room for. Keyed off that rather than off the
	   `has-sidebar` class, because the class records what was ASKED for and the
	   aside records what was BUILT, and this rule is about the gap between them. */
	#tie-wrapper .section-item.has-sidebar:not(:has(.main-content-row > aside.sidebar)) .main-content {
		width: 100%;
	}
}
