/* Reset and base styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1em;
  color: #333332;
  background: #fff;
  line-height: 1.6;
}

a img {
  border: none;
}

/* Header styles */
header {
  height: 80px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
}

.branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-title {
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
  /* container will shrink-wrap to the width of "CODECUBE" */
}

.title-main {
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  color: #1A202C;
  /* no special width—just sizes to its text */
}

.title-sub {
  font-weight: 400;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  color: #4A90E2;
  width: 100%;       /* fill the full width of .site-title */
  text-align: center; /* center the text */
}

#site-logo {
  width: auto;
  height: 48px;
}

/* Navigation styles - Mobile first */
nav {
  margin-left: 2rem;
}

nav .nav-list {
  display: flex;
  flex-direction: row;
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
}

nav .nav-list li {
  margin: 0;
}

nav .nav-list a {
  text-decoration: none;
  color: #333332;
  font-weight: 500;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}

nav .nav-list a:hover {
  color: #4A90E2;
}

/* Tablet and desktop styles */
@media (min-width: 768px) {
  nav .nav-list {
    flex-direction: row;
  }
}

/* Mobile styles - navigation below logo */
@media (max-width: 767px) {
  header {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem;
  }
  
  #site-logo {
    height: 60px; /* Larger logo on mobile */
  }
  
  .site-title .title-main {
    font-size: 1.4rem; /* Slightly larger text on mobile */
  }
  
  nav {
    width: 100%;
    margin-left: 0;
    margin-top: 1rem;
  }
  
  nav .nav-list {
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
  
  nav .nav-list li {
    width: 100%;
  }
  
  nav .nav-list a {
    display: block;
    padding: 0.75rem 0;
  }
}

/* Main content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1A202C;
  margin: 0;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
}

/* Partners carousel placeholder */
.partners-carousel {
  min-height: 2rem;
  margin-bottom: 4rem;
  /* Reserved for later implementation */
  display: none; /* Hidden until implemented */
}

/* Latest posts section */
.latest-posts {
  margin-bottom: 4rem;
}

.latest-posts h2 {
  font-size: 2rem;
  font-weight: 600;
  color: #1A202C;
  margin-bottom: 2rem;
  text-align: center;
}

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

/* Mobile-specific adjustments for posts */
@media (max-width: 767px) {
  .post-list {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 1.25rem;
  }
}

.post-item {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-item h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.post-item h3 a {
  text-decoration: none;
  color: #1A202C;
}

.post-item h3 a:hover {
  color: #4A90E2;
}

.post-date {
  display: block;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.post-summary {
  font-size: 0.9rem;
  color: #4b5563;
  margin: 0;
  line-height: 1.5;
}

/* Archive section */
.archive {
  border-top: 2px solid #e5e5e5;
  padding-top: 2rem;
}

.archive h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #1A202C;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Years list styling */
.archive > div:first-of-type {
  margin-bottom: 2rem;
  line-height: 1.8;
}

.archive > div:first-of-type a {
  color: #4A90E2;
  text-decoration: none;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.archive > div:first-of-type a:hover {
  background-color: #f0f8ff;
}

/* Mobile and tablet improvements for years list */
@media (max-width: 1024px) {
  .archive > div:first-of-type {
    font-size: 1.1rem;
    line-height: 2;
  }
  
  .archive > div:first-of-type a {
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0.25rem 0.25rem 0;
    display: inline-block;
    font-size: 1rem;
  }
}

.titleicon {
  width: 24px;
  height: 24px;
}

.archive h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1A202C;
  margin: 2rem 0 1rem 0;
}

#archivelist {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
}

#archivelist li {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

#archivelist .entry-title a {
  text-decoration: none;
  color: #1A202C;
  font-weight: 500;
  font-size: 1.1rem;
}

#archivelist .entry-title a:hover {
  color: #4A90E2;
}

#archivelist .published {
  color: #6b7280;
  font-size: 0.9rem;
}

#archivelist .entry-summary {
  margin: 0.5rem 0 0 0;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Footer */
footer {
  background: #f8f9fa;
  padding: 2rem 1.5rem;
  text-align: center;
  border-top: 1px solid #e5e5e5;
  color: #6b7280;
  font-size: 0.9rem;
}

footer a {
  color: #4A90E2;
  text-decoration: none;
}

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

/* Utility classes */
blockquote {
  border-left: 4px solid #4A90E2;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: #4b5563;
}

pre {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.9em;
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  border: 1px solid #e5e5e5;
}

/* Additional utility styles from original */
#author { 
  font-weight: bold; 
}

/* Table styling for blog content */
.hentry table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95em;
  border-radius: 4px;
  overflow: hidden;
}

.hentry table thead {
  background: #f5f5f5;
  border-bottom: 2px solid #4A90E2;
}

.hentry table thead th {
  padding: 10px;
  text-align: left;
  font-weight: 600;
}

.hentry table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e5e5;
}

.hentry table tbody tr:nth-child(even) {
  background: #f9f9f9;
}

/* Content images */
.hentry img, main img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1rem 0;
}

/* Code styling */
code {
  background: #f1f3f4;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.9em;
}

/* Lists in content */
.hentry li {
  padding-bottom: 10px;
}

/* Resume styles */
.resume {
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  background-color: #fdfdfd;
  color: #333;
}

.resume h1,
.resume h2,
.resume h3 {
  color: #2c3e50;
}

.resume h1 {
  border-bottom: 2px solid #ccc;
  padding-bottom: .3em;
}

.resume section {
  margin-top: 2em;
}

/* Two-column layout for desktop and iPad */
.resume .two-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}

.resume .column {
  flex: 1 1 calc(50% - 1rem);
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.resume ul {
  padding-left: 1.2rem;
}

/* Mobile layout - single column */
@media (max-width: 767px) {
  .resume {
    padding: 1rem;
  }
  
  .resume .two-columns {
    flex-direction: column;
  }
  
  .resume .column {
    flex: 1 1 100%;
  }
}

/* Print layout */
@media print {
  .resume {
    padding: 0;
    max-width: none;
  }
  
  .resume .two-columns {
    display: block;
  }
}

/* Social media links - modern responsive layout */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.social-icon {
  width: 90px;
  height: 90px;
  border-radius: 8px;
}

/* Projects section */
.projects-section {
  margin: 2rem 0;
}

.project {
  display: flex;
  gap: 1.5rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #4A90E2;
}

.project-logo {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.project-icon {
  width: 80px;
  height: 80px;
}

.project-icon-emoji {
  font-size: 4rem;
  line-height: 1;
}

.project-content {
  flex: 1;
}

.project-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.4rem;
  color: #1A202C;
}

.project-content p {
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

.project-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.project-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #4A90E2;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.project-link:hover {
  background: #357ABD;
  color: white;
}

/* Mobile responsiveness for social and projects */
@media (max-width: 768px) {
  .social-links {
    gap: 0.75rem;
    padding: 1rem;
  }
  
  .social-icon {
    width: 70px;
    height: 70px;
  }
  
  .project {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .project-logo {
    align-self: center;
  }
  
  .project-icon {
    width: 60px;
    height: 60px;
  }
  
  .project-icon-emoji {
    font-size: 3rem;
  }
  
  .project-links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .social-links {
    gap: 0.75rem;
  }
  
  .social-icon {
    width: 60px;
    height: 60px;
  }
}

/* Post navigation styles */
.post-navigation {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
  margin-bottom: 1.5rem;
}

.post-navigation .nav-previous:last-child,
.post-navigation .nav-next:last-child {
  margin-bottom: 0;
}

.post-navigation p {
  margin: 0 0 0.5rem 0;
}

.post-navigation p:last-child {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.4;
}

.post-navigation a {
  text-decoration: none;
  color: #4A90E2;
  font-weight: 500;
}

.post-navigation a:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .post-navigation {
    display: flex;
    gap: 2rem;
  }
  
  .post-navigation .nav-previous,
  .post-navigation .nav-next {
    flex: 1;
    margin-bottom: 0;
  }
}