/* Base Styles and CSS Variables */
:root {
  --primary-color: #E84C22; /* UN PLUS DRC Orange */
  --secondary-color: #1a1a1a; /* Black */
  --text-dark: #111111;
  --text-light: #555555;
  --bg-light: #f9f9f9;
  --white: #ffffff;
  --border-color: #eeeeee;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Merriweather', serif;
  font-weight: 700;
  line-height: 1.3;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header & Navigation */
.site-header {
  background-color: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.top-bar {
  background-color: var(--text-dark);
  color: var(--white);
  font-size: 0.8rem;
  padding: 5px 0;
  text-align: center;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}

.logo-container h1 {
  font-size: 2rem;
  color: var(--primary-color);
  letter-spacing: -1px;
}

.logo-container span {
  color: var(--secondary-color);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.main-nav a:hover {
  color: var(--primary-color);
}

/* Dropdown Menu */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--white);
  min-width: 220px;
  box-shadow: 0px 8px 30px 0px rgba(0,0,0,0.1);
  z-index: 1001;
  top: 100%;
  left: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.dropdown-content a {
  color: var(--text-dark);
  padding: 12px 20px;
  text-decoration: none;
  display: block;
  text-transform: none;
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 1px solid var(--bg-light);
}

.dropdown-content a:last-child {
  border-bottom: none;
}

.dropdown-content a:hover {
  background-color: var(--bg-light);
  color: var(--primary-color);
  padding-left: 25px; /* nice animation */
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 5%;
  display: grid;
  grid-template-columns: 70% 28%;
  gap: 2%;
}

/* Featured Article */
.featured-article {
  margin-bottom: 2rem;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.featured-article .img-wrapper {
  height: 450px;
  overflow: hidden;
}

.featured-article img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-article:hover img {
  transform: scale(1.05);
}

.featured-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  padding: 2rem;
  color: var(--white);
}

.category-tag {
  background-color: var(--primary-color);
  color: var(--white);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 10px;
}

.featured-content h2 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

/* Article List */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.article-card .img-wrapper {
  height: 200px;
  overflow: hidden;
}

.article-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover img {
  transform: scale(1.05);
}

.article-info {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.article-info h3 {
  font-size: 1.2rem;
  margin: 10px 0;
  flex-grow: 1;
}

.article-info h3 a:hover {
  color: var(--primary-color);
}

.article-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
}

/* Sidebar */
.sidebar {
  background: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  height: fit-content;
}

.sidebar-widget {
  margin-bottom: 2rem;
}

.widget-title {
  font-size: 1.2rem;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.trending-list {
  list-style: none;
}

.trending-list li {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.trending-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.trending-list a {
  font-weight: 600;
  display: block;
}

.trending-list a:hover {
  color: var(--primary-color);
}

/* Article Detail Page */
.single-article-header {
  margin-bottom: 2rem;
}

.single-article-title {
  font-size: 2.8rem;
  margin: 15px 0;
}

.single-article-image {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
}

.article-content p {
  margin-bottom: 1.5rem;
}

/* Admin Dashboard */
.admin-container {
  max-width: 1000px;
  margin: 3rem auto;
  background: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--text-dark);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-light);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  font-family: 'Merriweather', serif;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  background-color: var(--text-dark);
  color: var(--white);
  font-weight: 600;
}

.admin-table tr:hover {
  background-color: var(--bg-light);
}

.admin-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.admin-btn:hover {
  background-color: #c82333;
}

/* Footer Styles */
.site-footer {
  background: var(--secondary-color);
  color: var(--white);
  padding: 4rem 5% 1rem;
  margin-top: 4rem;
  font-family: 'Inter', sans-serif;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-links h3, .footer-contact h3 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--white);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
  display: inline-block;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #aaa;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary-color);
  padding-left: 5px;
}

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 1.5rem;
  text-align: center;
  color: #777;
  font-size: 0.9rem;
}

/* ============================
   MOBILE MENU TOGGLE BUTTON
   ============================ */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  padding: 8px;
  border-radius: 6px;
  transition: var(--transition);
  z-index: 1010;
  position: relative;
}

.menu-toggle:hover {
  background-color: var(--bg-light);
}

/* Animated hamburger lines */
.menu-toggle .hamburger-line {
  display: block;
  width: 26px;
  height: 3px;
  background-color: var(--text-dark);
  border-radius: 2px;
  transition: all 0.3s ease;
  position: relative;
}

.menu-toggle .hamburger-line + .hamburger-line {
  margin-top: 5px;
}

/* X animation when active */
.menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* ============================
   RESPONSIVE: TABLET (≤992px)
   ============================ */
@media (max-width: 992px) {
  /* Header */
  .header-main {
    flex-wrap: wrap;
    padding: 0.8rem 4%;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  /* Navigation - slide down panel */
  .main-nav {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
  }

  .main-nav.active {
    max-height: 500px;
    opacity: 1;
  }

  .main-nav ul {
    flex-direction: column;
    width: 100%;
    margin-top: 0.8rem;
    gap: 0;
    background: var(--white);
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
  }

  .main-nav ul li {
    border-bottom: 1px solid var(--border-color);
  }

  .main-nav ul li:last-child {
    border-bottom: none;
  }

  .main-nav ul li a {
    display: block;
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  /* Dropdown on mobile */
  .dropdown:hover .dropdown-content {
    display: none;
  }

  .dropdown-content {
    position: static;
    display: none !important;
    box-shadow: none;
    border: none;
    border-radius: 0;
    min-width: 100%;
    background-color: var(--bg-light);
  }

  .dropdown.active .dropdown-content {
    display: block !important;
  }

  .dropdown-content a {
    padding: 10px 16px 10px 32px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
  }

  /* Main layout */
  .container {
    grid-template-columns: 1fr;
    padding: 0 4%;
    margin: 1.5rem auto;
    gap: 1.5rem;
  }

  /* Featured article */
  .featured-article .img-wrapper {
    height: 350px;
  }

  .featured-content h2 {
    font-size: 1.8rem;
  }

  .featured-content {
    padding: 1.5rem;
  }

  /* Article grid */
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }

  /* Sidebar */
  .sidebar {
    margin-top: 0;
  }

  /* Single article */
  .single-article-title {
    font-size: 2.2rem;
  }

  /* Admin */
  .admin-container {
    margin: 1.5rem auto;
    padding: 1.5rem;
  }

  .admin-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .admin-header h2 {
    font-size: 1.3rem;
  }

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

  /* Footer */
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .site-footer {
    padding: 3rem 4% 1rem;
    margin-top: 2.5rem;
  }
}

/* ============================
   RESPONSIVE: SMALL TABLET (≤768px)
   ============================ */
@media (max-width: 768px) {
  .top-bar {
    font-size: 0.7rem;
    padding: 4px 10px;
  }

  /* Featured article */
  .featured-article .img-wrapper {
    height: 280px;
  }

  .featured-content h2 {
    font-size: 1.4rem;
  }

  .featured-content p {
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .featured-content {
    padding: 1.2rem;
  }

  /* Article grid - single column */
  .article-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .article-card {
    flex-direction: row;
    align-items: stretch;
  }

  .article-card .img-wrapper {
    width: 140px;
    min-width: 140px;
    height: auto;
    min-height: 140px;
  }

  .article-info {
    padding: 1rem;
  }

  .article-info h3 {
    font-size: 1rem;
    margin: 5px 0;
  }

  /* Widget title */
  .widget-title {
    font-size: 1.1rem;
  }

  /* Sidebar */
  .sidebar {
    padding: 1.5rem;
  }

  /* Single article */
  .single-article-title {
    font-size: 1.8rem;
  }

  .article-content {
    font-size: 1rem;
  }

  .single-article-image {
    max-height: 350px;
    border-radius: 6px;
  }

  /* Admin */
  .admin-container {
    margin: 1rem 3%;
    padding: 1.2rem;
  }

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

  .stat-value {
    font-size: 2rem;
  }

  .admin-table th, .admin-table td {
    padding: 0.7rem 0.5rem;
    font-size: 0.85rem;
  }

  /* Footer */
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .site-footer {
    padding: 2.5rem 4% 1rem;
    margin-top: 2rem;
  }
}

/* ============================
   RESPONSIVE: PHONE (≤480px)
   ============================ */
@media (max-width: 480px) {
  .top-bar {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  .header-main {
    padding: 0.6rem 3%;
  }

  /* Scale down logo on small screens */
  .logo-container a h1 {
    font-size: 1.5rem !important;
  }

  .logo-container a div {
    width: 32px !important;
    height: 36px !important;
  }

  .logo-container a div span {
    font-size: 1.3rem !important;
  }

  /* Container */
  .container {
    padding: 0 3%;
    margin: 1rem auto;
    gap: 1rem;
  }

  /* Featured article */
  .featured-article .img-wrapper {
    height: 220px;
  }

  .featured-content {
    padding: 1rem;
  }

  .featured-content h2 {
    font-size: 1.15rem;
    line-height: 1.3;
  }

  .featured-content p {
    font-size: 0.8rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .category-tag {
    font-size: 0.65rem;
    padding: 3px 8px;
    margin-bottom: 6px;
  }

  /* Article cards - compact horizontal layout */
  .article-card .img-wrapper {
    width: 110px;
    min-width: 110px;
    min-height: 110px;
  }

  .article-info {
    padding: 0.8rem;
  }

  .article-info h3 {
    font-size: 0.9rem;
    margin: 3px 0;
  }

  .article-meta {
    font-size: 0.75rem;
    margin-top: 8px;
    flex-direction: column;
    gap: 4px;
  }

  /* Widget title */
  .widget-title {
    font-size: 1rem;
  }

  /* Sidebar */
  .sidebar {
    padding: 1.2rem;
  }

  .trending-list a {
    font-size: 0.9rem;
  }

  /* Single article */
  .single-article-title {
    font-size: 1.4rem;
  }

  .article-content {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .single-article-image {
    max-height: 250px;
    border-radius: 4px;
    margin-bottom: 1.2rem;
  }

  /* Admin */
  .admin-container {
    margin: 0.8rem 2%;
    padding: 1rem;
    border-radius: 6px;
  }

  .admin-header h2 {
    font-size: 1.1rem;
  }

  .admin-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  .stat-value {
    font-size: 1.6rem;
  }

  .admin-table th, .admin-table td {
    padding: 0.5rem 0.4rem;
    font-size: 0.78rem;
  }

  /* Footer */
  .site-footer {
    padding: 2rem 3% 1rem;
    margin-top: 1.5rem;
  }

  .footer-bottom {
    font-size: 0.8rem;
  }
}