/* ===========================
   WordPress Learning — Stylesheet
   =========================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: #333;
  background: #fff;
  line-height: 1.7;
}

/* ===========================
   Header
   =========================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #2c3e50;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

header .logo {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

header .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switcher a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.lang-switcher a.active {
  color: #fff;
  background: rgba(255,255,255,0.15);
}

.lang-switcher a:hover {
  color: #fff;
}

.lang-switcher span {
  color: rgba(255,255,255,0.3);
  font-size: 0.85rem;
}

/* Hamburger (mobile only) */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ===========================
   Sidebar
   =========================== */
.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: 280px;
  background: #f5f5f5;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  padding: 16px 0;
  z-index: 50;
}

.sidebar .module {
  margin-bottom: 8px;
}

.sidebar .module h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  padding: 8px 20px 4px;
}

.sidebar .module ul {
  list-style: none;
}

.sidebar .module li a {
  display: block;
  padding: 5px 20px 5px 28px;
  color: #444;
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.4;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar .module li a:hover {
  background: #eaeaea;
  color: #111;
}

.sidebar .module li.active a {
  background: #e8f0fe;
  color: #1a56db;
  border-left-color: #1a56db;
  font-weight: 600;
}

/* ===========================
   Main Content
   =========================== */
.content {
  margin-left: 280px;
  margin-top: 56px;
  padding: 40px 48px 80px;
  max-width: 1080px;
}

.content h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
  line-height: 1.3;
}

.content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #222;
  margin-top: 40px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #eee;
}

.content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-top: 28px;
  margin-bottom: 8px;
}

.content h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #444;
  margin-top: 20px;
  margin-bottom: 6px;
}

.content p {
  margin-bottom: 16px;
}

.content a {
  color: #1a56db;
  text-decoration: none;
}

.content a:hover {
  text-decoration: underline;
}

.content hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 32px 0;
}

/* Lists */
.content ul, .content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.content li {
  margin-bottom: 6px;
}

.content li > ul, .content li > ol {
  margin-top: 6px;
  margin-bottom: 0;
}

/* Tables */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.92rem;
}

.content thead th {
  background: #f0f0f0;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #ddd;
}

.content tbody td {
  padding: 8px 12px;
  border: 1px solid #ddd;
  vertical-align: top;
}

.content tbody tr:nth-child(even) {
  background: #fafafa;
}

/* Code */
.content code {
  font-family: "Cascadia Code", "Fira Code", "Consolas", "Monaco", monospace;
  font-size: 0.88em;
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
}

.content pre {
  background: #f6f6f6;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 20px;
  line-height: 1.5;
}

.content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

/* Blockquote */
.content blockquote {
  border-left: 4px solid #1a56db;
  background: #f0f5ff;
  padding: 12px 20px;
  margin: 16px 0;
  border-radius: 0 6px 6px 0;
}

.content blockquote p {
  margin-bottom: 0;
}

/* Strong & Em */
.content strong {
  font-weight: 600;
  color: #111;
}

/* ===========================
   Lesson Navigation (Prev/Next)
   =========================== */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
  gap: 16px;
}

.lesson-nav a {
  display: inline-block;
  padding: 10px 20px;
  background: #f5f5f5;
  color: #333;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background 0.2s;
  max-width: 45%;
}

.lesson-nav a:hover {
  background: #e8f0fe;
  color: #1a56db;
  text-decoration: none;
}

.lesson-nav .next {
  margin-left: auto;
  text-align: right;
}

/* ===========================
   Index / Overview Page
   =========================== */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.overview-card {
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  transition: box-shadow 0.2s;
}

.overview-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.overview-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.1rem;
  border-bottom: none;
}

.overview-card ul {
  padding-left: 18px;
  margin-bottom: 0;
}

.overview-card li {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

/* External resources table on index */
.resources-table {
  margin-top: 16px;
}

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

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 280px;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 16px rgba(0,0,0,0.15);
  }

  .content {
    margin-left: 0;
    padding: 24px 20px 60px;
  }

  .lesson-nav {
    flex-direction: column;
  }

  .lesson-nav a {
    max-width: 100%;
    text-align: center;
  }

  .content h1 {
    font-size: 1.6rem;
  }

  .content h2 {
    font-size: 1.3rem;
  }

  .content table {
    font-size: 0.82rem;
  }

  .content thead th,
  .content tbody td {
    padding: 6px 8px;
  }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 40;
}

.sidebar-overlay.open {
  display: block;
}
