/* Kagebe 2025 Modernization */
@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@300;400;600&family=Inter:wght@300;400;600&display=swap");

:root {
  /* Palette - Inspired by original but vibrant */
  --primary: #ffb347;
  /* Pastel Orange */
  --primary-dark: #ff9f1c;
  /* Vivid Orange */
  --secondary: #9b5de5;
  /* Purple for contrast/fun */
  --accent: #00bbf9;
  /* Cyan for highlights */
  --bg-body: #fff8f0;
  /* Warm white */
  --bg-card: #ffffff;
  --text-main: #2b2d42;
  --text-muted: #6d6875;

  /* Spacing & Radius */
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.brand {
  font-family: "Fredoka", sans-serif;
}

h3,
p,
li {
  margin-bottom: 1.16em;
}

li {
  margin-left: 1.2em;
}

/* --- Utilities --- */
.text-center {
  text-align: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.italic-muted {
  font-size: 0.9em;
  font-style: italic;
  color: var(--text-muted);
}

/* --- Header --- */
header {
  background: var(--bg-card);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.brand {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand span {
  color: var(--primary-dark);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

nav a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  transition: all 0.3s ease;
}

nav a:hover,
nav a.active {
  background-color: var(--primary);
  color: white;
  transform: translateY(-2px);
}

/* --- Mobile Menu Toggle --- */
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- Main Layout --- */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  /* Content + Sidebar */
  gap: 2rem;
}

/* --- Content Area --- */
#content-area {
  display: grid;
  gap: 2rem;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.5s ease-out forwards;
  opacity: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.card-image {
  width: 100%;
  height: 344px;
  /* height: 300px; */
  object-fit: cover;
  background-color: #eee;
}

.card-body {
  padding: 2rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--text-main);
  line-height: 1.2;
}

.card-text {
  color: #4a4a4a;
  margin-bottom: 1.5rem;
}

.card-text img {
  display: block;
  margin: auto;
  max-width: 100%;
  height: auto;
  padding: 0.3em;
}

.card-text dl {
  margin: 1rem 0;
}

.card-text dt {
  font-weight: 600;
  color: var(--primary-dark);
  margin-top: 1rem;
  font-size: 1.1em;
}

.card-text dd {
  margin-left: 1.5rem;
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

.card-text em {
  color: var(--secondary);
  font-style: italic;
}

.special-text {
  font-size: 0.9em;
  margin: 1rem 2rem;
  color: #555;
  font-style: italic;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f0f0f0;
  padding-top: 1rem;
}

.author-badge {
  background: #f0f0f0;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* --- Sidebar --- */
aside {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.widget {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.widget h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: var(--secondary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.widget ul {
  list-style: none;
}

.widget li {
  margin-bottom: 0.5rem;
}

.widget a {
  text-decoration: none;
  color: var(--text-main);
  transition: color 0.2s;
}

.widget a:hover {
  color: var(--primary-dark);
}

/* --- Search Box --- */
.search-box {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 10px;
}

.search-input {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid #ccc;
  width: 70%;
  font-family: inherit;
  transition: border-color 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-primary {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s, transform 0.2s;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.page-btn {
  border: none;
  background: var(--bg-card);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: all 0.2s;
}

.page-btn:hover,
.page-btn.active {
  background: var(--secondary);
  color: white;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Footer --- */
footer {
  background: var(--text-main);
  color: white;
  padding: 3rem 2rem;
  margin-top: 4rem;
  text-align: center;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
  margin: 0 1rem;
}

.public-domain {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.5rem;
  }

  .card-body {
    padding: 1.5rem;
  }

  .card-title {
    font-size: 1.5rem;
  }

  nav {
    display: none;
    /* Simple hide for now, would need JS toggle for full mobile menu */
    width: 100%;
    order: 3;
  }

  nav.open {
    display: flex;
    flex-direction: column;
    padding-top: 1rem;
  }

  .menu-toggle {
    display: block;
  }

  header {
    justify-content: space-between;
    padding: 1rem;
  }
}

/* --- 404 Page Specifics --- */
.error-page-container,
.centered-container {
  display: block;
  /* Override grid */
  max-width: 900px;
}

.error-content {
  width: 100%;
}

.error-content h1 {
  font-size: 6rem;
  color: var(--primary);
  margin-bottom: 0;
}

.error-content h2 {
  color: var(--secondary);
  margin-bottom: 2rem;
}

.error-body {
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
}

.error-link {
  color: var(--primary);
  font-weight: bold;
  text-decoration: none;
}

.error-link:hover {
  text-decoration: underline;
}

.error-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.search-404 {
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 400px;
  margin: 0 auto;
}

.legal-content h1 {
  color: var(--primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.legal-content h2 {
  color: var(--secondary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
}

.legal-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.legal-content ul {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
}

.legal-content blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  background: #f9f9f9;
  padding: 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.aviso {
  width: 100%;
  max-width: 800px;
  display: block;
  margin: 0 auto 2rem auto;
  border-radius: var(--radius-md);
}

#final {
  margin-top: 2rem;
  font-weight: bold;
  text-align: center;
}

.contact-form {
  background-color: #f9f9f9;
  padding: 20px;
  border: 1px dashed #ccc;
  margin-top: 20px;
  font-family: 'Courier New', Courier, monospace;
}

.contact-alert {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
  padding: 15px;
  margin-top: 20px;
  border-radius: var(--radius-md);
}

.stamp-signature {
  font-size: 0.7em;
  color: red;
  transform: rotate(-10deg);
  display: inline-block;
}

.contact-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.contact-form input[type="text"],
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  border: 1px solid #aaa;
  background-color: #eee;
}

.contact-form .fingerprint-box {
  border: 2px solid #333;
  height: 100px;
  width: 100px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #ccc;
  font-size: 0.8em;
  text-align: center;
}

.stamp-container {
  text-align: right;
  margin-top: 30px;
  position: relative;
}

.stamp-img {
  transform: rotate(-15deg);
  opacity: 0.8;
}
