/* ============================================
   MODERN CONTENT & COMPONENT STYLES
   Cards, Blog Posts, Projects, Typography
   ============================================ */

/* ─── CONTENT CARDS ─── */
.content-card {
  background: #a1887f;
  border: 1px solid #8d6e63;
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: all var(--transition-base);
  color: #fff5f1;
}

html[mode="dark"] .content-card {
  background: #795548;
  border-color: #6d4c41;
  color: #efebe9;
}

.content-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.content-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.content-card-icon {
  font-size: 2rem;
  color: var(--color-primary);
  flex-shrink: 0;
}

.content-card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-2);
}

.content-card-description {
  color: var(--color-text-secondary);
  line-height: var(--line-relaxed);
}

html[mode="dark"] .content-card-description {
  color: var(--color-dark-text);
  opacity: 0.9;
}

.content-card-footer {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

/* ─── BLOG POST LIST ─── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Blog section heading */
#main h1,
.page-title,
.archive h1 {
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  font-weight: 700;
  background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: var(--space-3);
}

#main h1::after,
.page-title::after,
.archive h1::after {
  content: '';
  display: block;
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg, #0ea5e9 0%, #06b6d4 100%);
  border-radius: 2px;
  margin-top: var(--space-3);
  animation: slideInLeft 0.8s ease-out;
}

/* Style h2 within post-content (blog post titles in markdown) */
.post-content h2 {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 700;
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -0.015em;
  line-height: 1.3;
  position: relative;
  animation: titleFadeInScale 0.7s ease-out both;
  filter: drop-shadow(0 0 20px rgba(14, 165, 233, 0.15));
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.post-content h2:hover {
  transform: translateX(4px) scale(1.02);
  background: linear-gradient(135deg, #0284c7 0%, #0c4a6e 50%, #082f49 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 28px rgba(14, 165, 233, 0.25));
}

.post-content h3,
.post-content h4 {
  color: #1e293b;
  font-weight: 700;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[mode="dark"] .post-content h3,
html[mode="dark"] .post-content h4 {
  color: #e0f2fe;
}

.post-item {
  position: relative;
  padding: calc(var(--space-6) + 0.25rem);
  border-left: 4px solid transparent;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, rgba(14,165,233,0.02) 0%, rgba(255,255,255,0.0) 100%);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  box-shadow: 0 6px 18px rgba(12, 38, 59, 0.03);
  animation: fadeInUp 0.6s ease-out both;
}

.post-item:nth-child(1) { animation-delay: 0.1s; }
.post-item:nth-child(2) { animation-delay: 0.2s; }
.post-item:nth-child(3) { animation-delay: 0.3s; }
.post-item:nth-child(4) { animation-delay: 0.4s; }
.post-item:nth-child(5) { animation-delay: 0.5s; }

html[mode="dark"] .post-item {
  border-bottom-color: rgba(255,255,255,0.03);
  background: linear-gradient(180deg, rgba(6,182,212,0.02) 0%, transparent 100%);
}

.post-item::before {
  content: '';
  display: block;
  width: 56px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #0ea5e9 0%, #06b6d4 100%);
  margin-bottom: var(--space-3);
  animation: scaleInWidth 0.6s ease-out 0.15s both;
}

.post-item:hover {
  transform: translateY(-8px) translateX(4px);
  border-left-color: rgba(14,165,233,0.9);
  padding-left: calc(var(--space-6) + 4px);
  background: linear-gradient(180deg, rgba(14,165,233,0.05) 0%, rgba(255,255,255,0.02) 100%);
  box-shadow: 0 24px 48px rgba(4, 30, 55, 0.12);
}

html[mode="dark"] .post-item:hover {
  background: linear-gradient(180deg, rgba(6,182,212,0.06) 0%, rgba(6,182,212,0.02) 100%);
}

.post-item a {
  text-decoration: none;
  color: var(--color-text-primary);
}

html[mode="dark"] .post-item a {
  color: var(--color-dark-text);
}

.post-item a:hover {
  color: var(--color-primary);
}

.post-title {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 700;
  margin-bottom: var(--space-2);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -0.015em;
  line-height: 1.3;
  position: relative;
  animation: titleFadeInScale 0.7s ease-out both;
  filter: drop-shadow(0 0 20px rgba(14, 165, 233, 0.15));
}

.post-item:nth-child(1) .post-title { animation-delay: 0.2s; }
.post-item:nth-child(2) .post-title { animation-delay: 0.3s; }
.post-item:nth-child(3) .post-title { animation-delay: 0.4s; }
.post-item:nth-child(4) .post-title { animation-delay: 0.5s; }
.post-item:nth-child(5) .post-title { animation-delay: 0.6s; }

.post-item:hover .post-title {
  transform: translateX(6px) scale(1.02);
  background: linear-gradient(135deg, #0284c7 0%, #0c4a6e 50%, #082f49 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 28px rgba(14, 165, 233, 0.25));
}

.post-meta {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: #4b6b86;
  margin-bottom: var(--space-2);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
}

html[mode="dark"] .post-meta {
  color: #7dd3fc;
}

.post-excerpt {
  color: #355165;
  line-height: var(--line-relaxed);
  margin-bottom: var(--space-3);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[mode="dark"] .post-excerpt {
  color: #9fcfe6;
  opacity: 0.95;
}

/* ─── TAGS & CATEGORIES ─── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--radius-full);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
}

.tag:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.tags-container {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-4) 0;
}

/* ─── PROJECT SHOWCASE ─── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-8);
  margin: var(--space-8) 0;
}

.project-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

html[mode="dark"] .project-card {
  background: var(--color-dark-bg-secondary);
  border-color: var(--color-dark-border);
}

.project-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-8px);
  border-color: var(--color-primary);
}

.project-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
  overflow: hidden;
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-content {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

html[mode="dark"] .project-title {
  color: var(--color-dark-text);
}

.project-description {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--line-relaxed);
  margin-bottom: var(--space-4);
  flex: 1;
}

html[mode="dark"] .project-description {
  color: var(--color-dark-text);
  opacity: 0.9;
}

.project-meta {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  margin-bottom: var(--space-4);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-primary);
  font-weight: var(--font-semibold);
  transition: all var(--transition-fast);
}

.project-link:hover {
  gap: var(--space-3);
}

/* Distinct project title + subtitle styling */
.projects .project-item h2 {
  margin: 0 0 0.55rem 0;
  padding-left: 0.7rem;
  border-left: 4px solid #0ea5e9;
  font-size: clamp(1.75rem, 2.5vw, 2.05rem);
  letter-spacing: -0.02em;
  color: #1f2f44;
}

.projects .project-item:nth-of-type(2) h2 {
  border-left-color: #0f766e;
}

.projects .project-item:nth-of-type(3) h2 {
  border-left-color: #b45309;
}

/* High-visibility project metadata (category tags) */
.projects .project-kicker {
  display: inline-block;
  margin: 0 0 var(--space-4) 0;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #0b4f88;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.14);
}

.projects .project-item:nth-of-type(2) .project-kicker {
  background: rgba(15, 118, 110, 0.14);
  border-color: rgba(15, 118, 110, 0.35);
  color: #0f5f58;
}

.projects .project-item:nth-of-type(3) .project-kicker {
  background: rgba(180, 83, 9, 0.14);
  border-color: rgba(180, 83, 9, 0.35);
  color: #8a4508;
}

html[mode="dark"] .projects .project-kicker {
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(125, 211, 252, 0.55);
  color: #dbeafe;
}

html[mode="dark"] .projects .project-item h2 {
  color: #e5edf7;
}

/* ─── SKILLS SECTION ─── */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

.skill-category {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

html[mode="dark"] .skill-category {
  background: var(--color-dark-bg-secondary);
  border-color: var(--color-dark-border);
}

.skill-category:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.skill-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-4);
  color: var(--color-primary);
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skill-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

html[mode="dark"] .skill-item {
  color: var(--color-dark-text);
}

.skill-item::before {
  content: '→';
  color: var(--color-primary);
  font-weight: var(--font-bold);
  width: 20px;
}

/* ─── TIMELINE ─── */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--color-primary);
}

.timeline li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 20px;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 0;
  width: 12px;
  height: 12px;
  background: var(--color-primary);
  border-radius: 50%;
}

.timeline-date {
  font-size: var(--text-sm);
  color: var(--color-secondary);
  margin-bottom: 4px;
  display: block;
}

.timeline-event {
  font-size: var(--text-md);
  font-weight: var(--font-medium);
}

/* ─── BLOCKQUOTES ─── */
blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-6);
  padding-left: var(--space-8);
  border-left: 4px solid var(--color-primary);
  background: var(--color-bg-lighter);
  border-radius: var(--radius-lg);
  font-style: italic;
  color: var(--color-text-secondary);
  position: relative;
}

html[mode="dark"] blockquote {
  background: rgba(14, 165, 233, 0.05);
  color: var(--color-dark-text);
  border-color: var(--color-primary);
}

blockquote::before {
  content: '"';
  position: absolute;
  left: var(--space-4);
  top: 0;
  font-size: 3rem;
  color: var(--color-primary);
  opacity: 0.2;
}

/* ─── CODE BLOCKS ─── */
code,
pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

code {
  background: var(--color-bg-lighter);
  color: var(--color-accent);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: var(--font-semibold);
}

html[mode="dark"] code {
  background: rgba(14, 165, 233, 0.1);
  color: #f87171;
}

pre {
  background: var(--color-dark-bg-secondary);
  color: var(--color-white);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: var(--space-4) 0;
  border: 1px solid var(--color-dark-border);
  line-height: var(--line-relaxed);
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

/* ─── IMAGES & MEDIA ─── */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  transition: transform var(--transition-base);
}

figure {
  margin: var(--space-6) 0;
}

figcaption {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
  font-style: italic;
}

/* ─── TABLES ─── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0;
  font-size: var(--text-sm);
}

th {
  background: var(--color-bg-lighter);
  color: var(--color-text-primary);
  font-weight: var(--font-semibold);
  padding: var(--space-4);
  text-align: left;
  border-bottom: 2px solid var(--color-border);
}

html[mode="dark"] th {
  background: var(--color-dark-bg-secondary);
  color: var(--color-dark-text);
  border-bottom-color: var(--color-dark-border);
}

td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

html[mode="dark"] td {
  border-bottom-color: var(--color-dark-border);
  color: var(--color-dark-text);
}

tr:hover {
  background: var(--color-bg-lighter);
}

html[mode="dark"] tr:hover {
  background: rgba(14, 165, 233, 0.05);
}

/* ─── LISTS ─── */
ul, ol {
  margin: var(--space-4) 0 var(--space-4) var(--space-6);
}

li {
  margin-bottom: var(--space-2);
}

/* ─── HORIZONTAL RULE ─── */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-border), transparent);
  margin: var(--space-8) 0;
}

html[mode="dark"] hr {
  background: linear-gradient(to right, transparent, var(--color-dark-border), transparent);
}

/* ─── PRINT STYLES ─── */
@media print {
  #topbar-wrapper,
  #sidebar,
  #back-to-top,
  .no-print {
    display: none !important;
  }

  #main-wrapper {
    margin-left: 0;
  }

  body {
    background: white;
    color: black;
  }
}

/* ─── SIDEBAR ENHANCEMENTS (appended) ─── */
.sidebar-gradient {
  height: 48px;
  margin: 0 12px 12px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(14,165,233,0.12), rgba(6,182,212,0.06));
  box-shadow: inset 0 -8px 20px rgba(0,0,0,0.25);
}

.sidebar-card {
  margin: 0 12px 12px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.03));
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 12px;
  overflow: hidden;
}

.sidebar-card .card-inner {
  padding: var(--space-4);
  text-align: center;
}
.sidebar-card .card-title { font-size: var(--text-sm); color: var(--color-text-muted); }
.sidebar-card .card-name { font-size: var(--text-lg); font-weight: var(--font-bold); margin-top: var(--space-1); }
.sidebar-card .card-sub { font-size: var(--text-xs); color: var(--color-text-secondary); margin-top: var(--space-1); }
.sidebar-card .card-actions { display:flex; gap:var(--space-2); justify-content:center; margin-top:var(--space-3); }
.sidebar-card .btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.sidebar-card .btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.06); }

.sidebar-extras { margin: 12px; }
.sidebar-panel { background: transparent; border-radius: 10px; margin-bottom: 8px; }
.sidebar-panel summary { cursor: pointer; list-style: none; padding: 8px 10px; font-weight: var(--font-semibold); color: var(--color-text-muted); }
.sidebar-panel[open] summary { color: var(--color-text-primary); }
.sidebar-panel summary::-webkit-details-marker { display:none; }
.sidebar-panel .tag-cloud { padding: 8px 10px 12px 10px; display:flex; flex-wrap:wrap; gap:8px; max-height:220px; overflow:auto; }

/* Make tags punchier and visible on warm wood background */
.tag { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); color: var(--color-white); padding: 6px 10px; font-size: 13px; border-radius: 999px; display:inline-block; }
.tag:hover { background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark)); color: white; border-color: transparent; box-shadow: 0 6px 18px rgba(2,132,199,0.18); transform: translateY(-3px); }

.recent-posts { list-style: none; padding: 8px 10px 12px 10px; margin: 0; display:flex; flex-direction:column; gap:8px; }
.recent-posts li a { color: var(--color-text-secondary); font-size: 14px; }
.recent-posts li a:hover { color: var(--color-primary); }

/* scrollbar for tag cloud */
.tag-cloud::-webkit-scrollbar { width: 8px; }
.tag-cloud::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.04); border-radius: 8px; }

@media (max-width: 900px) {
  .sidebar-card, .sidebar-gradient { display: none; }
}
