@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');

:root {
    --primary-color: #4a4a4a;
    --secondary-color: #aeaeae;
    --text-color: #333;
    --background-color: #ffffff;
    --font-family: 'Roboto', sans-serif;
}

html {
    overscroll-behavior: none;
    -webkit-overscroll-behavior: none;
    -ms-overscroll-behavior: none;
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

body {
    overscroll-behavior-x: none;
    -webkit-overscroll-behavior-x: none;
    -ms-overscroll-behavior-x: none;
    position: relative;
    width: 100%;
    overflow-x: hidden;
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s, color 0.3s;
}

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

a {
    font-weight: 300;
    text-decoration: none;
    cursor: pointer;
    color: var(--primary-color);
    transition: color 0.3s, transform 0.3s;
}

a:hover {
    color: var(--secondary-color);
}

h1 {
    font-weight: 300;
    font-size: 2em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--primary-color);
}

h2 {
    font-weight: 300;
    font-size: 1.1em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--primary-color);
}

p {
    font-weight: 300;
    font-size: 1em;
    line-height: 1.4;
}

.overlay-content h2 {
    font-weight: 400;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: white;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em 2em;
}

.navbar h1 {
    font-size: 1.1em;
}

#channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    justify-items: center;
    justify-content: center;
    margin: 2rem auto;
    min-height: 90vh;
    align-items: center;
    max-width: 1200px;
    padding: 0 2rem;
    position: relative;
}

#channel-grid h1 {
text-align: center;
}

.content-item {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
    animation: fadeIn 0.5s ease-in-out;
    background-color: white;
}

.content-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.channel-item {
    gap: 0.5em;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
}

.channel-item:hover {
    transform: translateY(-5px);
}

.channel-item h2 {
    opacity: 0;
}

.channel-item:hover h2 {
    opacity: 1;
    transition: all 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.channel-item h2 {
    margin-top: 0;
}

.channel-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 1rem;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.channel-item:hover img {
    filter: grayscale(0%);
}

#content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    /* gap: 1rem; */
    padding: 1rem;
}

.content-item img,
.content-item video {
    max-width: 100%;
    max-height: 10em;
    width: auto;
    height: auto;
    filter: grayscale(100%);
    margin: 0.5em auto 1em auto;
    object-fit: contain;
    display: block;
}

.content-item h2 {
border-bottom: 1px solid black;
margin: 0 0 0.5em 0;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    animation: fadeInOverlay 0.5s ease-in-out;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.overlay-content {
    display: flex;
    flex-direction: column;
    gap: 1em;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 40px;
    background: var(--background-color);
    width: 80%;
    max-width: 900px;
    border-radius: 5px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

#overlay-detailed-description{
    border-top: 1px solid var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
    padding: 1em 0;
    margin: 0.5em 0 0.9em 0;
}

.overlay-content img {
    position: relative;
    margin: 0 auto;
    background: white;
    filter: none;
    max-width: 100%;
    height: 100%;
    max-height: 50vh;
    width: auto;
    display: block;
    object-fit: contain;
}

.overlay-content video {
    position: relative;
    margin: 0 auto;
    background: white;
    width: 100%;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: var(--primary-color);
    transition: color 0.3s, transform 0.3s;
}

.close:hover {
    color: var(--secondary-color);
    transform: rotate(90deg);
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 2em;
    cursor: pointer;
    padding: 10px;
    z-index: 99;
    transition: color 0.3s, transform 0.3s;
}

.nav-button:hover {
    color: rgba(255, 255, 255, 0.7);
}

#prev-button {
    left: -3em;
}

#next-button {
    right: -3em;
}

#overlay-description {
    font-style: italic;
}

main {
    margin-top: 80px;
}

@media (orientation: portrait) {
    #channel-grid {
        grid-template-columns: 1fr;  /* Single column for portrait */
        padding: 0 1rem;
    }

    .overlay-content {
        width: 95%;  /* Wider overlay on portrait */
        padding: 20px;
    }

    .nav-button {
        display: none;  /* Hide navigation buttons on portrait */
    }

    .channel-item {
        padding: 1rem;
    }

    .channel-item img {
        height: 150px;  /* Smaller images for portrait */
    }

    .navbar {
        padding: 0.5em 1em;  /* Tighter navbar padding */
    }
}

