/**
  * set all elements box-sizing property to border-box
  */
*,
*:before,
*:after {
  box-sizing: border-box;
}

/**
  * set colors to custom properties
  */
:root {
  --red: rgb(255, 0, 0);
  --black: rgb(0, 0, 0);
  --gold: #D4AF37;
  --maroon: #630000;
  --white: #fff;
  --off-white: #f5f5f5;
  --silver: #C0C0C0;
  --yellow: #ffff00;
  --header-back-1: hsl(0, 100%, 48%);
  --header-back-2: hsl(0, 100%, 44%);
  --eighty-shadow: rgba(0, 0, 0, 0.8);
  --sixty-shadow: rgba(0, 0, 0, 0.6);
  --h1-top: hsla(0, 100%, 68%, 0.747);
  --h1-mid: hsla(0, 56%, 48%, 0.705);
  --h1-bottom: rgb(85, 10, 10);
  --card-text: rgb(255, 185, 185);
  --card-body: rgb(255, 218, 218);
  --card-caption: hsla(0, 100%, 50%, 0.815);
  --card-title-out: rgba(0, 0, 0, 0.175);
  --card-title-in: rgba(255, 255, 255, 0.175);
  --z-index: -1;
}

/**
  * set the min-height to 100dvh
  */
html {
  font-family: Lato, sans-serif;
  min-height: 100dvh;
}

/**
  * body
  */
/* prettier-ignore */
body {
  margin: 0;
  min-height: 100dvh;
  background:
    url(images/club-rotate.webp) fixed no-repeat top 20px left 15px / 200px 200px,
    url(images/spade-rotate.webp) fixed no-repeat top 20px right 15px / 200px 200px,
    url(images/heart-rotate.webp) fixed no-repeat bottom 20px left 15px / 200px 200px,
    url(images/diamond-rotate.webp) fixed no-repeat bottom 20px right 15px / 200px 200px,
    fixed linear-gradient(to bottom,
      var(--red) 40%,
      var(--black) 63%) var(--black);
}

/**
  * content wrapper
  */
.wrapper {
  display: grid;
  max-width: 800px;
  border: 2px solid var(--gold);
  border-radius: 10px;
  background: var(--maroon);
  margin-top: 10px;
  margin-bottom: 10px;
}

/**
  * header
  */
/* prettier-ignore */
header {
  display: flex;
  border-radius: 10px;
  border: 2px solid var(--gold);
  margin: 20px;
  background:
    url(images/amazed.webp) no-repeat top left / 100px 100px,
    url(images/ace.webp) no-repeat center center / cover,
    linear-gradient(to bottom,
      var(--header-back-1),
      var(--header-back-2)) var(--black);
  box-shadow: inset 0 2px 4px var(--eighty-shadow);
}

/**
  * header h1
  */
/* prettier-ignore */
header h1 {
  flex: 1 1 auto;
  margin: 0;
  color: var(--white);
  line-height: 4;
  text-align: center;
  letter-spacing: 2px;
  text-shadow: 0 -2px 2px var(--sixty-shadow);
  background:
    transparent linear-gradient(to bottom,
      var(--h1-top) 20px,
      var(--h1-mid) 40px,
      var(--h1-bottom));
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  font-size: x-large;
}

/**
  * sup is a superscript element
  */
header h1 sup {
  font-size: 0.6em;
}

/**
  * navigation
  */
.nav-main {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9999;
  line-height: 0;
  background: var(--gold);
}

.nav-main-menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 0;
}

.nav-main-menu-toggle svg * {
  transform-box: fill-box;
  margin-bottom: 10px;
  border-radius: 4px;
  transition: all .5s cubic-bezier(.08, .81, .87, .71);
}

.nav-main-menu-toggle rect:nth-child(1) {
  transform-origin: bottom left;
}

.nav-main-menu-toggle rect:nth-child(2) {
  transform-origin: center;
}

.nav-main-menu-toggle rect:nth-child(3) {
  transform-origin: bottom right;
}

.nav-main-menu-toggle[aria-expanded="true"] rect:nth-child(1) {
  transform: rotate(45deg) translate(0px, -5px);
}

.nav-main-menu-toggle[aria-expanded="true"] rect:nth-child(2) {
  transform: rotate(495deg) translate(0px);
}

.nav-main-menu-toggle[aria-expanded="true"] rect:nth-child(3) {
  transform: rotate(45deg);
  opacity: 0;
}

#nav-main-menu {
  visibility: hidden;
  transform: translateX(-100%);
  position: absolute;
  width: 50vw;
  background: var(--silver);
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  transition: all 0.5s ease-in-out;
}

#nav-main-menu:not([hidden]) {
  visibility: visible;
  transform: translateX(0) rotate(360deg);
  transition: all 0.5s ease-in-out;
}

#nav-main-menu li a {
  color: inherit;
  display: flex;
  line-height: 3;
  padding: 0 2em;
  transition: all 0.25s ease-in-out;
}

#nav-main-menu li a:hover,
#nav-main-menu li a:focus {
  background: var(--off-white);
  transform: rotate(5deg);
}

#nav-main-menu li a:active {
  transition: none;
  transform: rotate(-5deg);
}

/**
  * cards
  */
.cards {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
}

.cards .card {
  flex: 0 0 calc(100% - 20px);
  display: flex;
  margin: 10px;
  min-width: 0;
  background: var(--silver);
  border-radius: 10px;
  border: 1px dotted var(--black);
  overflow: hidden;
}

.cards .card:has(.card-link:hover) {
  border: 1px dashed var(--black);
}

.cards .card:has(.card-link:active) {
  border: 1px solid var(--black);
}

.cards .card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 0 0 100%;
}

.cards .card-figure {
  position: relative;
  margin: 0;
  line-height: 0;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
}

.cards .card-figure-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 1s ease;
}

.cards .card-link:hover .card-figure-image {
  transform: matrix3d(0.6, 0.1, 0.7, 0,
      -0.5, 0.8, 0.1, 0,
      -0.6, -0.5, 0.5, 0,
      0, 0, 0, 1);
}

.cards .card-figure-caption {
  padding: 0 10px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0px;
  background: var(--card-caption);
  color: var(--black);
  backdrop-filter: blur(5px);
  line-height: 2;
  font-weight: bold
}

.cards .card-section {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 10px;
  background-color: var(--card-body);
  border-radius: 0 0 10px 10px;
}

.cards .card-section-title {
  margin-bottom: 15px;
  border: 3px ridge;
  padding: 5px;
  text-align: center;
  border-radius: 5px;
  background: linear-gradient(to right, var(--card-title-out), var(--card-title-in), var(--card-title-out));
  transition: all 1s ease;
}

.cards .card-link:hover .card-section-title {
  transform: rotate(3deg);
}

.cards .card-section-meta {
  display: flex;
  flex-wrap: wrap;
}

.cards .card-section-meta * {
  flex: 0 0 50%;
  font-size: .8em;
  line-height: 2;
}

.cards .card-section-meta :nth-child(even) {
  text-align: right;
  font-style: italic;
}

.cards .card-section-meta-comments {
  font-weight: bold;
}

.cards .card-section-excerpt {
  flex-grow: 1;
  background-color: var(--card-text);
  padding: 5px;
  box-shadow: 0 0 10px 5px var(--card-text);
  line-height: 1.3;
}

.cards .card-section-button {
  align-self: flex-end;
  margin: 10px;
  padding: 0 1em;
  border-radius: .5em;
  border: 1px solid;
  line-height: 2;
  transition: transform 1s ease, background-color 1s ease, text-shadow 1s ease;
}

.cards .card-link:hover .card-section-button {
  border: none;
  padding-top: 1px;
  padding-bottom: 1px;
  margin-right: 11px;
  transform: scale(1.3);
  background: var(--silver);
  text-shadow: 1px 1px 3px var(--black);
}

.cards .card-link:active .card-section-button {
  border: none;
  padding-top: 1px;
  padding-bottom: 1px;
  margin-right: 11px;
  transition: none;
  transform: scale(1);
  text-shadow: none;
}

/**
  * form
  */
.form {
  margin: 10px;
  margin-bottom: 20px;
  border: 1px dotted var(--black);
  border-radius: 10px;
  padding: 10px;
  background:
    linear-gradient(to bottom,
      var(--card-text) 10%,
      var(--card-body) 50%,
      var(--card-text) 90%) var(--white);
}

.callout {
  font-family: Palatino, serif;
  background-color: var(--black);
  color: var(--red);
  padding: 0;
  overflow: hidden;
}

.callout-heading {
  font-size: 3em;
  text-transform: uppercase;
  text-align: center;
  margin: 1px 0 7px;
}

.callout-intro {
  font-size: 1.5em;
  text-align: center;
  margin: 55px 0 50px;
  line-height: 1.4;
  max-width: 60ch;
}

.subscribe-newsletter {
  transition: all 1s ease-in;
  font-size: 1.2em;
}

.subscribe-newsletter {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  row-gap: 20px;
}

.subscribe-newsletter fieldset {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  row-gap: 20px;
}

.subscribe-newsletter fieldset:first-child {
  padding: 10px;
}

.subscribe-newsletter fieldset:last-child {
  padding-top: 12px;
}

.subscribe-newsletter fieldset:last-child::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: url("images/loader.svg") no-repeat center;
  z-index: var(--z-index, -1);
}

.subscribe-newsletter input {
  position: relative;
  font-family: inherit;
  font-size: 1.2em;
  flex-basis: 50%;
}

.subscribe-newsletter input[type=email] {
  background: var(--silver);
  color: var(--maroon);
}

.subscribe-newsletter input[type=email]:focus {
  outline: none;
}

.subscribe-newsletter input::placeholder {
  position: relative;
}

.subscribe-newsletter input::placeholder {
  transition: opacity 0.3s ease-in;
}

.subscribe-newsletter input:focus::placeholder {
  transition: opacity 0.3s ease-out;
  opacity: 0
}

.subscribe-newsletter input[type=submit],
.subscribe-newsletter input[type=submit]:invalid {
  background: var(--silver);
  color: var(--maroon);
  font-weight: bold;
  text-transform: uppercase;
  transition: all 0.5s .1s ease-in;
  cursor: pointer;
}

.subscribe-newsletter input[type=submit]:hover,
.subscribe-newsletter:valid input[type=submit]:hover {
  transform: scale(1.5);
}

.subscribe-newsletter input[type=submit]:active {
  transition: none;
  background-color: var(--maroon);
  color: var(--silver);
}

.subscribe-newsletter label:not(.subscribe-newsletter-message) {
  flex-basis: 15%;
}

.subscribe-newsletter-message {
  background-color: var(--gold);
  color: var(--maroon);
  padding: 3px;
}

.subscribe-newsletter .subscribe-newsletter-message-error {
  background: var(--yellow);
  color: var(--maroon);
  font-size: 30px;
}

.subscribe-newsletter .subscribe-newsletter-message-success {
  background: var(--gold);
  color: var(--maroon);
  font-size: 1.6em;
  padding: 5px;
  text-align: center;
  align-items: center;
}

/**
  * footer
  */
footer {
  display: flex;
  gap: 20px;
  margin: 0 20px 20px;
}

/**
  * footer a
  */
footer a {
  color: var(--white);
  text-decoration: none;
  line-height: 2;
}

/**
  * first child of footer
  */
footer a:first-child {
  margin-right: auto;
}

/**
  * style href attributes that start with javascript like a button
  */
footer a[href^="javascript"] {
  position: relative;
  color: var(--black);
  background-color: var(--white);
  border-radius: 3px;
  padding: 0 10px;
  box-shadow: 0 2px 2px var(--black);
}

/**
  * active state of footer buttons
  */
footer a[href^="javascript"]:active {
  top: 2px;
  box-shadow: none;
}

/**
  * media query if screen is 48rem or larger
  */
@media (min-width: 48rem) {

  /**
    * content wrapper
    */
  .wrapper {
    margin: 20px auto;
    position: relative;
  }

  /**
    * header
    */
  /* prettier-ignore */
  header {
    height: 400px;
    background:
      url(images/amazed.webp) no-repeat top left / 250px 250px,
      url(images/ace.webp) no-repeat center center / cover,
      linear-gradient(to bottom,
        var(--header-back-1),
        var(--header-back-2)) var(--black);
    position: relative;
  }

  /**
    * header after pseudo
    */
  header::after {
    content: " ";
    float: right;
    background: url(images/arrow.webp) no-repeat top left / 400px 400px;
    width: 400px;
    height: 400px;
    position: absolute;
    right: -95px;
    top: -70px;
  }

  /**
    * header h1
    */
  header h1 {
    font-size: 2.75em;
    line-height: 2;
    align-self: flex-end;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
  }

  /**
    * navigation
    */
  .nav-main {
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
  }

  .nav-main-menu-toggle {
    display: none;
  }

  #nav-main-menu {
    position: relative;
    visibility: visible;
    transform: translateX(0);
    transition: none;
    background: transparent;
    display: flex;
    flex-direction: row;
    width: auto;
  }

  /**
    * cards
    */
  .cards .card {
    flex: 0 0 calc(50% - 20px);
  }

  /**
    * form
    */
  .callout {
    padding: 60px;
  }

  .subscribe-newsletter {
    height: 8em;
    align-items: center;
  }

  .subscribe-newsletter:valid input[type=submit] {
    transform: scale(1.75);

  }

  /**
    * img
    */
  img {
    width: 250px;
    height: 250px;
    float: right;
    margin: 0 0 50px 5px;
  }
}