/* Global Styles */
:root {
  --primary-color: #253b80;
  --secondary-color: #1e9652;
  --accent-color: #ff4d4d;
  --text-color: #333;
  --light-gray: #f4f4f4;
  --medium-gray: #e0e0e0;
  --dark-gray: #666;
  --white: #fff;
  --font-heading: "Montserrat", sans-serif;
  --font-body: "Open Sans", sans-serif;
  --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

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

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-gray);
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-areas:
    "header header"
    "hero hero"
    "featured featured"
    "latest sidebar"
    "footer footer";
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

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

a:hover {
  color: var(--secondary-color);
}

ul {
  list-style: none;
}

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

.btn {
  display: inline-block;
  background: var(--primary-color);
  color: var(--white);
  padding: 12px 25px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}

.btn:hover {
  background: var(--secondary-color);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: var(--white);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--primary-color);
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 10px;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--secondary-color);
}

/* Header */
header {
  grid-area: header;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--medium-gray);
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 45px;
  margin-right: 10px;
}

.logo h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--primary-color);
  margin-bottom: 2px;
  line-height: 1;
}

.logo p {
  font-size: 12px;
  color: var(--dark-gray);
  line-height: 1;
}

nav ul {
  display: flex;
}

nav li {
  margin-left: 25px;
}

nav a {
  color: var(--text-color);
  font-weight: 600;
  padding: 5px 0;
  position: relative;
}

nav a:hover,
nav a.active {
  color: var(--secondary-color);
}

nav a.active::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 3px;
  background: var(--secondary-color);
  bottom: -2px;
  left: 0;
  border-radius: 2px;
}

/* Hero Section */
.hero {
  grid-area: hero;
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url("img/hero.img") no-repeat center center/cover;
  color: var(--white);
  text-align: center;
  padding: 25px 20px;
  margin: 10px 0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 85vh;
}

.hero-content {
  max-width: 600px;
  margin: 0 auto;
}

.hero h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  margin-bottom: 8px;
}

.hero p {
  font-size: 14px;
  margin-bottom: 12px;
}

.hero .btn {
  padding: 8px 16px;
  font-size: 12px;
}

/* Featured Posts */
.featured-posts {
  grid-area: featured;
  margin-bottom: 40px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.post {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.post:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.post-img {
  height: 200px;
  overflow: hidden;
}

.post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.post-content {
  padding: 20px;
}

.category {
  display: inline-block;
  background: var(--secondary-color);
  color: var(--white);
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
}

.post h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  margin-bottom: 10px;
}

.post p {
  color: var(--dark-gray);
  margin-bottom: 15px;
  font-size: 14px;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  color: var(--dark-gray);
  font-size: 12px;
  margin-bottom: 15px;
}

.read-more {
  display: inline-block;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 14px;
}

.read-more:hover {
  color: var(--secondary-color);
}

/* Latest Posts */
.latest-posts {
  grid-area: latest;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-item {
  display: flex;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.post-thumbnail {
  flex: 0 0 250px;
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-details {
  padding: 15px;
  flex: 1;
}

.post-details h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.post-details p {
  font-size: 14px;
  color: var(--dark-gray);
  margin-bottom: 10px;
}

.view-all {
  text-align: center;
  margin-top: 30px;
}

/* Sidebar Styling */
.sidebar {
  grid-area: sidebar;
}

.widget {
  background: var(--white);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.widget h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--medium-gray);
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subscribe-form input {
  padding: 10px;
  border: 1px solid var(--medium-gray);
  border-radius: 5px;
}

.categories li {
  border-bottom: 1px solid var(--medium-gray);
  padding: 8px 0;
}

.categories li:last-child {
  border-bottom: none;
}

.categories a {
  display: flex;
  justify-content: space-between;
}

.social-icons {
  display: flex;
  justify-content: space-between;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: var(--white);
  border-radius: 50%;
  transition: var(--transition);
}

.social-icons a:hover {
  background: var(--secondary-color);
  transform: translateY(-3px);
}

/* Footer Styling */
footer {
  grid-area: footer;
  background: var(--primary-color);
  color: var(--white);
  padding: 50px 30px 25px;
  margin-top: 60px;
  border-radius: 10px 10px 0 0;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  margin-bottom: 30px;
}

.footer-logo h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  margin-bottom: 15px;
}

.footer-links h3,
.footer-newsletter h3 {
  font-size: 18px;
  margin-bottom: 18px;
}

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

.footer-links a {
  color: #ccc;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-newsletter form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.footer-newsletter input {
  padding: 10px;
  border: none;
  border-radius: 5px;
}

.footer-newsletter .btn {
  padding: 8px 15px;
  font-size: 12px;
  width: fit-content;
  background: var(--secondary-color);
  margin-top: 5px;
}

.footer-newsletter .btn:hover {
  background: var(--white);
  color: var(--secondary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  color: #aaa;
}

/* Media Queries */
@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "hero"
      "featured"
      "latest"
      "sidebar"
      "footer";
  }

  header {
    flex-direction: column;
  }

  nav ul {
    margin-top: 20px;
  }

  nav li {
    margin: 0 10px;
  }

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

@media (max-width: 600px) {
  .hero h2 {
    font-size: 32px;
  }

  .post-item {
    flex-direction: column;
  }

  .post-thumbnail {
    height: 200px;
    flex: none;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }

  nav li {
    margin: 5px 10px;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}
