/*
Theme Name: Twisted Pixels Divi Child
Description: Shared hero, CTA, FAQ, blog and editorial styles for Twisted Pixels.
Author: Twisted Pixels
Template: Divi
Version: 1.0.3
Text Domain: twisted-pixels-divi-child
*/

/*
 * Twisted Pixels | Divi stylesheet
 * Load after Divi in a child theme or paste into Divi's Custom CSS field.
 * Existing section classes: tp-hero, tp-cta, tp-faq, tp-insights-grid,
 * tp-intro, tp-services, tp-process and tp-related.
 * Add tp-insights-grid to any unlabelled Blog section, including the
 * homepage grid. Add tp-main-content to other editorial sections as needed.
 * Set post count, category, author visibility, hero images, equal heights
 * and section background masks in Divi. This CSS controls presentation.
 */

/* Design tokens and shared type */
#main-content {
  --tp-navy: #101b35;
  --tp-magenta: #cf056f;
  --tp-link: #9b0347;
  --tp-ink: #1b1d1e;
  --tp-muted: #4c5568;
  --tp-border: #dce4ee;
  --tp-white: #fff;
  --tp-radius: 1rem;
  --tp-shadow: 0 8px 24px rgb(16 27 53 / 12%);
  --tp-card-gap: clamp(1.25rem, 3vw, 2rem);
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head), .tp-cta, .tp-faq, .tp-insights-grid, .tp-intro, .tp-services, .tp-process, .tp-related, .tp-main-content)
:is(h1, h2, h3, h4) {
  line-height: 1.18;
  overflow-wrap: anywhere;
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head), .tp-cta, .tp-faq, .tp-insights-grid, .tp-intro, .tp-services, .tp-process, .tp-related, .tp-main-content)
:is(a, button):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* Hero. The homepage also uses the header-head class on its H1. */
#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) .header-eyebrow {
  color: #ffc0cb;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) .header-head {
  color: var(--tp-white);
  font-size: clamp(2.25rem, 4.2vw, 4.25rem);
  text-wrap: balance;
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) .header-sub {
  color: var(--tp-white);
  max-inline-size: 60ch;
  font-size: 1.25em;
  line-height: 1.55;
}

/* CTA. Inherit the section's text colour and keep Divi's button colours. */
#main-content .tp-cta .et_pb_text {
  max-inline-size: 46rem;
  margin-inline: auto;
}

#main-content .tp-cta .et_pb_text h2 {
  font-size: clamp(1.9rem, 3.3vw, 3.25rem);
  text-wrap: balance;
}

#main-content :is(.tp-hero, .tp-cta) .et_pb_button {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* FAQ and native Divi accordion */
#main-content .tp-faq .et_pb_accordion {
  max-inline-size: 54rem;
  margin-inline: auto;
}

#main-content .tp-faq .et_pb_toggle {
  padding: clamp(1rem, 2.4vw, 1.5rem);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  background: var(--tp-white);
  color: var(--tp-ink);
}

#main-content .tp-faq .et_pb_toggle + .et_pb_toggle {
  margin-block-start: .75rem;
}

#main-content .tp-faq .et_pb_toggle .et_pb_toggle_title {
  color: var(--tp-navy);
  font-size: 1.125rem;
  padding-inline-end: 2rem;
}

#main-content .tp-faq .et_pb_toggle_title::before {
  color: var(--tp-link);
}

#main-content .tp-faq .et_pb_toggle_content {
  line-height: 1.65;
}

/* Divi Blog grid. Keep Salvattore's column wrappers so the live grid
 * retains Divi's post order when more than three posts are shown. */
#main-content .tp-insights-grid .et_pb_blog_grid .et_pb_salvattore_content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--tp-card-gap);
}

#main-content .tp-insights-grid .et_pb_blog_grid .et_pb_salvattore_content > .column {
  display: flex;
  flex-direction: column;
  gap: var(--tp-card-gap);
  width: auto;
  min-width: 0;
  margin: 0;
}

#main-content .tp-insights-grid .et_pb_blog_grid .et_pb_salvattore_content::before,
#main-content .tp-insights-grid .et_pb_blog_grid .et_pb_salvattore_content::after {
  display: none;
}

#main-content .tp-insights-grid .et_pb_blog_grid article.et_pb_post {
  box-sizing: border-box;
  min-inline-size: 0;
  max-inline-size: 100%;
  inline-size: 100%;
  margin: 0 !important; /* Reset Divi's per-card inline and gutter margins. */
  padding: clamp(.9rem, 2vw, 1.25rem);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  background: var(--tp-white);
  color: var(--tp-ink);
  box-shadow: var(--tp-shadow);
}

#main-content .tp-insights-grid .et_pb_blog_grid .et_pb_image_container {
  margin: 0 0 1rem;
}

#main-content .tp-insights-grid .et_pb_blog_grid .et_pb_image_container img {
  display: block;
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: .65rem;
}

#main-content .tp-insights-grid .et_pb_blog_grid .entry-title {
  color: var(--tp-navy);
  font-size: clamp(1.1rem, 1.65vw, 1.4rem);
}

#main-content .tp-insights-grid .et_pb_blog_grid .post-meta {
  color: var(--tp-muted);
  font-size: .75rem;
  line-height: 1.5;
}

/* Editorial content. Use tp-main-content on sections with a light background. */
#main-content :is(.tp-intro, .tp-services, .tp-process, .tp-related, .tp-main-content) .et_pb_text {
  line-height: 1.7;
  overflow-wrap: anywhere;
}

#main-content .tp-main-content .et_pb_text {
  color: var(--tp-ink);
}

#main-content .tp-main-content .et_pb_text :is(h2, h3, h4) {
  color: var(--tp-navy);
}

#main-content :is(.tp-intro, .tp-services, .tp-process, .tp-related, .tp-main-content, .tp-faq) .et_pb_text :is(ul, ol) {
  padding-inline-start: 1.3em;
}

#main-content :is(.tp-main-content .et_pb_text, .tp-faq .et_pb_toggle_content) a {
  color: var(--tp-link);
  text-decoration: underline;
  text-underline-offset: .15em;
}

#main-content .tp-main-content .et_pb_image img {
  max-inline-size: 100%;
  height: auto;
  border-radius: var(--tp-radius);
}

@media (max-width: 980px) {
  #main-content .tp-insights-grid .et_pb_blog_grid .et_pb_salvattore_content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  #main-content .et_pb_section:is(.tp-hero, :has(.header-head), .tp-cta) :is(.et_pb_text, .et_pb_button_module_wrapper),
  #main-content .tp-insights-grid .et_pb_blog_grid article.et_pb_post {
    text-align: center;
  }

  #main-content .et_pb_section:is(.tp-hero, :has(.header-head)) .header-sub {
    margin-inline: auto;
  }

  #main-content .tp-insights-grid .et_pb_blog_grid .et_pb_salvattore_content {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
}

/* Full-bleed split hero. Set the mask and each page's image in Divi. */
#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) {
  padding: 0;
  background-color: #0b1738;
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) > .et_pb_row:has(> .et_pb_column_1_2 + .et_pb_column_1_2) {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: none;
  padding: 0;
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) > .et_pb_row:has(> .et_pb_column_1_2 + .et_pb_column_1_2) > .et_pb_column {
  float: none;
  min-width: 0;
  margin: 0;
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) > .et_pb_row:has(> .et_pb_column_1_2 + .et_pb_column_1_2) > .et_pb_column:first-child {
  width: 53%;
  padding: clamp(2.75rem, 4.15vw, 5rem) clamp(1.5rem, 4vw, 5rem);
  align-content: center;
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) > .et_pb_row:has(> .et_pb_column_1_2 + .et_pb_column_1_2) > .et_pb_column:nth-child(2) {
  width: 47%;
  padding: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) .header-head {
  max-inline-size: 18ch;
  font-weight: 700;
  text-wrap: wrap;
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) .header-sub {
  max-inline-size: 40ch;
  font-size: 1.25em;
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) .et_pb_button {
  padding: .65em 1.05em;
  border: 0;
  border-radius: .4rem;
  font-weight: 700;
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) .et_pb_button_module_wrapper:not(.et_pb_button_module_wrapper ~ .et_pb_button_module_wrapper) .et_pb_button {
  background-color: #bd0067;
  color: #fff;
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) .et_pb_button:hover {
  background-color: var(--tp-link);
  color: #fff;
}

@media (max-width: 980px) {
  #main-content .et_pb_section:is(.tp-hero, :has(.header-head)) > .et_pb_row:has(> .et_pb_column_1_2 + .et_pb_column_1_2) {
    flex-direction: column;
  }

  #main-content .et_pb_section:is(.tp-hero, :has(.header-head)) > .et_pb_row:has(> .et_pb_column_1_2 + .et_pb_column_1_2) > .et_pb_column:is(:first-child, :nth-child(2)) {
    width: 100%;
  }

  #main-content .et_pb_section:is(.tp-hero, :has(.header-head)) > .et_pb_row:has(> .et_pb_column_1_2 + .et_pb_column_1_2) > .et_pb_column:nth-child(2) {
    min-height: clamp(13rem, 48vw, 24rem);
  }
}

@media (max-width: 767px) {
  #main-content .et_pb_section:is(.tp-hero, :has(.header-head)) .header-head {
    margin-inline: auto;
    text-wrap: balance;
  }
}

/* Hero font families registered in WordPress. */
#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) :is(.et_pb_text, p, .et_pb_button) {
  font-family: rucksack, Helvetica, Arial, sans-serif;
}

#main-content .et_pb_section:is(.tp-hero, :has(.header-head)) :is(h1, h2, h3, h4, h5, h6) {
  font-family: Gilroy, Helvetica, Arial, sans-serif;
}

/* Locally hosted Gilroy faces. */
@font-face {
  font-family: 'Gilroy';
  src: url('/wp-content/fonts/Gilroy-Thin.woff') format('woff');
  font-style: normal;
  font-weight: 100;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('/wp-content/fonts/Gilroy-UltraLight.woff') format('woff');
  font-style: normal;
  font-weight: 200;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('/wp-content/fonts/Gilroy-Light.woff') format('woff');
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('/wp-content/fonts/Gilroy-Regular.woff') format('woff');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('/wp-content/fonts/Gilroy-Medium.woff') format('woff');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('/wp-content/fonts/Gilroy-SemiBold.woff') format('woff');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('/wp-content/fonts/Gilroy-Bold.woff') format('woff');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('/wp-content/fonts/Gilroy-ExtraBold.woff') format('woff');
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('/wp-content/fonts/Gilroy-Black.woff') format('woff');
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy Heavy';
  src: url('/wp-content/fonts/Gilroy-Heavy.woff') format('woff');
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}
