/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif; /* Apply Montserrat globally */
}

/* Global variables */
:root {
  --tile-gap-desktop: 50px;
  --tile-gap-tablet: 40px;
  --tile-gap-mobile: 30px;
}

body {
  line-height: 1.6;
  background-color: white;
  color: #333;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

html {
  overflow-y: scroll;
}

/* Header */
.header {
  background: white;
  color: #333;
  padding: 20px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  font-family: 'Montserrat', sans-serif; 
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Logo */
.logo img {
  height: 55px;
  width: auto;
  display: block;
  margin-left: -220px;
  margin-top: 25px;
}

/* Navigation */
.nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 80px;
}

.nav a {
  position: relative;
  color: #333;
  text-decoration: none;
  font-weight: 550;
  font-size: 18px;
  padding-bottom: 5px;
  font-family: 'Montserrat', sans-serif;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #333;
  transition: all 0.3s ease;
}

.nav a:hover::after {
  width: 100%;
  left: 0;
}

/* Search Icon */
.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.2s ease;
  margin-right: -200px;
}

.search-btn svg {
  width: 35px;
  height: 35px;
  fill: #333;
  transition: fill 0.2s ease;
}

.search-btn:hover svg {
  fill: #007BFF;
}

.search-btn:active {
  background: rgba(0, 123, 255, 0.2);
  transform: scale(0.9);
}

/* Library Section */
.library-section {
  text-align: center;
  padding: 50px 20px;
  margin-bottom: 60px;
}

.library-section h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.library-section p {
  font-size: 1.2rem;
  margin-bottom: 40px;
  color: #555;
}

/* Category Tiles Grid */
.category-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--tile-gap-desktop);
  align-items: stretch;
  justify-items: center;
}

.tile {
  background-color: #f9f9f9;
  padding: 30px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.tile a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.tile img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  margin-bottom: 15px;
}

.tile h3 {
  font-size: 1.1rem;
  color: #333;
  text-align: center;
}

.tile:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Responsive Adjustments */
@media (max-width: 900px) {
  .category-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--tile-gap-tablet);
  }
}

@media (max-width: 600px) {
  .category-tiles {
    grid-template-columns: 1fr;
    gap: var(--tile-gap-mobile);
  }
}

/* Footer */
.footer {
  background: #222;
  color: white;
  font-family: 'Montserrat', sans-serif;
}

.footer-top {
  background: #6f51e5;
  text-align: center;
  padding: 15px;
}

.footer-top p {
  margin-bottom: 10px;
  font-size: 14px;
}

.footer-top .social-icons a {
  color: white;
  margin: 0 10px;
  font-size: 18px;
  transition: color 0.3s;
}

.footer-top .social-icons a:hover {
  color: #ddd;
}

.footer-main {
  display: flex;
  justify-content: space-evenly;
  align-items: flex-start;
  padding: 40px 20px;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-col {
  flex: 1 1 250px;
  max-width: 300px;
}

.footer-col h4 {
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 2px solid #6f51e5;
  display: inline-block;
  padding-bottom: 5px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-col ul li a:hover {
  color: white;
}

.footer-bottom {
  background: #111;
  text-align: center;
  padding: 15px;
  font-size: 14px;
}

/* Article page styles */
main.article-content {
  width: 90%;
  max-width: 900px;
  margin: 30px auto;
  font-family: 'Montserrat', sans-serif;
}

.article-content h1 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.article-content p {
  margin-bottom: 15px;
}

.article-content div {
  line-height: 1.7;
}
