/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  color: #222222;
  line-height: 1.75;
  background-color: #f7f5f2;
  background-image:
    linear-gradient(
      rgba(247, 245, 242, 0.86),
      rgba(247, 245, 242, 0.86)
    ),
    url('../images/background_learning_memory.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('../images/background_paper_grain.jpg');
  opacity: 0.05;
  pointer-events: none;
  z-index: -1;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: #8ca4b8;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #6a8499;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(247, 245, 242, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(140, 164, 184, 0.2);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1.15rem;
  font-weight: normal;
  letter-spacing: 0.03em;
  color: #222222;
  text-decoration: none;
}

.site-logo:hover {
  color: #8ca4b8;
  text-decoration: none;
}

.nav-desktop {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav-desktop a {
  font-size: 0.95rem;
  color: #444444;
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #8ca4b8;
  text-decoration: none;
}

.nav-desktop a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: #8ca4b8;
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #222222;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(247, 245, 242, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(140, 164, 184, 0.2);
  padding: 1rem 1.5rem 1.5rem;
  list-style: none;
}

.nav-mobile.open {
  display: block;
}

.nav-mobile li {
  margin-bottom: 0.75rem;
}

.nav-mobile a {
  font-size: 1rem;
  color: #444444;
  text-decoration: none;
  display: block;
  padding: 0.4rem 0;
}

.nav-mobile a:hover,
.nav-mobile a.active {
  color: #8ca4b8;
}

/* Layout Containers */
.content-wrapper,
.page-container,
.main-content,
.article-container,
.contact-container,
.privacy-container {
  max-width: 800px;
  margin: 2.5rem auto;
  padding: 2.5rem 2.75rem;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.wide-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* Typography */
h1 {
  font-size: 2rem;
  font-weight: normal;
  line-height: 1.3;
  margin-bottom: 1.25rem;
  color: #222222;
}

h2 {
  font-size: 1.5rem;
  font-weight: normal;
  margin: 2.5rem 0 1rem;
  color: #333333;
}

h3 {
  font-size: 1.2rem;
  font-weight: normal;
  margin: 1.5rem 0 0.75rem;
  color: #444444;
}

p {
  margin-bottom: 1.25rem;
}

.intro-italic {
  font-style: italic;
  color: #555555;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.section-block {
  margin-bottom: 2.5rem;
}

.section-block p:last-child {
  margin-bottom: 0;
}

/* Fade-in Animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Blog Dashboard */
.dashboard-section {
  margin-top: 3rem;
}

.dashboard-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.75rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.blog-card {
  display: block;
  padding: 1.75rem;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: #222222;
  transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  color: #222222;
}

.blog-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: #333333;
}

.blog-card p {
  font-size: 0.95rem;
  color: #555555;
  margin-bottom: 1rem;
  line-height: 1.65;
}

.card-link {
  font-size: 0.85rem;
  color: #8ca4b8;
  letter-spacing: 0.02em;
}

/* Curiosity List */
.curiosity-list {
  list-style: none;
  padding: 0;
}

.curiosity-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(140, 164, 184, 0.15);
  font-style: italic;
  color: #444444;
}

.curiosity-list li:last-child {
  border-bottom: none;
}

/* Article Pages */
.article-meta {
  font-size: 0.9rem;
  color: #777777;
  margin-bottom: 1.5rem;
}

.article-body p {
  text-align: justify;
  hyphens: auto;
}

.related-notes {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(140, 164, 184, 0.2);
}

.related-notes h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.related-notes ul {
  list-style: none;
  padding: 0;
}

.related-notes li {
  margin-bottom: 0.6rem;
}

.return-home {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.95rem;
}

/* Contact Form */
.contact-details {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(247, 245, 242, 0.5);
  border-radius: 12px;
}

.contact-details p {
  margin-bottom: 0.75rem;
}

.contact-form {
  margin-top: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: #444444;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: Georgia, serif;
  font-size: 1rem;
  border: 1px solid rgba(140, 164, 184, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: #222222;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #8ca4b8;
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.btn-submit {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-family: Georgia, serif;
  font-size: 1rem;
  background: #8ca4b8;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-submit:hover {
  background: #6a8499;
}

/* Privacy Policy */
.privacy-container h2 {
  font-size: 1.3rem;
  margin-top: 2rem;
}

.privacy-container h2:first-of-type {
  margin-top: 1.5rem;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  font-size: 0.85rem;
  color: #777777;
}

.site-footer a {
  color: #8ca4b8;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-desktop {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .content-wrapper,
  .page-container,
  .main-content,
  .article-container,
  .contact-container,
  .privacy-container {
    margin: 1.5rem 1rem;
    padding: 1.75rem 1.5rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  body {
    background-attachment: scroll;
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 0.85rem 1rem;
  }

  .site-logo {
    font-size: 1rem;
  }
}
