/* ===========================================================================
   Easy-Commission overrides for jb_dynamic4.

   Loaded by templates/jb_dynamic4/index.php line 135
   (`$theme->add_css('custom.css')`), which the vendor calls unconditionally
   but ships no file for. It is the LAST stylesheet on the page, so nothing
   here needs `!important` except where it fights an inline <style> block.

   Three kinds of rule live here, and nothing else:
     1. Bootstrap 4 -> 5 regressions. jb_dynamic shipped Bootstrap 4.1.0;
        jb_dynamic4 ships Bootstrap 5.1.0, and the template's own
        bootstrap.min.css loads AFTER components/com_sppagebuilder's CSS, so
        Bootstrap wins every tie.
     2. Header/topbar layout rules that jb_dynamic's template.css carried and
        jb_dynamic4's does not.
     3. Rules carried forward verbatim from the live site's own
        templates/jb_dynamic/css/custom.css, which was never migrated.

   Anything that belongs in a template option or the Layout builder belongs
   there, not here.
   =========================================================================== */


/* ===========================================================================
   1. BOOTSTRAP 4 -> 5 REGRESSIONS
   =========================================================================== */

/* ---------------------------------------------------------------------------
   Buttons wrap to two lines
   18 November 2026

   Bootstrap 4.1's `.btn` carried `white-space: nowrap`; Bootstrap 5 dropped it
   deliberately so long labels wrap. The header's "15 Day Free Trial" button is
   143px wide in a 315px container, so under Bootstrap 5 it breaks onto two
   lines and grows to 64px tall while "Login" beside it stays 43px.

   Measured on live (Bootstrap 4.1.0):   both buttons 43px.
   Measured on staging before this rule: trial 64px, login 43px.

   TRADE-OFF: this restores Bootstrap 4 behaviour for every .btn on the site.
   A long button label will now overflow its container instead of wrapping.
   That is what the live site does today, so it is the faithful choice, but if
   a future page needs a wrapping button, give it its own class rather than
   deleting this rule.
   --------------------------------------------------------------------------- */

.btn {
	white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   The header "Login" button lost its green

   Bootstrap 5.1's `.btn` base rule sets `color: #212529` and
   `background-color: transparent`. Bootstrap 4.1's set neither. The header
   buttons are marked up as `class="btn sppb-btn-success ..."`, and
   /components/com_sppagebuilder/assets/css/sppagebuilder.css loads BEFORE
   /templates/jb_dynamic4/css/bootstrap.min.css, so at equal specificity
   Bootstrap wins and the green disappears.

   The blue "15 Day Free Trial" button beside it survived only because its
   `.sppb-btn-easy` rule (emitted into the page by SP Page Builder) uses
   `!important`.

   Colours below are SP Page Builder's own `.sppb-btn-success` values, copied
   from sppagebuilder.css so they stay in step with the rest of the site.
   Raising specificity to `.btn.sppb-btn-success` is enough; no `!important`.
   --------------------------------------------------------------------------- */

.btn.sppb-btn-success {
	color: #fff;
	background-color: #23cf5f;
	border-color: #23cf5f;
}

.btn.sppb-btn-success:hover,
.btn.sppb-btn-success:focus {
	color: #fff;
	background-color: #1fae51;
	border-color: #1fae51;
}

/* ---------------------------------------------------------------------------
   Table headers turned dark grey instead of the site blue

   The pricing and feature tables are marked up `<thead class="table-dark">`,
   and the page's own CSS overrides that to the site blue:

       #sppb-addon-1638848865111 .table-dark { background-color: #2299d0; }

   Under Bootstrap 4 `.table-dark` painted the THEAD element and the cells were
   transparent, so that override showed through. Bootstrap 5 moved the colour
   onto every cell:

       .table > :not(caption) > * > * { background-color: var(--bs-table-bg); }
       .table-dark                    { --bs-table-bg: #212529; }

   so each `th` now paints #212529 on top of the blue thead. Bootstrap 5 also
   tightened cell padding from .75rem to .5rem.

   Resetting the cell background to transparent restores the Bootstrap 4
   result. It does NOT break `.table-striped`: Bootstrap 5 draws stripes with
   `box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg)`, not with
   background-color, and that is left untouched.
   --------------------------------------------------------------------------- */

.table > :not(caption) > * > * {
	padding: 0.75rem;
	background-color: transparent;
}

/* ---------------------------------------------------------------------------
   Every page is 180px wider than live, on screens 1400px and up
   17 November 2026

   Bootstrap 5 added a sixth breakpoint, xxl. Bootstrap 4.1 capped .container
   at 1140px from 1200px upwards and had nothing above that; Bootstrap 5.1
   adds

       @media (min-width: 1400px) { .container { max-width: 1320px } }

   so on a 1440px screen the content column is 1320px instead of 1140px. That
   is every .container on the site - 8 on the home page, the same 8 live has -
   and therefore every column inside one.

   Measured at 1440x900:

       #sp-bottom .sppb-row              live 1140   staging 1320
       footer "Useful Links" column      live  160   staging  190

   Not reported by anyone: below 1400px the two agree, so it only shows on a
   wide monitor.

   Only `.container` is restricted here, not Bootstrap's .container-xl /
   .container-xxl, because .container is the only one this site emits. If a
   future page uses .container-xxl it will keep Bootstrap 5's own width, which
   is almost certainly what whoever wrote it meant.
   --------------------------------------------------------------------------- */

@media (min-width: 1400px) {
	.container {
		max-width: 1140px;
	}
}


/* ===========================================================================
   2. HEADER LAYOUT RULES MISSING FROM jb_dynamic4's template.css

   These rules are present in jb_dynamic's template.css (lines 1867-1974 of
   the live file) and absent from jb_dynamic4's. Without them the header band
   is 100px instead of 70px and nothing in the header or the logo band is
   vertically centred - the logo, the search box and the Paid Sign Up button
   all sit flush against the top of their row.

   They supersede the two rules this file carried on 17 November 2026
   (`#sp-header .row > div > .sp-column { height: 100% }` and
   `#sp-menu { padding: 0 }`), which forced full-height columns as a way of
   reaching the same result. Centring the row is what the live site does,
   needs no `!important` against Helix's inline padding, and leaves the menu
   column's 20px Layout padding doing the job it was set for.
   =========================================================================== */

.header-default#sp-header {
	height: 70px !important;
}

.header-default#sp-header .sp-megamenu-parent > li > a,
.header-default#sp-header .sp-megamenu-parent > li > span {
	line-height: 30px !important;
}

.header-default#sp-header #offcanvas-toggler {
	height: 70px !important;
	line-height: 70px !important;
}

#sp-header .row {
	align-items: center;
}

/* The logo band (the `Header-block` layout row) and the topbar. */

#sp-header-block div {
	align-items: center;
}

#sp-topbar #sp-top1 .sp-column {
	align-items: center;
	display: flex;
}


/* ===========================================================================
   3. CARRIED FORWARD FROM THE LIVE SITE'S OWN custom.css

   templates/jb_dynamic/css/custom.css on the live server (2,534 bytes, last
   modified 2 April 2022) was never migrated into jb_dynamic4. Most of it is
   dead: `.ec_custom_ce_component`, `#page_navigation`, `.intergrates-*` and
   `.readmore` match nothing in any published page, module or article, and
   nothing in the live site's own home, pricing or features HTML either, so
   they are deliberately NOT carried over. If a page that uses them turns up
   later, the original is at
   Joomla-Website/templates/jb_dynamic/css/custom.css.

   These two blocks are still in use and are carried verbatim.
   =========================================================================== */

/* Bootstrap tooltips. 50 of them on the pricing page alone; the default 200px
   box truncates the longer feature descriptions badly.

   NOTE: the tooltips themselves do not fire on Bootstrap 5 - the markup uses
   the Bootstrap 4 attribute `data-toggle="tooltip"`, which Bootstrap 5
   renamed to `data-bs-toggle`. This rule only styles them once that is fixed.
   See DEPLOYMENT.md section 27 for the three-line initialiser. */

.tooltip-inner {
	max-width: 500px !important;
	text-align: left !important;
}

/* Below 992px the header columns stack, and without this the logo, the search
   box and the Paid Sign Up button butt straight up against the row above. */

@media screen and (max-width: 992px) {
	#sp-search {
		padding-top: 15px;
	}

	#sp-freetrial {
		padding-top: 15px;
	}

	.logo {
		padding-top: 20px;
	}
}


/* ===========================================================================
   4. THE FOOTER NEWSLETTER FORM
   17 November 2026

   _handover/06-fix-acymailing-optin-and-proprofs.sql replaces SP Page
   Builder's Opt-in Form addon - which is written against AcyMailing 6/7 and
   cannot talk to the AcyMailing 11.1.1 that is installed - with AcyMailing's
   own mod_acym, rendered through SP Page Builder's Module addon. Same list,
   same terms checkbox, different markup, so the look has to be rebuilt here.

   Everything below is scoped to .ec-footer-subscribe (the addon wrapper) and
   the module inside it, both set by that script. No other AcyMailing form on
   the site is affected.

   Measured on www.easy-commission.com at 1440x900 and reproduced:

       intro and terms text   16px
       email input            41px tall, white, rounded on the left only
       submit button          46 x 41, #FFA700, rounded on the right only
       terms link             #3c8ac9, #2299d0 on hover
   =========================================================================== */

/* Layout: email field and button side by side, terms checkbox underneath.

   mod_acym puts its button in a <p class="acysubbuttons"> that is a SIBLING
   of .acym_form, not a child, so the two have to become flex items of
   .acym_module_form; .acym_form then wraps internally to drop the terms
   checkbox onto a line of its own. align-items: flex-start keeps the button
   level with the input rather than with the whole block. */

.ec-footer-subscribe .acym_module_form {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
}

.ec-footer-subscribe .acym_introtext {
	flex: 1 0 100%;
	font-size: 16px;
	margin-bottom: 20px;
}

/* The flex-basis is 60%, and it is doing real work. A wrapping flex container
   assigns items to lines from their flex-basis BEFORE growing or shrinking
   them, so:

     auto  the basis is .acym_form's max-content width (the terms sentence),
           which is wider than the column -> the button is pushed onto a line
           of its own
     0     100% + 0 fits on one line, so .acym_form joins the intro text and
           is grown to 0px, and the button is pushed onto a line of its own

   60% is simply "big enough that 100% + this overflows line 1, small enough
   that this + the 46px button fits line 2". .acym_form is then grown to fill
   whatever is left beside the button. */

.ec-footer-subscribe .acym_form {
	flex: 1 1 60%;
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
}

.ec-footer-subscribe .acym_form .onefield.fieldacy2 {
	flex: 1 1 100%;
	margin: 0;
}

/* The negative right margin gives the terms line back the 46px the button
   took out of .acym_form, so it runs the full width of the column as it does
   on live. */

.ec-footer-subscribe .acym_form .fieldacyterms {
	flex: 1 0 100%;
	margin: 12px -46px 0 0;
	font-size: 16px;
}

.ec-footer-subscribe p.acysubbuttons {
	flex: 0 0 auto;
	margin: 0;
}

/* The field. 41px is the height the live site gave the old form, through a
   rule in the template's own Custom CSS:

       #sp-bottom .sppb-addon-optin-forms .sppb-optin-form-content
       .sppb-form-control { height: 41px !important; }

   That rule now matches nothing on any page and can be deleted from Template
   Options -> Custom Code -> Custom CSS whenever convenient.

   max-width: none overrides AcyMailing's own
   media/com_acym/css/module.min.css, which caps every form input at 90% -
   that is what otherwise leaves a 30px gap between the field and the
   button. */

.ec-footer-subscribe .acym_form input[type="email"] {
	width: 100%;
	max-width: none;
	height: 41px;
	border-radius: 4px 0 0 4px;
}

/* The submit button.

   Live's is an unlabelled arrow: <button aria-label=""> with no text, which
   is a WCAG 4.1.2 failure. This keeps the word "Subscribe" in the DOM for
   screen readers, hides it visually with font-size: 0, and draws the same
   arrow with a pseudo-element. Same appearance, no accessibility regression.

   To show the word instead, delete the font-size, the fixed width and the
   ::after rule.

   The two !important declarations are not decoration. mod_acym marks the
   button `btn btn-primary`, and two rules already on every page carry
   !important of their own:

       .sppb-btn-primary, .btn-primary { background-color: #0345bf !important }
           - templates/jb_dynamic4/css/template.css
       .sppb-btn, .btn, a.tpFilterItem { font-size: 14px !important }
           - the template's own Custom CSS, Template Options

   Both are (0,1,0); the selectors below are (0,2,1), so they win on
   specificity among important declarations. */

.ec-footer-subscribe button.subbutton {
	width: 46px;
	height: 41px;
	padding: 0;
	font-size: 0 !important;
	line-height: 41px;
	color: #fff;
	background-color: #ffa700 !important;
	border: 1px solid #ffa700;
	border-radius: 0 3px 3px 0;
}

.ec-footer-subscribe button.subbutton:hover,
.ec-footer-subscribe button.subbutton:focus {
	color: #fff;
	background-color: #e69600 !important;
	border-color: #e69600;
}

.ec-footer-subscribe button.subbutton::after {
	content: "\f124";                                           /* location-arrow */
	font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
	font-weight: 900;
	font-size: 14px;
}

/* The terms link, carried from the old addon's own custom CSS. */

.ec-footer-subscribe .fieldacyterms a {
	color: #3c8ac9;
}

.ec-footer-subscribe .fieldacyterms a:hover {
	color: #2299d0;
}

/* AcyMailing's confirmation / error message replaces the form in place
   (successmode = replace). Without this it inherits the footer's 18px. */

.ec-footer-subscribe .acym__message,
.ec-footer-subscribe .acym__field__error__block {
	font-size: 16px;
}
