/*
 Theme Name:   Beautiful WP
 Description:  Beautiful WP plugin sales, changelog & documentation theme
 Author:       Nikel Schubert
 Author URI:   https://nikel.co
 Template:     twentytwentyone
 Version:      2.0.0
 License:      GNU General Public License v3 or later
 License URI:  http://www.gnu.org/licenses/gpl-3.0.html
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  beautiful-wp
*/

/*
*
* ==========================================
* SITE COLORS
* WordPress stores Customizer color settings (background color, Twenty
* Twenty-One's own Colors panel) per theme *slug*. Renaming the theme
* folder from twentytwentyone-child to beautiful-wp reset all of these to
* defaults, so they're hardcoded here instead of depending on Customizer
* state that won't survive future renames/migrations.
* ==========================================
*
*/

body,
body.custom-background {
  background-color: #f9fafb !important;
}

:root {
  --global--color-background: #f9fafb;
  --global--color-primary: #000;
  --global--color-secondary: #000;
  --button--color-background: #000;
  --button--color-text-hover: #000;
}

/*
*
* ==========================================
* SITE HEADER & TYPOGRAPHY
* Previously provided by the Twentig plugin's Customizer settings;
* ported here directly so the plugin can be deactivated without any
* visual change (centered header, header spacing, heading/branding sizes).
* ==========================================
*
*/

:root {
  --header--padding: 18px;
  --global--font-size-xxl: 3.5rem;
  --global--font-size-page-title: 2rem;
  --branding--title--font-size: 21px;
  --branding--title--font-size-mobile: 21px;
  --primary-nav--font-weight: 400;
}

/* Belt-and-suspenders: the --global--font-size-page-title override above
   should be enough on its own, but .singular .entry-title in the parent
   theme has matched specificity, so force it directly too. */
h1.entry-title,
.entry-title {
  font-size: 2rem !important;
  line-height: 1.3 !important;
}

/*
* Content width: Twentig replaced the theme's own responsive width formula
* with its own (fed by a --max--alignwide-width/--max--aligndefault-width
* setting, both configured to 1190px on this site) via its own stylesheet,
* which disappears with the plugin. Twenty Twenty-One's native formula
* (see its style.css, ~line 664) caps aligndefault at 610px and alignwide
* at 1240px instead. Re-declared here at the same breakpoints, replacing
* only the cap, so default- and wide-aligned content both render at
* 1190px like they did with Twentig, without losing the fluid mobile
* sizing the parent theme's formula provides below that.
*/
@media only screen and (min-width: 482px) {
  :root {
    --responsive--aligndefault-width: min(
      calc(100vw - 4 * var(--global--spacing-horizontal)),
      1190px
    );
    --responsive--alignwide-width: min(calc(100vw - 4 * var(--global--spacing-horizontal)), 1190px);
  }
}
@media only screen and (min-width: 822px) {
  :root {
    --responsive--aligndefault-width: min(
      calc(100vw - 8 * var(--global--spacing-horizontal)),
      1190px
    );
    --responsive--alignwide-width: min(calc(100vw - 8 * var(--global--spacing-horizontal)), 1190px);
  }
}

/* The --responsive--aligndefault-width override above isn't reliably
   winning against the parent theme's own rule that consumes it (same
   variable-override issue seen elsewhere on this site), so force the
   actual max-width directly on default-aligned content everywhere inside
   #content, matching Twenty Twenty-One's own selector for that rule
   (entry-content > * that isn't wide/full/left/right aligned). */
@media only screen and (min-width: 482px) {
  #content
    .entry-content
    > *:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.wp-block-separator),
  #content
    [class*="inner-container"]
    > *:not(.entry-content):not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(
      .wp-block-separator
    ) {
    max-width: 800px !important;
  }
}

.site-header {
  padding-top: var(--header--padding);
  /* Overrides a higher-specificity rule (likely Twentig's own
     "body:not(.tw-header-bg) .site-header", which pads by 2x/3x
     --global--spacing-vertical depending on screen width) that was
     winning over a plain padding-bottom here. */
  padding-bottom: var(--global--spacing-vertical) !important;
}

.site-header .site-title,
.site-footer > .site-info .site-name {
  font-weight: 400;
  text-transform: uppercase;
}

/* The theme blanks get_the_title() sitewide (see functions.php); collapse
   the now-empty title element instead of leaving a hollow gap where it
   used to be hidden by Twentig's "no title" page template. */
.entry-title:empty {
  display: none;
}

@media (min-width: 482px) {
  .site-header {
    row-gap: 0;
  }
  .primary-navigation {
    margin: min(20px, calc(0.4 * var(--header--padding))) auto 0;
  }
  .primary-menu-container,
  .primary-navigation > div > .menu-wrapper {
    justify-content: center;
  }
  .site-branding {
    width: 100%;
    margin: 0;
    text-align: center;
  }
  .site-header .site-logo {
    display: flex;
    margin: 0;
    text-align: center;
  }
  .site-header > .site-logo {
    padding-bottom: 20px;
    border-bottom: 0;
  }
  .site-header .custom-logo-link {
    margin: 0 auto;
  }
}

@media only screen and (max-width: 481px) {
  .primary-menu-container {
    display: block;
  }
  ul.header-actions {
    margin-inline-start: 0;
    padding-bottom: 120px;
    justify-content: flex-start;
  }
  .header-actions .menu-search {
    margin: 0 0 35px;
    width: 100%;
  }
  .header-actions .menu-search:last-child {
    margin-bottom: 0;
  }
  .header-actions .search-field {
    width: 100%;
    border-color: currentcolor;
    font-size: var(--primary-nav--font-size-mobile);
  }
  .header-actions li.social-item {
    margin-inline-start: calc(0px - var(--primary-nav--padding));
  }
  .header-actions .social-item + .social-item {
    margin-inline-start: 0;
  }
  .header-actions .social-item a {
    padding: var(--primary-nav--padding);
  }
  .header-actions .menu-button {
    width: 100%;
    margin: 0;
  }
  .header-actions .menu-button a {
    display: inline-block;
  }
  .header-actions .social-item + .menu-button {
    margin-top: 35px;
  }
  .header-actions .menu-search + .menu-button {
    margin-top: 15px;
  }
}

/*
*
* ==========================================
* CUSTOM UTIL CLASSES
* ==========================================
*
*/

.rounded-lg {
  border-radius: 1rem !important;
}

.text-small {
  font-size: 0.9rem !important;
}

.custom-separator {
  width: 5rem;
  height: 6px;
  border-radius: 1rem;
}

.text-uppercase {
  letter-spacing: 0.2em;
}

a.wp-block-button__link.wp-element-button,
#page input[type="submit"],
.wp-block-file .wp-block-file__button {
  border-radius: 5px !important;
}

#page input[type="submit"],
#page .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background),
.wp-block-file .wp-block-file__button {
  background-color: #2271b1;
  border-color: #2271b1;
}

#page
  .wp-block-button.is-style-outline
  .wp-block-button__link:not(.has-background):not(.has-text-color) {
  border-color: #2271b1;
  color: #2271b1;
}

#page input[type="submit"]:hover,
#page input[type="submit"]:focus,
#page input[type="submit"]:active,
#page .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background):hover,
#page .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background):focus,
#page .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background):active,
#page .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color):hover,
#page .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color):focus,
#page .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color):active,
.wp-block-file .wp-block-file__button:hover,
.wp-block-file .wp-block-file__button:focus,
.wp-block-file .wp-block-file__button:active {
  background-color: #2271b1 !important;
  border-color: #2271b1 !important;
}

.underline {
  text-decoration: underline !important;
}
a.underline:hover {
  text-decoration: none !important;
}

.primary-navigation a:hover {
  text-decoration: underline !important;
  text-decoration-style: wavy !important;
}

.primary-navigation a:focus {
  background-color: transparent !important;
  color: #000000 !important;
  text-decoration-style: wavy !important;
}

.primary-navigation .current_page_item a {
  background-color: transparent !important;
  color: #000000 !important;
  text-decoration-style: wavy !important;
}

/*
*
* ==========================================
* PLUGIN PRODUCTS: PRICING, CARDS, CHANGELOG, DOCS
* ==========================================
*
*/

/* Overrides Twenty Twenty-One's .singular .entry-header rule (3px border,
   large page-title font size) for our own virtual-route page headers,
   which are secondary navigation, not the main page heading. #primary is
   used to outrank that rule's specificity, not just !important. */
#primary .bwp-subtle-header {
  border: none !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 2rem !important;
}

/* DevTools confirmed the line is a generated ::after box on this exact
   element, not border-bottom, from a rule elsewhere we haven't pinned
   down (possibly Twentig, if it's still active as a plugin even though
   the theme's been switched). Neutralize the pseudo-element directly. */
#primary .bwp-subtle-header::after {
  content: none !important;
  display: none !important;
}

#primary .bwp-subtle-header .entry-title {
  font-weight: 600;
  color: #697586;
}

#primary .bwp-subtle-header p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

#primary .bwp-subtle-header p a {
  color: #697586;
}

.bwp-product-intro {
  margin-top: 0;
  display: flow-root; /* contains the floated logo so it doesn't bleed into the pricing table below */
}

.bwp-product-logo {
  float: left;
  margin: 0 1.5rem 1rem 0;
}

.bwp-product-logo-image {
  max-width: 160px;
  max-height: 120px;
  width: auto;
  height: auto;
}

@media only screen and (max-width: 481px) {
  .bwp-product-logo {
    float: none;
    margin: 0 auto 1rem;
    text-align: center;
  }
}

.bwp-tier-highlight {
  position: relative;
}

.bwp-tier-highlight .bg-white {
  border: 2px solid #4d90e1;
}

.bwp-tier-badge {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #4d90e1, #417edc);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 1rem;
  border-radius: 1rem;
  white-space: nowrap;
}

/* Tiers with fewer (or no) price note lines, or a shorter feature list,
   would otherwise render a shorter card than their neighbors. The row
   itself switched from align-items-end to align-items-stretch (see
   bwp_render_pricing_table()) so Bootstrap stretches each column to the
   tallest one; these two make the column and the card itself actually
   fill that stretched height instead of staying their natural size. */
.bwp-tier-col {
  display: flex !important;
}

.bwp-tier-card {
  display: flex !important;
  flex-direction: column;
  width: 100%;
}

/* On top of the whole-card stretch above: the price note lines
   themselves need reserved space regardless of how many (if any) a tier
   has, so the separator/button below always start at the same height.
   Centering the whole price+notes block (an earlier attempt at this)
   shifted the price number itself up/down depending on content, which
   isn't what we want — only the note-lines area should be fixed height,
   with the price number staying in its natural top position. */
.bwp-tier-note-lines {
  min-height: 2rem !important;
}

.bwp-product-card {
  transition: transform 0.15s ease-in-out;
}

.bwp-product-card:hover {
  transform: translateY(-4px);
}

.bwp-product-card-thumb {
  max-width: 100%;
  height: auto;
}

.bwp-product-card-price {
  font-weight: 700;
}

.bwp-product-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0 2.5rem;
}

.bwp-product-links-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  border: 2px solid #2271b1;
  border-radius: 50px;
  color: #2271b1;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
  -webkit-tap-highlight-color: transparent;
}

/* :active explicitly matched to :hover/:focus (rather than left
   unstyled) so mousedown doesn't briefly fall through to some other
   default :active background (e.g. the parent theme's generic button
   active-state color, which currently resolves to black) instead of
   this element's own blue. */
.bwp-product-links-item:hover,
.bwp-product-links-item:focus,
.bwp-product-links-item:active {
  background-color: #2271b1 !important;
  color: #fff !important;
  text-decoration: none;
}

.bwp-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.bwp-gallery-image {
  max-width: 100%;
  height: auto;
  border-radius: 1rem;
}

.bwp-changelog-count {
  color: #697586;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2rem;
}

.bwp-changelog-timeline {
  position: relative;
}

.bwp-changelog-entry {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0 2rem;
  margin-bottom: 2.5rem;
}

.bwp-changelog-entry:last-child {
  margin-bottom: 0;
}

.bwp-changelog-marker {
  position: relative;
  padding-left: 1.25rem;
}

.bwp-changelog-marker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, #4d90e1, #417edc);
}

.bwp-changelog-marker::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1.1rem;
  bottom: -2.5rem;
  width: 2px;
  background: #e3e8ef;
}

.bwp-changelog-entry:last-child .bwp-changelog-marker::after {
  display: none;
}

.bwp-changelog-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(180deg, #4d90e1, #417edc);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  padding: 0.35rem 0.85rem;
  border-radius: 1rem;
  margin: 0;
}

/* Only the newest release (first in the version-descending list) keeps
   the blue badge/dot; older releases get a muted grey version. */
.bwp-changelog-entry:not(:first-child) .bwp-changelog-badge {
  background: linear-gradient(180deg, #9aa5b1, #7b8794);
}

.bwp-changelog-entry:not(:first-child) .bwp-changelog-marker::before {
  background: linear-gradient(180deg, #9aa5b1, #7b8794);
}

.bwp-changelog-date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #697586;
}

.bwp-changelog-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  padding: 1.5rem 2rem;
}

/* .bwp-changelog-body nests block content below .entry-content, so it
   never matches the parent theme's ".entry-content > *" spacing rule.
   Reapply the same spacing here directly. */
.bwp-changelog-body > * {
  margin-top: var(--global--spacing-vertical, 1.5rem);
  margin-bottom: var(--global--spacing-vertical, 1.5rem);
}

.bwp-changelog-body > *:first-child {
  margin-top: 0;
}

.bwp-changelog-body > *:last-child {
  margin-bottom: 0;
}

@media only screen and (max-width: 651px) {
  .bwp-changelog-entry {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .bwp-changelog-marker::after {
    display: none;
  }

  .bwp-changelog-card {
    padding: 1.25rem 1.5rem;
  }
}

.bwp-docs-index {
  list-style: none;
  padding: 0;
}

.bwp-docs-index li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #e3e8ef;
}

.bwp-doc-sidebar ul {
  list-style: none;
  padding: 0;
}

.bwp-doc-sidebar li {
  padding: 0.35rem 0;
}

.bwp-doc-sidebar li.is-current a {
  font-weight: 700;
  text-decoration: underline;
}
