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

:root {
  --primary-blue: #0072ce;
  --primary-orange: #ff8200;
  --dark-blue: #005baa;
  --text-gray: #4a5568;
  --light-gray: #f7fafc;
  --border-gray: #e2e8f0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-gray);
  background-color: var(--light-gray);
}

/* Header styles */
header {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  height: 40px;
  margin-right: 10px;
}

.search-container {
  display: flex;
  gap: 0.5rem;
  flex: 0 1 400px;
}

#searchInput {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-gray);
  border-radius: 4px;
  width: 100%;
  font-size: 0.95rem;
}

#searchButton {
  padding: 0.5rem 1.5rem;
  background-color: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#searchButton:hover {
  background-color: var(--dark-blue);
}

/* Breadcrumb styles */
.breadcrumb {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0 1rem;
  color: var(--text-gray);
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--primary-blue);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 0.5rem;
  color: var(--text-gray);
}

/* Main content styles */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.tiles-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.tile {
  background-color: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border-gray);
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-blue);
}

.tile h3 {
  color: var(--primary-blue);
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

.tile p {
  color: var(--text-gray);
  font-size: 0.95rem;
  line-height: 1.5;
}

.article-content {
  background-color: white;
  border-radius: 8px;
  padding: 2.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-width: 900px;
  margin: 2rem auto;
}

.article-content h1 {
  color: var(--primary-blue);
  margin-bottom: 1.5rem;
  font-size: 2rem;
  line-height: 1.2;
}

.article-content img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 8px;
}

/* Back button styles */
#backButton {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, background-color 0.2s;
  z-index: 1000;
}

#backButton:hover {
  background-color: var(--dark-blue);
  transform: scale(1.05);
}

/* Article list styles */
.article-list {
  background: white;
  border-radius: 8px;
  padding: 1rem;
}

.article-list-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-gray);
  cursor: pointer;
  transition: background-color 0.2s;
}

.article-list-item:last-child {
  border-bottom: none;
}

.article-list-item:hover {
  background-color: var(--light-gray);
}

.article-list-item h3 {
  color: var(--primary-blue);
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

/* Loading indicator */
.loading {
  display: none;
  text-align: center;
  padding: 2rem;
  color: var(--text-gray);
}

.loading::after {
  content: "Loading...";
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%,
  20% {
    content: "Loading.";
  }
  40% {
    content: "Loading..";
  }
  60%,
  100% {
    content: "Loading...";
  }
}
