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

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #666;
  --color-accent: #0055cc;
  --color-accent-hover: #003d99;
  --color-border: #e0e0e0;
  --color-card-bg: #f9f9f9;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, monospace;
  --max-width: 900px;
  --spacing: 1.5rem;
}

html { font-size: 18px; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
}

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

img { max-width: 100%; height: auto; display: block; }

/* ── Layout ───────────────────────────────────── */
header, main, footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

main { padding-top: 2rem; padding-bottom: 4rem; min-height: 60vh; }

/* ── Header / Nav ─────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.site-title {
  text-decoration: none;
  margin-right: auto;
}

.site-logo {
  height: 45px;
  width: auto;
  display: block;
}

nav { display: flex; gap: 1.2rem; }
nav a { color: var(--color-text); font-size: 0.9rem; font-weight: 500; }
nav a:hover { color: var(--color-accent); text-decoration: none; }

.lang-switcher { display: flex; gap: 0.6rem; font-size: 0.85rem; }
.lang-switcher a { color: var(--color-muted); }
.lang-switcher a.active { color: var(--color-accent); font-weight: 600; }
.lang-switcher a:hover { color: var(--color-accent); text-decoration: none; }

/* ── Footer ───────────────────────────────────── */
footer {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
  padding-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 3rem;
}
footer .footer-reg {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* ── Hero ─────────────────────────────────────── */
.hero { padding: 3rem 0 2rem; }
.hero h1 { font-size: 2.4rem; line-height: 1.2; margin-bottom: 1rem; }
.hero-content p { font-size: 1.1rem; color: var(--color-muted); max-width: 600px; }

/* ── Home Sections ────────────────────────────── */
.home-section { margin-top: 3rem; }
.home-section h2 { font-size: 1.4rem; margin-bottom: 1.2rem; border-bottom: 2px solid var(--color-border); padding-bottom: 0.5rem; }

/* ── Post List ────────────────────────────────── */
.post-list { list-style: none; }
.post-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--color-border); display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.post-date { color: var(--color-muted); font-size: 0.85rem; white-space: nowrap; }
.scope { color: var(--color-muted); font-size: 0.9rem; }

/* ── Cards (Portfolio grid) ───────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; margin-top: 1rem; }

.card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-card-bg);
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); text-decoration: none; }
.card img { width: 100%; height: 180px; object-fit: cover; }
.card-body { padding: 1rem; }
.card-body h2, .card-body h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.card-body .scope { font-size: 0.85rem; color: var(--color-muted); }
.card-body .url { font-size: 0.8rem; color: var(--color-muted); word-break: break-all; }

/* ── Buttons ──────────────────────────────────── */
.btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  color: var(--color-accent);
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--color-accent); color: #fff; text-decoration: none; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); }

/* ── Article ──────────────────────────────────── */
.article-header { margin-bottom: 2rem; }
.article-header h1 { font-size: 2rem; line-height: 1.2; }
.article-meta { color: var(--color-muted); font-size: 0.9rem; margin-top: 0.4rem; }
.featured-image { border-radius: 8px; margin-bottom: 2rem; width: 100%; }

.article-content h2 { font-size: 1.4rem; margin: 2rem 0 0.8rem; }
.article-content h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.article-content p { margin-bottom: 1rem; }
.article-content ul, .article-content ol { margin: 0 0 1rem 1.5rem; }
.article-content li { margin-bottom: 0.3rem; }
.article-content blockquote { border-left: 4px solid var(--color-border); padding-left: 1rem; color: var(--color-muted); margin: 1rem 0; }
.article-content code { font-family: var(--font-mono); font-size: 0.85em; background: #f3f3f3; padding: 0.1em 0.3em; border-radius: 3px; }
.article-content pre { background: #1e1e1e; color: #d4d4d4; padding: 1rem; border-radius: 6px; overflow-x: auto; margin-bottom: 1rem; }
.article-content pre code { background: none; padding: 0; }

/* ── Contact Form ─────────────────────────────── */
.contact-form { max-width: 560px; margin-top: 2rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.4rem; font-size: 0.9rem; }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--color-accent); }
.form-group textarea { resize: vertical; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 640px) {
  html { font-size: 16px; }
  .site-header { gap: 0.8rem; }
  .hero h1 { font-size: 1.8rem; }
  nav { gap: 0.8rem; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ── Print ────────────────────────────────────── */
@media print {
  header, footer, .lang-switcher, .btn, nav { display: none !important; }
  body { font-size: 12pt; color: #000; }
  a { color: #000; text-decoration: underline; }
  .card-grid { display: block; }
  .card { border: 1px solid #ccc; margin-bottom: 1rem; page-break-inside: avoid; }
  .featured-image { max-height: 300px; object-fit: contain; }
}

.hero-drawing {
  margin-top: 2rem;
  max-width: 100%;
  height: auto;
}
