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

/* Color (also uses element selector) */
body {
    font-family: 'Roboto', sans-serif;
    background-color: hsl(210, 30%, 95%); /* hsl */
    color: var(--primary, black); /* fallback */
}

:root {
    --primary: #3498db; /* fallback */
}   

footer {
    background-color: #2c3e50; /* hex */
    color: white; /* named */
}

a {
    color: color-mix(in srgb, blue 70%, white 30%); /* wide gamut */
}



section {
    padding-left: 20px;
}

/* Relative units */
body {
    padding: 2rem;
}

textarea {
    width: 50vw;
}

h3 {
    font-size: 1.5em; 
}

/* Absolute units */
header {
    padding: 20px;
}

video {
    width: 250px;
}

section {
    border-width: 2pt; 
}


/* Margin long */
h1 {
    margin-top: 10px;
    margin-bottom: 10px;
    margin-left: auto;
    margin-right: auto;
}

/* Margin short */
section {
    margin: 20px;
}

/* Padding long */
footer {
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 10px;
    padding-right: 10px;
}

/* Padding short */
main {
    padding: 1rem 2rem;
}

/* Border */
section {
    border-style: solid;
    border-color: black;
    border-width: 2px;
    border-radius: 10px;
}


/* Text */
p {
    text-align: left;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Display */
nav li {
    display: inline-block;
}

span {
    display: inline;
}


/* Sizing */
video {
    height: 250px;
    width: 250px;
    max-width: 100%;
    min-width: 150px;
}

/* Positionnnnnnn! */
header {
    position: sticky;
    top: 0;
}

footer {
    position: relative;
}


/* Pseudo-Classes (*/
button:hover {
    background-color: green;
}

button:active {
    background-color: red;
}

/* Layouts - Flexbox */
nav ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.links-group {
    display: flex;
    flex-direction: column;
}

/* Layouts - Grid */
main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Responsiveness */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }

    nav ul {
        flex-direction: column;
    }
}

/* Class Selector */
.fit-picture {
    border-radius: 10px;
}

/* ID Selector */
#comments {
    width: 300px;
}

/* Attribute Selector */
input[type="radio"] {
    accent-color: orange;
}

/* Selector List */
h1, h2 {
    color: rgb(44, 62, 80); /* rgb */
}


/*===================
-----COMBINATORS-----
===================*/


/* Descendant */
nav ul li {
    list-style: circle;
}

/* Child */
nav > ul {
    padding-left: 20px;
}

/* Adjacent sibling */
h2 + p {
    color: blue;
}

/* General sibling */
h2 ~ p {
    font-style: italic;
}

/* Combined selector */
img.fit-picture {
    border: 2px solid black;
}


/*===================
----NEW SELECTORS----
===================*/

/* :has() */
section:has(video) {
    background-color: #eef;
}

/* Nested selector */
section {
    & h3 {
        color: purple;
    }
}