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

:root {
  --primary-color: #0066cc;
  --secondary-color: #004c99;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #ffffff;
  --bg-light: #f5f5f5;
  --border-color: #ddd;
  --max-width: 1200px;
  --spacing-unit: 1rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-color);
}

/* Typography */
h1, h2, h3, h4 {
  margin-bottom: 1rem;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
  margin-bottom: 1rem;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

main {
  min-height: 60vh;
}

/* Header */
.site-header {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
}

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

.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.language-switcher__label {
  font-size: 0.9rem;
  color: var(--text-light);
}

.language-switcher__links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.language-switcher__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.language-switcher__link:hover,
.language-switcher__link.is-active {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(0, 102, 204, 0.08);
}

/* Footer */
.site-footer {
  background: var(--bg-light);
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  padding: 3rem 0 1rem;
}

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

.footer-section h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--primary-color);
  text-decoration: none;
}

.footer-section a:hover {
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  text-align: center;
  color: var(--text-light);
}

/* CTA Blocks */
.cta-block {
  background: var(--bg-light);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
}

.cta-block h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.cta-primary {
  background: #e6f2ff;
}

.cta-secondary {
  background: var(--bg-light);
  border-color: var(--secondary-color);
}

.cta-secondary h3 {
  color: var(--secondary-color);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  margin-top: 1rem;
  border: 2px solid transparent;
  text-align: center;
}

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

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

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

.btn-secondary:hover {
  background: #003366;
}

.btn-outline {
  background: transparent;
  color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-outline:hover {
  background: rgba(0, 76, 153, 0.08);
}

/* Article Page */
.article-page {
  padding: 2rem 0;
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.article-header h1 {
  color: var(--primary-color);
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

.article-content {
  max-width: 800px;
}

.article-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

.article-content ul, .article-content ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

/* Vocabulary Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: var(--bg-light);
  font-weight: 600;
}

/* Next Article Link */
.next-article {
  background: var(--bg-light);
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 3rem;
}

.next-article h3 {
  margin-bottom: 1rem;
}

.next-link {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
}

.next-link:hover {
  text-decoration: underline;
}

/* Home Page Specific */
.hero {
  text-align: center;
  padding: 3rem 0;
  background: linear-gradient(135deg, #e6f2ff 0%, #f5f5f5 100%);
}

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

.hero p {
  font-size: 1.3rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.hero.hero-dual {
  text-align: left;
  padding: 4rem 0 3rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary-color);
  margin-bottom: 0.75rem;
}

.hero-intro {
  max-width: 860px;
}

.language-switcher--hero {
  margin: 1.25rem 0 2rem;
}

.hero-book-grid,
.path-grid,
.feature-grid,
.sample-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.hero-book-grid {
  margin-top: 2rem;
}

.book-panel,
.path-card,
.feature-card,
.sample-card,
.final-cta {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

.book-panel-accent {
  border-color: rgba(0, 102, 204, 0.25);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.book-panel__label,
.sample-card__label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.book-panel h2,
.path-card h3,
.feature-card h3,
.sample-card h3,
.final-cta h2 {
  margin-bottom: 0.75rem;
}

.check-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.check-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: 700;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button-row .btn {
  margin-top: 0;
}

.home-section {
  padding: 4rem 0;
}

.home-section-alt {
  background: var(--bg-light);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 2rem;
}

.section-heading p {
  color: var(--text-light);
}

html[dir="rtl"] body {
  text-align: right;
}

html[dir="rtl"] .site-header .container,
html[dir="rtl"] .header-right {
  flex-direction: row-reverse;
}

html[dir="rtl"] .main-nav,
html[dir="rtl"] .language-switcher,
html[dir="rtl"] .language-switcher__links,
html[dir="rtl"] .button-row {
  flex-direction: row-reverse;
}

html[dir="rtl"] .check-list li {
  padding-left: 0;
  padding-right: 1.5rem;
}

html[dir="rtl"] .check-list li::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .section-heading,
html[dir="rtl"] .hero.hero-dual {
  text-align: right;
}

.proof-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.proof-point {
  text-align: center;
  padding: 1.5rem;
}

.proof-point h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.article-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.article-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text-color);
  transition: box-shadow 0.3s ease;
}

.article-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.sample-card .btn {
  margin-top: 1rem;
}

.final-cta-section {
  padding-top: 0;
}

.final-cta {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 1.5rem;
  align-items: center;
  border: 2px solid rgba(0, 102, 204, 0.18);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  
  .hero h1 {
    font-size: 2rem;
  }

  .hero.hero-dual {
    padding: 3rem 0 2rem;
  }
  
  .main-nav {
    width: 100%;
    margin-top: 1rem;
    gap: 1rem;
  }
  
  .site-header .container {
    justify-content: center;
  }

  .header-right {
    justify-content: center;
  }
  
  .logo {
    width: 100%;
    text-align: center;
  }
  
  .cta-block {
    padding: 1.5rem 1rem;
  }
  
  .btn {
    display: block;
    width: 100%;
  }

  .hero-book-grid,
  .path-grid,
  .feature-grid,
  .sample-grid,
  .final-cta {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
  }

  .book-panel,
  .path-card,
  .feature-card,
  .sample-card,
  .final-cta {
    padding: 1.5rem 1rem;
  }
}
