:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --background-color: #f5f5f5;
  --text-light: #ffffff;
  --shadow: 0 2px 5px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  background-color: var(--background-color);
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header & Navigation */
header {
  background-color: var(--primary-color);
  color: var(--text-light);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

main {
  flex: 1; /* Pushes footer down */
}


nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

ul, ol {
  list-style: none;
}

/* Menu Icon Styling */

.menu-icon {
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  padding: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  /* transition: var(--transition);*/
}

.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  padding: 0.5rem;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--secondary-color);
  outline: none;
}

/* Dropdown Navigation */
.dropdown {
  position: relative;
}

.subnav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--primary-color);
  min-width: 200px;
  box-shadow: var(--shadow);
  z-index: 1000;
}

.dropdown:hover .subnav {
  display: block;
}

.subnav li {
  padding: 0.5rem 1rem;
}

.subnav a {
  color: var(--text-light);
  white-space: nowrap;
}

/* Section Visibility */
.section {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.section.active {
  display: block;
  opacity: 1;
}

.subnav a.active {
  color: var(--secondary-color);
  font-weight: bold;
}

/* Main Content */
.container {
  flex: 1;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}


/* Card System */
.card {
  background: white;
  padding: 1.5rem;
  border-radius: 5px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Grid System */
.articles-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}



/* Footer */
footer {
  background-color: var(--primary-color);
  color: var(--text-light);
  text-align: center;
  padding: 1rem;
  margin-top: auto;
}



/* Mobile Responsive Styles, @media  screen and (max-width: 767px) { */
@media screen and (max-width: 767px){
  body {
    padding-bottom: 0;
  }

  nav {
    flex-wrap: wrap;
    gap: 1rem;
  }

  ul, ol {
    list-style: none;
  }
  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;        /* Alinha os itens à esquerda */
    padding-left: 1rem;             /* Recuo à esquerda */
    background-color: var(--primary-color);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
  }
  

  .nav-links.active {
    max-height: 1000px; /* suficiente pro menu expandir */
    overflow-y: auto;
  }


  .menu-icon {
    display: block;
  }

  .menu-icon::before {
    content: '\2630'; /* Unicode for ☰ */
    display: block;
  }
  

  h1 {
    font-size: 1.5rem;
    margin: 0.5em 0;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .card {
    margin-bottom: 1rem;
  }

  .hero-logo {
    width: 100px;
    height: auto;
    margin-bottom: 20px;
  }

  footer {
    position: relative;
    margin-top: 2rem;
  }

  /* Mobile Dropdown Adjustments */
  .dropdown {
    width: 100%;
    text-align: center;
  }

  .subnav {
    display: none;
    background-color: var(--primary-color);
    width: 100%;
    padding-left: 1rem;
  }

  

  .dropdown.open .subnav {
    display: block;
  }

  .dropdown .subnav.open {
    display: block;
  }
}


/* Accessibility Improvements */

a:focus,
button:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }  
  .card {
    transition: none;
  }
}

