:root {
  --color-bg: #FAF7F2;
  --color-text: #1F2937;
  --color-muted: #6B7280;
  --color-accent: #2699f7;
  --color-border: #E5E7EB;

  --font-heading: 'Domine', serif;
  --font-body: 'Domine', serif;

  --max-width: 1100px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Ensure global scrollbar behavior to prevent 'jumping' layout */
html {
  overflow-y: scroll;
}

body {
  padding-top: 96px;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 80px 0;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
}

h2 {
  font-size: 2.1rem;
  margin-bottom: 32px;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  background: white;
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  left: 0; /* Prevents horizontal shifting on short pages */
}

.main-nav {
  margin-left: auto;
}

main {
  display: block;
  width: 100%;
}

.nav {
  height: 96px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: height 0.3s ease; /* Smooth transition for shrinking */
  padding: 0 24px; /* Locked padding ensures alignment across all pages */
}

.nav nav {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.nav a {
  margin-left: 24px;
  font-size: 0.95rem;
  color: var(--color-muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--color-text);
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0; /* Prevents the logo from squishing on small screens */
}

.logo img {
  display: block;
  height: 64px;
  width: auto;
  transition: height 0.3s ease;
}

.logo a{
  margin: 0px;
}

/* Standardization for the Shrink Effect */
.site-header.shrink .nav {
  height: 68px;
}

.site-header.shrink .logo img {
  height: 44px;
}

/* Hero */

.hero {
  position: relative;
  height: 75vh;
  min-height: 520px;
  overflow: hidden;
  padding: 0;
}

.hero-slider {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.8s ease-in-out;
}

.hero-slide {
  min-width: 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
}

.hero-content {
  display: flex;
  width:100%;
  justify-content: space-between;
  gap: 64px;
  color: #000000;
  align-items: center;
  text-align: center;
}

.hero-box {
  max-width: 520px;
  min-height: 500px;
  position: relative;
  background: none;
  padding: 36px;
  border-bottom: 1px solid var(--color-border);
  z-index: 1;
}

.hero-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: -1;
}

.hero-author {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--color-muted);
}

.hero-info {
  font-size: .8rem !important;
  color: #374151;
  margin-bottom: 28px;
  border-top: 1px solid var(--color-muted);
  padding-top: 16px;
  font-family: var(--font-heading);
  font-weight: 100;
}

.hero-box h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--color-muted);
}

.hero-box p {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--color-muted);
}

.hero-box img {
  height: 150px;
  width: auto;
}

/* Dots */
.hero-dots {
  position: absolute;
  z-index: 10;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  cursor: pointer;
  border: #aaaaaa solid 1px;
}

.hero-dot.active {
  background: white;
}


/* Button */
.btn {
  display: inline-block;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn:hover {
  border: 1px solid var(--color-bg);
  color: var(--color-bg);
  background-color: var(--color-accent);
}

.btnGray {
  display: inline-block;
  border: 1px solid var(--color-muted);
  color: var(--color-muted);
  padding: 8px 32px;
  border-radius: 4px;
  font-size: 0.9rem;
  text-decoration: none;
}

.btnGray:hover {
  border: 1px solid var(--color-bg);
  color: var(--color-bg);
  background-color: var(--color-accent);
}

.btn-amazon {
  display: inline-block;
  border: 1px solid var(--color-muted);
  color: var(--color-muted);
  padding: 8px 32px;
  border-radius: 4px;
  font-size: 0.9rem;
  text-decoration: none;
  margin-right: 16px;
}

.btn-amazon:hover {
  border: 1px solid var(--color-bg);
  color: var(--color-bg);
  background-color:  #FF9900;
}

.btn-trendyol {
  display: inline-block;
  border: 1px solid var(--color-muted);
  color: var(--color-muted);
  padding: 8px 32px;
  border-radius: 4px;
  font-size: 0.9rem;
  text-decoration: none;
  margin-right: 16px;
}

.btn-trendyol:hover {
  border: 1px solid var(--color-bg);
  color: var(--color-bg);
  background-color: #F27A1A;
}

.btn-kitapyurdu {
  display: inline-block;
  border: 1px solid var(--color-muted);
  color: var(--color-muted);
  padding: 8px 32px;
  border-radius: 4px;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn-kitapyurdu:hover {
  border: 1px solid var(--color-bg);
  color: var(--color-bg);
  background-color: #fdba00;
}


/* Books */
.books-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

.book-card {
  text-align: center;
} 

.book-card-text{
  display: block;
  height: 100px;
  overflow: hidden;
  font-size: 0.8rem;
}

.book-card img {
  width: 180px;
}


/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: white;
  padding-top: 64px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo img {
  height: 64px;
}

.footer-brand {
  font-size: 0.8rem;
  color: var(--color-muted);
  text-decoration: none;
}

.footer-brand a {
  color: var(--color-muted);
  text-decoration: none;
}

.footer-brand a:hover {
  color: var(--color-text);
  text-decoration: none;
}

.footer-social a {
  margin-left: 16px;
  font-size: 2rem;
  color: var(--color-muted);
  text-decoration: none;
}

.footer-social a:hover {
  color: var(--color-text);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  margin-top: 32px;
  padding: 16px 0;
  text-align: center;
  font-size: 0.8rem;
}


/* =========================
   MOBILE OPTIMIZATION
   ========================= */
@media (max-width: 768px) {

  body {
    padding-top: 72px;
  }

  section {
    padding: 48px 0;
  }

  h2 {
    font-size: 1.6rem;
    margin-bottom: 24px;
  }

  /* ---------- Header ---------- */
  .nav {
    height: 72px;
  }

  .logo img {
    height: 44px;
  }

  .nav nav a {
    margin-left: 16px;
    font-size: 0.85rem;
  }

  /* ---------- Hero ---------- */
  .hero {
    height: auto;
    min-height: unset;
  }

  .hero-slide {
    padding: 32px 0;
  }

  .hero-content {
    flex-direction: column;
    gap: 24px;
    align-items: center;
    text-align: center;
  }

  .hero-box {
    max-width: 100%;
    min-height: unset;
    padding: 24px;
  }

  .hero-box img {
    height: 120px;
    margin-bottom: 12px;
  }

  .hero-box h1 {
    font-size: 1.2rem;
  }

  .hero-author {
    font-size: 0.85rem;
  }

  .hero-info {
    font-size: 0.75rem !important;
    padding-top: 12px;
  }

  .btn {
    font-size: 0.85rem;
    padding: 6px 14px;
  }

  /* ---------- Hero dots ---------- */
  .hero-dots {
    bottom: 8px;
  }

  /* ---------- Books ---------- */
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .book-card img {
    width: 140px;
  }

  .book-card h3 {
    font-size: 0.9rem;
  } 

  .book-card p {
    font-size: 0.8rem;
    color: var(--color-muted);
  }

  /* ---------- Footer ---------- */
  .footer-grid {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }

  .footer-social a {
    margin: 0 8px;
    font-size: 1.6rem;
  }
}

/* Extra-small phones */
@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: 1fr;
  }

  .hero-box img {
    height: 120px;
  }
}

/* --- Desktop Reset --- */
.burger-menu {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--color-text);
  cursor: pointer;
}

@media (max-width: 768px) {
  .burger-menu {
    display: block;
  }

  .main-nav {
    /* Position it exactly under the header */
    position: absolute;
    top: 100%; /* Starts at the bottom of the header */
    left: 0;
    width: 100%;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    
    /* Animation: Vertical Slide/Fade */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease-in-out;
  }

  .main-nav.active {
    max-height: 300px; /* Adjust based on number of links */
    opacity: 1;
    padding: 20px 0;
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .nav-links a {
    margin: 0 !important;
    padding: 15px 24px;
    width: 100%;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 1.1rem;
    color: var(--color-text);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }
}


/* About Page */
.about-hero { background: #efebe5; text-align: center; padding: 100px 0; }
.subtitle { font-size: 1.2rem; color: var(--color-muted);padding-top: 10px; }
.about-grid { display: block;}
.about-content .container {
  max-width: 800px; /* Narrower text is easier to read for long bios */
}

.about-text {
  text-align: justify;
  color: var(--color-text);
  font-size: 1.05rem;
}
/* Book Detail Page */
.detail-wrapper { display: grid; grid-template-columns: 400px 1fr; gap: 60px; padding-top: 40px; }
.detail-image { margin-top: 55px;}
.detail-image img { width: 100%;}
.category-tag { color: var(--color-accent); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
.detail-info h1 { font-size: 3rem; margin: 10px 0; }
.author-name { color: var(--color-muted); margin-bottom: 30px; }
.description { margin-bottom: 30px; font-size: 1.1rem;text-align: justify; }
.book-meta {padding-top: 10px; margin-bottom: 30px; font-size: 0.9rem; }
.author-photo{
  width: 100px;
  height: auto;
  border-radius: 50%;
  float: left;
  margin-right: 16px;
}
.author-text{
   margin-bottom: 30px; font-size: 1.1rem; 
   text-align: justify;
}

/* --- Book Meta Table --- */
.book-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  font-size: 0.95rem;
  border-top: 1px solid var(--color-border);
}

.book-meta-table tr {
  border-bottom: 1px solid var(--color-border);
}

.book-meta-table th {
  text-align: left;
  padding: 12px 0;
  color: var(--color-text);
  font-weight: 600;
  width: 40%; /* Adjusts the label column width */
}

.book-meta-table td {
  padding: 12px 0;
  color: var(--color-muted);
  text-align: left;
}

@media (max-width: 768px) {
  .about-grid, .detail-wrapper { grid-template-columns: 1fr; gap: 30px; }
  .detail-image img { width: 250px; margin: 0 auto; display: block; }
  .detail-info h1 { font-size: 2rem; }

  .book-meta-table th {
    font-size: 0.9rem;
  }
  .book-meta-table td {
    font-size: 0.9rem;
  }
}


/* --- Book Detail Thumbnails --- */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 15px;
  margin-bottom: 20px;
  width: 100%;
}

.thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.thumb:hover {
  opacity: 1;
}

.thumb.active {
  opacity: 1;
}

/* Specific Mobile Fix for Book Page */
@media (max-width: 768px) {
  .detail-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers the content on mobile */
    text-align: center;
    gap: 20px;
  }

  .detail-image {
    width: 100%;
    max-width: 320px; /* Limits the size of the whole image area */
    margin: 0 auto;
  }

  .thumb-grid {
    grid-template-columns: repeat(4, 70px); /* Forces small square sizes */
    justify-content: center; /* Centers the 4 squares */
    gap: 10px;
  }

.thumb-grid img {
  width: 70px;
  height: 70px;      /* Ensures they stay square */
  object-fit: cover; /* Crops the image to fill the square without stretching */
}

  .detail-image img#main-book-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
  }

  /* Align the table text back to left for readability even if container is centered */
  .book-meta-table th, .book-meta-table td {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .btn-amazon, .btn-trendyol, .btn-kitapyurdu {
    display: block;
    width: 100%;
    text-align: center;
    margin-right: 0;
    margin-bottom: 10px;
  }
}