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

:root {
  --color-bg: #18183A;
  --color-text: #E5EBEA;
  --color-text-muted: #a8b0ae;
  --color-primary: #D1345B;
  --color-primary-hover: #21A179;
  --color-border: #2a2a52;
  --color-header-bg: #18183A;
  --color-footer-bg: #18183A;
  --max-width: 960px;
  --font-heading: Garamond, "EB Garamond", "Times New Roman", serif;
  --font-body: "Courier New", Courier, monospace;
  --font-size-base: 1rem;
  --line-height-base: 1.6;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === Skip Link === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* === Header === */
.site-header {
  background: var(--color-header-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
}

.header-mobile-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-mobile-bar .nav-toggle {
  display: block;
}

.header-title {
  text-align: center;
  padding: 1.5rem 1.5rem 0.5rem;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.25rem 1.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.header-lang-desktop {
  margin-left: auto;
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 300;
  font-style: italic;
  color: var(--color-text);
  text-decoration: none;
}

.site-logo:hover {
  color: var(--color-primary);
}

/* === Navigation === */
.site-nav {
  display: flex;
  align-items: center;
}

.nav-toggle {
  display: none;
  background: none;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  line-height: 1;
}

.nav-toggle-icon {
  display: block;
  width: 1.2rem;
  height: 2px;
  background: var(--color-text);
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  display: block;
  width: 1.2rem;
  height: 2px;
  background: var(--color-text);
  position: absolute;
  left: 0;
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}

.nav-list a {
  display: block;
  padding: 0.4rem 0.75rem;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  position: relative;
  transition: color 0.4s;
}

.nav-list a::before {
  content: "";
  position: absolute;
  width: 0;
  height: 1.5px;
  background: linear-gradient(to left, var(--color-primary), transparent);
  bottom: 0;
  left: 0.75rem;
  transition: width 0.4s;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--color-primary);
}

.nav-list a:hover::before,
.nav-list a[aria-current="page"]::before {
  width: calc(100% - 1.5rem);
}

/* === Language Switcher === */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: auto;
  flex-shrink: 0;
}

.lang-link {
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  text-decoration: none;
  color: var(--color-text-muted);
  transition: background 0.15s, color 0.15s;
}

.lang-link:hover {
  background: var(--color-primary);
  color: #fff;
}

.lang-active {
  color: var(--color-primary);
}

.lang-separator {
  color: var(--color-border);
}

/* === Main Content === */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

.page-content h1 {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: 2rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.page-content h2 {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.page-content h3 {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.page-content p {
  margin-bottom: 1rem;
}

.page-content a {
  color: var(--color-primary);
}

.page-content a:hover {
  color: var(--color-primary-hover);
}

.page-content ul,
.page-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.page-content strong {
  font-weight: 600;
}

.page-content em {
  font-style: italic;
}

/* === Footer === */
.site-footer {
  background: var(--color-footer-bg);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--color-primary);
}

/* === Redirect Page === */
.redirect-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 1rem;
}

.redirect-page a {
  color: var(--color-primary);
  text-decoration: underline;
  font-size: 1.25rem;
}

/* === Blog Posts === */
.blog-post {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-border);
}

.blog-post:last-child {
  border-bottom: none;
}

.blog-post h2 {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

.blog-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.blog-content {
  line-height: 1.7;
}

.blog-content p {
  margin-bottom: 1rem;
}

.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.blog-content a {
  color: var(--color-primary);
}

.blog-content a:hover {
  color: var(--color-primary-hover);
}

.blog-content blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--color-text-muted);
  font-style: italic;
}

/* === Coming Soon === */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  gap: 0.5rem;
}

.coming-soon h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 300;
  font-style: italic;
}

.coming-soon p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* === Responsive === */
@media (max-width: 700px) {
  .header-mobile-bar {
    display: flex;
  }

  .header-title {
    display: none;
  }

  .header-lang-desktop {
    display: none;
  }

  .header-mobile-bar .nav-toggle,
  .nav-toggle {
    display: block;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding-top: 0.5rem;
  }

  .nav-list.open {
    display: flex;
  }

  .header-inner {
    flex-wrap: wrap;
    padding-top: 0;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    padding: 0.75rem 1.5rem 0.4rem;
  }
}

/* === Images & Figures === */
.page-content figure {
  margin: 1.5rem 0;
}

.page-content figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.page-content figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* === Focus styles for accessibility === */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
