/* TODO:  

* Fonts
* Heading styles
* Colour pallettes

*/

/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;

  word-break: normal;
}

/* 6. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 8. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
  padding-bottom: 0.5em;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

/* ** VARIABLES **  */
:root {
  --font-family-heading-fallback: sans-serif;
  --font-family-heading: 'Raleway';
  /* ======= */
  /* --font-family-heading-fallback: serif;
  --font-family-heading: 'Old Standard TT'; */
  /* ======= */
  --font-family-body: 'Inter';
  /* --color-primary: yellow; */
  --color-primary: #d4967d;

  --color-secondary: #495958;

  --text-color: #252727;

  --text-color-inverted: white;
  --color-alternative: #669bbc;

  --color-temp-note: #001eff66;

  /* new colours  */
  --color-primary: #003049;
  --color-secondary: #c1121f;
  --color-secondary-alt: #84b6d6;
  --color-tertiary: #fdf0d5;

  /* Colour pallete */
  --colour-pallette-1: #238b46;
  --colour-pallette-2: #74c476;
  --colour-pallette-3: #bae4b3;
  --colour-pallette-4: #f0f9e8;
  /* Sandra colours  */
  /* --color-primary: #344e41; */
  --color-primary: var(--colour-pallette-1);
  --color-secondary: var(--colour-pallette-2);
  --color-tertiary: var(--colour-pallette-3);
  --color-quaternary: var(--colour-pallette-4);
  /* 
  --color-primary: red;
  --color-secondary: green;
  --color-tertiary: yellow;
  --color-quaternary: blue; */

  --color-primary-darker: hsl(from var(--color-primary) h s calc(l - 5));
  --color-secondary-darker: hsl(from var(--color-secondary) h s calc(l - 5));
  --color-tertiary-darker: hsl(from var(--color-tertiary) h s calc(l - 5));

  --spacing: 1.2em;
}

body {
  /* background-color: rgb(53, 77, 143); */
  margin: 0;
  color: var(--text-color);
}

dl {
  display: flex;
  flex-direction: column;
  /* word-break: break-all; */
}
/* =========== */

.site-title {
  font-family: var(--font-family-heading-fallback);
  font-family: var(--font-family-heading);
  /* font-family: 'Raleway', sans-serif; */
  /* font-family: "Playfair Display", serif; */
  font-optical-sizing: auto;
  font-weight: 400;
  /* font-style: italic; */
  text-decoration: none;
  font-size: 2rem;
  line-height: 1;

  color: var(--text-color-inverted);
}

body {
  font-family: 'Inter', sans-serif;
  /* font-family: "Source Sans 3", sans-serif; */
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-size: 1em;
}

/* ** layout** */

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

header {
  min-height: 50px;
}

footer {
  min-height: 50px;
}

/* ** TYPOGRAPHY **  */
h1,
h2 {
  /* font-family: 'Raleway', sans-serif; */
  font-family: var(--font-family-heading-fallback);
  font-family: var(--font-family-heading);
  font-optical-sizing: auto;
}
h1 {
  font-weight: 700;
  font-size: 2em;
}
h2 {
  font-weight: 600;
  font-size: 1.5em;
  line-height: 1.25;
}

/* ** NAVIGATION **    */

#check {
  display: none;
}
#check + label {
  background: url('bars-solid.svg') no-repeat;

  background-position-x: center;
  background-position-y: center;

  color: white;
  cursor: pointer;

  display: inline-block;
  height: 30px;
  width: 30px;
}

.site-nav__links {
  position: absolute;
  right: 0;
  /* background: orange; */
  font-size: 1.5em;
  min-width: 50%;
  display: none;

  a {
    display: block;
    background-color: #e5e3dc;
    color: black; /* TODO: colour vars */
    line-height: 1;
    padding: 0.5em;
    text-decoration: none;
  }
}
#check:checked ~ .site-nav__links.is-small {
  display: block;
}
#check:checked ~ .site-nav__links + .site-nav__links {
  display: none;
}

#check:checked + label {
  background: url('xmark-solid.svg') center no-repeat;
  background-position-x: center;
  background-position-y: center;
}

/* ** HEADER **  */
header {
  padding: 1.2em;
  /* todo: sort out typography and spacing...  */

  background-color: var(--color-primary); /* TODO: variable */
  color: white;

  display: flex;

  nav {
    margin-left: auto;
  }

  a {
    color: white;
  }
}
/* ** FOOTER **  */
footer {
  padding: 1.2em 1.2em 0 1.2em;
  /* todo: sort out typography and spacing...  */

  background-color: var(--color-primary); /* TODO: variable */
  color: white;

  display: flex;

  flex-direction: column; /* small screen*/

  ul,
  li {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .footer__content {
    text-align: center;

    .footer__title {
      /* font-family: 'Raleway', sans-serif; */
      font-family: var(--font-family-heading-fallback);
      font-family: var(--font-family-heading);
      font-optical-sizing: auto;
      /* font-weight: 400; */
      /* font-style: italic; */
      text-decoration: none;
      font-size: 24px;
      line-height: 1;
      color: var(--text-color-inverted);
    }
  }

  .footer__nav {
    display: flex;
    justify-content: space-around;
    margin-top: 12px;
    a {
      text-decoration: none;
      color: var(--text-color-inverted);
      &:hover {
        color: var(--color-secondary);
      }
    }

    & > li a {
      font-size: 20px;
      font-weight: 500;
    }
    & > li > ul > li {
      padding-left: 8px;
      > a {
        font-size: 18px;
        font-weight: 300;
      }
    }
  }

  .footer__copyright {
    padding: 0;
    margin-top: 12px;
    text-align: center;
  }
}

/* ** HERO **  */

.hero-wrapper {
  /* background-color: rgb(160, 168, 226); */
  /* background-color: var(--color-primary); */
  color: var(--text-color);
  /* border-bottom: 1px solid var(--color-primary); */
}

.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 1.2em;

  /* color: white; */

  /* a.button {
    background-color: var(--color-secondary);
    color: var(--text-color-inverted);
    height: 46px;
    font-size: 1.5em;
    border-radius: 23px;
  } */
}

.layout {
  max-width: 1200px;
  margin: auto;
}
.hero {
  padding: var(--spacing);

  /* todo: sort out typography and spacing...  */

  img {
    width: 280px;
    margin: auto;
    /* TODO: Think about sizing for image(s)  */
  }
}

.hero__content > h2 {
  line-height: 1;
  margin-bottom: 0.5em;
}

.hero__content .button {
  color: var(--color-primary);
}

/* ** SECTIONS **  */
.section-new {
  padding: 1.2em;
  margin: 1.2em auto;
  /* todo: sort out typography and spacing...  */
  /* background-color: #e5e3dc; */

  &.section-new--is-alt {
    background-color: var(--color-secondary-alt);
  }
}
.section-new:not(.section-new--as-card) .section-new__content > h2 {
  text-align: center;
}
.section {
  padding: 12px;
  margin: 12px auto;
  /* todo: sort out typography and spacing...  */
  /* background-color: cornsilk; */
}

.section__image {
  text-align: center;

  img {
    width: 55%;
  }
}

.section-new--as-card {
  background-color: transparent;
}
.section-new--as-card .section-new__image {
  img {
    max-height: 400px;
    margin: auto;
  }
}
.section-new .section-new__content {
  h2 {
    margin-bottom: 0.8em;
  }

  a.button {
    margin: 1em 0 1em auto;
  }
}

.card {
  background-color: rgb(229, 181, 122);
}

.card--is-centre {
  background-color: rgb(196, 201, 126);
  /* text-align: center; */
}
.card--is-centre .card__content > h2 {
  text-align: center;
}

article {
  display: flex;
  margin-bottom: var(--spacing);
}

.article__image {
  width: 150px;
  flex-shrink: 0;

  &.mphs-logo {
    background-color: #003976;
  }
}

.article__content {
  margin-left: 1em;
  flex-grow: 2;
}
.size-check {
  display: none;
}

.book-details {
  display: flex;
  flex-direction: column;
  padding: 1em;
}

.book-details .book-details__title {
  grid-area: 1 / 1 / 2 / 3;
}
.book-details .book-details__image {
  grid-area: 2 / 1 / 3 / 2;
  padding-top: 1em;

  img {
    max-height: 500px; /* investigate responsive image...?*/
    margin: auto;
  }
}
.book-details .book-details__content {
  grid-area: 2 / 2 / 3 / 3;
  padding-top: 1em;
  padding-left: 1em;
}

a.button {
  background-color: white;
  display: flex;
  padding: 0 18px;
  height: 38px;
  width: fit-content;
  font-size: 1em;
  text-decoration: none;
  border-radius: 19px;
  align-items: center;
  margin: 0.75em 0;

  &.button--is-primary {
    background-color: var(--color-primary);
    /* background-color: var(--color-secondary); */
    color: var(--text-color-inverted);
    &:hover {
      background-color: var(--color-primary-darker);
      /* background-color: var(--color-secondary-darker); */
    }
    &.button--is-outline {
      border-color: var(--color-primary);
      color: var(--color-primary);
      &:hover {
        border-color: var(--color-primary-darker);
        color: var(--color-primary-darker);

        background-color: transparent;
      }
    }

    &.button--is-large {
      height: 46px;
      font-size: 1.5em;
      border-radius: 23px;
    }
  }
  &.button--is-secondary {
    background-color: var(--color-secondary);
    color: var(--text-color-inverted);
    &:hover {
      background-color: var(--color-secondary-darker);
    }
    &.button--is-outline {
      border-color: var(--color-primary);
      color: var(--color-primary);
      background-color: var(--color-tertiary);
      &:hover {
        border-color: var(--color-primary-darker);
        /* color: var(--color-primary-darker); */
        color: white;
        background-color: var(--color-tertiary);
        background-color: var(--color-secondary-darker);
      }
    }
  }
  &.button--is-outline {
    background-color: transparent;
    border-width: 1px;
    border-style: solid;
  }
}
/* 
a.button.button--is-primary {
  background-color: var(--color-secondary);
  color: var(--text-color-inverted);
}
a.button.button--is-secondary {
  background-color: white;
  color: var(--text-color);
  border: 1px solid var(--text-color);
} */

/*  ** ARTICLES ** */

.container-page {
  /* background-color: yellow; */
  margin-top: 16px;
  h1 {
    margin: 0 16px;
    line-height: 1.2;
    border-bottom: 1px solid var(--color-primary);
  }

  h1:has(+ h2) {
    border-bottom: none;
  }

  & > h2 {
    margin: 0 16px;
    line-height: 1.2;
    border-bottom: 1px solid var(--color-primary);
  }
}

.details-card {
  display: flex;
  flex-direction: column;

  &.details-card--is-alt {
    background-color: var(--color-quaternary);
    .reviews {
      .review {
        background-color: var(--color-secondary);
      }
    }
  }

  .image-content {
    display: flex;
    align-items: center;

    &.is-alt {
      flex-direction: row-reverse;
    }
  }

  .details-card__image {
    img {
      max-height: 500px;
      margin: 1em auto;
      border: 1px solid var(--color-alternative);
    }
  }

  .details-card__title {
    margin: var(--spacing);
    margin-bottom: 0;
  }
  .details-card__content {
    margin: var(--spacing);
    /* margin-top: 0; */
    .button {
      margin-left: auto;
    }

    iframe {
      max-height: 200px;
    }

    p {
      /* background-color: pink; */
      clear: both;
    }

    img {
      height: 200px;
      float: left;
      /* clear: both; */
      margin: 10px;
      margin-top: 0;

      &.is-right {
        float: right;
      }
    }
  }

  &.details-card--is-centred {
    /* background-color: var(--color-tertiary); */
    padding-bottom: var(--spacing);

    .details-card__title {
      text-align: center;
    }

    .button {
      margin: 1em auto 0 auto;
    }
  }
}

.details-card.is-reversed {
  background-color: var(--color-tertiary);

  a.button {
    &.button--is-secondary {
      &:hover {
      }
      &.button--is-outline {
        background-color: white;
        &:hover {
        }
      }
    }
  }
}

.article-list {
  display: flex;
  flex-direction: column;
  padding: var(--spacing);

  background-color: var(--color-tertiary);
  /* background-color: lightgreen; */

  .article-list__title {
    margin-bottom: var(--spacing);
  }
}

.temp-note {
  background: var(--color-temp-note);
  padding: 25px;
  font-size: 18px;
  font-style: italic;
  text-align: center;
  border: 1px dashed;
  margin: 1em;

  &.temp-note--is-small {
    margin: 0;
    padding: 0;
    font-size: 14px;
  }
}

.event {
  /* background-color: palegreen; */
  line-height: 1.25;

  .event__heading {
    font-size: 16px;
    /* font-weight: 500; */
    display: flex;
    margin-bottom: 6px;

    .heading__datetime {
      margin-left: auto;
    }

    .heading__date {
      /* background-color: palevioletred; */
      margin-right: 4px;
    }

    .heading__year {
      /* background-color: rgb(84, 159, 102); */
      margin-left: 8px;
    }
  }

  .event__title {
    /* background-color: rgb(221, 172, 64); */
    font-weight: 500;
    font-size: 18px;
    margin-bottom: 6px;
  }
  .event__details {
    /* background-color: rgb(176, 118, 145); */

    .button {
      /* background-color: palegoldenrod; */
      margin-left: auto;
    }
  }
}

/**
  --color-primary
  --color-secondary
  --color-secondary-alt
  --color-tertiary
**/

.event-section {
  > h2 {
    /* color: blue; */
    margin-bottom: calc(var(--spacing) / 2);
  }
  /* background-color: rgb(229, 154, 175); */
  display: flex;
  flex-direction: column;
  padding: var(--spacing);

  /* &.has-background-1 {
    background-color: var(--color-secondary-alt);
  }
  &.has-background-2 {
    background-color: var(--color-tertiary);
  } */

  dd {
    margin-bottom: var(--spacing);
  }
}

.event-subsection {
  > h3 {
    /* color: green; */
    line-height: 1;
    margin-bottom: calc(var(--spacing) / 2);
  }
  /* background-color: rgb(147, 219, 165); */
  display: flex;
  flex-direction: column;
  /* padding: var(--spacing); */
}

.event-list {
  /* background-color: #c1121f; */
  padding: 0;
  margin: 0;
  ul,
  li {
    /* list-style: none; */
  }
}

.event-new {
  /* background-color: #fdf0d5; */
  margin-bottom: calc(var(--spacing) / 2);
  display: flex;
  flex-direction: column;
  span {
    display: inline-block;
  }

  &::after {
    content: '';
    border-bottom: 1px solid var(--color-secondary);
    display: block;
    margin-top: calc(var(--spacing) / 2);
    width: 50px;
  }
}

.has-background-1 {
  background-color: var(--color-secondary);
  color: var(--text-color-inverted);
}
.has-background-2 {
  background-color: var(--color-tertiary);
}

.reviews {
  &:before {
    content: '';
    border-top: 1px solid;
    display: block;
    margin: 0 25%;
    padding-bottom: var(--spacing);
  }

  list-style: none;
  padding: 0;
  margin-top: var(--spacing);
  clear: both;

  .review {
    padding: calc(var(--spacing) / 2);
    background-color: var(--color-quaternary);
    margin-bottom: var(--spacing);

    p {
      padding: 0;
      margin-top: calc(var(--spacing) / 2);
      text-align: right;
      font-style: italic;
      font-size: 14px;
    }
  }
}

.footer__socials {
  display: flex;
  justify-content: center;

  li {
    margin: 4px;
  }
}

@media (max-width: 480px) {
  .size-check.size-esm {
    background-color: yellow;
    display: block;
  }
}
@media (min-width: 481px) and (max-width: 600px) {
  .size-check.size-sm {
    background-color: rgb(244, 183, 61);
    display: block;
  }
}
@media (min-width: 601px) and (max-width: 786px) {
  .size-check.size-st {
    background-color: rgb(232, 124, 237);
    display: block;
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .size-check.size-lt {
    background-color: rgb(124, 237, 220);
    display: block;
  }
}
@media (min-width: 1025px) and (max-width: 1280px) {
  .size-check.size-sd {
    background-color: rgb(171, 168, 237);
    display: block;
  }
}
@media (min-width: 1281px) and (max-width: 1440px) {
  .size-check.size-ld {
    background-color: rgb(171, 168, 237);
    display: block;
  }
}

@media (min-width: 1441px) {
  .size-check.size-eld {
    background-color: rgb(201, 128, 139);
    display: block;
  }
}
/* ** Media queries  */

/* small tablet (portrait)*/
@media (min-width: 601px) {
  /* nav menu */
  #check,
  #check + label {
    display: none;
  }
  .site-nav__links.is-small {
    display: none;
  }

  #check:checked ~ .site-nav__links.is-small {
    display: none;
  }
  #check:checked ~ .site-nav__links.is-large {
    display: block;
  }

  .site-nav {
    display: flex;
    align-items: center;
  }
  .site-nav__links.is-large {
    position: relative;
    font-size: 1em;
    display: block;

    a {
      display: inline-flex;
      background-color: transparent;
      color: white; /* TODO: colour vars */
      line-height: 1;
      /* padding: 0; */
      text-decoration: none;
      margin: 0 0 0 1.5em;
    }
  }

  .hero img {
    width: 430px;
    margin: auto;
    border-radius: 50%;
  }

  .hero__content {
    margin-top: 0;
    padding-right: 1em;
  }

  .hero {
    /* background-color: rgb(130, 222, 219); */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(1, 1fr);
    gap: 0px;

    grid-template-areas: 'text image';
  }

  .hero__image {
    grid-area: image;
  }
  .hero__content {
    grid-area: text;
  }

  /* --------- */

  .book-details {
    display: grid;
    grid-template-columns: 1fr 2fr;
    /* grid-template-rows: repeat(2, 1fr); */
    grid-column-gap: 0px;
    grid-row-gap: 0px;
  }

  .section {
    /* background-color: rgb(130, 222, 219); */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(1, 1fr);
    gap: 0px;

    grid-template-areas: 'image text';
  }

  .section__image {
    grid-area: image;
  }
  .section__content {
    grid-area: text;
  }

  .section-new--as-card {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: repeat(1, 1fr);
    gap: 0px;

    grid-template-areas: 'image text';
  }

  .section-new--as-card .section-new__image {
    grid-area: image;
    margin-right: 1em;
    /* justify-self: center; */
  }
  .section-new--as-card .section-new__content {
    grid-area: text;
  }

  .card:not(.card--is-centre) {
    background-color: rgb(230, 245, 26);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(1, 1fr);
    gap: 0px;

    grid-template-areas: 'image text';
  }

  .card__image {
    grid-area: image;
  }
  .card__content {
    grid-area: text;
  }

  .details-card {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: auto 1fr;
    grid-column-gap: 0px;
    grid-row-gap: 0px;
    grid-template-areas:
      'image title'
      'image content';
  }
  .details-card.is-reversed {
    background-color: var(--color-tertiary);
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto 1fr;
    grid-column-gap: 0px;
    grid-row-gap: 0px;
    grid-template-areas:
      ' title image'
      'content image';

    .details-card__image {
      margin: 0 1em 0 0;
    }
  }

  .details-card.details-card--is-centred {
    display: block;

    ul {
      max-width: fit-content;
      margin: auto;
      li {
        max-width: fit-content;
      }
    }
  }

  .details-card__title {
    grid-area: title;
  }

  .details-card__image {
    grid-area: image;
    margin: 0 0 0 1em;
  }
  .details-card__content {
    grid-area: content;
  }

  /* ** FOOTER **  */
  footer {
    /* todo: sort out typography and spacing...  */

    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: 1fr auto;
    grid-column-gap: 0px;
    grid-row-gap: 0px;
    grid-template-areas:
      ' title nav'
      'copyright copyright';

    .footer__content {
      text-align: center;
      grid-area: 1 / 1 / 2 / 2;

      .footer__title {
        /* font-family: 'Raleway', sans-serif; */
        font-family: var(--font-family-heading-fallback);
        font-family: var(--font-family-heading);
        font-optical-sizing: auto;
        /* font-weight: 400; */
        /* font-style: italic; */
        text-decoration: none;
        font-size: 24px;
        line-height: 1;
        color: var(--text-color-inverted);
      }
    }

    .footer__nav {
      display: flex;
      justify-content: space-around;
      margin-top: 0;
      grid-area: 1 / 2 / 2 / 3;

      & > li a {
        font-size: 18px;
        font-weight: 500;
      }
      & > li > ul > li {
        padding-left: 8px;
        > a {
          font-size: 16px;
          font-weight: 300;
        }
      }
    }

    .footer__copyright {
      grid-area: 2 / 1 / 3 / 3;
    }
  }
}

/* Large Tablets (Landscape) */
@media (min-width: 769px) {
  .hero__content > h1 {
    font-size: 3em;
  }
  .hero__content > h2 {
    font-size: 2em;
  }
}

@media (min-width: 576px) {
}
