/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #8b4513;
  --secondary-color: #d4a574;
  --accent-color: #a0522d;
  --text-color: #333;
  --light-bg: #faf8f5;
  --white: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

body {
  font-family: "Lato", sans-serif;
  line-height: 1.7;
  color: var(--text-color);
  background-color: var(--white);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.navbar {
  position: sticky;
  top: 0;
  background-color: #3d2817;
  box-shadow: 0 2px 10px var(--shadow);
  z-index: 1000;
  padding: 1rem 0;
  border-bottom: 2px solid #000000;
}

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

.nav-brand a {
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--white);
  transition: var(--transition);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--white);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

@media (max-width: 768px) {
  .nav-link {
    color: #3d2817;
  }
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: var(--transition);
}

.nav-link:hover::after {
  width: 100%;
}

/* Hero Section */
.hero {
  padding: 0;
  background-color: #3d2817;
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
}

.hero-image {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid #000000;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
  color: var(--white);
  width: 100%;
  padding: 0 20px;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 300;
  font-style: italic;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Introduction Section */
.intro-section {
  padding: 5rem 0;
  background-color: var(--light-bg);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
}

.intro-image {
  position: sticky;
  top: 100px;
}

.portrait-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 30px var(--shadow);
  object-fit: contain;
}

.section-title {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--accent-color);
}

.intro-text p {
  margin-bottom: 1.2rem;
  text-align: justify;
}

/* Content Section */
.content-section {
  padding: 4rem 0;
  max-width: 900px;
  margin: 0 auto;
}

.content-section p {
  margin-bottom: 1.5rem;
  text-align: justify;
}

.quote {
  background-color: var(--light-bg);
  border-left: 4px solid var(--accent-color);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  font-style: italic;
  color: #555;
}

.quote p {
  margin-bottom: 1rem;
}

.quote p:last-child {
  margin-bottom: 0;
}

/* Paintings Section */
.paintings-section {
  padding: 5rem 0;
  background-color: var(--white);
}

.section-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
  color: #666;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.6rem 1.5rem;
  background-color: var(--white);
  border: 2px solid var(--secondary-color);
  color: var(--text-color);
  cursor: pointer;
  border-radius: 25px;
  font-weight: 500;
  transition: var(--transition);
}

.filter-btn:hover {
  background-color: var(--light-bg);
}

.filter-btn.active {
  background-color: var(--accent-color);
  color: var(--white);
  border-color: var(--accent-color);
}

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

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 5px 15px var(--shadow);
  transition: var(--transition);
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item.hidden {
  display: none;
}

/* Biography Section */
.biography-section {
  padding: 5rem 0;
  background-color: var(--light-bg);
}

.bio-section {
  margin-bottom: 3rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.bio-section h3 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  margin-top: 2rem;
}

.bio-section p {
  margin-bottom: 1.2rem;
  text-align: justify;
}

.highlight {
  color: var(--accent-color);
  font-style: italic;
}

.highlight-quote {
  background: linear-gradient(135deg, #f5f0e8 0%, #faf8f5 100%);
  border-left: 5px solid var(--primary-color);
  padding: 2rem;
  margin: 2rem 0;
  font-size: 1.1rem;
}

/* References Section */
.references-section {
  padding: 5rem 0;
  background-color: var(--white);
}

.references-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.reference-card {
  background-color: var(--light-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 5px 15px var(--shadow);
}

.reference-card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.reference-card ul {
  list-style: none;
}

.reference-card li {
  margin-bottom: 0.8rem;
  padding-left: 1.5rem;
  position: relative;
}

.reference-card li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent-color);
}

.contact-section {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem;
  background-color: var(--light-bg);
  border-radius: 8px;
}

.contact-section h3 {
  color: var(--primary-color);
}

.contact-section a {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Books Section */
.books-section {
  padding: 5rem 0;
  background-color: var(--white);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  margin-top: 3rem;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.book-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 10px 30px var(--shadow);
  transition: var(--transition);
  background-color: var(--white);
}

.book-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.book-image {
  position: relative;
  width: 100%;
  padding-bottom: 140%; /* Aspect ratio for book covers */
  overflow: hidden;
  background-color: var(--light-bg);
}

.book-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.book-card:hover .book-image img {
  transform: scale(1.05);
}

.book-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(139, 69, 19, 0.95), transparent);
  padding: 2rem 1.5rem 1.5rem;
  transform: translateY(100%);
  transition: var(--transition);
}

.book-card:hover .book-overlay {
  transform: translateY(0);
}

.book-cta {
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background-color: var(--accent-color);
  border-radius: 5px;
  transition: var(--transition);
}

.book-card:hover .book-cta {
  background-color: var(--secondary-color);
  color: var(--text-color);
}

/* Landscape Book Layout */
.books-grid-landscape {
  margin-top: 3rem;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.book-card-landscape {
  width: 100%;
}

.book-image-landscape {
  padding-bottom: 50%; /* Landscape aspect ratio - full width */
}

.book-image-landscape img {
  object-fit: contain;
}

/* Footer */
.footer {
  background-color: var(--primary-color);
  color: var(--white);
  text-align: center;
  padding: 2rem 0;
}

.footer p {
  margin-bottom: 0.5rem;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--white);
  border: none;
  font-size: 2rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.lightbox-close {
  top: 20px;
  right: 20px;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--white);
    flex-direction: column;
    padding: 0;
    gap: 0;
    box-shadow: none;
    height: 0;
    overflow: hidden;
    transition: var(--transition);
  }

  .nav-menu li {
    display: none;
  }

  .nav-menu.active {
    height: auto;
    padding: 1rem;
    gap: 0.5rem;
    box-shadow: 0 5px 10px var(--shadow);
  }

  .nav-menu.active li {
    display: block;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .intro-grid {
    grid-template-columns: 1fr;
  }

  .intro-image {
    position: static;
  }

  .section-title {
    font-size: 2rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }

  .bio-section h3 {
    font-size: 1.5rem;
  }

  .lightbox-prev,
  .lightbox-next {
    padding: 0.5rem 1rem;
    font-size: 1.5rem;
  }

  .lightbox-close {
    padding: 0.5rem 1rem;
  }

  .books-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .book-card-landscape {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.8rem;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection Color */
::selection {
  background-color: var(--secondary-color);
  color: var(--white);
}
