/* --- Site Colors --- */
:root {
  --primary-color: #1A1A1A;
  --secondary-color: #555555;
  --accent-color: #FDFDFD;
  --header-accent-color: #111111;
  --highlight-color: #FF8C00;
  --primary-gradient: linear-gradient(135deg, #FDFDFD, #F0F0F0);
  --secondary-gradient: linear-gradient(135deg, #FF8C00, #FFA733);
  --highlight-gradient: linear-gradient(135deg, #FF8C00, #FFD27F);
}

/* --- Reset / Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Source Serif Pro', Georgia, serif;
}

body {
  background-color: var(--accent-color);
  color: var(--primary-color);
  line-height: 1.75;
  font-size: 1rem;
  margin: 1px auto;
  max-width: 1300px;
}

/* --- Universal SVG safety scaling --- */
svg {
  max-width: 100%;
  height: auto;
}

/* Sans-serif UI elements */
header .logo,
nav a,
.share-btn,
.copy-btn,
#lang-bar a,
.rss-link {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Noto Sans', sans-serif;
}

/* Layout */
header,
main,
section {
  max-width: calc(100% - 6px);
  margin-left: auto;
  margin-right: auto;
}


h1, h2 {
  margin-top: 0.5rem;   /* reduce space above */
  margin-bottom: 0.2rem; /* optional: reduce space below */
  line-height: 1.3;   /* tighter line spacing */
  font-weight: 700;   /* bold, but controlled */
}

h1 {
  font-size: 1.2rem;    /* 32px if body = 16px */
}

h2 {
  font-size: 1.0rem;  /* 24px */
}


#content-stream {
  padding: 2rem 1.5rem 0 1.5rem;
}

/* Links */
a {
  text-decoration: none;
  color: var(--highlight-color);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
a:hover {
  color: #e67e00;
  text-shadow: 0 0 2px rgba(0,0,0,0.1);
}

/* --- Header --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 2rem;
  background: var(--primary-gradient);
  color: var(--primary-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-bottom: 2px solid var(--highlight-color);
}

header .logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

header nav {
  display: flex;
  gap: 2rem;
}

nav a {
  font-weight: 600;
  transition: opacity 0.3s ease;
}
nav a:hover {
  opacity: 0.85;
}

#nav-menu {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  padding: 0;
  margin: 0;
}

#nav-menu a {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  line-height: 1;
}


/* --- Share Bar --- */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem;
  margin: 2rem auto 1rem;
}

.share-btn,
.copy-btn {
  flex: 1 1 auto;          /* allow shrink/grow */
  min-width: 0;            /* fully shrinkable */
  font-size: 0.75rem;      /* smaller text */
  padding: 0.15rem 0.4rem; /* narrower buttons */
  border-radius: 9999px;
  border: 1px solid #fff;
  background: var(--highlight-gradient);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.share-btn:hover,
.copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(0,0,0,0.25);
  background: var(--secondary-gradient);
}

/* --- SVG inside share buttons --- */
.share-btn svg,
.copy-btn svg {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
  margin: 0 auto;
  flex-shrink: 0;
}

/* --- Mobile adjustments --- */
@media (max-width: 540px) {
  .share-bar {
    flex-wrap: nowrap;       /* keep buttons in one line */
    gap: 0.15rem;
    overflow-x: auto;        /* allow horizontal scroll if needed */
  }
  .share-btn,
  .copy-btn {
    min-width: 0;
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
  }
}

/* --- Language Bar --- */
#lang {
  display: flex;
  justify-content: center;
  margin: 0 auto 0.2rem;
}

#lang-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.05em;
  padding: 0.2em 0.2em;
  background: #fff;
  border-radius: 9999px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

#lang-bar a {
  padding: 0.2em 0.5em;
  border-radius: 9999px;
  font-size: 0.9em;
  font-weight: 600;
  color: #333;
  transition: background 0.2s ease, color 0.2s ease;
}

#lang-bar a:hover {
  background: var(--highlight-color);
  color: #fff;
}

.lang-sensitive {
  font-style: italic;
  opacity: 0.85;
  letter-spacing: 0.2px;
  font-size: 0.95rem;
  margin: 0.5rem auto 1rem auto;
  text-align: center;
  max-width: 90%;
}

html[lang="en"] .lang-sensitive {
  display: none;
}

html:not([lang="en"]) .lang-sensitive {
  display: block;
}

@media (max-width: 600px) {
  h1 { font-size: 1.2rem; }
  h2 { font-size: 1.0rem; }
}

@media (max-width: 600px) {
  #lang-bar a {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
  }
}

/* --- RSS icon --- */
.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.rss-link:hover {
  opacity: 0.8;
}

/* --- Footer --- */
footer {
  background: var(--primary-gradient);
  color: var(--primary-color);
  text-align: center;
  padding: 2.5rem 1rem;
  margin-top: 3rem;
  font-size: 0.9rem;
  line-height: 1.7;
  border-top: 4px solid var(--highlight-color);
}

footer a {
  color: var(--highlight-color);
  font-weight: 600;
  transition: opacity 0.3s ease;
}
footer a:hover {
  opacity: 0.75;
}
.arrow {
  display: inline-block;
  width: 0;
  height: 0;
}

.arrow.up {
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 8px solid currentColor;
}

.arrow.right {
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid currentColor;
}

/* --- Canonical URL (quiet, readable, gently spaced) --- */
canonic {
  display: block;
  margin: 0.4rem auto 0.8rem auto;  /* tight top, soft bottom */
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.3;
  opacity: 0.8;
}

canonic a {
  color: #9a9a9a;
  font-weight: 500;
  text-decoration: none;
  word-break: break-all;
}

canonic a:hover {
  color: #777;
  text-decoration: underline;
}
