/* Base styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #fafafa;
  color: #333;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #2c3e50;
  color: white;
  padding: 10px 20px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 999;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-container h1 {
  margin: 0;
  font-size: 22px;
}

.logo-container a {
  text-decoration: none;
  color: inherit;
}

#language-select {
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 5px;
  border: none;
  background: #34495e;
  color: white;
  cursor: pointer;
}

/* Topics buttons */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 5px 0;
  position: relative;
}

nav button {
  background: #34495e;
  border: none;
  color: white;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

nav button:hover {
  background: #1abc9c;
}

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

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #34495e;
  padding: 5px;
  border-radius: 5px;
  z-index: 2000;
  min-width: 120px;
}

.dropdown-content button {
  display: block;
  width: 100%;
  text-align: left;
  background: #34495e;
  padding: 6px 10px;
  margin: 2px 0;
}

.dropdown-content button:hover {
  background: #1abc9c;
}

/* Hamburger */
.hamburger {
  display: none;
  width: 30px;
  height: 22px;
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  z-index: 1001;
}

.hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  background: white;
  border-radius: 3px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 9px; }
.hamburger span:nth-child(3) { top: 18px; }

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg);
  top: 9px;
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg);
  top: 9px;
}

/* Side drawer */
.side-drawer {
  position: fixed;
  top: 0;
  left: -260px;
  width: 260px;
  height: 100vh;
  background-color: #2c3e50;
  padding: 20px;
  box-shadow: 2px 0 8px rgba(0,0,0,0.4);
  transition: left 0.3s ease;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.side-drawer.open {
  left: 0;
}

.side-drawer h3 {
  color: #fff;
  margin: 0 0 10px;
  font-size: 18px;
}

.side-drawer button {
  width: 100%;
  text-align: left;
  background: #34495e;
  padding: 10px;
  font-size: 15px;
}

.side-drawer button:hover {
  background: #1abc9c;
}

/* Overlay */
.overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}

.overlay.show {
  display: block;
}

/* Container + articles */
.container {
  padding: 20px;
  max-width: 900px;
  margin: auto;
}

.news-article {
  background: white;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-article:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.news-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
}

.news-content h3 {
  margin: 0 0 8px;
  color: #2c3e50;
  font-size: 16px;
}

.news-content h3:hover {
  color: #1abc9c;
}

.news-content p {
  font-size: 13px;
  line-height: 1.4em;
  margin: 4px 0;
  max-width: 65ch;
}

.meta {
  font-size: 12px;
  color: #555;
}

.hashtags {
  color: #1abc9c;
  font-size: 12px;
  margin-top: 4px;
}

.hashtags span {
  cursor: pointer;
  margin-right: 5px;
}

.hashtags span:hover {
  text-decoration: underline;
}

/* Buttons */
#load-more, #reset-button {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#load-more {
  background: #2c3e50;
  color: white;
}

#load-more:hover { background: #1abc9c; }

#reset-button {
  display: none;
  background: #e74c3c;
  color: white;
}

#reset-button:hover { background: #c0392b; }

/* Footer */
footer {
  background-color: #2c3e50;
  color: white;
  text-align: center;
  padding: 15px;
  margin-top: 30px;
}

footer a {
  color: #1abc9c;
  text-decoration: none;
}

/* Grid for desktop */
@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
  }
  #news-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
  #news-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile fixes */
@media (max-width: 768px) {
  header {
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .logo-container {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  /* Hide topics & about in header on mobile */
  nav, #about-link {
    display: none;
  }

  /* Hamburger visible */
  .hamburger {
    display: block;
  }

  /* Side drawer shows About and all topics */
  .side-drawer {
    display: flex;
  }

  #news-container {
    display: block;
  }

  .news-article {
    flex-direction: column;
  }
}

/* Links */
.news-content h3 a {
  color: #2c3e50;
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-content h3 a:hover {
  color: #1abc9c;
  text-decoration: underline;
}

.read-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: normal;
  color: #1abc9c;
  text-decoration: none;
  transition: color 0.2s ease;
}

.read-more:hover {
  color: #16a085;
  text-decoration: underline;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.action-buttons button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.action-buttons button:hover {
  background-color: #0056b3;
}

#reset-button {
  display: none;
}

/* ----------------------
   Drawer & overlay
-----------------------*/
#drawer {
  display: none;       /* hidden by default */
  position: fixed;
  top: 0;
  right: 0;
  width: 250px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 5px rgba(0,0,0,0.3);
  z-index: 1000;
  overflow-y: auto;
  padding: 1rem;
  transition: transform 0.3s ease;
}

#drawer.open {
  transform: translateX(0);
}

#drawer h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

#drawer button, #drawer a {
  display: block;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: #333;
  text-decoration: none;
}

#drawer button:hover, #drawer a:hover {
  background: #f0f0f0;
}

#overlay {
  display: none;
  position: fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background: rgba(0,0,0,0.3);
  z-index: 900;
}

#overlay.show {
  display: block;
}

/* Hamburger */
.hamburger {
  font-size: 1.5rem;
  cursor: pointer;
  border: none;
  background: none;
}

/* Dropdown inside desktop topics */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #fff;
  min-width: 120px;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
  z-index: 100;
}

.dropdown-content button {
  display: block;
  width: 100%;
  padding: 0.3rem 0.5rem;
  background: none;
  border: none;
  text-align: left;
}

.dropdown-content button:hover {
  background: #eee;
}

/* ----------------------
   Mobile adjustments
-----------------------*/
@media (max-width: 768px) {
  #topics,
  #about-link {
    display: none !important; /* hide inline topics & About on mobile */
  }

  #drawer {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 250px;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 5px rgba(0,0,0,0.3);
    z-index: 1000;
    overflow-y: auto;
    padding: 1rem;
  }

  #drawer.open {
    display: block;
  }

  #overlay {
    display: none;
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.3);
    z-index: 900;
  }

  #overlay.show {
    display: block;
  }

  .hamburger {
    display: flex !important;
    position: absolute;
    right: 16px;
    top: 16px;
  }
}


