/* ===== Color Theme ===== */
:root {
  --color-primary: #7c6d8a;        /* muted lavender */
  --color-primary-dark: #5e4f6b;   /* darker lavender */
  --color-highlight: #e8b4b8;      /* dusty rose */
  --color-text: #3a3541;           /* dark plum-gray */
  --color-text-soft: #6b6275;      /* muted text */
  --color-text-muted: #9a8fa3;     /* light muted text */
  --color-bg: #faf8fc;             /* soft lavender white */
  --color-bg-alt: #f0ecf4;         /* light lavender */
  --color-bg-card: #faf8fc;        /* card background */
  --color-bg-img: #e8e3ee;         /* image placeholder bg */
  --color-border: #d8d0e0;         /* soft border */
  --color-footer-bg: #3a3541;      /* dark footer */
  --color-footer-text: #c9c1d3;    /* footer text */
  --color-shadow: rgba(58, 53, 65, 0.08);
  --color-shadow-hover: rgba(58, 53, 65, 0.14);
  --color-focus: rgba(124, 109, 138, 0.15);
  --gradient-hero: linear-gradient(135deg, #7c6d8a 0%, #b8a9c8 100%);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Georgia", "Palatino Linotype", "Book Antiqua", Palatino,
    serif;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

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

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--color-bg);
  box-shadow: 0 2px 10px var(--color-shadow);
  z-index: 1000;
  padding: 1rem 0;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-weight: 500;
  transition: color 0.3s;
}

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

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  position: relative;
  transition: transform 0.3s;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

/* ===== Hero ===== */
.hero {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--gradient-hero);
  color: #fff;
  padding: 8rem 1rem 4rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero .highlight {
  color: var(--color-highlight);
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
}

/* ===== Button ===== */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  background: var(--color-primary);
  color: #fff;
}

.btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

/* ===== Tag ===== */
.tag {
  display: inline-block;
  background: var(--color-bg-alt);
  color: var(--color-primary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* ===== Featured Post ===== */
.featured {
  padding: 4rem 0;
  background: var(--color-bg-alt);
}

.featured-post {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  background: var(--color-bg-card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--color-shadow);
}

.featured-img {
  flex: 1;
  min-width: 0;
}

.featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-content {
  flex: 1;
  padding: 2rem 2rem 2rem 0;
  text-align: left;
}

.featured-post h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  text-align: left;
}

.featured-post .post-meta {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.featured-post p {
  color: var(--color-text-soft);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

/* ===== Blog Layout ===== */
.blog-section {
  padding: 4rem 0;
}

.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

/* ===== Post Cards ===== */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.post-card {
  background: var(--color-bg-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px var(--color-shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px var(--color-shadow-hover);
}

.post-card-img {
  font-size: 3rem;
  text-align: center;
  padding: 2rem;
  background: var(--color-bg-img);
  overflow: hidden;
}

.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card-body {
  padding: 1.25rem;
}

.post-card-body h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.post-meta {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.post-card-body p {
  color: var(--color-text-soft);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.read-more {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.9rem;
  transition: color 0.3s;
}

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

/* ===== Sidebar ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-widget {
  background: var(--color-bg-alt);
  border-radius: 12px;
  padding: 1.5rem;
}

.sidebar-widget h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.sidebar-widget p {
  color: var(--color-text-soft);
  font-size: 0.95rem;
}

.category-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

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

.category-list a {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--color-text-soft);
  transition: color 0.3s;
}

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

.category-list a.active {
  color: var(--color-primary);
  font-weight: 600;
}

.category-list span {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ===== Newsletter ===== */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.newsletter-form input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus);
}

/* ===== Contact ===== */
.contact {
  padding: 5rem 0;
  background: var(--color-bg-alt);
}

.contact-form {
  max-width: 600px;
  margin: 2rem auto 0;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus);
}

/* ===== Gallery ===== */
.gallery-section {
  padding: 4rem 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  cursor: pointer;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 25px var(--color-shadow-hover);
}

/* ===== Footer ===== */
.footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  text-align: center;
  padding: 2rem 0;
}

/* ===== Post Page ===== */
.post-header {
  padding: 8rem 1rem 3rem;
  background: var(--gradient-hero);
  color: #fff;
}

.post-header .container {
  max-width: 750px;
}

.back-link {
  display: inline-block;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.back-link:hover {
  color: #fff;
}

.post-header .tag {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.post-header h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.post-header .post-meta {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
}

.post-content {
  padding: 3rem 1rem;
}

.post-content .container {
  max-width: 750px;
}

.post-content h2 {
  text-align: left;
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.post-content p {
  color: var(--color-text-soft);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.post-content ul {
  list-style: disc;
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.post-content ul li {
  color: var(--color-text-soft);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 0.4rem;
}

.post-content pre {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.post-content code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
}

.post-content p code {
  background: var(--color-bg-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--color-primary);
}

/* ===== Video Embed ===== */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== Video Link (clickable thumbnail) ===== */
.video-link {
  display: block;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto 1.5rem;
  max-width: 500px;
  line-height: 0;
}

.video-link img {
  width: 100%;
  transition: transform 0.3s, filter 0.3s;
}

.video-link:hover img {
  transform: scale(1.02);
  filter: brightness(0.85);
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3.5rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.3s;
}

.video-link:hover .play-button {
  background: rgba(255, 0, 0, 0.85);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-bg);
    padding: 1rem 5%;
    box-shadow: 0 4px 10px var(--color-shadow);
    gap: 1rem;
  }

  .nav-links.active {
    display: flex;
  }

  .hero h1 {
    font-size: 2rem;
  }

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

  .featured-content {
    padding: 1.5rem;
    text-align: center;
  }

  .featured-post h2 {
    text-align: center;
  }

  .blog-layout {
    grid-template-columns: 1fr;
  }

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

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

  .post-header h1 {
    font-size: 1.75rem;
  }
}
