/* MK Edit static site — layout inspired by a classic content-library blog */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f7fb;
  --text: #1a1a1a;
  --muted: #666666;
  --border: #e8e8ef;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  --max: 1160px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  z-index: 1000;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
  color: var(--text);
}

.brand img {
  height: 40px;
  width: auto;
  display: block;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-text .tagline {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 400;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.search-form input {
  width: min(280px, 42vw);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--bg-soft);
}

.search-form input:focus {
  outline: 2px solid rgba(99, 102, 241, 0.35);
  outline-offset: 1px;
  border-color: var(--accent);
  background: var(--bg);
}

.search-form button {
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.search-form button:hover {
  background: var(--accent-hover);
}

.nav-bar {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.nav-toggle {
  display: none;
  width: 100%;
  padding: 12px 0;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: center;
}

.nav-list > li {
  position: relative;
}

.nav-list > li > a {
  display: inline-block;
  padding: 12px 0;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9375rem;
}

.nav-list > li > a:hover {
  color: var(--accent);
  text-decoration: none;
}

.has-sub:hover .sub-nav,
.has-sub:focus-within .sub-nav {
  display: block;
}

.sub-nav {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 0;
  z-index: 60;
}

.sub-nav a {
  display: block;
  padding: 8px 14px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
}

.sub-nav a:hover {
  background: var(--bg-soft);
  text-decoration: none;
  color: var(--accent);
}

.layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 20px 56px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  align-items: start;
}

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

  .nav-toggle {
    display: block;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 12px;
  }

  .nav-list.is-open {
    display: flex;
  }

  .sub-nav {
    position: static;
    display: block;
    border: 0;
    box-shadow: none;
    padding: 0 0 0 12px;
    margin-top: 4px;
  }

  .has-sub:hover .sub-nav {
    display: block;
  }
}

.page-title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-intro {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.05rem;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.post-thumb {
  display: block;
  height: 200px;
  overflow: hidden;
  background: var(--bg-soft);
  margin: 0;
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-body {
  padding: 20px 22px 22px;
}

.post-body h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  line-height: 1.3;
}

.post-body h2 a {
  color: var(--text);
}

.post-body h2 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-meta {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.post-meta a {
  font-weight: 600;
}

.post-excerpt {
  margin: 0 0 14px;
  color: #333;
}

.read-more {
  font-weight: 600;
  font-size: 0.95rem;
}

.sidebar .widget {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
  background: var(--bg-soft);
}

.sidebar h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
}

.sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar li {
  margin-bottom: 10px;
}

.sidebar li a {
  color: var(--text);
  font-weight: 500;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 28px 20px 40px;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.footer-links a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
}

.footer-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Article */
.article {
  max-width: 720px;
}

.article-header {
  margin-bottom: 22px;
}

.article .post-meta {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.article-header h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.article .lead {
  font-size: 1.125rem;
  color: var(--muted);
  margin: 0 0 20px;
}

.article figure.hero {
  margin: 0 0 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article figure.hero img {
  width: 100%;
  max-height: min(52vh, 420px);
  height: auto;
  object-fit: cover;
  display: block;
}

.article figure.hero .thumb-credit {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.article figure.hero .thumb-credit a {
  font-weight: 600;
}

.article h2 {
  margin-top: 28px;
  font-size: 1.25rem;
}

.article h3 {
  margin-top: 22px;
  font-size: 1.1rem;
}

.article p {
  margin: 0 0 14px;
}

.article ul,
.article ol {
  margin: 0 0 16px;
  padding-left: 1.25rem;
}

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

.prompt-box {
  margin: 22px 0;
  padding: 16px 18px;
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  background: #f5f6ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.breadcrumb {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.breadcrumb a {
  font-weight: 600;
}

@media (max-width: 600px) {
  .search-form input {
    width: 100%;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
