*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }

:root {
  --content-width: 740px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --line-height: 1.75;

  --bg: #1a1a1a;
  --bg-soft: #232323;
  --surface: #2a2a2a;
  --border: #3a3a3a;
  --text: #e5e5e5;
  --text-strong: #f5f5f5;
  --muted: #9ca3af;
  --accent: #6ec9a8;
  --accent-strong: #8fe0bf;
  --code-bg: #111111;
  --blockquote-bg: #232323;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

html[data-theme="light"] {
  --bg: #faf8f5;
  --bg-soft: #f3f1ec;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1a1a1a;
  --text-strong: #111111;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-strong: #0d5f58;
  --code-bg: #1f2937;
  --blockquote-bg: #f9fafb;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

[hidden] { display: none !important; }

body {
  /* margin: 0; */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--line-height);
  transition: background-color .2s ease, color .2s ease;
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
  /* line-height: 1.6; */
}

article .content {
  max-width: var(--content-width);
  margin: 0 auto;
  font-family: var(--font-body);
  line-height: var(--line-height);
  color: var(--text);
}

article { margin-bottom: 3rem; }
h1, h2 { line-height: 1.3; }
.content img { max-width: 100%; height: auto; }

.site-header {
  max-width: var(--content-width);
  margin: 2rem auto 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.site-header h1 a {
  color: var(--text-strong);
  text-decoration: none;
}
.site-tagline {
  font-size: .9rem;
  color: var(--muted);
  margin-top: .35rem;
}

.site-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-icon-light { display: none; }
html[data-theme="light"] .theme-icon-dark { display: none; }
html[data-theme="light"] .theme-icon-light { display: inline; }

.post-card { border-bottom: 1px solid var(--border); }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); }
.post-excerpt { color: var(--muted); }
.post-meta { color: var(--muted); }

.content a { color: var(--accent); }
.content blockquote {
  border-left: 3px solid var(--accent);
  background: var(--blockquote-bg);
  color: var(--text);
}
.content pre {
  background: var(--code-bg);
  color: #f9fafb;
}
.content code {
  color: var(--bg-soft);
  background: var(--text-strong);
}
.content th { background: var(--bg-soft); }
.content th, .content td { border: 1px solid var(--border); }

#load-more {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
}
#load-more:hover { background: var(--bg-soft); }

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.site-header {
  max-width: var(--content-width, 740px);
  margin: 2rem auto 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}
.site-header h1 {
  font-size: 1.5rem;
  line-height: 1.3;
}
.site-tagline {
  font-size: .9rem;
  color: var(--muted, #6b7280);
  margin-top: .35rem;
}

.post-card {
  padding: 1.25rem 0;
  border-bottom: 1px solid #e5e7eb;
}
.post-title {
  font-size: 1.25rem;
  line-height: 1.4;
  margin-bottom: .35rem;
}
.post-title a {
  text-decoration: none;
}

.post-excerpt {
  font-size: .95rem;
  color: var(--muted, #6b7280);
  line-height: 1.5;               
  height: 1.5em;                  
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;            
  margin-bottom: .4rem;
}

.post-meta {
  font-size: .8rem;
  color: var(--muted, #6b7280);
}

#post-list {
  max-width: var(--content-width, 740px);
  margin: 0 auto;
}

.load-more-msg {
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem 0 3rem;
}
#load-sentinel { height: 1px; }

.post-single {
  max-width: var(--content-width, 740px);
  margin: 0 auto;
}
.post-single-header {
  margin: 2rem 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}
.post-single-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: .6rem;
  color: var(--text-strong);
}
.post-single-meta {
  font-size: .9rem;
  color: var(--muted, #6b7280);
}

.content {
  font-size: 1.05rem;
  line-height: var(--line-height, 1.75);
  color: var(--text, #1a1a1a);
}
.content p,
.content ul,
.content ol,
.content blockquote,
.content pre,
.content table {
  margin-bottom: 1.25rem;
}
.content h2 {
  font-size: 1.4rem;
  line-height: 1.35;
  margin: 2rem 0 .75rem;
}
.content h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 .5rem;
}
.content ul,
.content ol {
  padding-left: 1.4rem;
}
.content li { margin-bottom: .35rem; }
.content blockquote {
  border-left: 3px solid var(--accent, #0f766e);
  padding: .4rem 0 .4rem 1rem;
  color: #4b5563;
  background: #f9fafb;
}
.content img {
  border-radius: 6px;
  margin: 1.25rem auto;
}
.content a {
  color: var(--accent, #0f766e);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.content pre {
  background: #1f2937;
  color: #f9fafb;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: .9rem;
}
.content code {
  padding: .1rem .3rem;
  border-radius: 3px;
  font-size: .9em;
}
.content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}
.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
.content th,
.content td {
  border: 1px solid #e5e7eb;
  padding: .5rem .7rem;
  text-align: left;
}
.content th { background: #f9fafb; }

.related {
  max-width: var(--content-width, 740px);
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}
.related-title {
  font-size: 1.1rem;
  margin-bottom: .75rem;
}
.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.related-list li {
  padding: .5rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.related-list a {
  color: var(--text, #1a1a1a);
  text-decoration: none;
  font-weight: 500;
}
.related-list a:hover { color: var(--accent, #0f766e); }
.related-list time {
  display: block;
  font-size: .8rem;
  color: var(--muted, #6b7280);
}

.back-link {
  max-width: var(--content-width, 740px);
  margin: 2rem auto 4rem;
  font-size: .9rem;
}
.back-link a {
  color: var(--accent, #0f766e);
  text-decoration: none;
}

.ad-slot {
  display: block;
  margin: 2rem auto;
  min-height: 280px;          
  width: 100%;
  max-width: var(--content-width);
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.ad-slot::before {
  content: "Advertisement";
  position: absolute;
  top: .35rem;
  left: .5rem;
  font-size: .65rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}
.ad-slot--inline { min-height: 250px; }
.ad-slot--footer { min-height: 250px; margin-top: 2.5rem; }

.ad-feed {
  min-height: 120px;
  margin: 1rem 0;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.ad-feed::before {
  content: "Advertisement";
  position: absolute;
  top: .35rem;
  left: .5rem;
  font-size: .65rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}

@media (max-width: 640px) {
  .ad-slot { min-height: 250px; }
  .ad-slot--inline { min-height: 200px; }
}

.site-footer {
  max-width: var(--content-width, 740px);
  margin: 4rem auto 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  font-size: .85rem;
  color: var(--muted, #6b7280);
  text-align: center;
}

.not-found {
  max-width: 540px;
  margin: 6rem auto;
  text-align: center;
}
.not-found h1 {
  font-size: 3rem;
  color: var(--accent, #0f766e);
  margin-bottom: .5rem;
}
.not-found a {
  color: var(--accent, #0f766e);
}

.legal-menu {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  font-size: .85rem;
}
.legal-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.legal-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.legal-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + .5rem);
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: .35rem 0;
  display: flex;
  flex-direction: column;
}
.legal-panel a {
  padding: .5rem .85rem;
  color: var(--text);
  text-decoration: none;
}
.legal-panel a:hover {
  background: var(--bg-soft);
  color: var(--accent);
}

@media (max-width: 640px) {
  .legal-toggle-label { display: none; }
  .legal-toggle { padding: .55rem .7rem; }
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0,0,0,.15);
}
.cookie-banner-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: .9rem 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: .875rem;
}
.cookie-banner-text {
  margin: 0;
  color: var(--text);
  flex: 1 1 320px;
}
.cookie-banner-text a {
  color: var(--accent);
}
.cookie-banner-actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}
.cookie-banner-actions button {
  padding: .5rem .9rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
}
.cookie-banner-actions .btn-primary {
  background: var(--accent);
  color: #fff;
}
.cookie-banner-actions .btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.cookie-banner-actions .btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 640px) {
  .cookie-banner-inner { padding: .75rem; }
  .cookie-banner-actions { width: 100%; }
  .cookie-banner-actions button { flex: 1; }
}
