/* External stylesheet for Online Library project */

:root {
  --max-width: 1000px;
  --accent: #3b82f6;
  --muted: #666;
  --bg-light: #f9f9f9;
}

/* Global styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #111;
  background-color: var(--bg-light);
  line-height: 1.6;
  padding: 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover, a:focus {
  text-decoration: underline;
}

/* Header / Navigation */
.site-header {
  background: var(--accent);
  color: white;
  padding: 1rem;
}

.site-header h1 {
  margin-bottom: 0.5rem;
}

.site-header nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

nav a {
  color: inherit;
  font-weight: 500;
}

/* Main content */
main {
  max-width: var(--max-width);
  margin: 1rem auto;
  padding: 0 1rem;
}

section {
  margin-bottom: 2rem;
}

/* Books section */
.book {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #fff;
  padding: 0.5rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.thumb {
  width: 90px;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.gallery-grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  border: 1px solid #ddd;
  transition: transform 0.2s ease;
}

.gallery-grid img:hover {
  transform: scale(1.05);
}

/* Forms */
form {
  display: grid;
  gap: 0.5rem;
  max-width: 540px;
  background: #fff;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.inline {
  display: inline;
  margin-left: 0.25rem;
  margin-right: 1rem;
}

/* Footer */
footer {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 1rem;
  text-align: center;
}

/* Utility */
.top-link {
  margin-top: 2rem;
  text-align: right;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .site-header nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  .book {
    flex-direction: row;
    gap: 0.5rem;
  }
}
