/* reset */
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
    display: block;
}

body {
    line-height: 1;
}

ol,
ul {
    list-style: none;
}

blockquote,
q {
    quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
    content: '';
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

[hidden] {
    display: none !important;
}

HTML,
BODY,
MAIN {
    width: 100%;
    height: 100vh;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.3;
}

BODY {
    background: #1e1e1e;
}

*:focus,
*:focus-visible {
    outline: none;
}

*,
*::after,
*::before {
    box-sizing: border-box;
}

I {
    vertical-align: middle;
}

button {
    cursor: pointer;
}

.home-search {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 25px;
    width: 100%;
    height: 100%;
}

.logo {
    height: 110px;
}

.logo .icon {
    display: none;
}

.logo IMG {
    height: 100%;
}

.search-form {
    position: relative;
    max-width: 520px;
    width: 100%;
    height: 50px;
    border-radius: 50px;
    border: 1px solid #333;
    background: #323232;
    padding: 0 60px 0 15px;
    overflow: hidden;
}

.search-result {
    display: none;
}

.search-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 18px;
}

.btn-submit {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 60px;
    background: none;
    border: none;
}

/* RESULTS MODE */
MAIN.results-mode {
    padding: 30px;
}

MAIN.results-mode .home-search {
    flex-direction: row;
    justify-content: flex-start;
    height: initial;
}

MAIN.results-mode .home-search .logo {
    height: 50px;
}

MAIN.results-mode .search-result {
    display: block;
    flex: 1;
    margin: 30px 0 100px 60px;
    padding-bottom: 100px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.tabs button {
    padding: 10px 20px;
    border-radius: 50px;
    border: none;
}

.tabs button.active {
    background: #5b5bb9;
}

.results {
    display: flex;
    flex-direction: column;
    gap: 25px;
    max-width: 60%;
    margin-top: 40px;
}

.results .title {
    font-size: 20px;
    margin-bottom: 10px;
}

.results .meta {
    font-weight: 300;
    font-size: 14px;
    margin-bottom: 15px;
}

.results .snippet {
    line-height: 1.3;
}

.pager {
    display: flex;
    gap: 15px;
    margin-top: 40px;
}

.pager button {
    padding: 10px 20px;
    border-radius: 50px;
    border: none;
}

/* Grille images */

.results.image-grid {
    max-width: 95%;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.image-card {
    position: relative;
    display: block;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--card);
}

.image-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.image-card .cap {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 2px 8px;
    font-size: 12px;
    color: white;
    background: rgb(0 0 0 / 86%);
    border-radius: 999px;
    pointer-events: none;
}

/* Grille vidéos */

.results.video-grid {
    max-width: 95%;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.video-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

.video-card .thumb {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--card);
}

.video-card img {
    width: 100%;
    height: 132px;
    object-fit: cover;
    display: block;
}

.video-card .play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 26px;
    opacity: .0;
    transition: opacity .15s ease;
}

.video-card:hover .play {
    opacity: .85;
}

.video-card .badge {
    position: absolute;
    padding: 2px 6px;
    font-size: 12px;
    color: var(--fg);
    background: rgba(0, 0, 0, .55);
    border-radius: 6px;
}

.video-card .badge.duration {
    right: 8px;
    bottom: 8px;
}

.video-card .badge.host {
    left: 8px;
    bottom: 8px;
}

.video-card .vtitle {
    margin: 8px 2px 0;
    font-size: 14px;
    line-height: 1.3;
    color: var(--fg);
}

/* ADAPTABILITY */
@media (max-width: 720px) {

    .results.image-grid,
    .results.video-grid {
        max-width: 100%;
    }

    MAIN.results-mode .logo .icon {
        display: block;
    }

    MAIN.results-mode .logo .full {
        display: none;
    }

    MAIN:not(.results-mode) .home-search {
        flex-direction: column;
        padding: 0 25px;
    }

    MAIN.results-mode .home-search {
        flex-direction: row;
    }

    MAIN:not(.results-mode) .home-search .logo {
        height: 110px;
    }

    MAIN.results-mode .search-result {
        margin-left: 0;
    }

    .results {
        max-width: 100%;
    }

    .video-card img {
        height: 150px;
    }

    .image-card img {
        height: 180px;
    }

}