/* ===== STARTUP BLOG — INTERCOM-INSPIRED THEME ===== */

:root {
  --bg-cream: #f5f3ee;
  --bg-white: #ffffff;
  --text-primary: #14141a;
  --text-secondary: #6b6b70;
  --border-light: #e3e1da;
  --accent-black: #14141a;
  --accent-blue: #3B5FE0;
  --accent-blue-hover: #2d4ac2;
  --pill-bg: #ffffff;
  --max-width: 1200px;
  --content-width: 760px;
}

* {
  box-sizing: border-box;
}

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

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

/* Accessibility — visible focus states for keyboard navigation */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

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

/* ===== TOP NAV ===== */
.site-header {
  background: var(--bg-cream);
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-black);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.85rem;
}

.top-nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.top-nav-links a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.top-nav-links a:hover {
  color: var(--accent-blue);
}

.top-nav-links a.active {
  border-bottom: 2px solid var(--accent-blue);
}

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

.header-right a {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.header-right a:hover {
  color: var(--accent-blue);
}

.cta-black-btn {
  background: var(--accent-blue);
  color: white !important;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.cta-black-btn:hover {
  background: var(--accent-blue-hover);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-primary);
}

/* ===== HERO ===== */
.hero-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 24px 30px;
  text-align: center;
}

.hero-section h1 {
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 30px;
  line-height: 1;
}

.category-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}

.category-pills a {
  background: var(--pill-bg);
  border: 1px solid var(--border-light);
  padding: 8px 18px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.category-pills a:hover,
.category-pills a.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

.hero-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ===== FEATURED POST ===== */
.featured-post {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 50px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.featured-text .post-date-meta {
  display: flex;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.featured-text h2 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}

.featured-text h2 a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.featured-text p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 20px;
}

.featured-text .read-more {
  color: var(--accent-blue);
  font-weight: 700;
  text-decoration: underline;
}

.featured-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-weight: 600;
  font-size: 0.9rem;
}

.featured-author .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border-light);
}

.featured-image {
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 4/3;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== POST GRID ===== */
.post-grid-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 24px 80px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.post-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
  transform: translateY(-3px);
  border-color: var(--accent-blue);
}

.post-card .card-image {
  aspect-ratio: 16/10;
  background: var(--bg-cream);
  overflow: hidden;
}

.post-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card .card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card .tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-blue);
  margin-bottom: 10px;
}

.post-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.3;
}

.post-card h3 a:hover {
  color: var(--accent-blue);
}

.post-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin: 0 0 16px;
  flex-grow: 1;
}

.post-card .meta {
  color: var(--text-secondary);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

/* ===== SINGLE POST ===== */
.post-single {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 60px 24px 90px;
}

.post-single .post-tag {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 14px;
  display: block;
}

.post-single .post-title {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 18px;
}

.post-single .post-meta {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-light);
}

.post-content h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 44px;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.post-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 30px;
}

.post-content p {
  font-size: 1.1rem;
  color: #2a2a30;
  margin-bottom: 20px;
}

.post-content ul, .post-content ol {
  font-size: 1.05rem;
  margin-bottom: 20px;
}

.post-content a {
  color: var(--accent-blue);
  font-weight: 600;
  text-decoration: underline;
}

.post-content a:hover {
  color: var(--accent-blue-hover);
}

/* ===== TABLES ===== */
.post-content > table,
table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

/* Mobile table overflow fix — prevents horizontal page break on small screens */
.table-wrapper {
  overflow-x: auto;
  margin: 28px 0;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.table-wrapper table {
  margin: 0;
  border: none;
  border-radius: 0;
}

th {
  background: var(--bg-cream);
  padding: 14px;
  text-align: left;
  font-weight: 700;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
}

/* ===== BLOCKQUOTE ===== */
blockquote {
  border-left: 4px solid var(--accent-blue);
  background: var(--bg-cream);
  padding: 18px 22px;
  margin: 28px 0;
  border-radius: 0 12px 12px 0;
  font-style: italic;
}

/* ===== CTA BOX ===== */
.cta-box {
  background: var(--bg-cream);
  border: 2px solid var(--accent-blue);
  border-radius: 20px;
  padding: 40px;
  margin: 44px 0;
  text-align: center;
}

.cta-box p {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary) !important;
}

.cta-btn {
  display: inline-block;
  background: var(--accent-blue);
  color: white !important;
  padding: 13px 32px;
  border-radius: 10px;
  font-weight: 700;
  transition: background 0.2s ease;
}

.cta-btn:hover {
  background: var(--accent-blue-hover);
}

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border-light);
  padding: 40px 24px;
  text-align: center;
  background: var(--bg-cream);
}

.footer-links a {
  margin: 0 14px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--accent-blue);
}

.footer-copy {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 16px;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero-section h1 { font-size: 3rem; }
  .featured-post { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 768px) {
  .top-nav-links { display: none; }
  .header-right .top-nav-links,
  .header-right > a:not(.cta-black-btn) { display: none; }
  .mobile-toggle { display: block; }
  .hero-section h1 { font-size: 2.2rem; }
  .hero-section { padding: 40px 20px 20px; }
  .category-pills a { font-size: 0.82rem; padding: 6px 14px; }
  .post-single .post-title { font-size: 1.8rem; }
  .post-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-section h1 { font-size: 1.8rem; }
  .header-right { gap: 10px; }
  .header-right a:not(.cta-black-btn) { display: none; }
}

/* Respect user's reduced motion preference — accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}