/* =============================================
   FitLive Theme — Apple-inspired minimal design
   ============================================= */

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

:root {
  --black:   #1d1d1f;
  --gray:    #6e6e73;
  --light:   #f5f5f7;
  --white:   #ffffff;
  --blue:    #0071e3;
  --blue-h:  #0077ed;
  --border:  #d2d2d7;
  --radius:  18px;
  --font:    'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --max-w:   1120px;
  --trans:   0.25s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-logo { flex-shrink: 0; }
.site-logo img { height: 28px; width: auto; }
.site-title-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--black);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-links li a,
.nav-links li .nav-link {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--black);
  border-radius: 980px;
  transition: background var(--trans);
}
.nav-links li a:hover { background: rgba(0,0,0,0.05); }

.nav-link--cta {
  background: var(--black) !important;
  color: var(--white) !important;
}
.nav-link--cta:hover { background: #333 !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: var(--trans);
}

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--black);
}

.hero--no-cover {
  background: linear-gradient(135deg, #1d1d1f 0%, #2d2d2f 100%);
  min-height: 360px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.4;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
  width: 100%;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--white);
  line-height: 1.05;
  margin-bottom: 20px;
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: rgba(255,255,255,0.72);
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ── POSTS SECTION ── */
.posts-section { padding: 80px 0; }
.posts-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* Featured post */
.post-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 80px;
  padding-bottom: 80px;
  border-bottom: 1px solid var(--border);
}

.post-featured-img-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/10;
  display: block;
}
.post-featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.post-featured-img-wrap:hover .post-featured-img { transform: scale(1.03); }

.post-featured-content { padding: 8px 0; }

.post-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.post-tag:hover { color: var(--blue-h); }

.post-featured-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}
.post-featured-title a:hover { color: var(--blue); }

.post-featured-excerpt {
  font-size: 1.05rem;
  color: var(--gray);
  line-height: 1.65;
  margin-bottom: 20px;
}

/* Post meta */
.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--gray);
  font-weight: 500;
}
.post-meta span + span::before {
  content: '·';
  margin-right: 12px;
}

/* Posts grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.posts-grid--small { grid-template-columns: repeat(3, 1fr); }

.post-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--light);
  transition: transform var(--trans), box-shadow var(--trans);
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.post-card-img-wrap {
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.post-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.post-card-img-wrap:hover .post-card-img { transform: scale(1.04); }

.post-card-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 8px 0 10px;
  flex: 1;
}
.post-card-title a:hover { color: var(--blue); }

.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--gray);
  line-height: 1.55;
  margin-bottom: 14px;
}

/* ── POST PAGE ── */
.post-page { padding-bottom: 80px; }

.post-header {
  padding: 64px 24px 48px;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}
.post-header-inner { max-width: 700px; margin: 0 auto; }

.post-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 12px 0 20px;
}

.post-subtitle {
  font-size: 1.2rem;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: 24px;
}

.post-meta { justify-content: center; }
.post-author { font-weight: 600; color: var(--black); }

.post-cover {
  max-width: var(--max-w);
  margin: 0 auto 56px;
  padding: 0 24px;
}
.post-cover img {
  width: 100%;
  border-radius: var(--radius);
  max-height: 560px;
  object-fit: cover;
}
.post-cover figcaption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 10px;
}

/* Post content typography */
.post-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--black);
}

.post-content h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 2.5em 0 0.6em;
  line-height: 1.2;
}
.post-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 2em 0 0.5em;
}
.post-content p { margin-bottom: 1.4em; }
.post-content a { color: var(--blue); }
.post-content a:hover { text-decoration: underline; }
.post-content strong { font-weight: 700; }
.post-content em { font-style: italic; }
.post-content blockquote {
  border-left: 3px solid var(--blue);
  padding: 4px 0 4px 24px;
  margin: 2em 0;
  font-size: 1.15rem;
  color: var(--gray);
  font-style: italic;
}
.post-content ul, .post-content ol {
  margin: 0 0 1.4em 1.5em;
}
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 0.4em; }
.post-content img {
  border-radius: 12px;
  margin: 2em auto;
  max-width: 100%;
}
.post-content figure { margin: 2em 0; }
.post-content figcaption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 8px;
}
.post-content pre {
  background: var(--light);
  border-radius: 12px;
  padding: 20px 24px;
  overflow-x: auto;
  font-size: 0.875rem;
  margin: 2em 0;
}
.post-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
}
.post-content pre code { background: none; padding: 0; }
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3em 0;
}

/* Wide images in post */
.post-content .kg-width-wide,
.post-content .kg-width-full {
  max-width: 900px;
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.post-content .kg-width-full { max-width: 100vw; }

/* Ghost cards */
.post-content .kg-image-card img { border-radius: 12px; }
.post-content .kg-gallery-container { margin: 2em 0; }
.post-content .kg-gallery-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.post-content .kg-gallery-image { flex: 1; overflow: hidden; border-radius: 8px; }
.post-content .kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }

.post-content .kg-bookmark-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  margin: 2em 0;
}
.post-content .kg-bookmark-content { padding: 20px; flex: 1; }
.post-content .kg-bookmark-title { font-weight: 600; margin-bottom: 6px; }
.post-content .kg-bookmark-description { font-size: 0.875rem; color: var(--gray); }
.post-content .kg-bookmark-thumbnail { width: 160px; flex-shrink: 0; }
.post-content .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* Post footer */
.post-footer { margin-top: 56px; }
.post-footer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.post-tags-list { display: flex; flex-wrap: wrap; gap: 8px; }

.share-btn {
  background: var(--light);
  border: none;
  border-radius: 980px;
  padding: 8px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--trans);
  font-family: var(--font);
}
.share-btn:hover { background: var(--border); }

/* ── SUBSCRIBE SECTION ── */
.subscribe-section {
  background: var(--light);
  padding: 80px 24px;
  margin-top: 64px;
  text-align: center;
}
.subscribe-inner { max-width: 520px; margin: 0 auto; }
.subscribe-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.subscribe-desc {
  color: var(--gray);
  margin-bottom: 32px;
  font-size: 1rem;
  line-height: 1.5;
}
.subscribe-already {
  color: var(--blue);
  font-weight: 600;
}
.subscribe-form {
  display: flex;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
}
.subscribe-form input {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 980px;
  font-size: 0.9rem;
  font-family: var(--font);
  background: var(--white);
  outline: none;
  transition: border-color var(--trans);
}
.subscribe-form input:focus { border-color: var(--blue); }
.subscribe-form button {
  padding: 12px 24px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 980px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  transition: background var(--trans);
}
.subscribe-form button:hover { background: var(--blue-h); }

/* ── RELATED SECTION ── */
.related-section { padding: 64px 0; background: var(--light); margin-top: 0; }
.related-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.related-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

/* ── PAGINATION ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 56px;
  font-size: 0.9rem;
  font-weight: 500;
}
.pagination a {
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 980px;
  transition: all var(--trans);
}
.pagination a:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
.pagination .page-number { color: var(--gray); }

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--gray);
}
.footer-nav { display: flex; gap: 20px; }
.footer-nav a:hover { color: var(--black); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .post-featured {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .posts-grid--small { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(20px);
    padding: 16px 24px 24px;
    border-bottom: 1px solid var(--border);
    gap: 4px;
  }
  .nav-toggle { display: flex; }

  .posts-grid, .posts-grid--small { grid-template-columns: 1fr; }
  .subscribe-form { flex-direction: column; }
  .post-title { font-size: 2rem; }
  .hero-title { font-size: 2.4rem; }
  .footer-inner { flex-direction: column; text-align: center; }
}
