/* ============================================================
   Best AP Books — redesigned stylesheet
   Fonts: Poppins (headings) + Inter (body)
   Target: high school students, modern feel
   ============================================================ */

/* ── Reset / base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: #334155;
  background: #f1f5f9;
  line-height: 1.75;
}

a { color: #4f46e5; text-decoration: none; transition: color 0.15s; }
a:hover { color: #f97316; text-decoration: none; }

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

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.25;
  margin-bottom: 0.5em;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }
h5, h6 { font-size: 1rem; }

p { margin-bottom: 1em; }
ul, ol { padding-left: 1.5em; margin-bottom: 1em; }

/* ── Layout helpers ──────────────────────────────────────── */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.clearfix::after { content: ''; display: table; clear: both; }

/* ── Header ──────────────────────────────────────────────── */
#site-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.35);
}

#catcher { display: none; }
.sticky-navigation { background: transparent; }

#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

/* Logo */
.logo-wrap { flex-shrink: 0; }

#logo, #footer-logo {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0;
  letter-spacing: -0.02em;
}

#logo a { color: #ffffff; }
#logo a:hover { color: #fde68a; }

/* Nav */
#secondary-navigation { display: flex; align-items: center; gap: 4px; }

.toggle-mobile-menu {
  display: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
}

.navigation ul.menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 4px;
}

.navigation ul.menu li a {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  padding: 8px 16px;
  display: block;
  border-radius: 100px;
  transition: background 0.2s, color 0.2s;
}

.navigation ul.menu li a:hover,
.navigation ul.menu li.current-menu-item > a {
  background: rgba(255,255,255,0.2);
  color: #ffffff;
}

/* ── Banner / breadcrumb bar ─────────────────────────────── */
#banner-bottom {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 10px 0 14px;
}

.header-social { display: none; }

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

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  flex-wrap: wrap;
}

.breadcrumb a { color: rgba(255,255,255,0.85); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .icon-font { color: rgba(255,255,255,0.5); }

/* ── Main layout ─────────────────────────────────────────── */
#page { padding: 32px 0 48px; }

/* Home */
body.home #page { display: block; }
body.home .article { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

body.home .post-style {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

body.home .with-sidebar {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

body.home aside#sidebar { width: 280px; flex-shrink: 0; }

/* Interior: 2-column */
body.page #page,
body.archive #page,
body.category #page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* Single post: grid so related posts span full width */
body.single #page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
}

body.single #page article.article   { grid-column: 1; grid-row: 1; }
body.single #page aside#sidebar     { grid-column: 2; grid-row: 1; }
body.single #page .relatedPost-wrap { grid-column: 1 / -1; grid-row: 2; }

article.article, div.article { flex: 1 1 0; min-width: 0; }

/* ── Content card ────────────────────────────────────────── */
#content_box {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 36px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
}

.post-content h2,
.post-content h3 { margin-top: 1.6em; }

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 0.9rem;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.post-content table th,
.post-content table td {
  border: 1px solid #e2e8f0;
  padding: 10px 14px;
  text-align: left;
}

.post-content table th {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  border: none;
}

.post-content table tr:nth-child(even) td { background: #f8fafc; }
.post-content table tr:hover td { background: #f1f5f9; }

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar { width: 280px; flex-shrink: 0; }

#sidebar .widget {
  background: #ffffff;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
}

#sidebar .widget-title {
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4f46e5;
  border-bottom: 2px solid #e0e7ff;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

#sidebar .widget ul.menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

#sidebar .widget ul.menu li { border-bottom: 1px solid #f1f5f9; }
#sidebar .widget ul.menu li:last-child { border-bottom: none; }

#sidebar .widget ul.menu li a {
  display: block;
  padding: 8px 6px;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s, padding-left 0.15s;
}

#sidebar .widget ul.menu li a:hover,
#sidebar .widget ul.menu li.current-menu-item a {
  color: #4f46e5;
  padding-left: 10px;
}

/* Home sidebar */
body.home aside#sidebar .widget { background: #fff; border-radius: 16px; padding: 22px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06); }
body.home aside#sidebar .widget-title { font-family: 'Poppins', sans-serif; font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #4f46e5; border-bottom: 2px solid #e0e7ff; padding-bottom: 10px; margin-bottom: 14px; }
body.home aside#sidebar ul.menu { list-style: none; padding: 0; margin: 0; }
body.home aside#sidebar ul.menu li { border-bottom: 1px solid #f1f5f9; }
body.home aside#sidebar ul.menu li a { display: block; padding: 8px 6px; color: #475569; font-size: 0.88rem; font-weight: 500; transition: color 0.15s, padding-left 0.15s; }
body.home aside#sidebar ul.menu li a:hover { color: #4f46e5; padding-left: 10px; }

/* ── Home post cards ─────────────────────────────────────── */
.blogPost { display: flex; gap: 16px; align-items: flex-start; }

.post-image-left {
  flex-shrink: 0;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  width: 140px;
}

.post-image-left img {
  width: 140px;
  height: 100px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.post-image-left:hover img { transform: scale(1.05); }

.latestPost {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.latestPost:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(79,70,229,0.15);
}

.latestPost-content { flex: 1; min-width: 0; }

.latestPost-content .title {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
  line-height: 1.3;
}

.latestPost-content .title a { color: #1e293b; }
.latestPost-content .title a:hover { color: #4f46e5; }

.front-view-content {
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 10px;
  line-height: 1.6;
}

.readMore {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4f46e5;
  background: #eef2ff;
  padding: 4px 12px;
  border-radius: 100px;
  transition: background 0.2s, color 0.2s;
}

.readMore:hover { background: #4f46e5; color: #fff; }

.post-info {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 6px;
}

.post-info .fa { margin-right: 4px; }

/* Archive / category grid */
#content_box.column4,
#content_box.column3 { width: 100%; float: none; }

body.archive .grid,
body.category .grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Single post featured image */
.featured-thumbnail.single-featured {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}

.featured-thumbnail.single-featured img {
  width: 100%;
  height: auto;
}

/* Post meta (author, date, category) */
.post-info { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.82rem; color: #94a3b8; margin-bottom: 20px; }

/* ── Related Posts ───────────────────────────────────────── */
.relatedPost-wrap { padding: 0; }

.related-posts h4 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e0e7ff;
}

.related-posts .clear {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.related-posts article.latestPost {
  flex: 1 1 260px;
  padding: 0;
  overflow: hidden;
}

.related-posts a#featured-thumbnail { display: block; }
.related-posts a#featured-thumbnail img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  transition: transform 0.3s;
}
.related-posts a#featured-thumbnail:hover img { transform: scale(1.04); }

.related-posts .latestPost-content { padding: 14px 16px 16px; }

/* Author box */
.postauthor {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  margin-top: 28px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.postauthor h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: #94a3b8; margin-bottom: 8px; }
.postauthor-wrap { display: flex; gap: 16px; align-items: flex-start; }
.postauthor img.avatar { border-radius: 50%; width: 60px; height: 60px; flex-shrink: 0; }

/* ── Footer ──────────────────────────────────────────────── */
#site-footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 48px 0 0;
  font-size: 0.9rem;
}

#footer-logo a { color: #fff; }
#footer-logo a:hover { color: #a5b4fc; }

.footerTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 32px;
}

.footer-widgets {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 32px;
}

.f-widget { flex: 1 1 200px; }

.footer-widgets h3.widget-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #e2e8f0;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-widgets .menu { list-style: none; padding: 0; margin: 0; }

.footer-widgets .menu li a {
  color: #94a3b8;
  font-size: 0.88rem;
  display: block;
  padding: 5px 0;
  transition: color 0.15s;
}

.footer-widgets .menu li a:hover { color: #fff; }
.footer-widgets .textwidget { font-size: 0.88rem; line-height: 1.7; }

#copyright-note {
  margin-top: 16px;
  font-size: 0.8rem;
  color: #475569;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 16px 0;
}

/* ── Utility ─────────────────────────────────────────────── */
.nocomments { display: none; }
.header-social { display: none; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  body.home .post-style { flex-direction: column; }
  body.home aside#sidebar { width: 100%; }

  body.page #page,
  body.archive #page,
  body.category #page { flex-direction: column; }

  body.single #page {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  body.single #page article.article,
  body.single #page aside#sidebar,
  body.single #page .relatedPost-wrap {
    grid-column: 1;
    grid-row: auto;
  }

  #sidebar { width: 100%; }

  .footer-widgets { flex-direction: column; gap: 20px; }
  .footerTop { flex-direction: column; gap: 16px; text-align: center; }
}

@media (max-width: 640px) {
  .toggle-mobile-menu { display: block; }
  .navigation { display: none; }
  .navigation.open { display: block; width: 100%; }
  .navigation ul.menu { flex-direction: column; padding: 8px 0 12px; gap: 2px; }
  .navigation ul.menu li a { border-radius: 8px; }

  #content_box { padding: 20px; border-radius: 12px; }

  .blogPost { flex-direction: column; }
  .post-image-left { width: 100%; }
  .post-image-left img { width: 100%; height: 180px; }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
}
