/* Divy's - Apple Design Philosophy */

:root {
  --apple-black: #1d1d1f;
  --apple-gray: #86868b;
  --apple-light-gray: #f5f5f7;
  --apple-border: #d2d2d7;
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-white: #ffffff;
  --apple-background: #fbfbfd;
}

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

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--apple-background);
  color: var(--apple-black);
  line-height: 1.47059;
  letter-spacing: -0.022em;
  min-height: 100vh;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
header {
  text-align: center;
  padding: 4rem 0 3rem;
  margin-bottom: 1rem;
  border-bottom: none;
}

header::after {
  display: none;
}

.site-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--apple-black);
  margin-bottom: 0.5rem;
}

.site-subtitle {
  display: none;
}

.site-tagline {
  font-size: 1.05rem;
  color: var(--apple-gray);
  font-weight: 400;
  margin-top: 0.25rem;
  letter-spacing: normal;
  text-transform: none;
}

/* Navigation */
nav {
  margin-top: 2rem;
  padding-top: 0;
  border-top: none;
}

nav a {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--apple-blue);
  text-decoration: none;
  margin: 0 1rem;
  transition: opacity 0.2s;
}

nav a:hover {
  opacity: 0.7;
}

/* Content Wrapper - Flexbox for sidebar */
.content-wrapper {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.content-wrapper main {
  flex: 1;
  min-width: 0;
}

.content-wrapper article.post {
  flex: 1;
  min-width: 0;
}

/* Sidebar */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 2rem;
  padding-top: 1rem;
}

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

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--apple-gray);
  margin-bottom: 0.75rem;
}

.sidebar-list {
  list-style: none;
}

.sidebar-list li {
  margin-bottom: 0.25rem;
}

.sidebar-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: var(--apple-black);
  text-decoration: none;
  border-radius: 8px;
  transition: background-color 0.15s;
}

.sidebar-list a:hover {
  background-color: var(--apple-light-gray);
}

.sidebar-list a.active {
  background-color: var(--apple-blue);
  color: white;
}

.sidebar-list a.active .count {
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-list .count {
  font-size: 0.8rem;
  color: var(--apple-gray);
  font-weight: 400;
}

/* Archive Title */
.archive-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--apple-black);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--apple-border);
}

/* Post List */
.post-list {
  list-style: none;
  padding: 1rem 0;
}

.post-item {
  margin-bottom: 0;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--apple-border);
}

.post-item:first-child {
  padding-top: 0.5rem;
}

.post-item:last-child {
  border-bottom: none;
}

.post-date {
  font-size: 0.85rem;
  color: var(--apple-gray);
  font-weight: 400;
  display: block;
  margin-bottom: 0.4rem;
  text-transform: none;
  letter-spacing: normal;
}

.post-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.25;
  letter-spacing: -0.022em;
}

.post-title a {
  color: var(--apple-black);
  text-decoration: none;
  transition: color 0.2s;
}

.post-title a:hover {
  color: var(--apple-blue);
}

.post-excerpt {
  color: var(--apple-gray);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

/* Post Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.post-tags .tag,
a.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.1);
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.15s;
}

.post-tags .tag:hover,
a.tag:hover {
  background: rgba(0, 113, 227, 0.2);
}

/* Single Post */
article.post {
  padding: 2rem 0;
}

article.post header {
  text-align: left;
  padding: 0 0 2rem 0;
  margin-bottom: 0;
}

article.post .post-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.032em;
}

article.post .post-meta {
  font-size: 0.95rem;
  color: var(--apple-gray);
  font-weight: 400;
}

article.post .post-meta a {
  color: var(--apple-blue);
  text-decoration: none;
}

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

.post-content {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--apple-black);
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content p:first-of-type::first-letter {
  font-size: inherit;
  float: none;
  margin: 0;
  font-weight: inherit;
  color: inherit;
}

.post-content h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin: 3rem 0 1rem;
  color: var(--apple-black);
  letter-spacing: -0.022em;
}

.post-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
  color: var(--apple-black);
  letter-spacing: -0.022em;
}

.post-content blockquote {
  margin: 2rem 0;
  padding: 0 0 0 1.5rem;
  border-left: 3px solid var(--apple-border);
  color: var(--apple-gray);
}

.post-content blockquote p {
  margin-bottom: 0;
}

.post-content code {
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', monospace;
  background: var(--apple-light-gray);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.9em;
  color: var(--apple-black);
}

.post-content pre {
  background: var(--apple-black);
  color: #f5f5f7;
  padding: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  margin: 2rem 0;
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Monaco, monospace;
  font-size: 0.9rem;
  line-height: 1.55;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  border-radius: 0;
}

.post-content a {
  color: var(--apple-blue);
  text-decoration: none;
}

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

.post-content ul,
.post-content ol {
  margin: 1.5rem 0 1.5rem 1.25rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
  display: block;
  border-radius: 12px;
}

.post-content hr {
  border: none;
  margin: 3rem 0;
  height: 1px;
  background: var(--apple-border);
}

.post-content hr::before {
  display: none;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--apple-blue);
  text-decoration: none;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 0.7;
}

.back-link::before {
  content: '‹';
  margin-right: 0.35rem;
  font-size: 1.2rem;
  line-height: 1;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 1rem 4rem;
  margin-top: 2rem;
  border-top: 1px solid var(--apple-border);
}

footer::before {
  display: none;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--apple-gray);
  font-weight: 400;
}

.footer-quote {
  font-size: 0.85rem;
  color: var(--apple-gray);
  margin-top: 0.5rem;
  font-style: normal;
}

/* About page */
.about-content {
  text-align: left;
}

/* Social links */
.social-links {
  display: flex;
  gap: 1.25rem;
  margin-top: 1rem;
}

.social-links a {
  color: var(--apple-gray);
  transition: color 0.2s;
}

.social-links a:hover {
  color: var(--apple-blue);
}

.social-links svg {
  display: block;
}

/* Responsive */
@media (max-width: 900px) {
  .content-wrapper {
    flex-direction: column-reverse;
    gap: 2rem;
  }

  .sidebar {
    width: 100%;
    position: static;
    display: flex;
    gap: 2rem;
    padding-top: 0;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--apple-border);
  }

  .sidebar-section {
    margin-bottom: 0;
    flex: 1;
  }

  .sidebar-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .sidebar-list li {
    margin-bottom: 0;
  }

  .sidebar-list a {
    padding: 0.4rem 0.75rem;
    background: var(--apple-light-gray);
  }
}

@media (max-width: 734px) {
  html {
    font-size: 16px;
  }

  .site-title {
    font-size: 2rem;
  }

  .container {
    padding: 0 1.25rem;
  }

  nav a {
    margin: 0.25rem 0.75rem;
  }

  article.post .post-title {
    font-size: 1.8rem;
  }

  .post-content pre {
    border-radius: 8px;
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    padding: 1.25rem;
  }

  .sidebar {
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
  }

  .container {
    max-width: 100%;
  }

  nav, .back-link, .sidebar {
    display: none;
  }
}
