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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-gray-800);
  background: var(--color-white);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-gray-800);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.6rem); }
h4 { font-size: 1.2rem; }

p {
  color: var(--color-gray-600);
  line-height: 1.75;
}

/* ===== CONTAINER ===== */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }
}

/* ===== SECTIONS ===== */
section {
  padding: var(--section-pad);
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  font-size: 1.125rem;
  max-width: 640px;
  margin: 0 auto;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(11, 61, 145, 0.08);
  color: var(--color-primary);
  border: 1px solid rgba(11, 61, 145, 0.15);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all var(--transition-base);
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(11, 61, 145, 0.35);
}

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

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

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

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

.btn-outline-white {
  border-color: rgba(255,255,255,0.6);
  color: var(--color-white);
  background: transparent;
}

.btn-outline-white:hover {
  background: rgba(255,255,255,0.15);
  border-color: white;
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1rem;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.85rem;
}

/* ===== CARDS ===== */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-200);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

/* ===== GRIDS ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ===== TAGS ===== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--color-gray-100);
  color: var(--color-gray-600);
}

.tag-primary {
  background: rgba(11, 61, 145, 0.1);
  color: var(--color-primary);
}

/* ===== STAR RATING ===== */
.stars {
  display: flex;
  gap: 2px;
  color: #f59e0b;
  font-size: 1rem;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--color-gray-400);
  margin-bottom: 32px;
}

.breadcrumb a {
  color: var(--color-primary);
}

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

.breadcrumb-sep {
  color: var(--color-gray-400);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(11, 61, 145, 0.3); }
  70% { box-shadow: 0 0 0 12px rgba(11, 61, 145, 0); }
  100% { box-shadow: 0 0 0 0 rgba(11, 61, 145, 0); }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.animate-fade-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* Intersection Observer based animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ===== UTILITIES ===== */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-gray-400); }
.text-white { color: var(--color-white); }
.text-center { text-align: center; }
.text-left { text-align: left; }

.bg-primary { background: var(--color-primary); }
.bg-dark { background: var(--color-dark); }
.bg-gray-100 { background: var(--color-gray-100); }
.bg-off-white { background: var(--color-off-white); }

.font-heading { font-family: var(--font-heading); }
.font-bold { font-weight: 700; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ===== BLOG POST CONTENT ===== */
.post-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--color-gray-600);
}

.post-content h2 {
  font-size: 1.6rem;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--color-gray-800);
}

.post-content h3 {
  font-size: 1.25rem;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--color-gray-800);
}

.post-content p {
  margin-bottom: 20px;
}

.post-content ul, .post-content ol {
  list-style: revert;
  padding-left: 24px;
  margin-bottom: 20px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content strong {
  color: var(--color-gray-800);
  font-weight: 600;
}

.post-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ===== FOCUS STYLES ===== */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== FORM BASE ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gray-800);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-gray-800);
  background: var(--color-white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.08);
}

.form-input::placeholder {
  color: var(--color-gray-400);
}

/* ===== PROSE MARKDOWN RENDER ===== */
.prose h2::before {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--color-primary);
  margin-bottom: 12px;
  border-radius: 2px;
}

/* ===== MOBILE HELPER ===== */
@media (max-width: 768px) {
  section {
    padding: 60px 0;
  }

  .section-header {
    margin-bottom: 40px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
}
