/* CUSTOM VARIABLES */
:root {
  /* Colors */
  --color-black: #111;
  --color-white: #fff;
  --color-primarySuperDark: #e17e14;
  --color-primaryDarker: #e69b0f;
  --color-primaryDark: #f2b318;
  --color-primary: #fdc921;
  --color-primaryLight: #fedd71;
  --color-primaryLighter: #fff1c3;
  --color-primarySuperLight: #fffbeb;
  --color-grey: #666;
  --color-lightgrey: #f5f5f5;

  /* Icons */
  --icon-clr-header: var(--color-black);
  --icon-clr-footer: var(--color-primaryLighter);
  --icon-clr-primary: var(--color-primary);

  /* Fonts */
  --ff-primary: 'Poppins', sans-serif;
  --ff-body: var(--ff-primary);
  --ff-heading: var(--ff-primary);

  /* Font Weights */
  --fw-regular: 400;
  --fw-bold: 700;
  --fw-semibold: 600;

  /* Font Sizes */
  --fs-300: 0.8rem;
  --fs-400: 1rem;
  --fs-500: 1.4rem;
  --fs-550: 1.6rem;
  --fs-600: 1.8rem;
  --fs-700: 2.2rem;
  --fs-750: 2.5rem;
  --fs-800: 2.8rem;

  /* Specific Font Sizes */
  --fs-body: var(--fs-400);
  --fs-primary-heading: var(--fs-800);
  --fs-secondary-heading: var(--fs-700);
  --fs-nav: var(--fs-400);
  --fs-button: var(--fs-400);

  /* Sizes */
  --size-200: 0.5rem;
  --size-300: 0.75rem;
  --size-400: 1rem;
  --size-500: 1.5rem;
  --size-600: 2rem;
  --size-700: 3rem;
  --size-800: 4rem;
  --size-900: 5rem;

  /* Spacing */
  --ff-indent: 18px;
  --row-spacing: 2rem 0;
  --flow-margin: 1.4em;

  /* Border radius */
  --corners: 1.3em;
  --corners-sharp: 4px;

  /* Shadows */
  --shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
  --shadow-images: rgba(50, 50, 93, 0.25) 0px 30px 60px -12px,
    rgba(0, 0, 0, 0.3) 0px 18px 36px -18px;

  /* Page background colour */
  background: var(--color-primarySuperLight);  
}

/* RESPONSIVE FONT SIZES */
@media (min-width: 50em) {
  :root {
    --fs-300: 0.9rem;
    --fs-400: 1.1rem;
    --fs-600: 2rem;
    --fs-700: 3rem;
    --fs-750: 3.5rem;
    --fs-800: 4.5rem;
  }
}

/* CSS REFRESH */

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
* {
  margin: 0;
  padding: 0;
  font: inherit;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: 1.5;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}

/* Set shorter line heights on headings and interactive elements */
h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

/* Balance text wrapping on headings */
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Make images easier to work with */
img,
picture,
svg {
  max-width: 100%;
  display: block;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

/* GENERAL STYLING */
body {
  font-size: var(--ff-body);
  font-family: var(--ff-primary);
  color: var(--color-black);
  padding-bottom: 2em;
  line-height: 1.6;
}

/* FLEXBOX */
.flex {
  display: flex;
}

.gap-400 {
  gap: var(--size-400)
}

.ai--c {
  align-items: center;
}

.jc--sb { justify-content: space-between; }

.vertical-align-center {
  align-items: center;
}

.justify-self-end {
  justify-self: center;
}

@media (min-width: 50em) {
  .justify-self-end {
    justify-self: end;
  }
}

/* BUTTONS */
.button {
  cursor: pointer;
  text-decoration: none;
  border-radius: 100vmax;
  padding: 1em 1.75em;
  font-size: var(--fs-button);
  font-weight: var(--fw-bold);
  line-height: 1;
  transition-timing-function: ease-in-out;
  transition: 0.2s;
}

.button--primary {
  background-color: var(--color-primary);
  color: var(--color-black);
  border: 0;
}

.button--primary:hover,
.button--primary:focus-visible {
  background-color: var(--color-primaryDark);
}

.button--inverted {
  color: var(--color-primaryDarker);
  background-color: var(--color-white);
  border: 0;
}

.button--inverted:hover,
.button--inverted:focus-visible {
  color: var(--color-black);
}

.button--underlined {
  border-radius: 0;
  padding: 0;
  padding-bottom: 0.5em;
  border: 0;
  border-bottom: 2px solid var(--color-black);
  background: none;
  color: var(--color-black);
}

.button--underlined:hover,
.button--underlined:focus {
  border-color: var(--color-primaryDarker);
  color: var(--color-primaryDarker);
}

/* NAVIGATION */
.primary-header {
  padding: var(--size-500) 0;
}

.mobile-nav-toggle {
  display: none;
}

.nav-list {
  font-size: var(--fs-nav);
  font-weight: var(--fw-semibold);
  gap: clamp(var(--size-500), 5vw, var(--size-800));
}

.nav-list a {
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a:focus {
  color: var(--color-primaryDark);
}

@media (max-width: 50em) {
  .primary-navigation {
    display: none;
    position: fixed;
    padding: var(--size-600);
    inset: 7rem var(--size-400) auto;
    max-width: 25rem;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--corners-sharp);
    box-shadow: var(--shadow);
  }

  .primary-header[data-overlay]::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgb(0 0 0 / 0), rgb(0 0 0 / 0.8));
  }

  .nav-list {
    display: grid;
    gap: var(--size-500);
    text-align: center;
    font-weight: var(--fw-bold);
  }

  .primary-navigation[data-visible] {
    display: block;
  }

  .mobile-nav-toggle {
    display: block;
    position: fixed;
    top: var(--size-600);
    right: var(--size-500);
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 0.5em;
    background-color: var(--color-primaryLighter);
    border-radius: var(--corners-sharp);
  }

  .mobile-nav-toggle .icon-close {
    display: none;
  }
}

/* SPRITES */
.image__logo {
  width: 4rem;
}

.header-logo {
  width: 60px;
  aspect-ratio: 1;
  fill: var(--icon-clr-header);
}

.footer-logo {
  width: 60px;
  aspect-ratio: 1;
  fill: var(--icon-clr-footer);
}

.nav-icon {
  width: 30px;
  aspect-ratio: 1;
  fill: var(--icon-clr-header);
}

a.logo:where(:hover, :focus) > .logo-icon {
  fill: var(--icon-clr-primary);
}

/* FOOTER */
.footer__form {
  grid-row: 2;
}

.footer__socials {
  grid-row: 4;
}

.primary-footer form {
  display: flex;
  gap: var(--size-300);
}

.primary-footer input {
  border-radius: 100vw;
  border: 0;
  padding: var(--size-300) var(--size-400);
}

.footer-nav {
  columns: 2;
  column-gap: clamp();
}

.footer-nav a {
  text-decoration: none;
  font-weight: var(--fw-semibold);
}

.footer-nav a:where(:hover, :focus) {
  color: var(--color-primary);
}

@media (max-width: 49em) {
  .primary-footer .even-columns > * {
    justify-self: center;
  }
  .primary-footer .even-columns {
    gap: 2.5em;
  }
}

@media (min-width: 50em) {
  .footer__logo {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .footer__socials {
    grid-column: 1;
    grid-row: 2;
  }

  .footer__nav {
    grid-column: 2;
    grid-row: 1;
  }

  .footer__form {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .footer__disclaimer {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
  }
}

/* SOCIAL LIST */

.social-list {
  display: flex;
  gap: var(--size-600);
}

.social-icon {
  width: var(--size-600);
  aspect-ratio: 1;
  fill: var(--icon-clr-footer);
}

.social-list a:where(:hover, :focus) .social-icon {
  fill: var(--icon-clr-primary);
}

@media (min-width: 50em) {
  .social-list {
    display: flex;
    gap: var(--size-300);
  }

  .social-icon {
    width: var(--size-500);
  }
}

/* UTILITIES */

/* Visually Hidden */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; /* added line */
  border: 0;
}

/* Container */
.container {
  --maxwidth: 80rem;
  --padding: 1rem;

  width: min(var(--maxwidth), 100% - (var(--padding) * 2));
  margin-inline: auto;
}

.row-small {
  max-width: 90em;
}

@media (min-width: 50em) {
  .row-small {
    max-width: 60em;
    margin-inline: auto;
  }
}

/* Grid Layouts */
.even-columns,
.sml-big-columns {
  display: grid;
  gap: 1rem;
}

@media (min-width: 50em) {
  .even-columns {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }

  .sml-big-columns {
    grid-template-columns: 1fr 6fr;
  }
}

/* Responsive Display */
.mbl--hide {
  display: none;
}

@media (min-width: 50em) {
  .mbl--hide {
    display: block;
  }
}

@media (max-width: 50em) {
  .move-ontop {
    order: -1;
  }
}

/* Row padding */
.padding-block-600 {
  padding-block: var(--size-600);
}
.padding-block-800 {
  padding-block: var(--size-800);
}

@media (max-width: 50em) {
  .padding-block-800 {
    padding-block: var(--size-600);
  }
}

/* Flow margins */
:where(.flow :not(:first-child)) {
  margin-top: var(--flow-spacer, var(--flow-margin));
}

.add-flow {
  margin-top: var(--flow-spacer, var(--flow-margin));
}

/* Text colours */
.text-black {
  color: var(--color-black);
}

.text-white {
  color: var(--color-white);
}

.text-primarySuperDark {
  color: var(--color-primarySuperDark);
}

.text-primaryDarker {
  color: var(--color-primaryDarker);
}

.text-primaryDark {
  color: var(--color-primaryDark);
}

.text-primary {
  color: var(--color-primary);
}

.text-primaryLight {
  color: var(--color-primaryLight);
}

.text-primaryLighter {
  color: var(--color-primaryLighter);
}

.text-primarySuperLight {
  color: var(--color-primarySuperLight);
}

.text-grey-400 {
  color: var(--color-grey);
}

.text-grey-100 {
  color: var(--color-lightgrey);
}

/* Background colours */
.bg-black {
  background-color: var(--color-black);
}

.bg-primarySuperDark {
  background-color: var(--color-primarySuperDark);
}

.bg-primaryDarker {
  background-color: var(--color-primaryDarker);
}

.bg-primaryDark {
  background-color: var(--color-primaryDark);
}

.bg-primary {
  background-color: var(--color-primary);
}

.bg-primaryLight {
  background-color: var(--color-primaryLight);
}

.bg-primaryLighter {
  background-color: var(--color-primaryLighter);
}

.bg-primarySuperLight {
  background-color: var(--color-primarySuperLight);
}

.bg-secondary {
  background-color: var(--color-grey);
}

.bg-secondaryLighter {
  background-color: var(--color-lightgrey);
}

/* Font weights */
.fw-bold {
  font-weight: var(--fw-bold);
}

.fw-semibold {
  font-weight: var(--fw-semibold);
}

.fw-regular {
  font-weight: var(--fw-regular);
}

strong {
  font-weight: var(--fw-semibold);
}

em {
  font-style: italic;
}

/* Font sizes */
.fs-primary-heading {
  font-size: var(--fs-primary-heading);
  line-height: 1.1;
}

.fs-secondary-heading {
  font-size: var(--fs-secondary-heading);
  line-height: 1.1;
}

.fs-300 {
  font-size: var(--fs-300);
}

.fs-400 {
  font-size: var(--fs-400);
}

.fs-500 {
  font-size: var(--fs-500);
}

.fs-550 {
  font-size: var(--fs-550);
}

.fs-600 {
  font-size: var(--fs-600);
}

.fs-700 {
  font-size: var(--fs-700);
}

.fs-750 {
  font-size: var(--fs-750);
}

.fs-800 {
  font-size: var(--fs-800);
}

@media (min-width: 50em) {
  .desktop-fs-550 {
    font-size: var(--fs-550);
  }
}

/* Font styling */
.ff-upper {
  text-transform: uppercase;
}

.ff-pill {
  display: inline-block;
  padding: 0.25em 1em;
  background-color: var(--color-primaryLighter);
  border-radius: 100vmax;
}

.ff-underline {
  border-bottom: 4px solid var(--color-primary);
  padding-bottom: var(--size-300);
  margin-bottom: var(--size-500);
  display: inline-block;
}

/* Text Alignment */
.center-mb-left {
  text-align: left;
}

.left-mb-center {
  text-align: center;
}

@media (min-width: 50em) {
  .left-mb-center {
    text-align: left;
  }

  .center-mb-left {
    text-align: center;
  }
}

/* Border radius */
.rounded {
  border-radius: var(--corners);
}
.sharp {
  border-radius: var(--corners-sharp);
}

/* Other */
.sticky {
  position: sticky;
  top: 20px;
}

/* UTILITIES END */

/* CARDS */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 3rem 2rem;
  list-style-type: none;
}

.card a {
  text-decoration: none;
}

.card__image {
  width: 100%;
  height: 20rem;
  overflow: hidden;
}

.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.8s ease;
}

.card__image:hover img {
  transform: scale(1.02);
}

/* BLOG */

.blog__content {
  display: grid;
  gap: 3rem;
}

@media (min-width: 50em) {
  .blog__content {
    grid-template-columns: 3fr 1fr;
    gap: 6rem;
  }

  .blog-body > h4 {
    line-height: 1.5;
  }

  .blog-body > h3 ~ h4 {
    margin-top: var(--size-700);
  }

  .blog-body > h3 + h4 {
    margin-top: var(--size-400);
  }
}

:where(.blog-body :not(:first-child)) {
  margin-top: var(--flow-spacer, var(--size-400));
}

.blog-body :where(ul, ol) {
  padding-left: var(--size-400);
  list-style-position: outside;
}

.blog-body li {
  padding-left: var(--size-200);
}

:where(.blog-body > .fs-600:not(:first-of-type)) {
  margin-top: var(--size-900);
}

@media (max-width: 50em) {
  :where(.blog-body > .fs-600:not(:first-of-type)) {
    margin-top: var(--size-700);
  }

}

.left-border-line {
  padding: var(--size-200) var(--size-500);
  border-left: 4px solid var(--color-primary);
}

.blog__nav :not(:first-child) {
  margin-top: var(--size-400);
}

.blog__nav * {
  list-style-type: none;
  color: var(--color-black);
  text-decoration: none;
  transition: all 0.4s ease;
}

.blog-nav-link:where(:hover, :focus, :active) {
  color: var(--color-primaryDark);
  font-weight: var(--fw-bold);
}

.blog__image {
  box-shadow: var(--shadow-images);
  max-height: calc(var(--size-900) * 5);
  overflow: hidden;
  border-radius: var(--corners);
}

.blog__image img {
  width: 100%;
  object-fit: cover;
}

.image-source {
  text-align: center;
  margin-top: var(--size-300);
}

.code-snippet {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: var(--corners);
  margin: 1em 0;
}

.blog__example {
  background-color: var(--color-primaryLighter);
  padding: 20px;
  border-radius: var(--corners);
  margin: 20px 0;
}

/* SPRINT 2 HTML-CSS POSITION PAGE */

.eg-ancestor {
  text-align: center;
  width: 100%;
  height: 12em;
  background-color: rgba(255, 183, 3, 0.2);
  border: 3px solid rgb(255, 183, 3);
  color: rgb(255, 183, 3);
  border-radius: var(--corners-sharp);
  position: relative;
}

.eg-relative {
  margin: 0;
  border: 3px solid rgba(33, 158, 188);
  background-color: rgba(33, 158, 188, 0.3);
  color: rgba(33, 158, 188);
  border-radius: var(--corners-sharp);
  position: relative;
  width: 9rem;
  height: 8rem;
  top: 0;
  left: 0;
}

.eg-absolute {
  margin: 0;
  border: 3px solid rgba(255, 0, 110);
  background-color: rgba(255, 0, 110, 0.25);
  color: rgba(255, 0, 110);
  border-radius: var(--corners-sharp);
  position: absolute;
  width: 9rem;
  height: 8rem;
  top: 0;
  right: 0;
}

.eg-fixed {
  margin: 0;
  border: 3px solid rgba(106, 153, 78);
  background-color: rgba(106, 153, 78, 0.25);
  color: rgba(106, 153, 78);
  border-radius: var(--corners-sharp);
  position: fixed;
  width: 9rem;
  height: 8rem;
  bottom: 0;
  right: 0;
}

/* SPRINT 4 TABLE */

table {
  width: 100%;
  border-radius: var(--corners-sharp);
  border-collapse: collapse;
  box-shadow: var(--shadow);
  background: var(--color-primaryLighter);
  border: 1px solid var(--color-primaryLight);
  border-bottom: 3px solid var(--color-primaryDark);
}

caption,
th,
td {
  padding: var(--size-200);
}

caption,
th {
  text-align: left;
}

th {
  background-color: var(--color-primaryDark);
  color: var(--color-white);
}

th,
td {  
  border: 1px solid var(--color-primaryLight);
  text-wrap: pretty;
}

tr:nth-of-type(2n) {
  background: var(--color-primarySuperLight);
}

.blog-body [role="list"] {
  padding-left: 0;
}

.blog-body [role="list"] > li {
  display: inline-block;
}

@media (max-width: 50em) {
  th {
    display: none;
  }

  tr,
  td {
    margin: 0;
  }

  td {
    display: block;
    padding: 0.5rem 1rem;
    border: 0;
  }

  td::before {
    content: attr(data-cell) ": ";
    font-weight: var(--fw-semibold);
    text-transform: capitalize;
  }
}

/* ABOUT PAGE */

.border-red {
  border: 2px solid red;
}

.big-sml-images {
  position: relative;
  margin-bottom: 2.5em;
}

.big-sml-images img:first-child {
  width: 56%;
}

.big-sml-images img:nth-child(2) {
  width: 40%;
  position: absolute;
  bottom: -3em;
  right: 0;
}

@media (min-width: 50em) {
  .big-sml-images img:first-child {
    width: 63%;
  }

  .big-sml-images img:nth-child(2) {
    width: 33%;
    position: absolute;
    bottom: -5em;
    right: 0;
  }
}

/* GALLERY */

.gallery {
  gap: var(--size-300);
}

.gallery__item {
  width: 25%;
  height: auto;
}