/*
 * EMFN style overrides
 *
 * Enqueued after the main theme stylesheet, so these styles will take 
 * precedence over the default styles provided by the theme, depending on 
 * selector specificity. You may still need `!important` to fight long 
 * selectors or third-party plugin CSS
 */

:root {
  --emfn-header-footer: #efece7;
  --emfn-action-pack-mint: #eefdf2;
  --emfn-action-pack-green: #009966;
  --emfn-action-pack-visited: #00724c;
}

/* site title*/
.site-title a {
  color: var(--newspack-primary-color) !important;
  font-size: 1rem;
  font-family: var(--newspack-theme-font-body);
  text-transform: uppercase;
}

/*above-header widget banner*/
.above-header-widgets > div.wrapper {
  max-width: 100vw !important;
  margin: 0;
  width: 100vw;
}
.above-header-widgets > div.wrapper p {
  hyphens: auto;
  text-wrap: balance;
}
.wp-elements-192648feabfe8b91b2dfa69a9e73100d a:where(:not(.wp-element-button)),
.above-header-widgets > div.wrapper a:link,
.above-header-widgets > div.wrapper a:visited {
  text-decoration: underline;
}
.above-header-widgets > div.wrapper a:hover,
.above-header-widgets > div.wrapper a:active {
  color: color-mix(var(--newspack-theme-color-primary), white 50%);
}

/* Show Breadcrumbs only on Archive pages*/
.site-breadcrumb,
body.author .site-breadcrumb {
  display: none !important;
}
body.archive .site-breadcrumb {
  display: inherit !important;
}

/*capitalize By in all normal bylines*/
.entry-meta .byline:not(.sponsor-byline) > span {
  text-transform: capitalize;
}

/* for all Posts body copy, control internal hyperlink color*/
.type-post.post .entry-content .wp-block-paragraph a:link,
.type-post.post .entry-content a:active,
.type-post.post .entry-content a:hover,
.type-post.post .entry-content .wp-block-paragraph a:visited {
  color: inherit !important;
}

.type-post.post .entry-content a:active,
.type-post.post .entry-content a:hover {
  color: var(--newspack-theme-color-primary-variation);
}

.type-post.post .entry-content a:visited {
  color: var(--newspack-theme-color-secondary-against-white);
}

/* convert all horizontal rules to rounded-corner style */
hr,
.entry .entry-content > .wp-block-separator,
.entry .entry-content > hr,
.rounded-hr {
  background-color: var(--newspack-theme-color-primary);
  border-radius: 3px;
  width: 100px !important;
  height: 6px !important;
}

/* apply our styles to tables with .emfn-table */
figure.emfn-table.wp-block-table > table {
  max-width: 80% !important;
}
figure.emfn-table.wp-block-table thead {
  border-color: var(--newspack-listings--grey-medium);
}
figure.emfn-table.wp-block-table thead th {
  border: none;
}
figure.emfn-table.wp-block-table tbody tr:not(:last-of-type) {
  border: 1px solid var(--newspack-listings--grey-medium);
  border-width: 1px 0px;
}
figure.emfn-table.wp-block-table tbody td {
  border-width: 0px;
}
figure.emfn-table.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
  background-color: #f1f1f1;
}

/* apply our styles to Details blocks*/
.wp-block-details {
  border-width: 0px;
  border-bottom: 1px solid var(--newspack-listings--grey-medium);
  display: block;
  width: 100%;
  margin-bottom: 32px !important;
}
.wp-block-details:last-of-type {
  border-bottom-width: 0px;
}

/*knock out magins on .above-footer widget content*/
.above-footer-widgets .wrapper {
  margin: auto;
  max-width: 100vw;
  width: auto;
}
.above-footer-widgets .wrapper .above-footer.widget {
  margin-bottom: 0px !important;
}

/*hide breadcrumbs on homepage*/
body.home .site-breadcrumb {
  display: none !important;
}
/* Content - Breadcrumbs */
@media (min-width: 782px) {
  .site-breadcrumb {
    margin: 1.5rem 0 0.25rem;
  }
}
.site-breadcrumb .wrapper > span {
  color: var(--newspack-theme-color-text-main);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--newspack-theme-font-display);
  font-size: 14px;
  gap: 0.5em;
}
.site-breadcrumb .breadcrumb_last {
  font-weight: bold;
  border-bottom: 2px solid var(--newspack-theme-color-secondary);
}

/*left-align logo*/
.h-sh.h-ll .site-branding {
  margin-right: auto;
}

/*right-align primary and tertiary navs */
.h-sh .site-header .wrapper {
  justify-content: space-between;
}

/* drop forced separation of nav locations*/
.h-sh.h-ll.hide-site-tagline.has-tertiary-menu .nav-wrapper + .nav-wrapper {
  margin-left: 10px;
}

/*convert nav3/tertiary to our style of button*/
.site-header .nav3 li a {
  background-color: var(--newspack-primary-color) !important;
  color: var(--newspack-primary-contrast-color) !important;
  border-radius: 32px;
  padding: 6px 24px;
  text-align: center;
}

/*restyle footer text*/
.site-info,
.site-info a {
  color: var(--newspack-theme-color-primary);
  font-weight: 200;
  font-style: normal;
  font-size: var(--wp--preset--font-size--small) !important;
}

/** ********** ACTION PACK ********** 
 * styles for Action Pack quiz & response page
 * - .action-item -- link recommendations inline in the quiz
 * - #fema-risks -- disclaimer about FEMA data inline in the quiz
 * - .emfn-content-cards -- "rounded box" styles for Content Loop entries
 * - .category-republishable -- peach background for Republishable category cards
 * - overrides for the specific . Content Loop on the Action Pack page
 * note: some styles also come from the Action Pack plugin itself, which is a bit messy but was 
 * faster than trying to override all the plugin styles with more specific selectors
 */
/* action items*/
.action-item {
  background-color: var(--emfn-action-pack-mint);
  border-radius: 16px;
  padding: 20px;
  color: var(--emfn-action-pack-green);
  list-style: none;
  margin: 0px;
}
.action-item p {
  margin: 0px;
}
.action-item a,
.action-item a:link,
.action-item a:visited {
  color: var(--emfn-action-pack-visited);
}
.action-item li.template {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.action-item li.template .material-symbols-outlined {
  flex-shrink: 0;
  float: none;
}

/* FEMA risk explanation within question Description */
#fema-risks {
  margin: 0px;
  padding: 0px;
  font-size: var(--newspack-theme-font-size-xs);
}

/* Center title only in Action Pack pages*/
body.parent-pageid-284 .entry-header {
  text-align: center;
}

/*Content Loop adjustments*/
.emfn-content-cards.wpnbha .article-section-title {
  border-bottom: 1px solid var(--newspack-theme-color-border-light);
}
/* this may not apply to anything? */
.archive article.entry .entry-content > * {
  border-top: 1px solid var(--newspack-theme-color-border-light);
  padding-top: 0px;
  margin-top: 0px;
}
.emfn-content-cards.wpnbha article,
.archive article.entry {
  padding: 24px 36px 20px 36px;
  background-color: var(--newspack-primary-contrast-color);
  border-radius: 24px;
  border: 1px solid var(--newspack-theme-color-border-light);
  box-shadow: rgba(0, 0, 0, 0.03) 0px 0px 6px 2px;
}

/* Republishable Card Peach */
:root {
  --republishable-peach: #fff7ed;
  --republishable-peach-border: #ffd7a8;
}
.emfn-content-cards.wpnbha article.category-republishable {
  background-color: var(--republishable-peach);
  border: 1px solid var(--republishable-peach-border);
}
.emfn-content-cards.wpnbha article.category-republishable .entry-wrapper .entry-meta {
  border-top-color: var(--republishable-peach-border);
}
/* Republishable Category link */
.emfn-content-cards.wpnbha article.category-republishable .cat-links a {
  display: inline-block;
}
/* change color for Type > Republishable Category on Republishable Cards */
.emfn-content-cards.wpnbha.show-category
  .category-republishable
  .cat-links
  a[href*="resources/type/republishable"] {
  --cat-color: var(--republishable-peach-border);
}
/* Republishable Card byline */
.emfn-content-cards.wpnbha article.category-republishable .entry-wrapper .entry-meta .byline {
  color: var(--newspack-theme-color-secondary-variation-against-white);
}
/* Republishable card byline links need to be a bit darker for accessibility */
.emfn-content-cards.wpnbha article.category-republishable .entry-wrapper .entry-meta .byline a {
  color: color-mix(in srgb, var(--newspack-theme-color-primary-against-white) 80%, black);
}

/*all Card Categories*/
.emfn-content-cards.wpnbha .cat-links a {
  background-color: var(--newspack-primary-contrast-color);
  border: 1px solid var(--newspack-ui-color-neutral-40);
  color: var(--newspack-theme-color-text-light);
  gap: 0em 1em;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
}
.emfn-content-cards.wpnbha .cat-links a:hover,
.emfn-content-cards.wpnbha .cat-links a:link:hover {
  border-color: var(--newspack-ui-color-neutral-50);
  color: var(--newspack-theme-color-text-medium);
  background-color: var(--newspack-primary-contrast-color);
  text-decoration-color: var(--newspack-theme-color-text-medium);
}
.emfn-content-cards.wpnbha .entry-sponsors {
  width: auto;
}
.emfn-content-cards.wpnbha .entry-sponsors.plus-author:not(:last-child) {
  margin-bottom: 0;
}

/*Card bylines*/
.emfn-content-cards.wpnbha .entry-wrapper .entry-meta {
  color: var(--newspack-theme-color-text-light);
  border-top: 1px solid var(--newspack-theme-color-border-light);
  gap: 0.5em 0.25em;
  margin-top: 12px;
  padding-top: 12px;
}
.emfn-content-cards.wpnbha .entry-wrapper .entry-meta,
.emfn-content-cards.wpnbha .entry-sponsors.plus-author {
  color: var(--newspack-theme-color-text-light);
  font-size: 13px !important;
}
.emfn-content-cards.wpnbha .entry-wrapper .entry-meta .byline,
.emfn-content-cards.wpnbha .entry-wrapper .entry-meta .entry-date {
  margin-right: 10px;
}

/* Article body*/
.emfn-content-cards.wpnbha .entry-wrapper p {
  padding: 6px 0px;
}
.single:not(.has-large-featured-image) .entry-header {
  border-bottom-color: var(--newspack-ui-color-neutral-40);
}

/* Content Loop load-more button */
.emfn-content-cards.wpnbha.has-more-button button {
  background-color: var(--newspack-primary-contrast-color);
  border-radius: 8px;
  border: 1px solid var(--newspack-ui-color-neutral-50);
  box-shadow: rgba(0, 0, 0, 0.03) 0px 0px 6px 2px;
  color: var(--newspack-theme-color-primary);
  margin-top: 2em;
  padding: 8px 18px;
}
.emfn-content-cards.wpnbha.has-more-button button:hover {
  background-color: var(--newspack-ui-color-neutral-10);
  border-color: var(--newspack-theme-color-secondary);
}

/** ********* MORE BUTTONS ********** 
 * styles for the "More"-like buttons that appear 
 * - at the end of the Content Loops on HP and Action Pack
 * - in the Facet Everything search results in Resources Library
 */
.facetwp-facet-load_more .facetwp-per-page-select,
.emfn-content-cards.wpnbha.has-more-button button {
  background-color: var(--newspack-primary-contrast-color);
  border-radius: 8px;
  border: 1px solid var(--newspack-ui-color-neutral-50);
  box-shadow: rgba(0, 0, 0, 0.03) 0px 0px 6px 2px;
  color: var(--newspack-theme-color-primary);
  font-size: var(--newspack-theme-font-size-sm);
  font-weight: 700;
}

.facetwp-facet-load_more .facetwp-per-page-select:hover,
.emfn-content-cards.wpnbha.has-more-button button:hover {
  background-color: var(--newspack-ui-color-neutral-30);
  border-color: var(--newspack-theme-color-secondary);
}

/** ********** SPONSOR & CATEGORY LABELS ********** 
 * styles for Action Pack quiz & response page
 * - hide the "Sponsor/Partner" category label that appears on Posts
 * - convert default category and tag styles to our button style, for both Card and non-Card contexts
 */
/* hide all sponsor labels */
.cat-links span.flag,
.archive article .sponsor-label {
  display: none;
}

/* all Category labels */
.cat-links a {
  color: var(--newspack-primary-contrast-color);
  text-transform: none;
  border: 1px solid var(--newspack-theme-color-primary-darken-10);
  background-color: var(--newspack-theme-color-primary);
  display: inline-block;
  padding: 6px 12px !important;
  border-radius: 8px;
  margin-bottom: 10px;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}
/* featured media - white text on black */
@media only screen and (min-width: 782px) {
  .featured-image-beside .cat-links a {
    padding: inherit;
  }
}

/* alter non-Card Tags */
.tags-links a {
  border: 1px solid var(--newspack-ui-color-neutral-40);
  background-color: var(--newspack-ui-color-neutral-5) !important;
  color: var(--newspack-theme-color-primary-variation-against-white) !important;
  padding: 10px 15px;
  border-radius: 8px;
  line-height: 1em;
  text-decoration: none;
  box-shadow: rgba(0, 0, 0, 0.03) 0px 0px 6px 2px;
}
.tags-links a:hover {
  border-color: var(--newspack-ui-color-neutral-50) !important;
  background-color: var(--newspack-ui-color-neutral-10) !important;
}

/* make Sponsor logos a circle */
.wpnbha .sponsor-logos img {
  border-radius: 50%;
  object-fit: cover;
  width: 40px;
  height: 40px;
}

/** 
 * Category pill colors 
 * used tetradic colors off https://www.colorhexa.com/e7bbb4
 */
/* all Resource pills & Timing category group*/
.emfn-content-cards.wpnbha.show-category .cat-links a[href] {
  --cat-color: var(--newspack-ui-color-neutral-5);
  background-color: var(--cat-color);
  border: 1px solid color-mix(in srgb, var(--cat-color), black 15%);
  color: color-mix(in srgb, var(--cat-color), black 66%);
}

/* Disaster category group*/
.emfn-content-cards.wpnbha.show-category .cat-links a[href*="resources/disasters/"] {
  --cat-color: #e7bbb4;
}

/* Operational Challenge category group*/
.emfn-content-cards.wpnbha.show-category .cat-links a[href*="resources/challenge/"] {
  --cat-color: #b4e7bb;
}
/* Type category group*/
.emfn-content-cards.wpnbha.show-category .cat-links a[href*="resources/type/"] {
  --cat-color: #b4e0e7;
}
/* Newsroom Condition category group*/
.emfn-content-cards.wpnbha.show-category .cat-links a[href*="resources/newsroom-condition/"] {
  --cat-color: #e7b4e0;
}

/** ********** YOAST FAQ ********** 
 * homepage FAQ styles, including the question and answer formatting
 */
.schema-faq .schema-faq-section {
  margin: 50px 0px;
}

.schema-faq .schema-faq-section .schema-faq-question:before {
  content: "🛈 ";
  color: var(--newspack-theme-color-primary) !important;
  font-size: var(--newspack-theme-font-size-md);
  font-weight: 500;
  text-align: top;
  width: 33px;
  display: inline-block;
}
.schema-faq .schema-faq-section .schema-faq-answer {
  font-size: var(--newspack-theme-font-size-sm);
}

/** ********** Newspack Tabs ********** 
 * override styles for newspack tabs in Pages
 */
.emfn-tabs.wp-block-newspack-tabs {
  background-color: transparent;
}
.emfn-tabs.wp-block-newspack-tabs .tab-item.is-active {
  background-color: var(--newspack-primary-contrast-color);
  border: 1px solid var(--newspack-ui-color-neutral-30);
}

/** ********** FACETWP CARDS ********** 
 * styles for the cards that appear in the FacetWP search results on the Resources page, 
 * which are separate from the main Content Loop cards and need some specific overrides to match our styles
 */

@media (max-width: 768px) {
  .post-2278 .wp-block-columns {
    flex-direction: column-reverse !important;
  }
}
.fwpl-result {
  background-color: var(--newspack-primary-contrast-color) !important;
  border-radius: 24px !important;
  border: 1px solid var(--newspack-theme-color-border-light) !important;
  box-shadow: rgba(0, 0, 0, 0.03) 0px 0px 6px 2px !important;
  padding: 24px 36px 20px 36px !important;
  margin-bottom: 1rem !important;
}

/* Title */
.fwpl-item.el-ywvhp a {
  font-size: 1.2em !important;
  font-weight: 700 !important;
  color: var(--newspack-secondary-color) !important;
  text-decoration: none !important;
  font-family: var(--newspack-theme-font-heading) !important;
}

.fwpl-item.el-ywvhp a:hover {
  color: var(--newspack-theme-color-primary) !important;
}

/* Author and date - same size */
.fwpl-item.el-7y595n,
.fwpl-item.el-amrzwf {
  font-size: 13px !important;
  color: var(--newspack-theme-color-text-light) !important;
  display: inline !important;
  margin-right: 0.75rem !important;
}

/* Excerpt/subtitle */
.fwpl-item.el-zz14v8 {
  font-size: var(--newspack-theme-font-size-sm) !important;
  font-style: italic !important;
  line-height: 1.6 !important;
  margin-top: 0.4rem !important;
}

/* Keep Reading */
.fwpl-item.el-qpacxb {
  margin-top: 8px !important;
  display: block !important;
}

.fwpl-btn {
  color: var(--newspack-secondary-color) !important;
  text-decoration: underline !important;
  font-size: 0.9em !important;
}

.fwpl-btn:hover {
  color: var(--newspack-theme-color-primary) !important;
}

.facetwp-counter {
  display: none !important;
}

/* Search bar */
.facetwp-search {
  border: 1px solid var(--newspack-ui-color-neutral-40) !important;
  border-radius: 8px !important;
  padding: 10px 16px !important;
  font-size: var(--newspack-theme-font-size-sm) !important;
  width: 100% !important;
  background-color: var(--newspack-primary-contrast-color) !important;
  color: var(--newspack-theme-color-text-main) !important;
}

.facetwp-search:focus {
  border-color: var(--newspack-secondary-color) !important;
  outline: none !important;
}

.facetwp-facet-search .facetwp-input-wrap {
  width: 100% !important;
  display: block !important;
}

.facetwp-icon {
  padding: 0px 10px;
}

/* Category pills border top */
.fwpl-item.el-lvcwxa {
  border-top: 1px solid var(--emfn-header-footer) !important;
  padding-top: 12px !important;
  margin-top: 12px !important;
  font-size: 0 !important;
}

.fwpl-term {
  font-size: 14px !important;
}

/* Facet's pagination drop-down */
.facetwp-facet-load_more .facetwp-per-page-select {
  padding: 4px 16px;
  appearance: base-select;
}

/* Default pills */
.fwpl-term a {
  background-color: var(--newspack-ui-color-neutral-5) !important;
  border: 1px solid var(--newspack-ui-color-neutral-50) !important;
  color: var(--newspack-ui-color-neutral-60) !important;
  display: inline-block !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  margin: 0 4px 6px 0 !important;
  text-decoration: none !important;
  font-size: 0.8em !important;
}

.fwpl-term a:hover {
  border-color: var(--newspack-ui-color-neutral-50) !important;
  background-color: var(--newspack-ui-color-neutral-30) !important;
}

/** 
 * Category pill colors 
 * used tetradic colors off https://www.colorhexa.com/e7bbb4
 */
/* all Resource pills & Timing category group*/
.cat-links a[href],
.fwpl-term a[href] {
  --cat-color: var(--newspack-ui-color-neutral-5);
  background-color: var(--cat-color) !important;
  border: 1px solid color-mix(in srgb, var(--cat-color), black 15%) !important;
  color: color-mix(in srgb, var(--cat-color), black 66%) !important;
  transition: all 0.15s ease-in-out;
}
.cat-links a[href]:hover,
.fwpl-term a[href]:hover,
.cat-links a[href]:active,
.fwpl-term a[href]:active {
  background-color: color-mix(in srgb, var(--cat-color), black 10%) !important;
  border-color: color-mix(in srgb, var(--cat-color), black 20%) !important;
}

/* Disaster category group*/
.cat-links a[href*="resources/disasters/"],
.fwpl-term a[href*="/resources/disasters/"] {
  --cat-color: #e7bbb4;
}

/* Operational Challenge category group*/
.cat-links a[href*="resources/challenge/"],
.fwpl-term a[href*="/resources/challenge/"] {
  --cat-color: #b4e7bb;
}
/* Type category group*/
.cat-links a[href*="resources/type/"],
.fwpl-term a[href*="/resources/type/"] {
  --cat-color: #b4e0e7;
}
/* Newsroom Condition category group*/
.cat-links a[href*="resources/newsroom-condition/"],
.fwpl-term a[href*="/resources/newsroom-condition/"] {
  --cat-color: #e7b4e0;
}
