/* ===========================
   Aituglo Ghost Theme
   Julian-inspired design system
   Same DA as cassim.sh
   =========================== */

@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Inter:wght@400;500&display=swap");

:root {
  --gh-font-heading: "Outfit", sans-serif;
  --gh-font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg: #f9fbfc;
  --bg-header: #ffffff;
  --text-heading: #2b5183;
  --text-subheading: #3d5a8d;
  --text-body: #1f1f1f;
  --text-nav: #104c68;
  --text-muted: #506d94;
  --accent: #0670a2;
  --accent-hover: #006899;
  --border: #e8e8e8;
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  font-size: 17px;
  line-height: 25px;
  color: var(--text-body);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: #dbeafe;
  color: var(--text-heading);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: "Outfit", sans-serif;
}

h1 {
  font-size: 57px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -2.75px;
  color: var(--text-muted);
}

h2 {
  font-size: 35px;
  font-weight: 500;
  line-height: 41px;
  letter-spacing: -1px;
  color: var(--text-subheading);
}

h3 {
  font-size: 22px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -0.5px;
  color: var(--text-subheading);
}

/* Layout */
.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .container,
  .container--narrow {
    padding: 0 40px;
  }
}

/* Header */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding-top: 16px;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .site-header__inner {
    padding: 0 40px;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.site-nav li {
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-nav);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--accent);
}

/* Hero with canvas */
.site-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 80px 0 36px;
}

.site-hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.site-hero__content {
  position: relative;
  z-index: 10;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-hero__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  object-fit: cover;
  margin: 0 auto 20px;
  display: block;
}

.site-hero__tagline {
  margin-top: 12px;
  font-size: 18px;
  color: var(--text-muted);
  font-family: "Inter", sans-serif;
}

.site-hero__description {
  margin-top: 12px;
  font-size: 18px;
  color: var(--text-muted);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* Slanted divider */
.slanted-divider {
  width: 100%;
  overflow: hidden;
}

.slanted-divider__line {
  width: 100%;
  height: 1px;
  transform: rotate(-1deg) scaleX(1.1);
  background: linear-gradient(to right, transparent, #d0d5dd, transparent);
}

/* Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.7s ease-out forwards;
  opacity: 0;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* Post feed */
.post-feed {
  display: grid;
  gap: 0;
}

.post-card {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.post-card:first-child {
  padding-top: 0;
}

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

.post-card__link {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  text-decoration: none;
  color: inherit;
}

.post-card__image-wrapper {
  flex-shrink: 0;
  width: 120px;
  height: 90px;
  overflow: hidden;
  border-radius: 6px;
  background: #eef3f8;
}

.post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card__link:hover .post-card__image {
  transform: scale(1.05);
}

.post-card__content {
  flex: 1;
  min-width: 0;
}

.post-card__title {
  font-family: "Outfit", sans-serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 6px;
  transition: color 0.15s ease;
}

.post-card__link:hover .post-card__title {
  color: var(--accent);
}

.post-card__excerpt {
  font-size: 15px;
  line-height: 22px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.post-card__meta {
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0.7;
}

.post-card__tag {
  color: var(--accent);
  font-weight: 500;
}

@media (max-width: 480px) {
  .post-card__image-wrapper {
    width: 80px;
    height: 60px;
  }

  .post-card__link {
    gap: 14px;
  }
}

/* Featured post cards (with images) */
.featured-feed {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

@media (min-width: 768px) {
  .featured-feed {
    grid-template-columns: repeat(3, 1fr);
  }
}

.featured-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.featured-card__image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
  transition: transform 0.3s ease;
}

.featured-card:hover .featured-card__image {
  transform: scale(1.03);
}

.featured-card__image-wrapper {
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 12px;
}

.featured-card__title {
  font-family: "Outfit", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 4px;
  transition: color 0.15s ease;
}

.featured-card:hover .featured-card__title {
  color: var(--accent);
}

.featured-card__meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* Single post */
.post {
  padding: 48px 0 64px;
}

.post__header {
  margin-bottom: 40px;
}

.post__title {
  font-family: "Outfit", sans-serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1.5px;
  color: var(--text-heading);
  margin-bottom: 16px;
}

/* Post title in hero */
.site-hero .post__meta {
  font-size: 15px;
  color: var(--text-muted);
}

.site-hero .post__meta a {
  color: var(--accent);
}

.post__meta {
  font-size: 15px;
  color: var(--text-muted);
}

.post__meta a {
  color: var(--accent);
}

.post__content {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-body);
}

.post__content h2 {
  margin-top: 48px;
  margin-bottom: 16px;
}

.post__content h3 {
  margin-top: 36px;
  margin-bottom: 12px;
}

.post__content p {
  margin-bottom: 20px;
}

.post__content ul,
.post__content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.post__content li {
  margin-bottom: 8px;
}

.post__content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--text-muted);
  font-style: italic;
}

.post__content pre {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.6;
}

.post__content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 15px;
}

.post__content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.post__content img {
  border-radius: 12px;
  margin: 24px 0;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

/* Lightbox overlay */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 12px;
  cursor: zoom-out;
}

.post__content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post__content a:hover {
  color: var(--accent-hover);
}

/* Feature image */
.post__feature-image {
  margin-bottom: 32px;
  border-radius: 12px;
  overflow: hidden;
}

.post__feature-image img {
  width: 100%;
  display: block;
}

/* Tag page */
.tag-header {
  padding: 48px 0 24px;
}

.tag-header h1 {
  font-size: 42px;
}

.tag-header__description {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 18px;
}

/* Author page */
.author-header {
  padding: 48px 0 24px;
}

.author-header h1 {
  font-size: 42px;
}

.author-header__bio {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 18px;
  max-width: 540px;
}

/* Pagination */
.pagination {
  padding: 40px 0;
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
}

.pagination a {
  color: var(--accent);
  font-weight: 500;
}

/* Footer */
.site-footer {
  padding: 40px 0;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-muted);
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-footer__links {
  display: flex;
  gap: 24px;
}

.site-footer__links a {
  color: var(--text-nav);
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--accent);
}

@media (min-width: 768px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    padding: 0 40px;
  }
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
  color: #fff;
}

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .site-hero canvas {
    display: none;
  }
}

/* Ghost editor cards (kg-*) */
.kg-width-wide {
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

.kg-width-full {
  max-width: none;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}

.kg-width-full img {
  width: 100%;
}

.kg-gallery-container {
  display: flex;
  flex-direction: column;
  margin: 24px 0;
}

.kg-gallery-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.kg-gallery-row:last-child {
  margin-bottom: 0;
}

.kg-gallery-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.kg-bookmark-card {
  margin: 24px 0;
}

.kg-bookmark-container {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.kg-bookmark-container:hover {
  border-color: var(--accent);
}

.kg-bookmark-content {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.kg-bookmark-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.kg-bookmark-description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kg-bookmark-metadata {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.kg-bookmark-icon {
  width: 16px;
  height: 16px;
}

.kg-bookmark-author,
.kg-bookmark-publisher {
  font-size: 13px;
}

.kg-bookmark-thumbnail {
  width: 200px;
  min-height: 100%;
}

.kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .kg-bookmark-container {
    flex-direction: column-reverse;
  }

  .kg-bookmark-thumbnail {
    width: 100%;
    min-height: 160px;
  }

  h1 {
    font-size: 36px;
    letter-spacing: -1.5px;
  }

  h2 {
    font-size: 26px;
    line-height: 32px;
  }

  .post__title {
    font-size: 32px;
  }

  .site-hero {
    padding: 40px 0 24px;
  }
}
