@import url('https://fonts.googleapis.com/css?family=Spectral&display=swap');
@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');

html {
    box-sizing: border-box;
}

* {
    /* border: 1px solid black; */
    margin: 0;
    padding: 0;
}

body {
    font-size: 20px;
}

main {
    max-width: 1000px;

    margin: 10px auto;
}

h1, h2, h3, h4 {
    font-family: Spectral, Arial, Helvetica, sans-serif;
}

p {
    font-family: Roboto, Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    text-align: justify;
    margin: 5px;
}

code {
    background-color: lightsteelblue;
}

.container-flex-column, .container-flex-row {
    margin: 15px;

    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;

    border: 5px solid hotpink;
    border-radius: 5px;
}

.container-flex-row {
    flex-direction: row;
}

.container-flex-column2 {
    display: flex;
    flex-direction: column;
}

.container-grid-1_2xY {
    margin: 15px;

    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: stretch;
    align-items: stretch;

    border: 5px solid hotpink;
    border-radius: 5px;
}

@media(max-width: 800px) {
    .container-grid-1_2xY {
        grid-template-columns: 1fr;
    }
}

.container-grid-1_2xY h2:nth-child(1) {
    margin: 10px;

    text-align: center;

    grid-column: 1/3;
}

@media(max-width: 800px) {
    .container-grid-1_2xY h2:nth-child(1) {
        grid-column: 1/2;
    }
}

.container-grid-1_2xY h2:nth-child(1)::before {
    content: "⭐";
}

.container-grid-1_2xY div:nth-child(1n + 2) {
    margin: 5px;
    padding: 5px;

    border: 5px solid palevioletred;
}

/* Text Align Property */

#ta-justify {
    text-align: justify;
}

#ta-center {
    text-align: center;
}

#ta-right {
    text-align: right;
}

#ta-left {
    text-align: left;
}

/* Width and Height */

@keyframes ch-width {
    50% {
        width: 90%;
    }
}

@keyframes ch-height {
    50% {
        height: 90%;
    }
}

#changing-width, #changing-height {
    width: 40%;
    height: 20%;
    
    border: 5px groove salmon;
    background-color: sandybrown;

    animation: ch-width 3s;
    animation-iteration-count: infinite;
}

#changing-height {
    animation-name: ch-height;
}

/* Box Shadow */

#box-shadow-1, #box-shadow-2, #box-shadow-3, #box-shadow-4 {
    margin: 20px auto;

    width: 200px;
    height: 200px;
    background-color: slategray;
    box-shadow: 0, 0, 0, 0, black;
}

@keyframes box-shadow-anim-1 {
    50% {
        box-shadow: 10px 5px 5px red;
    }
}

@keyframes box-shadow-anim-2 {
    50% {
        box-shadow:12px 12px 2px 5px rgba(0, 0, 255, .2);
    }
}

@keyframes box-shadow-anim-3 {
    50% {
        box-shadow: inset 5em 1em 10px gold;
    }
}

@keyframes box-shadow-anim-4 {
    50% {
        box-shadow: 3px 3px red, -1em 0 .4em olive;
    }
}

#box-shadow-1 {
    animation: box-shadow-anim-1 3s;
    animation-iteration-count: infinite;
}

#box-shadow-2 {
    animation: box-shadow-anim-2 3s;
    animation-iteration-count: infinite;
}

#box-shadow-3 {
    animation: box-shadow-anim-3 3s;
    animation-iteration-count: infinite;
}

#box-shadow-4 {
    animation: box-shadow-anim-4 3s;
    animation-iteration-count: infinite;
}

/* Opacity */

@keyframes opacity-anim {
    50% {
        opacity: 0.2;
    }
}

#opacity-parameter {
    animation: opacity-anim 2s;
    animation-iteration-count: infinite;
}

/* Pseudo Classes */

@keyframes pseudo-hover-anim {
    100% {
        background-color: deeppink;
    }
}

#pseudo-hover:hover {
    animation: pseudo-hover-anim 0.25s;
    animation-fill-mode: forwards;
}

h2:target {
    text-shadow: 1px 1px 0px deeppink, -1px -1px 0px deeppink;
}

#pseudo-active:active {
    background-color: black;
    color: white;
}

#position-relative {
    position: relative;
    right: 50px;
}

#position-absolute {
    position: absolute;
    left: 50px;
    top: 50px;
}

#position-fixed {
    position: fixed;
    bottom: 0px;
}

#float-left {
    float: left;
    width: 40px;
    height: 60px;
    background-color: wheat;
}

#float-right {
    float: right;
    width: 100px;
    height: 70px;
    background-color: wheat;
}

#overlapping1 {
    position: absolute;
    background-color: tomato;
    width: 200px;
    height: 200px;
    left: 100%;
}
#overlapping2 {
    position: absolute;
    background-color: teal;
    width: 300px;
    height: 200px;
    left: 110%;
}

#overlapping2:active {
    z-index: -100;
}

@keyframes animation-one {
    50% {
        margin: 30px 30px;
    }
}

#animation-one-id {
    animation: animation-one 3s;
    animation-iteration-count: infinite;
}