/* --- 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: 3px auto;
  max-width: 1300px;
}

/* Sans-serif UI elements now use system fonts */
header .logo,
nav a,
.hero h1,
section h2,
.book h3,
.book .teaser,
.cta a,
.article h4,
.share-btn,
.copy-btn,
#lang-bar a,
#dirNav h2 a,
.rss-link,
button,
input,
textarea,
select {
  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;
}

#content-stream {
  max-width: calc(100% - 6px);
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 1.5rem;
  padding-top: 1rem;
  margin-top: 0;
  max-width: unset !important;
}

main {
  padding: 0rem 0rem;
}

/* 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;
}

/* --- Hamburger Menu --- */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  background: none;
  border: none;
}
.hamburger span {
  width: 28px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* REMOVE mobile hiding */
@media (max-width: 768px) {
  header nav {
    display: flex !important;
    position: static;
    background: transparent;
    flex-direction: row;
    width: auto;
    padding: 0;
    gap: 1rem;
  }

  .hamburger {
    display: none !important;
  }
}

/* --- Hero Section --- */
.hero {
  background: var(--primary-gradient);
  color: var(--primary-color);
  text-align: center;
  padding: 4rem 2rem;
  margin: 2.5rem auto;
  max-width: 1300px;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 1.2rem;
  max-width: 720px;
  margin: 0 auto 2rem;
  color: var(--secondary-color);
  line-height: 1.9;
}

@media (max-width: 600px) {
  .hero {
    padding: 2rem 1rem;
  }
  .hero h1 {
    font-size: 1.6rem;
  }
  .hero p {
    font-size: 1rem;
  }
}

/* --- Sections --- */
section {
  padding: 3rem 1.5rem;
  margin: 2.5rem auto;
  background-color: #fefefe;
  max-width: 1000px;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.04);
}

section h2 {
  color: var(--header-accent-color);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  margin-top: 0.4rem;
  padding-left: 0.6rem;
  border-left: 3px solid rgba(255,140,0,0.35);
}

/* --- Featured Books --- */
.books {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.8rem;
}

.book {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: #fff;
}

.book h3 {
  position: relative;
  z-index: 1;
  font-size: 1.2rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  margin: 0;
}

.book .teaser {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: 90%;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  margin-top: 20px;
}

.book:hover .teaser {
  opacity: 1;
}

.book:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

/* --- Call to Action --- */
.cta {
  text-align: center;
  margin-top: 2.5rem;
}

.cta a {
  display: inline-block;
  margin: 0.6rem;
  padding: 0.9rem 1.6rem;
  background: var(--highlight-gradient);
  color: #fff;
  font-weight: 700;
  border-radius: 28px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255,140,0,0.4);
}
.cta a:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(255,140,0,0.6);
}

/* --- Screen reader only --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Articles --- */
.articles {
  display: grid;
  gap: 1.8rem;
}

.article {
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.article:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.article h4 {
  margin-bottom: 0.8rem;
  color: var(--header-accent-color);
  font-weight: 600;
}

/* --- 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;
}

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

.share-btn,
.copy-btn {
  flex: 0 1 auto;
  min-width: 60px;
  font-size: 0.85rem;
  padding: 0.3rem 1rem;
  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);
}

@media (max-width: 540px) {
  .share-btn,
  .copy-btn {
    min-width: 50px;
    font-size: 0.75rem;
    padding: 0.35rem 0.8rem;
  }
}

/* --- Language Bar --- */
#lang {
  display: flex;
  justify-content: center;
  margin: 0 auto 0.5rem;
}
#lang-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25em;
  padding: 0.4em 0.3em;
  background: #fff;
  border-radius: 9999px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}
#lang-bar a {
  padding: 0.35em 0.9em;
  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) {
  #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;
}

/* Directory Navigation */
#dirNav {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
  border-radius: 0;
  border: 0 solid #ddd;
}

#dirNav h1 {
  margin: 0 0 0.5em 0;
}

#dirNav h2 a {
  text-decoration: none;
  color: #333;
}

#dirNav p {
  margin: 0;
  line-height: 1.4;
}

#dirNav p a {
  font-weight: bold;
  text-decoration: none;
}

#dirNav p a:hover {
  text-decoration: underline;
}
