* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  color: #222;
  transition: background 0.3s, color 0.3s;
}

header {
  background: #1d2327;
  color: #fff;
  padding: 18px 8%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 24px;
  font-weight: bold;
}

nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 18px;
}

nav a:hover {
  color: #72aee6;
}

.menu-btn,
.dark-btn {
  border: none;
  background: #2271b1;
  color: white;
  padding: 9px 14px;
  border-radius: 5px;
  cursor: pointer;
}

.menu-btn {
  display: none;
}

.hero {
  background: linear-gradient(135deg, #2271b1, #135e96);
  color: white;
  text-align: center;
  padding: 90px 20px;
}

.hero h1 {
  font-size: 46px;
  margin-bottom: 10px;
}

.hero p {
  font-size: 18px;
}

.hero button {
  margin-top: 20px;
  padding: 13px 28px;
  border: none;
  background: #fff;
  color: #2271b1;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
}

main {
  display: flex;
  gap: 30px;
  padding: 40px 8%;
}

.posts {
  flex: 3;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

article {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

article img {
  width: 100%;
  display: block;
}

article h2,
article p,
article a {
  margin: 18px;
}

article a {
  display: inline-block;
  color: #2271b1;
  font-weight: bold;
  text-decoration: none;
}

aside {
  flex: 1;
  background: white;
  padding: 22px;
  border-radius: 8px;
  height: fit-content;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

aside input {
  width: 100%;
  padding: 11px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
}

aside ul {
  padding-left: 18px;
}

.notice {
  margin-top: 20px;
  background: #e7f3ff;
  color: #135e96;
  padding: 12px;
  border-radius: 6px;
  font-weight: bold;
}

.about,
.contact {
  background: white;
  margin: 0 8% 35px;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

footer {
  text-align: center;
  background: #1d2327;
  color: white;
  padding: 20px;
}

#backToTop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: none;
  border: none;
  background: #2271b1;
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
}

body.dark {
  background: #111827;
  color: #e5e7eb;
}

body.dark article,
body.dark aside,
body.dark .about,
body.dark .contact {
  background: #1f2937;
  color: #e5e7eb;
}

body.dark .notice {
  background: #111827;
  color: #93c5fd;
}

@media (max-width: 800px) {
  header {
    flex-wrap: wrap;
  }

  .menu-btn {
    display: block;
  }

  nav {
    display: none;
    width: 100%;
  }

  nav.active {
    display: block;
  }

  nav a {
    display: block;
    margin: 12px 0;
  }

  main {
    flex-direction: column;
  }

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