/* ===============================
   RESET / BASE
=============================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #0d1117;
  color: #f5f7fa;
  font-family: Arial, Helvetica, sans-serif;
}

/* ===============================
   HEADER / NAVBAR
=============================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(13, 17, 23, 0.95);
  border-bottom: 1px solid #2b3440;
  backdrop-filter: blur(10px);
}

.nav-container {
  width: min(95%, 1600px);
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  color: #ffffff;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
}

.navbar {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.navbar a {
  color: #b7c0cc;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.navbar a:hover,
.navbar a.active {
  color: #ffffff;
}

/* ===============================
   GLOBAL LAYOUT
=============================== */
.container {
  width: min(95%, 1600px);
  margin: 48px auto;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.page-header p {
  max-width: 850px;
  color: #b7c0cc;
  line-height: 1.6;
}

/* ===============================
   HOME PAGE / HERO
=============================== */
.hero-home {
  max-width: 950px;
  padding: 72px 0 40px;
}

.hero-home h1 {
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 28px;
}

.hero-home p {
  font-size: 1.08rem;
  line-height: 1.9;
  color: #b7c0cc;
  margin-bottom: 22px;
}

.hero-home p:last-child {
  margin-bottom: 0;
}

/* ===============================
   SHARED INFO BOX
=============================== */
.info-box {
  max-width: 850px;
  background: #161b22;
  border: 1px solid #2b3440;
  border-radius: 16px;
  padding: 24px;
}

.info-box h2 {
  font-size: 1.35rem;
  margin-bottom: 12px;
}

.info-box p {
  color: #b7c0cc;
  line-height: 1.7;
}

/* ===============================
   TUTORIAL CATEGORIES
=============================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.category-card {
  background: #161b22;
  border: 1px solid #2b3440;
  border-radius: 16px;
  padding: 22px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  color: #ffffff;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: #4f8cff;
}

.category-card.active {
  border-color: #4f8cff;
  box-shadow: 0 0 0 1px #4f8cff inset;
}

.category-card-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.category-card-count {
  color: #8b96a5;
  font-size: 0.92rem;
}

/* ===============================
   VIDEO / BLOG PANEL TOP
=============================== */
.video-panel {
  margin-top: 8px;
}

.video-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.video-panel-top h2 {
  font-size: 1.6rem;
}

/* ===============================
   SORT BAR
=============================== */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-bar label {
  color: #d7dce3;
  font-size: 0.95rem;
}

.sort-bar select {
  background: #161b22;
  color: #ffffff;
  border: 1px solid #2b3440;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.95rem;
  outline: none;
}

.sort-bar select:focus {
  border-color: #4f8cff;
}

/* ===============================
   SHARED GRID / CARDS
=============================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 32px;
}

.card {
  background: #161b22;
  border: 1px solid #2b3440;
  border-radius: 16px;
  padding: 20px;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.card h2,
.card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.card p {
  color: #b7c0cc;
  line-height: 1.5;
}

.video-date {
  color: #8b96a5;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

/* ===============================
   VIDEO EMBEDS
=============================== */
.video-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  margin-bottom: 16px;
}

.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===============================
   BLOG LIST
=============================== */
.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 32px;
}

.blog-card h3,
.blog-card h2 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.blog-card p {
  color: #b7c0cc;
  line-height: 1.5;
}

.blog-date {
  color: #8b96a5;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

/* ===============================
   LINKS / BLOG BUTTONS
=============================== */
.read-more {
  display: inline-block;
  margin-top: 14px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}

.read-more:hover {
  color: #b7c0cc;
}

.blog-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

.blog-button:hover {
  color: #b7c0cc;
}

.back-button {
  margin-bottom: 18px;
}

/* ===============================
   SINGLE BLOG POST
=============================== */
.post-page {
  max-width: 850px;
  margin: 0 auto;
  background: #161b22;
  border: 1px solid #2b3440;
  border-radius: 16px;
  padding: 28px;
}

.post-page h1 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.post-page p {
  color: #b7c0cc;
  line-height: 1.7;
  margin-bottom: 16px;
}

/* ===============================
   CONTACT
=============================== */
.contact-section {
  max-width: 760px;
  background: #161b22;
  border: 1px solid #2b3440;
  border-radius: 16px;
  padding: 24px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row label {
  color: #d7dce3;
  font-size: 0.95rem;
}

.form-row input,
.form-row textarea {
  width: 100%;
  background: #0d1117;
  border: 1px solid #2b3440;
  color: #ffffff;
  border-radius: 10px;
  padding: 14px;
  font-size: 0.95rem;
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: #4f8cff;
  outline: none;
}

.contact-form button {
  width: fit-content;
  background: #4f8cff;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  cursor: pointer;
}

.contact-form button:hover {
  background: #3f77db;
}

.form-status {
  margin-top: 10px;
  color: #b7c0cc;
}

.hidden-field {
  display: none;
}

/* ===============================
   RESPONSIVE
=============================== */
@media (max-width: 900px) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 0;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }

  .blog-list {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }

  .hero-home h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 520px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .blog-list {
    grid-template-columns: 1fr;
  }

  .hero-home h1 {
    font-size: 2rem;
  }

  .hero-home p {
    font-size: 1rem;
  }

  .video-panel-top {
    align-items: flex-start;
  }

  .sort-bar {
    width: 100%;
    justify-content: space-between;
  }
}