/* RESET */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
   /*  overflow-x: hidden; */
}

/* VARIABLES */
:root {
    
    /* COLORS */

    /* || BACKGROUNDS */

    --BG-HEADER: hsl(245, 85%, 3%);
    --BG-BODY: hsl(0, 0%, 100%);
    --BG-BODY-DEGRADE-TOP-RIGHT: linear-gradient(to top right, hsl(219, 100%, 58%), hsl(219, 100%, 18%));
    --BG-BODY-DEGRADE-BOTTOM-LEFT: linear-gradient(to bottom left, hsl(219, 100%, 58%), #00205c);

    /* || TEXT COLORS */
    --COLOR: hsl(0, 0%, 100%);
    --COLOR-TEXT: hsl(0, 0%, 0%);
    --COLOR-TITLE: hsl(0, 0%, 95%);
    --COLOR-HIGHLIGHT: hsl(180, 100%, 50%);
    --BG-FOOTER: hsl(245, 85%, 3%);
    --HOVER-LINK: hsl(180, 100%, 50%);

    /* BORDERS */
    --BORDER-RADIUS: 10px;

    /*IMAGES*/
    --logo-svg: hsl(0, 0%, 0%);
}

@media (prefers-color-scheme: dark) {
    :root {
        
        /* COLORS */

        /* || BACKGROUNDS */

        --BG-HEADER: hsl(245, 85%, 3%);
        --BG-BODY: hsl(0, 0%, 11%);
        --BG-BODY-DEGRADE-TOP-RIGHT: linear-gradient(to top right, hsl(0, 0%, 34%), #000);
        --BG-BODY-DEGRADE-BOTTOM-LEFT: linear-gradient(to bottom left, hsl(0, 0%, 34%), #000);

        /* || TEXT COLORS */
        --COLOR: hsl(0, 0%, 100%);
        --COLOR-TEXT: hsl(0, 0%, 100%);
        --COLOR-TITLE: hsl(0, 0%, 95%);
        --COLOR-HIGHLIGHT: hsl(180, 100%, 50%);
        --BG-FOOTER: hsl(245, 85%, 3%);
        --HOVER-LINK: hsl(180, 100%, 50%);

        /* BORDERS */

        --BORDER-RADIUS: 10px;

        /*IMAGES*/
        --logo-svg: hsl(0, 0%, 100%);
    }
}

body {
    box-sizing: border-box;
    overflow-x: hidden;
   /*  background-color: var(--BG-BODY); */
}

/* HEADER */

header {
  background-image: var(--BG-BODY-DEGRADE-TOP-RIGHT);
  padding: 10px 40px;
}

/* MENU */

.menu {
  display: flex;
  align-items: center;
  color: var(--COLOR);
}

.logo svg {
  width: 60px;
  height: auto;
 
}

.logo svg path {
  fill: var(--logo-svg);
  transition: fill 0.3s ease;
}

.menu h1, a {
  display: flex;  
  font-size: 24px;
  text-decoration: none;
  color: var(--COLOR);
}

/* Hamburger style button */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001; /* Garante que fique por cima do menu */
  margin-left: 60px;
}

.hamburger .bar {
  width: 100%;
  height: 3px;
  background-color: hsl(0, 0%, 100%);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.active .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Links nav */
.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
  margin-left: auto;
  font-size: 20px;
}

.nav-links li a {
  text-decoration: none;
  color: var(--COLOR);
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links li a:hover {
  color: var(--HOVER-LINK);
}

/* END OF MENU SECTION */

/* SEARCH BAR */

.search-container {
  position: relative;
  margin-left: auto;
  margin-right: 30px;
}

#search-input {
  width: 300px;
  padding: 8px 15px;
  border: none;
  border-radius: 20px;
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--COLOR);
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

#search-input:focus {
  background-color: rgba(255, 255, 255, 0.3);
  width: 350px;
}

.search-results {
  position: absolute;
  top: 45px;
  left: 0;
  width: 100%;
  max-width: 400px;
  max-height: 400px;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.95);
  border-radius: var(--BORDER-RADIUS);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 2000;
}

.search-results.active {
  display: block;
}

.search-result-item {
  display: block;
  padding: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--COLOR);
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.search-result-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item h4 {
  font-size: 16px;
  margin-bottom: 5px;
  color: var(--COLOR-HIGHLIGHT);
}

.search-result-item p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* END OF SEARCH BAR */


/* || HERO SECTION */

.hero {
    display: flex;
    align-content: center;
    background-image: var(--BG-BODY-DEGRADE-BOTTOM-LEFT);
    color: var(--COLOR);
    width: 100%;
    height: 500px;
    padding: 0 5rem 0;
}

@media (max-width: 768px) {
    .hero {
        padding: 0;
        height: 250px;
    }
}

.hero img {
    margin: 25px 0;
    width: 100%;
    height: 445px;
    border-radius: 20px;
    object-fit: cover;
    object-position: center top;
}

@media (max-width: 768px) {
    .hero img {
        margin: 0;
        width: 100%;
        border-radius: 0;
        height: 250px;
        object-fit: cover;
    }
}
.main-page-hero {
    display: flex;
    align-content: center;
    background-image: var(--BG-BODY-DEGRADE-BOTTOM-LEFT);
    color: var(--COLOR);
    width: 100%;
    height: 400px;
}

.main-page-hero img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: center center;
}

/* END OF HERO SECTION */

/*MAIN CONTENT*/

/*READING TIME*/

.reading-time {
    margin: 20px 0;
    padding: 15px;
    /* background-color: #f5f5f5;
    border-left: 4px solid #007bff; */
    border-radius: 4px;
    font-size: 16px;
}

.reading-time p {
    margin: 0;
    color: var(--COLOR);
}

.reading-time strong {
    color: #007bff;
    font-weight: 600;
}

/*END OF READING TIME*/

main {
    padding: 50px 5rem 10rem 20rem;
    color: var(--COLOR-TEXT);
    background: var(--BG-BODY);
}

@media (max-width: 1024px) {
    main {
        padding: 40px 2rem 10rem 2rem;
    }
}

/* || MAIN CONTENT WRAPPER - Layout com Sidebar */

.main-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    margin-bottom: 50px;
}

.content-section {
    grid-column: 1;
}

.main-post img {
    width: 500px;
    height: 500px;
    margin-left: 140.40px;
}

@media (max-width: 768px) {
    .main-post img {
        width: 100%;
        height: auto;
        margin-left: 0;
    }
}

/* || SIDEBAR STYLES */

.sidebar {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: sticky;
    top: 20px;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--COLOR-TEXT);
    margin: 10px 0;
    text-align: center;
}

.sidebar-post {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    background: var(--BG-BODY);
}

.sidebar-post:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar-post-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.sidebar-post h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--COLOR-TEXT);
    padding: 12px 15px 8px 15px;
    margin: 0;
}

.sidebar-post p {
    font-size: 12px;
    color: var(--COLOR-TEXT);
    padding: 0 15px 10px 15px;
    margin: 0;
    line-height: 1.4;
}

.sidebar-link {
    display: inline-block;
    padding: 8px 15px;
    font-size: 12px;
    color: var(--COLOR-HIGHLIGHT);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.sidebar-link:hover {
    color: #00a8cc;
}

/* || SUGGESTED POSTS SECTION - Posts em Linha */

.suggested-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.suggested-post-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--BG-BODY);
}

.suggested-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.suggested-post-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.suggested-post-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--COLOR-TEXT);
    padding: 15px;
    margin: 0;
}

.suggested-post-card p {
    font-size: 14px;
    color: var(--COLOR-TEXT);
    padding: 0 15px;
    margin: 0;
    line-height: 1.5;
}

.suggested-post-link {
    display: inline-block;
    padding: 12px 15px;
    font-size: 14px;
    color: var(--COLOR-HIGHLIGHT);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.suggested-post-link:hover {
    color: #00a8cc;
}

.title {
    text-align: center;
    margin: 70px 0;
    font-size: 30px;
}

.preview {
    text-decoration: none;
    color: var(--COLOR-TEXT);
}

.subtitle {
    font-size: 20px;
    margin: 20px 0 0 0;
}

.text {
    font-size: 18px;
    margin-bottom: 50px;
}

#post-content {
    font-size: 18px;
}

/* SEÇÃO DE VÍDEOS - DESKTOP E MOBILE */

.subtitlevideo {
    font-size: 40px;
    text-align: center;
    color: var(--COLOR-TEXT);
    margin: 30px 0;
}

.textvideo {
    font-size: 18px;
    margin: 30px 0;
}

.video {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    justify-items: center;
    margin-bottom: 50px;
}

.tutorial {
    width: 100%;
    max-width: 560px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.tutorial:hover {
    transform: translateY(-5px);
}

.tutorial iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* MOBILE - Até 768px */
@media (max-width: 768px) {
    .subtitlevideo {
        font-size: 28px;
        margin-bottom: 20px;
    }

    .video {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tutorial {
        max-width: 100%;
    }

    .suggested-posts {
        grid-template-columns: 1fr;
    }
}


/* || VISUAL RESOURCES */

.social-media {
    background-image: var(--BG-BODY-DEGRADE-TOP-RIGHT);
}

.social-icons {
    display: flex;
    gap: 16px;
    margin-left: 1159.4px;
}

@media (max-width: 768px) {
    .social-icons {
        margin-left: 0;
        justify-content: center;
    }
}

.social-icons img {
    width: 40px;
    height: 40px;
    margin-bottom: 20px
}

.social-icons img:hover {
    transform: translateY(-5px);
}

/* END OF VISUAL RESOUCES */

/* || FOOTER SECTION */

.contact h3 {
    margin-left: 1159.4px;
    color: var(--COLOR);
}

.contact p {
    margin-left: 1159.4px;
    text-align: unset;
    color: var(--COLOR);
}

@media (max-width: 768px) {
    .contact h3,
    .contact p {
        margin-left: 0;
        text-align: center;
    }
}

footer {
    background-image: var(--BG-BODY-DEGRADE-TOP-RIGHT);
}

footer h2 {
    font-size: 20px;
    padding-top: 50px;
    margin-bottom: 20px;
    color: var(--COLOR);
    margin-left: 1159.4px;
}

@media (max-width: 768px) {
    footer h2 {
        margin-left: 0;
        text-align: center;
    }
}

footer p {
    text-align: center;
    color: var(--COLOR);
    padding-bottom: 20px;
}

/* END OF FOOTER SECTION */


/* || MOBILE SECTION */

@media (max-width: 600px) {

    /* || HEADER MOBILE SECTION */

    header {
        padding-bottom: 70px; /* Cria espaço extra embaixo para a barra */
        position: relative;   /* Garante o posicionamento correto */
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        margin-top: 300px;
        right: -100%;
        background: rgba(0, 0, 0, 0.95);;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 200px;
        height: 100vh;
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links li {
        margin: 10px 0;
    }

    .nav-links a {
        color: white;
        font-size: 18px;
        text-decoration: none;
    }

    /* SEARCH BAR MOBILE */

    /* SUBSTITUA O .SEARCH-CONTAINER ANTERIOR POR ESTE */
    .search-container {
        display: block;
        position: absolute;
        bottom: 15px; /* Fixa a barra na parte inferior do cabeçalho */
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 350px;
        z-index: 999;
    }

    #search-input {
        width: 75%; /* Ocupa todo o espaço container definido acima */
    }

    #search-input:focus {
        width: 75%; /* Mantém a largura fixa ao clicar */
    }

    /* END OF SEARCH BAR MOBILE */

    /* END OF HEADER MOBILE SECTION */

    /* || HERO MOBILE SECTION */

    .hero {
        flex-direction: column;
        height: 250px;
    }

    .hero img {
        height: 250px;
        object-fit: cover;
        border-radius: 0;
    }

    main {
        padding: 10px;
    }

    .main-content-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 30px;
    }

    .sidebar {
       /*  grid-column: 1;
        position: static; */
        display: none;
    }

    .subtitlevideo {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .video {
        gap: 15px;
    }

    .tutorial {
        aspect-ratio: 16 / 9;
    }

    .suggested-posts {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* END OF HERO MOBILE SECTION */

    /* || POST MOBILE SECTION */

    .post {
        max-width: 100%;
        margin-left: 0;
        font-size: 20px;
    }

    .post h2 {
        margin: 10px 0 20px 0;
        font-size: 25px;
    }

    /* END OF POST MOBILE SECTION */


    /* || VISUAL MOBILE SECTION RESOURCES */

    .social-media {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 30px 20px;
    }

    .social-icons {
        margin-left: 0;
        justify-content: center;
        order: 2;
    }

   /*  END OF MOBILE SECTION RESOURCES */

    /* || FOOTER MOBILE SECTION */

    .contact {
        order: 1;
        margin-bottom: 20px;
        padding: 0 20px;
    }

    .contact h3,
    .contact p,
    footer h2 {
        margin-left: 0;
        text-align: center;
    }

    footer {
        padding: 20px 10px;
    }

    footer p {
        text-align: center;
        padding-top: 20px;
    }

    /* END OF FOOTER MOBILE SECTION */
}