:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary-color: #10b981;
  --accent-color: #f59e0b;
  --danger-color: #ef4444;
  --success-color: #22c55e;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-color: #e5e7eb;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.3s ease;
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-secondary: 'Poppins', sans-serif;
}

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

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

body {
  font-family: var(--font-primary);
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

a:hover {
  color: var(--primary-dark);
}

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-secondary);
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
}

.navbar {
  background-color: var(--bg-primary);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

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

.nav-brand,
.nav-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 700;
}

.nav-brand .custom-logo-link img,
.brand-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 10px;
}

.brand-fallback-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 1.4rem;
}

.brand-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--text-primary);
  margin: 3px 0;
  border-radius: 2px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-menu li {
  list-style: none;
}

.nav-menu a {
  color: var(--text-primary);
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition);
}

.nav-menu a:hover::after,
.nav-menu .current-menu-item a::after {
  width: 100%;
}

.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 4rem 0;
  text-align: center;
}

.hero h1,
.hero h2,
.hero h3,
.hero p {
  color: #fff;
}

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

.hero-subtitle {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.95);
}

.hero-description {
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  color: rgba(255, 255, 255, 0.9);
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.feature-badge {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(10px);
}

.main-layout,
.site-blog-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 20px;
}

.content-area {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.sidebar-widget,
.guide-card,
.post-card,
.single-post-card,
.widget,
.comments-area {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

.widget ul,
.footer-col ul {
  list-style: none;
  padding-left: 0;
}

.widget-title {
  color: var(--primary-color);
}

.quick-links {
  list-style: none;
}

.quick-links li {
  margin-bottom: 0.75rem;
}

.quick-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: var(--border-radius-sm);
}

.quick-links a:hover {
  background-color: var(--bg-tertiary);
  transform: translateX(5px);
}

.main-content {
  min-height: 100vh;
}

.calculator-section,
.faq-section {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-lg);
  scroll-margin-top: 110px;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--primary-color);
}

.section-description {
  color: var(--text-secondary);
}

.calculator-card {
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 2rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

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

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

.form-control,
input[type='search'],
input[type='text'],
input[type='email'],
input[type='url'],
input[type='number'],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  background-color: #fff;
  transition: var(--transition);
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.subject-row,
.semester-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
}

.button-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn,
button,
input[type='submit'] {
  padding: 0.875rem 1.5rem;
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary,
input[type='submit'],
.comment-form .submit {
  background-color: var(--primary-color);
  color: #fff;
}

.btn-primary:hover,
input[type='submit']:hover,
.comment-form .submit:hover {
  background-color: var(--primary-dark);
  color: #fff;
}

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

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

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

.help-btn,
.remove-btn {
  background-color: var(--info-color);
  color: #fff;
  border: none;
}

.remove-btn {
  padding: 0.75rem 1rem;
  background-color: var(--danger-color);
}

.help-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  position: relative;
}

.help-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  right: 0;
  background-color: var(--text-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
  white-space: nowrap;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
}

.result-container {
  margin-top: 2rem;
}

.result-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-xl);
}

.result-card h4,
.result-card p,
.result-card span,
.result-card strong {
  color: #fff;
}

.result-value {
  text-align: center;
  padding: 1.5rem 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 1.5rem;
}

.result-number {
  font-size: 3rem;
  font-weight: 700;
}

.result-details {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  padding: 1.5rem;
}

.result-details p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.badge-success {
  background-color: var(--success-color);
  color: #fff;
}

.badge-warning {
  background-color: var(--warning-color);
  color: #fff;
}

.badge-danger {
  background-color: var(--danger-color);
  color: #fff;
}

.badge-info {
  background-color: var(--info-color);
  color: #fff;
}

.alert {
  padding: 1rem;
  border-radius: var(--border-radius-sm);
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46 !important;
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e !important;
}

.alert-danger {
  background-color: #fee2e2;
  color: #991b1b !important;
}

.alert-info {
  background-color: #dbeafe;
  color: #1e40af !important;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 1rem;
}

.progress-fill {
  height: 100%;
  background-color: #fff;
  width: 0;
}

.guide-section {
  background-color: var(--bg-tertiary);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-top: 2rem;
}

.guide-list,
.guide-steps {
  padding-left: 1rem;
}

.guide-list li,
.guide-steps li {
  margin-bottom: 0.75rem;
}

.reference-table,
.table-responsive {
  margin-top: 2rem;
}

.grade-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

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

.grade-table thead {
  background-color: var(--primary-color);
  color: #fff;
}

.credits-info {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: var(--border-radius-sm);
  border: 2px solid var(--primary-color);
  margin-bottom: 1rem;
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
}

.faq-question {
  width: 100%;
  background: none;
  padding: 1.5rem;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

.faq-answer p {
  padding: 0 1.5rem 1.5rem;
}

.subject-grades {
  margin-top: 1.5rem;
}

.subject-grade-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  margin-bottom: 0.5rem;
}

.grade-badge {
  background-color: rgba(255, 255, 255, 0.3);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.post-card {
  overflow: hidden;
  padding: 0;
}

.post-card-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.post-card-content {
  padding: 1.5rem;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.entry-title a {
  color: var(--text-primary);
}

.single-post-card .post-thumbnail {
  margin-top: 1rem;
}

.single-post-card .post-thumbnail img {
  border-radius: var(--border-radius);
}

.page-header,
.archive-header {
  margin-bottom: 1.5rem;
}

.student-note-section {
  margin-top: 2rem;
  margin-bottom: 3rem;
}

.student-note-card {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 2rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.student-note-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.student-note-main {
  flex: 1;
  min-width: 280px;
}

.student-note-tip {
  flex: 0 1 300px;
  min-width: 250px;
  background: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: var(--border-radius-sm);
  border-left: 5px solid var(--secondary-color);
}

.footer {
  background-color: var(--text-primary);
  color: #fff;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer h4,
.footer p,
.footer li,
.footer a {
  color: rgba(255, 255, 255, 0.9);
}

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

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  box-shadow: var(--shadow-lg);
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.comment-list,
.comment-list ol {
  list-style: none;
  padding-left: 0;
}

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

.comment-respond label {
  display: block;
  margin-bottom: 0.4rem;
}

.comment-form > p {
  margin-bottom: 1rem;
}

.alignwide,
.alignfull {
  width: 100%;
}

.wp-block-image img,
.wp-block-cover,
.wp-block-gallery {
  border-radius: var(--border-radius-sm);
}

.text-center {
  text-align: center;
}

.mt-3 {
  margin-top: 1.5rem;
}

@media screen and (max-width: 1024px) {
  .main-layout,
  .site-blog-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media screen and (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
  }

  .nav-menu.active {
    max-height: 500px;
    padding: 1rem;
  }

  .subject-row,
  .semester-row {
    grid-template-columns: 1fr;
  }

  .button-group,
  .result-details p,
  .subject-grade-item,
  .student-note-flex {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

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

  .result-number {
    font-size: 2.25rem;
  }
}

@media screen and (max-width: 480px) {
  .container,
  .main-layout,
  .site-blog-layout {
    padding: 0 15px;
  }

  .calculator-section,
  .faq-section,
  .calculator-card,
  .guide-card,
  .sidebar-widget {
    padding: 1.25rem;
  }
}

/* === Version 1.1 Blog layout and customization improvements === */
.site-header {
  position: relative;
  z-index: 1000;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brand-tagline {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.hero-compact {
  padding: 3rem 0;
}

.blog-hero {
  margin-bottom: 0;
}

.blog-hero-inner {
  max-width: 860px;
}

.site-blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(260px, 0.72fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  max-width: 1280px;
  margin: 2.5rem auto 0;
  align-items: start;
}

.blog-content-area {
  min-width: 0;
}

.blog-content-area > * {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

.reading-width > * {
  max-width: 820px;
}

.posts-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.post-card,
.single-post-card,
.page-card,
.comments-area,
.not-found,
.site-sidebar .widget,
.site-sidebar .sidebar-widget {
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.post-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: #fff;
  overflow: hidden;
}

.post-card-thumb {
  display: block;
  overflow: hidden;
}

.post-card-thumb img {
  transition: transform 0.35s ease;
}

.post-card:hover .post-card-thumb img {
  transform: scale(1.03);
}

.post-card-content {
  padding: 1.5rem 1.5rem 1.35rem;
}

.post-card .entry-title {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  margin-bottom: 0.85rem;
}

.entry-summary,
.entry-summary p {
  line-height: 1.75;
}

.post-card-footer {
  margin-top: 1.25rem;
}

.btn-sm {
  padding: 0.72rem 1rem;
  font-size: 0.92rem;
}

.single-post-card,
.page-card,
.comments-area,
.not-found {
  background: #fff;
}

.reading-card {
  padding: clamp(1.5rem, 3vw, 2.35rem);
}

.single-post-card .entry-header,
.page-card .entry-header {
  margin-bottom: 1.5rem;
}

.single-post-card .entry-title,
.page-card .entry-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.entry-content {
  max-width: 100%;
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.85;
}

.entry-content > * + * {
  margin-top: 1.2rem;
}

.entry-content p,
.entry-content li,
.entry-content blockquote {
  color: #334155;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.entry-content h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.entry-content h3 {
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.25rem;
}

.entry-content blockquote {
  border-left: 4px solid var(--primary-color);
  background: #f8fafc;
  padding: 1rem 1.25rem;
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.post-tags a,
.tagcloud a {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary-color);
  font-size: 0.84rem !important;
  line-height: 1.2;
}

.site-sidebar {
  position: sticky;
  top: 110px;
  align-self: start;
}

.site-sidebar .widget,
.site-sidebar .sidebar-widget {
  padding: 1rem 1rem 1.1rem;
  margin-bottom: 1rem;
  border-radius: 16px;
}

.site-sidebar .widget-title {
  font-size: 1.02rem;
  margin-bottom: 0.85rem;
}

.site-sidebar,
.site-sidebar p,
.site-sidebar li,
.site-sidebar a,
.site-sidebar label {
  font-size: 0.95rem;
}

.site-sidebar ul {
  padding-left: 0;
  list-style: none;
}

.site-sidebar li + li {
  margin-top: 0.5rem;
}

.site-sidebar .search-form,
.site-sidebar form {
  display: grid;
  gap: 0.75rem;
}

.site-sidebar input[type='search'],
.site-sidebar select,
.site-sidebar input[type='text'],
.site-sidebar input[type='email'] {
  padding: 0.72rem 0.85rem;
  font-size: 0.95rem;
}

.site-sidebar .wp-block-latest-posts li,
.site-sidebar .wp-block-categories li,
.site-sidebar .wp-block-archives li,
.site-sidebar .widget_recent_entries li,
.site-sidebar .widget_categories li,
.site-sidebar .widget_archive li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.pagination-wrap,
.navigation.pagination {
  margin: 2rem auto 0;
  max-width: 880px;
}

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

.nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.nav-links .current {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.footer-widget-grid .widget,
.footer-widget-grid .footer-widget {
  background: transparent;
  box-shadow: none;
  border: 0;
  padding: 0;
  margin: 0;
}

@media screen and (max-width: 1100px) {
  .site-blog-layout {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  }

  .blog-content-area > *,
  .pagination-wrap,
  .navigation.pagination {
    max-width: 820px;
  }
}

@media screen and (max-width: 1024px) {
  .site-blog-layout {
    grid-template-columns: 1fr;
  }

  .blog-content-area {
    order: 1;
  }

  .site-sidebar {
    order: 2;
    position: static;
  }

  .blog-content-area > *,
  .site-sidebar,
  .pagination-wrap,
  .navigation.pagination {
    max-width: 880px;
  }
}

@media screen and (max-width: 768px) {
  .brand-tagline {
    display: none;
  }

  .site-blog-layout {
    gap: 1.25rem;
    margin-top: 1.5rem;
  }

  .reading-card,
  .post-card-content {
    padding: 1.2rem;
  }

  .single-post-card .entry-title,
  .page-card .entry-title {
    font-size: 1.9rem;
  }
}
.site-branding {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.site-branding .custom-logo-link,
.brand-fallback-link,
.brand-title-link {
  display: inline-flex;
  align-items: center;
}

.brand-title-link {
  color: var(--text-primary);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* === Version 1.2 mobile enhancements, sharing, author box === */
.share-panel,
.author-box {
  margin-top: 1.75rem;
  padding: 1.35rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.share-panel-header p,
.author-box-description,
.author-box-kicker {
  margin-bottom: 0;
}

.share-panel-title,
.author-box-title {
  margin-bottom: 0.35rem;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.16);
  background: #fff;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.share-button:hover,
.share-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--primary-color);
}

.share-button-copy.copied {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.author-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.author-box-avatar-image {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid rgba(79, 70, 229, 0.12);
}

.author-box-kicker {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}

.author-box-link {
  display: inline-flex;
  margin-top: 0.85rem;
  font-weight: 600;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.entry-content th,
.entry-content td {
  padding: 0.85rem;
  border: 1px solid var(--border-color);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.grade-table {
  min-width: 640px;
}

.main-layout {
  align-items: start;
}

.main-layout .main-content {
  min-width: 0;
}

.navbar .container {
  flex-wrap: wrap;
}

.nav-menu {
  margin-left: auto;
}

@media screen and (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .main-layout .main-content {
    order: 1;
  }

  .main-layout .sidebar {
    order: 2;
    position: static;
  }
}

@media screen and (max-width: 768px) {
  .navbar {
    padding: 0.85rem 0;
  }

  .navbar .container {
    gap: 0.75rem;
  }

  .nav-brand {
    max-width: calc(100% - 64px);
  }

  .brand-title,
  .brand-title-link {
    font-size: 1.1rem;
  }

  .nav-menu {
    width: 100%;
    order: 3;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
  }

  .nav-menu li,
  .nav-menu a {
    width: 100%;
  }

  .nav-menu a {
    padding: 0.85rem 0;
  }

  .hero {
    padding: 2.8rem 0;
  }

  .hero-features {
    gap: 0.75rem;
  }

  .feature-badge {
    width: 100%;
    justify-content: center;
  }

  .main-layout,
  .site-blog-layout {
    padding: 0 16px;
  }

  .calculator-section,
  .faq-section,
  .calculator-card,
  .guide-card,
  .sidebar-widget,
  .student-note-card {
    padding: 1.1rem;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .quick-links a {
    padding: 0.7rem 0.75rem;
  }

  .result-card,
  .result-details {
    padding: 1.25rem;
  }

  .entry-content {
    font-size: 1rem;
    line-height: 1.75;
  }

  .share-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .share-button {
    width: 100%;
  }

  .author-box {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .author-box-avatar {
    display: flex;
    justify-content: center;
  }
}

@media screen and (max-width: 640px) {
  html {
    font-size: 14px;
  }

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

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .button-group {
    gap: 0.75rem;
  }

  .share-buttons {
    grid-template-columns: 1fr;
  }

  .result-number {
    font-size: 2rem;
  }

  .grade-table {
    min-width: 560px;
  }
}

@media screen and (max-width: 480px) {
  .container,
  .main-layout,
  .site-blog-layout {
    padding: 0 14px;
  }

  .nav-toggle {
    margin-left: auto;
  }

  .brand-copy {
    min-width: 0;
  }

  .brand-title-link {
    font-size: 1rem;
  }

  .share-panel,
  .author-box,
  .reading-card,
  .comments-area {
    padding: 1rem;
  }

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