/* ========== Global Variables ========== */
:root {
  --primary-color: #333;
  --secondary-color: lightblue;
  --link-hover-color: lightblue;
  --footer-color: #555;
  --background-color: #f0f0f0;
  --font-family: Arial, sans-serif;
  --font-size-base: 1rem;
  --font-size-header: 1.8rem;
  --spacing-sm: 0.625rem; /* 10px */
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --border-color: #ddd;
  --border-radius: 5px;
  --max-width: 75rem;
  --max-thumbnail-width: 100px;
  --max-image-width: 37.5rem;
}

/* ========== Reset Styles ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  font-family: var(--font-family);
}

body {
  max-width: var(--max-width);
  margin: var(--spacing-lg) auto;
  padding-left: var(--spacing-sm);
  padding-right: var(--spacing-sm);
}

/* ========== Layout - Header & Footer ========== */
footer {
  border-top: 0.5px solid var(--border-color);
}

/* ========== Navigation ========== */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding-top: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
}

nav a img {
  display: block;
  width: 5rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

nav ul li {
  display: inline;
}

nav ul li a {
  font-size: var(--font-size-base);
  text-decoration: none;
  color: var(--primary-color);
  position: relative;
  transition: color 0.3s ease;
}

nav ul li a::before {
  content: "";
  position: absolute;
  left: -0.25rem;
  width: calc(100% + 0.5rem);
  bottom: 0;
  height: 100%;
  background-color: var(--secondary-color);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  transform: skewX(-15deg);
}

nav ul li a:hover::before {
  opacity: 1;
}

nav ul li a:hover {
  color: var(--primary-color);
}

/* ========== Links ========== */

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--link-hover-color);
}

/* ========== Footer ========== */
.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 2rem;
  padding-top: var(--spacing-lg);
}

.footer-content h1 {
  font-size: var(--font-size-base);
}

.footer-section {
  flex: 1;
  min-width: 200px;
  padding: 0 var(--spacing-sm); /* Add padding to the left/right */
  margin-bottom: var(--spacing-md); /* Space between sections */
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 0.75rem; /* Increased margin for better spacing */
}

.footer-section ul li a {
  color: var(--footer-color);
  display: block; /* Makes the whole link clickable */
  padding: 0.25rem 0; /* Adds padding around the link */
}

.footer-section ul li a:hover {
  color: var(--link-hover-color);
}

.footer-bottom {
  text-align: center;
  font-size: 0.85rem;
  color: var(--footer-color);
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-sm);
}

/* ========== Responsive Media Queries ========== */
@media (max-width: 768px) {
  body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .footer__content {
    flex-direction: column;
    text-align: center;
    gap: 1rem; /* Reduced gap on smaller screens */
  }

  .footer__section {
    margin-bottom: 1rem; /* Add bottom margin to sections for better separation */
  }

  /* Optional: Adjust link size for mobile */
  .footer__section ul li a {
    font-size: 0.9rem; /* Slightly smaller font on smaller screens */
  }
}

/* ========== Posts ========== */
.post-link {
  text-decoration: none;
  color: inherit;
}

.post-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--border-radius);
  transition: background-color 0.3s ease;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.post-preview:hover {
  background-color: var(--background-color);
  cursor: pointer;
}

.post-thumbnail {
  width: var(--max-thumbnail-width);
  height: auto;
  border-radius: var(--border-radius);
}

.post-info {
  display: flex;
  flex-direction: column;
}

.post-info h1 {
  font-size: var(--font-size-base);
}

.post-meta {
  font-size: 0.9em;
  color: var(--primary-color);
}

.author {
  font-weight: bold;
  color: #222;
}

.date {
  font-style: italic;
  color: #444;
}

/* ========== Post Content ========== */
.post {
  max-width: 50rem;
  margin: var(--spacing-lg) auto;
  padding: 1.5rem;
  line-height: 1.6;
}

.post-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.post-content {
  text-align: justify;
  margin-top: 1rem;
}

/* ========== Figures ========== */
.responsive-img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.image-container {
  display: block;
  text-align: center;
  max-width: var(--max-image-width);
  margin: var(--spacing-lg) auto;
}

.image-caption {
  font-size: 0.9rem;
  color: #444;
  margin-top: 0.25rem;
  font-style: italic;
}

/* ========== Tags ========== */
.tags {
  margin-left: 1rem;
}

.tag {
  background: #eee;
  padding: 3px 6px;
  border-radius: 4px;
  margin-right: 5px;
  font-size: var(--font-size-base);
  color: var(--primary-color);
}

.tag-filter .tag {
  text-decoration: none;
}

.tag-filter .tag:hover {
  background: var(--secondary-color);
  text-decoration: none;
}
