/* ==========================================================================
   AltNotes Blog Styles
   ========================================================================== */

.blog-hero {
  padding-top: clamp(40px, 6vw, 70px);
  padding-bottom: clamp(30px, 4vw, 50px);
}

.blog-hero .section-head {
  margin-bottom: 24px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: clamp(18px, 3vw, 28px);
  margin-top: 24px;
}

@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

/* Post Cards */
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 300ms cubic-bezier(0.16, 1, 0.3, 1), border-color 300ms ease;
  height: 100%;
}

.post-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(0, 122, 255, 0.32);
}

.post-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card:hover .post-card__thumb img {
  transform: scale(1.04);
}

/* Category Badge in Card Thumb */
.post-card__thumb .post-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(11, 11, 12, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

:root[data-theme="dark"] .post-card__thumb .post-card__badge {
  background: rgba(28, 28, 30, 0.9);
  border-color: rgba(255, 255, 255, 0.28);
}

.post-card__content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.post-card__title {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 10px 0;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
}

.post-card__excerpt {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 18px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__more {
  margin-top: auto;
  font-size: 14px;
  font-weight: 650;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 200ms ease;
}

.post-card:hover .post-card__more {
  gap: 8px;
}

/* ==========================================================================
   Single Post Page View
   ========================================================================== */
.post-single {
  padding: clamp(32px, 5vw, 60px) 0 clamp(60px, 8vw, 100px);
}

.container--narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.post-back-nav {
  margin-bottom: 28px;
}

.post-article {
  width: 100%;
}

.post-header {
  margin-bottom: 36px;
}

/* Tags bar in single post header */
.post-header__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.post-category-badge,
.post-header__tags .post-card__badge {
  position: static !important;
  top: auto !important;
  left: auto !important;
  display: inline-flex !important;
  align-items: center;
  padding: 5px 14px !important;
  border-radius: 999px !important;
  background: var(--accent-tint) !important;
  border: 1px solid var(--accent) !important;
  color: var(--accent) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .post-category-badge,
:root[data-theme="dark"] .post-header__tags .post-card__badge {
  background: rgba(10, 132, 255, 0.18) !important;
  color: #0a84ff !important;
  border-color: rgba(10, 132, 255, 0.4) !important;
}

.post-readtime-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.post-title {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 20px 0;
}

.post-author-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 32px 0;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.post-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.post-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-author-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.post-author-info .post-date {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

.post-hero {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  margin-top: 24px;
  background: var(--surface-2);
}

.post-hero img {
  width: 100%;
  height: auto;
  display: block;
}

/* Post Body Content Formatting */
.post-content {
  font-size: 17.5px;
  line-height: 1.7;
  color: var(--muted);
}

.post-content h2 {
  font-size: clamp(22px, 3.2vw, 28px);
  font-weight: 750;
  line-height: 1.25;
  color: var(--text);
  margin: 44px 0 18px 0;
  letter-spacing: -0.02em;
}

.post-content h3 {
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 14px 0;
  letter-spacing: -0.01em;
}

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

.post-content strong {
  color: var(--text);
}

.post-content img {
  width: 100%;
  border-radius: var(--radius);
  margin: 32px 0;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}

.post-content ul, 
.post-content ol {
  margin-bottom: 24px;
  padding-left: 22px;
}

.post-content li {
  margin-bottom: 10px;
  line-height: 1.6;
}

.post-content blockquote {
  margin: 36px 0;
  padding: 22px 26px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: var(--shadow-soft);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.post-content blockquote p {
  font-style: italic;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 0;
}

/* Code Blocks */
.post-content pre {
  margin: 28px 0;
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
}

.post-content code {
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 14px;
}

:not(pre) > code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.blog-loading, 
.post-error {
  text-align: center;
  padding: 80px 20px;
}

.post-error h1 {
  margin-bottom: 16px;
  font-size: 32px;
  color: var(--text);
}

/* Official Black iOS App Store Badge Button */
.btn-appstore {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: #000000;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  text-decoration: none !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease;
}

.btn-appstore:hover {
  transform: translateY(-2px);
  background: #121214;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  color: #ffffff !important;
}

.btn-appstore svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex-shrink: 0;
}

.btn-appstore__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
}

.btn-appstore__small {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.01em;
  opacity: 0.85;
  text-transform: uppercase;
}

.btn-appstore__big {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 1px;
}

.post-appstore-cta {
  margin: 3.5rem 0 2rem 0;
  padding: 2.25rem 1.5rem;
  border-radius: var(--radius, 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  transition: border-color 0.3s ease;
}

.post-appstore-cta:hover {
  border-color: rgba(0, 122, 255, 0.3);
}

.post-appstore-cta__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-appstore-cta__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.post-appstore-cta__lead {
  margin: 0;
  max-width: 520px;
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.5;
}


