@charset "UTF-8";

*,
 *:before,
 *:after {
     box-sizing: border-box;
}

html {
     font-family: sans-serif;
     min-height: 100dvh;
     scroll-behavior: smooth;
}

:root {
    --color-primary: hsl(205, 62%, 18%);
    --color-secondary: hsl(208, 72%, 82%);
    --color-tertiary: hsl(207,68%,75%);
    --color-cta: hsl(267, 61%, 54%);
    --color-white: hsl(0, 0%, 100%);
    --color-gray-light: hsl(0, 0%, 96%);
    --color-gray: hsl(0, 0%, 83%);
    --color-gray-dark: hsl(0, 0%, 40%);
    --color-black: hsl(0, 0%, 0%);

    --header-hero: url(web-uiux-adv/website-reviews/css/images/hero.webp);
    --header-h1: translate(185px, 50px);
}

@keyframes appear-mobile {
    0% {
        transform: translateX(-50px) translateY(-50px);
        opacity: 0;
    }
    100% {
        transform: translateX(20px) translateY(20px);
        opacity: 1;
        
    }
}

@keyframes appear-desktop {
    0% {
        transform: translateX(-50px) translateY(-50px);
        opacity: 0;
    }
    100% {
        transform: var(--header-h1);
        opacity: 1;
    }
}

@keyframes swing-in {
    0% {
        transform: rotateY(100deg);
        transform-origin: left;
        opacity: 0;
    }
    100% {
        transform: rotateY(0);
        transform-origin: left;
        opacity: 1;
    }
}

body {
    margin: 0;
    min-height: 100dvh;
    background-color: var(--color-primary)
}

.wrapper {
     width: min(100%, 1000px);
     background: var(--color-secondary);
}

h2 {
    padding: 20px;
    font-size: 2rem;
}

p {
     margin: 0 0 16px;
     line-height: 1.6;
     font-size: 1.2rem;
     max-width: 75ch;
}

img {
     width: 100%;
     border: 6px solid var(--color-secondary);
}

a {
     text-decoration: none;
}

header {
     position: relative;
     background-image: var(--header-hero);
     background-repeat: repeat;
     margin: 0 auto;
     height: 150px;
}
 
header h1 {
     margin: 0;
     padding: 0;
     color: var(--color-primary);
     line-height: 48px;
     font-size: 36px;
     letter-spacing: 2px;
     transform: translateX(5px) translateY(5px);
     animation: appear-mobile 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
}

main {
      animation: swing-in 0.5s cubic-bezier(0.175, 0.885, 0.320, 1.275) both;
}

nav ul li {
    padding: 20px;
    font-size: 24px;
    font-weight: bold;
    list-style-type: "⋆";
}

nav ul li a:link {
     color: var(--color-primary);
}

nav ul li a:visited {
    color: var(--color-primary);
}

nav ul li a:hover {
    color: var(--color-cta)
}

.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-color: hsl(208, 24%, 47%);
}
 
.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;
}
 
.cards .card-figure-image {
     width: 100%;
     height: 300px;
     object-fit: cover;
}
 
.cards .card-figure-caption {
     padding: 0 10px;
}
 
.cards .card-link:hover {
     box-shadow: 5px 5px 5px var(--color-cta), -5px -5px 5px var(--color-cta);
}

.cards .card-link:hover .card-figure-image {
     filter: contrast(150%);
}
 
.cards .card-figure-caption {
     position: absolute;
     left: 0;
     right: 0;
     bottom: 0px;
     background: hsla(228, 3%, 34%, 0.5);
     color: hsla(0, 0%, 100%, 1);
     backdrop-filter: blur(5px);
     line-height: 2;
     font-style: italic;
}
 
.cards .card-section {
     flex-grow: 1;
     display: flex;
     flex-direction: column;
     padding: 10px;
     background-color: var(--color-white);
}
 
.cards .card-section-title {
     font-size: 1.5rem;
     margin-bottom: 10px;
}
 
.cards .card-section-meta {
     display: flex;
     flex-wrap: wrap;
     margin-bottom: 10px;
}
 
.cards .card-section-meta * {
     flex: 0 0 50%;
     font-size: .8em;
     line-height: 2;
}
 
.cards .card-section-meta :nth-child(even) {
     text-align: right;
}
 
.cards .card-section-excerpt {
     flex-grow: 1;
}
 
.cards .card-section-button {
     align-self: flex-end;
     margin: 10px;
     padding: 0 1em;
     color: var(--color-primary);
     background-color: var(--color-secondary);
     text-decoration: none;
     line-height: 2;
     border-radius: 3px;
     padding: 0 10px;
     box-shadow: 2px 2px 2px var(--color-black);
     transition: all .25s .25s ease-in;
     transform-origin: bottom right;
}

.cards .card-section-button:hover {
     transition: all .25s .25s ease-in;
     transform: scale(1.3);
}

footer {
     display: flex;
     flex-wrap: wrap;
     gap: 20px;
     margin: 0 20px;
     padding-bottom: 10px;
}

footer p {
    color: var(--color-primary);
}
 
footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 24px;
    padding: 0 10px;
}

footer a:hover {
    position: relative;
    text-decoration: none;
    color: var(--color-cta)
}
 
footer :first-child {
     margin-right: auto;
}
 
footer a[href^="javascript"] {
     position: relative;
     color: var(--color-primary);
     padding: 0 10px;
}
 
footer a[href^="javascript"]:hover {
    color: var(--color-cta);
}

@media (min-width: 768px) {
     
     .wrapper {
         margin: 0 auto;
         box-shadow: 2px 0px 5px var(--color-black);
     }

     header {
          height: 300px;
     }

     header h1 {
         transform: var(--header-h1);
         animation: appear-desktop 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
     }

     nav a {
         transform: translate(0px, 0px);
     }

     .card:last-child:first-child {
          flex: 0 0 calc(100%);
     }

     .card:nth-child(2):nth-last-child(1),
     .card:nth-child(1):nth-last-child(2) {
          flex: 0 0 calc(50% - 20px);
     }

     .card:nth-child(3):nth-last-child(1),
     .card:nth-child(2):nth-last-child(2),
     .card:nth-child(1):nth-last-child(3) {
          flex: 0 0 calc(33.333% - 20px);
     }  
}