/* === Base Theme Setup === */
:root {
  color-scheme: light dark;
}

body {
  margin: 0;
  font-family: 'InterVariable', system-ui, sans-serif;
  background: var(--bg, #f9f9f9);
  color: var(--fg, #222);
  transition: background 0.3s, color 0.3s;
}

body.dark {
  --bg: #121212;
  --fg: #eee;
}

@font-face {
  font-family: 'InterVariable';
  src: url('/assets/fonts/InterVariable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin-top:0;
  margin-bottom: 1em;
}

strong, b {
  font-weight: 700;
}
em, i {
  font-style: italic;
}

/* === Header & Footer === */
header, footer {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#profile-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#profile-header img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

#profile-header .nip05 {
  font-size: 0.75rem;
  background: #ddd;
  border-radius: 4px;
  padding: 0 0.25rem;
  color: #555;
}

.icon-light,
.icon-dark {
  display: none;
}

body:not(.dark) .icon-light {
  display: inline-block;
}
body.dark .icon-dark {
  display: inline-block;
}

.theme-icon {
  stroke: currentColor;
  vertical-align: middle;
}

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: inherit;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links a {
  font-size: 0.9rem;
  text-decoration: none;
  color: inherit;
  font-weight: 400;
  transition: font-weight 0.2s;
}

.nav-links a.active {
  font-weight: 700; /* bold */
}

/* === Hero Section === */
.hero {
  position: relative;
  width: 100%;
  height: 320px;
  background: url('/assets/images/hero.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4); /* dark overlay */
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 1rem;
  max-width: 640px;
}

.hero-name {
  font-size: 2rem;
  font-weight: bold;
  margin: 0.5rem 0;
  text-align: center;
}

.hero-tagline {
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
}

/* === Headings === */

h1 {
  max-width: 640px;
  margin: 2rem auto 1rem;
  padding: 0 1rem;
  font-size: 1.5rem;
  text-align: left;
}

/* === Posts Container === */
#posts,
#blog-posts {
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* === Posts === */
.post {
  background: white;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  color: #333;
  text-align: left; 
  word-wrap: break-word;
}

body.dark .post {
  background: #1e1e1e;
  color: #eee;
}

.post-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-top: 1rem;
}

.timestamp {
  font-size: 0.8em;
  color: #777;
  margin-top: 0.5rem;
}

.timestamp a {
  color: inherit;
  text-decoration: none;
}

.timestamp a:hover {
  text-decoration: underline;
}

#load-more {
  display: block;
  margin: 2rem auto;
  padding: 0.5rem 1rem;
  font-size: 1rem;
}

#load-more.hidden {
  display: none;
}

/* === Footer === */

footer {
  flex-direction: column;
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid #ccc;
  margin-top: 2rem;
}

footer .links {
  margin: 0.5rem 0;
}

footer .links a {
  margin: 0 0.5rem;
  font-weight: normal;
}

.nip05 {
  font-size: 0.75rem;
  background: #eee;
  border-radius: 4px;
  padding: 0 0.25rem;
  color: #555;
}

body.dark .nip05 {
  background: #333;
  color: #aaa;
}

.verified-badge {
  vertical-align: middle;
  margin-left: 4px;
  stroke: currentColor;
  transition: stroke 0.2s;
}

/* === Links List === */
#links-list {
  max-width: 555px;
  margin: 2rem auto;
  padding: 0 1rem;
  text-align: center;
}

.links-list-section {
  margin-bottom: 2rem;
}

.links-list-section h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.links-list-section p {
  color: #666;
  margin-bottom: 1.5rem;
}

body.dark .links-list-section p {
  color: #aaa;
}

.profile-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-links li {
  width: 100%;
}

.profile-links a {
  display: block;
  background: #222;
  color: #f9f9f9;
  padding: 1rem;
  border-radius: 50px;
  text-align: center;
  transition: background-color 0.2s, transform 0.2s;
}

body.dark .profile-links a {
  background: #333;
}

.profile-links a:hover {
  background: #333;
  transform: translateY(-1px);
}

body.dark .profile-links a:hover {
  background: #444;
}

/* === Markdown Table Styling === */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 1em;
  background: #fff;
}
th, td {
  border: 1px solid #ddd;
  padding: 0.5em 0.75em;
  text-align: left;
}
th {
  background: #f5f5f5;
  font-weight: 600;
}
tr:nth-child(even) td {
  background: #fafafa;
}

body.dark table {
  background: #181818;
}
body.dark th {
  background: #232323;
  color: #eee;
}
body.dark td {
  background: #181818;
  color: #ccc;
}
body.dark tr:nth-child(even) td {
  background: #222;
}

.blog-post {
  background: white;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  color: #333;
  text-align: left;
  word-wrap: break-word;
}
body.dark .blog-post {
  background: #1e1e1e;
  color: #eee;
}
