/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: #f5f5f5;
  color: #333;
}

/* Header */
.site-header {
  background-color: #222;
  color: #fff;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header h1 {
  font-size: 1.5rem;
}

.site-header nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 1rem;
  font-weight: bold;
}

.site-header nav a:hover {
  text-decoration: underline;
}

/* Main containers */
.admin-container,
.blog-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ===== Admin page styling ===== */
#login-section,
#post-section {
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

#login-section h2,
#post-section h2 {
  margin-bottom: 1rem;
}

form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 1rem;
}

form label input,
form label textarea {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

form label small {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
}

.form-buttons {
  margin-top: 1rem;
}

.form-buttons button {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  margin-right: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

.form-buttons button:hover {
  background-color: #0056b3;
}

.error {
  color: #c00;
  margin-top: 0.5rem;
}

.success {
  color: #080;
  margin-top: 0.5rem;
}

/* Existing posts in Admin */
#existing-posts {
  margin-top: 1rem;
}

.post-summary {
  border: 1px solid #ddd;
  background-color: #fafafa;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  position: relative;
}

.post-summary h4 {
  margin-bottom: 0.5rem;
}

.post-summary .post-date {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.post-summary .post-preview {
  margin-bottom: 0.5rem;
  color: #333;
}

.post-summary button.edit-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: #28a745;
  color: #fff;
  border: none;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
}

.post-summary button.edit-btn:hover {
  background-color: #218838;
}

/* ===== Blog page styling ===== */
#posts-container {
  margin-top: 2rem;
}

.post-card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.post-card header {
  background-color: #007bff;
  color: #fff;
  padding: 1rem;
}

.post-card header h2 {
  margin-bottom: 0.25rem;
}

.post-card header .post-date {
  font-size: 0.9rem;
  color: #e0e0e0;
}

.post-card .post-content {
  padding: 1rem;
  line-height: 1.5;
}

.post-card .post-attachments {
  padding: 0 1rem 1rem;
}

.post-card .post-attachments img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.post-card .post-attachments video {
  max-width: 100%;
  display: block;
  margin-bottom: 0.5rem;
}

.post-card .post-attachments a {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: #007bff;
  text-decoration: none;
}

.post-card .post-attachments a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
  .site-header,
  .admin-container,
  .blog-container {
    padding: 0 1rem;
  }
}

