/* ---------- Global Styles ---------- */
html {
  font-size: var(--root-font-size);
}
body {
  background-color: var(--bg-page);
  font-family: var(--font-fam);
}
.touch-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
}
p {
  font-size: var(--f-sz-p);
  line-height: var(--lh-copy);
}
p.small {
  font-size: var(--f-sz-p-small);
}
p.large {
  font-size: var(--f-sz-p-large);
}
p.caption {
  font-size: var(--f-sz-p-caption);
}
a {
  opacity: var(--btn-default-op);
  text-decoration: none;
  line-height: var(--lh-label);
  font-size: var(--f-sz-p-small);
}
a:hover {
  opacity: var(--btn-hover-op);
}
a:active {
  opacity: var(--btn-active-op);
}
a:focus-visible {
  opacity: var(--btn-focus-op);
}
em {
  font-style: italic;
}
strong {
  font-weight: var(--wt-bold);
}
h1,
h2,
h3,
h4,
h5,
h6 {
  /* heading reset*/
  font-size: var(--root-font-size);
  line-height: var(--lh-heading);
  font-weight: var(--wt-bold);
}
.h-hero {
  font-size: var(--f-sz-h-1);
  line-height: var(--lh-heading);
  font-weight: var(--wt-bold);
}
.h-page {
  font-size: var(--f-sz-h-2);
  line-height: var(--lh-heading);
  font-weight: var(--wt-bold);
}
.h-page-sub {
  font-size: var(--f-sz-h-5);
  line-height: var(--lh-copy);
  font-weight: var(--wt-medium);
}
.h-page-sub em {
  font-weight: var(--wt-bold);
}
.h-page-metadata {
  font-size: var(--f-sz-h-6);
  line-height: var(--lh-heading);
  font-weight: var(--wt-bold);
}
.h-section {
  font-size: var(--f-sz-h-3);
  line-height: var(--lh-heading);
  font-weight: var(--wt-medium);
}
.h-card {
  font-size: var(--f-sz-h-4);
  line-height: var(--lh-heading);
  font-weight: var(--wt-medium);
}
.h-card-sub {
  font-size: var(--f-sz-h-6);
  line-height: var(--lh-heading);
  font-weight: var(--wt-medium);
}
.h-card-small {
  font-size: var(--f-sz-h-5);
  line-height: var(--lh-heading);
  font-weight: var(--wt-medium);
}

/* ---------- GLOBAL PAGE STRUCTURE ---------- */

/* PAGE SECTIONS */
section.problems,
section.work,
section.impact,
section.home-case-study,
section.work-examples {
  display: flex;
  flex-direction: column;
  gap: var(--gap-within-sections);
  margin-bottom: var(--gap-page-sections);
}
section.problems > *,
section.work > *,
section.impact > *,
section.home-case-study > *,
section.work-examples > * {
  width: 100%;
}
/* NAV */
nav.top-bar {
  width: 100vw;
  height: var(--height-nav);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--gap-list);
  padding: var(--pad-nav);
  box-sizing: border-box;
}
nav.top-bar .nav-item {
  display: flex;
  align-items: center;
  color: var(--btn-primary-default);
  gap: var(--gap-btn-icon);
}
@media (max-width: 767.8px) {
  /* On Phones, hide labels */
  .nav-item span {
    display: none;
  }
}
/* HERO */
section.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
section.hero .main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: var(--pad-page);
  box-sizing: border-box;
  width: 100vw;
}
section.hero.case-study .main {
  gap: var(--gap-flex);
}

@media (max-width: 767.8px) {
  /* On phones, image should stack on top of title */
  section.hero.case-study .main {
    flex-direction: column;
    justify-content: center;
    align-items: normal;
  }
}

section.hero.case-study .main img {
  flex: 2 1 0;
  min-width: 0;
  max-height: 65vh;
  object-fit: contain;
}
section.hero.case-study .main > div {
  flex: 1 1 0;
  min-width: 0;
}
section.home.hero > .main {
  max-width: 65vw;
  margin: 0 auto;
}
@media (max-width: 767.8px) {
  section.home.hero > .main {
    max-width: 100vw;
  }
}
@media (min-width: 768px) and (max-width: 1024px) {
  section.hero.case-study .main > img {
    flex: 1 1 0;
  }
  section.home.hero > .main {
    max-width: 100vw;
  }
}

section.hero .summary {
  box-sizing: border-box;
  flex: 0;
  margin: 0 var(--pad-page) var(--pad-page) var(--pad-page);
  padding: var(--pad-page);
}

/* TITLES */
.title {
  background: var(--col-bg-section-title);
  color: var(--col-txt-section-title);
  padding: var(--pad-title) 0;
}
/* SEGMENTS */
.segment {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-page);
  box-sizing: border-box;
}

.segment.content,
.segment .content {
  display: flex;
  flex-direction: column;
  gap: var(--gap-p-break);
}
.segment.content .chunk,
.segment .content .chunk {
  display: flex;
  flex-direction: column;
  gap: var(--gap-l-break);
}
.segment.content,
.segment .content .solid-button {
  align-self: flex-start;
}
.segment.img-full,
.segment .img-full {
  padding: var(--pad-page);
  display: flex;
  align-items: center;
  gap: var(--gap-flex);
  box-sizing: border-box;
}

.segment.img-full > p,
.segment .img-full > p {
  flex: 1 1 0;
}
.segment.img-full > img,
.segment .img-full > img {
  flex: 2 1 0;
  min-width: 0;
  max-height: var(--height-max-img-v);
  object-fit: contain;
}
@media (max-width: 767.8px) {
  /* On phones, image should stack on top of title */
  .segment.img-full {
    flex-direction: column;
    justify-content: center;
    align-items: normal;
  }
}
@media (min-width: 768px) and (max-width: 1024px) {
  .segment.img-full > img {
    flex: 1 1 0;
  }
}
@media (max-width: 1366px) /* XL Desktop or smaller */ {
  .segment.card {
    border-radius: 0px;
  }
}
.segment.project {
  padding: var(--pad-page);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--gap-p-break);
}
/* .segment.project.img {
  display: flex;
  flex-direction: row-reverse;
  gap: var(--gap-flex);
} */
.segment.project .img.right {
  display: flex;
  flex-direction: row-reverse;
  gap: var(--gap-flex);
}
.segment.project .img.left {
  display: flex;
  gap: var(--gap-flex);
}
.segment.project .img.v-centered {
  align-items: center;
}
.segment.project .img .project-image {
  flex: 1 1 0;
  min-width: 0;
}
.segment.project .img .project-image.wide {
  flex: 3 1 0;
}
.segment.project .img .project-image.extra-wide {
  flex: 6 1 0;
}
.segment.project .img .content {
  flex: 4 1 0;
}
.segment.project .img .project-image video,
.segment.project .img .project-image img {
  /* min-width: 0; */
  width: 100%;
  max-height: var(--height-max-img-v);
  object-fit: contain;
}
@media (min-width: 768px) and (max-width: 1024px) {
  .segment.project .img .project-image {
    flex: 2 1 0;
  }
  .segment.project .img .project-image.extra-wide {
    flex: 2 1 0;
  }
}
@media (max-width: 767.8px) {
  .segment.project .img.right,
  .segment.project .img.left {
    display: flex;
    flex-direction: column-reverse;
    gap: var(--gap-flex);
  }
  .segment.project .img-full {
    flex-direction: column;
  }
  .segment.project .img-full img {
    width: 100%;
  }
}
/* ---------- COMPONENTS ---------- */
/* ATOMS */
.tag {
  background: var(--ui-hl);
  display: inline-block;
  border-radius: var(--br-round);
  color: var(--text-rev-color);
  padding: var(--gap-sp-8) var(--gap-sp-16);
}
.tag p {
  line-height: var(--lh-label);
  font-size: var(--f-sz-p-caption);
}

blockquote {
  background: url(../images/quote-icon.svg) no-repeat 10px 15px;
  overflow: visible;
}
blockquote p {
  font-size: var(--f-sz-blockquote);
  color: var(--text-1-color);
  font-style: italic;
}
blockquote p.author {
  font-size: var(--f-sz-p-small);
}
/*
.device {
   box-shadow: var(--shadow-down); 
} */
/* BUTTONS */
a.ghost-button {
  display: inline-block;
  line-height: var(--lh-label);
  padding: calc(var(--l-sp-16) + 1px) var(--l-sp-28) calc(var(--l-sp-16) - 1px)
    var(--l-sp-28);
  border: 3px var(--btn-primary-default) solid;
  color: var(--btn-primary-default);
  border-radius: var(--br-16);
  font-weight: var(--wt-bold);
}
a.solid-button {
  display: inline-block;
  line-height: var(--lh-label);
  padding: calc(var(--l-sp-16) + 1px) var(--l-sp-28) calc(var(--l-sp-16) - 1px)
    var(--l-sp-28);
  border: 3px var(--btn-primary-default) solid;
  background-color: var(--btn-primary-default);
  color: var(--text-rev-color);
  border-radius: var(--br-16);
  font-weight: var(--wt-bold);
}
/* ---------- CARDS ---------- */
/* GEN. CARD */
.card {
  background: var(--bg-card);
  /* padding: var(--pad-card); */
  border-radius: var(--br-16);
}

.example-content {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sp-20);
}

/* ---------- EXAMPLE LAYOUTS ---------- */
/* ALL FLEX LAYOUTS & PHONE */
.flex-example {
  display: flex;
  justify-content: center;
  /* align-items: center;  I think this is messing up layouts*/
  flex-direction: column;
  gap: var(--gap-flex-ltr);
}
/* IMPROVE - For left/right layouts this makes the image center in a large chunk of space, can just the text fill up the space? 
*/
.flex-example img {
  width: 100%; /* Images should be full-width */
  height: auto; /* ... and maintain their aspect ratio */
  max-height: 45vh; /* ... but be restricted to 45% of the viewport height to make sure they never grow too tall */
  object-fit: contain;
}
.flex-example video {
  height: 100%;
  max-height: 45vh;
}
.grid-example {
  display: flex;
  gap: var(--gap-flex-ltr);
}
.grid-example img {
  flex: 1 1 auto;
  height: auto;
  min-width: 0;
}
/* TABLET */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Images go left/right on side-by-side templates */
  .flex-example.img-left > *,
  .flex-example.img > * {
    min-width: 0;
    flex: 1;
  }
  .flex-example.img-left {
    flex-direction: row;
  }
  .flex-example.img {
    flex-direction: row-reverse;
  }
}
@media (min-width: 1025px) and (max-width: 1366px) {
  /* Images go left/right on side-by-side templates */
  .flex-example.img-left > *,
  .flex-example.img > * {
    min-width: 0;
  }
  .flex-example.img-left {
    flex-direction: row;
  }
  .flex-example.img {
    flex-direction: row-reverse;
  }
  .flex-example.img > div,
  .flex-example.img-left > div {
    flex: 1 1 0;
  }
  .flex-example.img > img,
  .flex-example.img-left > img {
    flex: 0 0 auto;
    width: auto;
  }
}
/* XL-Desktop: >1366px */
@media (min-width: 1367px) {
  /* Images go left/right on side-by-side templates AND top templates */
  .flex-example.img-left > *,
  .flex-example.img > *,
  .flex-example.img-top > * {
    min-width: 0;
  }
  .flex-example.img-left,
  .flex-example.img-top {
    flex-direction: row;
  }
  .flex-example.img {
    flex-direction: row-reverse;
  }
  .flex-example.img > div,
  .flex-example.img-left > div,
  .flex-example.img-top > div,
  .flex-example.img-top > img {
    flex: 1 1 0;
  }
  .flex-example.img > img,
  .flex-example.img-left > img {
    flex: 0 0 auto;
    width: auto;
  }
}

/* IMG TOP - xPhone, xTablet, xDesktop image is on top. XL Desktop is L/R */

/* IMG LEFT/IMG RIGHT - xTablet, xDesktop, XL Desktop is L/R, xPhone is on top */

/*
.flex-example.img {
  flex-direction: row-reverse;
}
.flex-example.img-lg-top {
  flex-direction: column;
}
.flex-example > :not(img) {
  flex: 1;
}
.flex-example.img img,
.flex-example.img-left img {
  width: auto;
  max-height: 45vh;
  align-self: center;
}

.flex-example.img-lg-top img {
  width: 100%;
  max-width: 75vw;
  height: auto;
}

.flex-example.img,
.flex-example.img-left {
  flex-direction: column;
}

.flex-example.img img,
.flex-example.img-left img {
  width: 100%;
  height: auto;
}
/*


/* FOOTER NAV  */
.inner-segment.footer {
  padding: 0px var(--gap-sp-24);
}
.more-links {
  display: flex;
  gap: var(--gap-sp-24);
}
.more-links .card {
  flex-direction: column;
  text-align: center;
  flex: 1 1 0;
}
nav.more-links .card > *:not(h5) {
  align-self: center;
}
/* ---------- PER DEVICE THEMING * ---------- */
/* Phone: <768px */
@media (max-width: 767.98px) {
}

/* Tablet: 768–1024px */
@media (min-width: 768px) and (max-width: 1024px) {
  /*
  .flex-example {
    align-items: center;
  }

  .flex-example > img,
  .flex-example > :not(img) {
    flex: 1 1 0;
    min-width: 0;
  }

  .flex-example > img {
    width: 100%;
    height: auto;
    max-width: 100%;
  }*/
}

/* Desktop: 1025–1366px */
@media (min-width: 1025px) and (max-width: 1366px) {
  /*
  .flex-example.img-lg-top:nth-of-type(2n) {
    flex-direction: row;
  }
  .flex-example.img-lg-top:nth-of-type(2n + 1) {
    flex-direction: row-reverse;
  }
  
  .flex-example.img-lg-top img {
    width: 50%;
    max-width: 75vw;
    height: auto;
  }*/
}

/* XL-Desktop: >1366px */
@media (min-width: 1367px) {
  /*.flex-example.img-lg-top:nth-of-type(2n) {
    flex-direction: row;
  }
  .flex-example.img-lg-top:nth-of-type(2n + 1) {
    flex-direction: row-reverse;
  }
  
  .flex-example.img-lg-top img {
    width: 50%;
    max-width: 75vw;
    height: auto;
  }*/
}
