/*
  At some point we should use a CSS pre-processer so that
  we can split the css into files grouped by logical
  components.
*/

:root {
  /* Blacks / Greys */
  --color-grey-300: lightgrey;
  --color-grey-900: #0f172a;

  /* Blues */
  --color-blue-300: lightblue;
  --color-blue-100: rgb(208, 243, 255);

  /* Whites */
  --color-white-100: #fafaf9;

  /* Reds */
  --color-red-100: rgb(255, 142, 142);
}

body {
  margin: 0;
}

/* Banner component */

.banner {
  border: solid 1px var(--color-blue-300);
  background-color: var(--color-blue-100);
  padding: 1rem;
  border-radius: 5px;
}

.banner-error {
  border: solid 1px var(--color-red-100);
  background-color: var(--color-red-100);
}

/* Card component */
.card {
  border: solid 1px var(--color-grey-900);
  border-radius: 5px;
  margin: 0.5rem;
}

.card .card-image {
  border-bottom: solid 1px var(--color-grey-300);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.card .card-image img {
  max-width: 100%;
  max-height: 300px;
}

.card .card-content {
  padding: 2rem 2rem 1rem 2rem;
}

.card .card-actions *:not(:last-child) {
  margin-right: 0.5rem;
}

/* Magazine layout */
.magazine-title {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.3em;
  margin: 3rem 0 2rem 0;
  padding-bottom: 1.5rem;
  border-bottom: solid 1px #e0e0e0;
}

.magazine-subtitle {
  display: block;
  font-size: 0.4em;
  font-weight: 300;
  letter-spacing: 0.2em;
  margin-top: 0.8rem;
  opacity: 0.7;
}

.magazine-section {
  border-bottom: solid 1px #e0e0e0;
  margin: 2rem 0;
  padding: 2rem 0.5rem;
}

.magazine-section:last-child {
  border-bottom: none;
}

.magazine-section .magazine-image {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin-bottom: 2rem;
}

.magazine-section .magazine-image img {
  max-width: 100%;
  max-height: 300px;
}

.magazine-section .magazine-content {
  padding: 0 1rem;
}

.magazine-section .magazine-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.magazine-section .magazine-actions *:not(:last-child) {
  margin-right: 0;
}

/* Desktop styles - min-width: 769px */
@media (min-width: 769px) {
  .magazine-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 3rem 0.5rem;
    margin: 3rem 0;
  }

  .magazine-section .magazine-image {
    margin-bottom: 0;
  }

  .magazine-section .magazine-image img {
    max-height: 350px;
  }

  /* Alternating image position on desktop */
  .magazine-section.image-left .magazine-image {
    order: 1;
  }

  .magazine-section.image-left .magazine-content {
    order: 2;
  }

  .magazine-section.image-right .magazine-image {
    order: 2;
  }

  .magazine-section.image-right .magazine-content {
    order: 1;
  }
}

/* Table */

table {
  border-collapse: collapse
}

tbody {
  vertical-align: top;
}

tbody p {
  margin-bottom: 1rem;
}

tbody p:last-child {
  margin-bottom: 0rem;
}

.table-wrapper {
  overflow-x: auto;
}

tr:hover>td {
  background-color: var(--color-white-100);
}


/* Utility classes */

.min-width-100 {
  min-width: 100px;
}

.min-width-200 {
  min-width: 200px;
}