/*
 * Global styles for the PHP/MySQL news website.
 *
 * The design is inspired by major news portals. It defines the layout
 * and styling for the public pages as well as the admin interface.
 */

body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  color: #333;
  line-height: 1.5;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

header {
  background-color: #ffffff;
  border-bottom: 1px solid #dddddd;
  padding: 20px 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  margin: 0;
  font-size: 32px;
}
.site-title a {
  text-decoration: none;
  color: #000;
}

.top-nav a {
  margin-left: 15px;
  text-decoration: none;
  color: #333;
  font-weight: bold;
}

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

main {
  padding: 20px 0;
}

footer {
  background-color: #f5f5f5;
  border-top: 1px solid #dddddd;
  padding: 20px 0;
  text-align: center;
  font-size: 14px;
  color: #666;
}

.articles {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.post-card {
  background-color: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 4px;
  overflow: hidden;
  flex: 1 1 calc(33.333% - 20px);
  display: flex;
  flex-direction: column;
  min-width: 280px;
}

.post-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.post-body h2 {
  font-size: 20px;
  margin: 0 0 10px;
}

.post-body p {
  font-size: 14px;
  color: #555;
  margin-bottom: 15px;
  flex-grow: 1;
}

.post-body .read-more {
  align-self: flex-start;
  text-decoration: none;
  color: #007bff;
  font-weight: bold;
}

.post-body .read-more:hover {
  text-decoration: underline;
}

.article h2 {
  font-size: 28px;
  margin-bottom: 10px;
}

.post-date {
  font-size: 14px;
  color: #888;
  margin-bottom: 15px;
}

.post-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  margin-bottom: 20px;
  border-radius: 4px;
}

.post-summary {
  font-style: italic;
  color: #555;
  margin-bottom: 20px;
}

.post-content {
  line-height: 1.6;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  color: #007bff;
  text-decoration: none;
}

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

.admin-login, .admin-dashboard, .admin-edit {
  background-color: #ffffff;
  padding: 20px;
  border: 1px solid #dddddd;
  border-radius: 4px;
}

.admin-login h2, .admin-dashboard h2, .admin-edit h2 {
  margin-top: 0;
}

.error {
  color: #d9534f;
  margin-bottom: 10px;
}

.error:empty {
  display: none;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 14px;
}

.admin-table th, .admin-table td {
  border: 1px solid #cccccc;
  padding: 8px;
  text-align: left;
}

.admin-table th {
  background-color: #f0f0f0;
}

.admin-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.admin-table a {
  color: #007bff;
  text-decoration: none;
}

.admin-table a:hover {
  text-decoration: underline;
}

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

form input[type="text"],
form input[type="password"],
form textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  box-sizing: border-box;
}

form textarea {
  min-height: 120px;
}

form button {
  margin-top: 15px;
  padding: 10px 15px;
  background-color: #007bff;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

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