/* === Global Reset and Full Height === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
  background: #f4f6f8;
}

/* === Layout Container === */
.layout-container {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap; /* ✅ Wrap on small screens */
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
  align-items: flex-start;
  margin-top: 35px;
  width: 100%;
  padding-left: 2%;
  padding-right: 2%;
  overflow-x: hidden;
}

/* === Main Content === */
.main-content {
  flex: 0 0 65%;
  padding: 20px;
  border-radius: 4px;
  background-color: white;
  margin-top: 35px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  overflow-y: visible;
}

/* === Sidebar === */
.sidebar {
  flex: 0 0 25%;
  background: white;
  padding: 20px 15px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  height: fit-content;
  transition: transform 0.3s ease;
  z-index: 1;
}

/* === Sidebar List === */
.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar ul li {
  margin: 12px 0;
}

.sidebar ul li a {
  display: block;
  padding: 10px 15px;
  color: #151715;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s, transform 0.2s;
  font-weight: 500;
}

.sidebar ul li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(-5px);
}

.sidebar ul li a.active {
  background-color: #1abc9c;
  color: #fff;
}

/* === Page Title === */
h1.page-title {
  font-size: 32px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
  padding: 15px;
}

/* === Footer === */
.footer {
  background-color: #343a40;
  color: white;
  text-align: center;
  padding: 20px;
  /* ❌ Removed margin-top: auto */
}

/* === Section === */
.section {
  margin-bottom: 20px;
}

.content-box {
  background: white;
  padding: 25px 15px;
  border-radius: 6px;
}

/* === Sidebar Overlay (Mobile Only) === */
.sidebar-overlay {
  display: none;
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
  .layout-container {
    flex-direction: column;
    padding: 0;
    margin-top: 40px;
    width: 98%;
    margin-left: 1%;
    margin-right: 1%;
  }

  .main-content {
    width: 100%;
    padding: 5px;
    margin-left: 0 !important;
  }

  .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    max-height: calc(100vh - 60px);
    width: 80%;
    max-width: 280px;
    background: #f9f9f9;
    transform: translateX(-100%);
    overflow-y: auto;
    z-index: 1000;
    border-radius: 10px 10px 0 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 999;
  }

  h1.page-title {
    font-size: 25px;
  }
}

/* === Home Page Styles === */
.home-container {
  background-color: #f4f6f8;
  padding: 30px 15px;
  min-height: 100vh;
}

.home-title {
  font-size: 32px;
  margin-bottom: 25px;
  color: #222;
  text-align: center;
}

.post-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-card {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin: 0 auto;
  width: 100%;
  max-width: 900px;
  box-sizing: border-box;
}

.post-card:hover {
  transform: translateY(-5px);
}

.post-card h2 {
  font-size: 20px;
  margin-bottom: 10px;
  color: #1abc9c;
}

.post-card p {
  color: #555;
}

.read-more {
  display: inline-block;
  margin-top: 10px;
  color: #3498db;
  float: right;
  text-decoration: none;
  font-weight: 600;
}

.post-meta {
  margin-top: 15px;
  font-size: 13px;
  color: #888;
}
