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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1.6;
  color: #333;
  background-color: #fffaf4;
}

h1, h2, h3, h4 {
  font-family: "Playfair Display", Georgia, serif;
}

a {
  text-decoration: none;
  color: #a66a2e;
}

a:hover {
  text-decoration: underline;
}

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

/* header */
header {
  background-color: #f9e6cc;
  padding: 20px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

header h1 {
  font-size: 1.8rem;
  color: #5a3e19;
}

/* nav */
nav a {
  margin-left: 20px;
  font-size: 1rem;
  font-weight: 500;
}

nav a:hover {
  color: #5a3e19;
}

/* hamburger menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: #5a3e19;
  border-radius: 2px;
  transition: 0.3s;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translateY(8px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translateY(-8px);
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 30px;
  padding-top: 20px;
  color: #4a3415;
}

/* hero section */
.hero {
  background-color: #f5d9b0;
  text-align: center;
  padding: 80px 20px;
}

.hero h2 {
  font-size: 2.4rem;
  margin-bottom: 15px;
  color: #4a3415;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 25px;
  color: #4a3415;
}

/* buttons */
.btn {
  display: inline-block;
  background-color: #a66a2e;
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 1rem;
  transition: background 0.3s ease;
  cursor: pointer;
}

.btn:hover {
  background-color: #7a4f1f;
}

/* about section */
.about {
  padding: 60px 20px;
  background: #fff;
}

.about h3 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: #4a3415;
}

.about p {
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.about-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.about-text {
  flex: 1 1 55%;
}

.about-image {
  flex: 1 1 40%;
  display: flex;
  justify-content: flex-end;
}

.about-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Responsive stacking on smaller screens */
@media (max-width: 768px) {
  .about-content {
    flex-direction: column;
    text-align: center;
  }

  .about-image {
    justify-content: center;
    margin-top: 20px;
  }

  .about-text {
    text-align: center;
  }
}

/* blog section */
.blog {
  background-color: #f9f3ec;
  padding: 60px 20px;
}

.blog h3 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 40px;
  color: #4a3415;
}

/* carousel wrapper */
.post-carousel-wrapper {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

/* carousel */
.post-carousel {
  display: flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 20px;
  scroll-behavior: smooth;
  padding-bottom: 0;

  /* hide scrollbar completely */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.post-carousel::-webkit-scrollbar {
  display: none;
}

.post-card {
  flex: 0 0 50%;
  scroll-snap-align: center;
  max-width: 480px;
}

.post-card .substack-post-embed {
  width: 100%;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 6px;
  background: white;
}

/* carousel progress bar */
.carousel-progress {
  position: relative;
  height: 6px;
  width: 100%;
  background-color: #e0e0e0;
  border-radius: 3px;
  margin-top: 15px;
  overflow: hidden;
}

.carousel-progress-bar {
  height: 100%;
  background-color: #a66a2e;
  width: 0%;
  transition: width 0.25s ease;
}

/* view all posts button centered */
.center-btn {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  margin-bottom: 30px;
}

/* subscribe section */
.subscribe {
  background-color: #f5d9b0;
  text-align: center;
  padding: 60px 20px;
}

.subscribe h3 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: #4a3415;
}

.subscribe p {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.substack-embed iframe {
  max-width: 100%;
  width: 480px;
}

/* footer */
footer {
  background-color: #f9e6cc;
  padding: 20px;
  text-align: center;
  color: #5a3e19;
  font-size: 0.9rem;
}

/* responsive */
@media (max-width: 700px) {

  header h1 {
    font-size: 1.4rem;
  }

  nav {
    display: none;
    flex-direction: column;
    background-color: #f9e6cc;
    position: absolute;
    top: 70px;
    right: 20px;
    padding: 12px 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    min-width: 150px;
  }

  nav.active {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .post-card {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* CATEGORY FILTER BUTTONS */
.category-filters {
  text-align: center;
  margin-bottom: 20px;
}

.filter-btn {
  background-color: #f5d9b0;
  border: 1px solid #a66a2e;
  color: #5a3e19;
  padding: 8px 14px;
  margin: 0 5px;
  cursor: pointer;
  border-radius: 4px;
  white-space: normal;
  transition: 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: #a66a2e;
  color: #fff;
}

/* BIG IDEAS SECTION */
.big-ideas {
  background-color: #fff;
  padding: 60px 20px;
}

.big-ideas-content {
  display: flex;
  align-items: center;
  gap: 30px;
}

.big-ideas-image img {
  width: 100%;
  border-radius: 6px;
}

.big-ideas-text h3 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: #4a3415;
}

.big-ideas-text p {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

/* FOOTER ICONS */
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-icons {
  display: flex;
  gap: 20px;
}

.footer-icons a {
  color: #5a3e19;
  font-size: 3rem;
  transition: color 0.3s ease;
}

.footer-icons a:hover {
  color: #a66a2e;
}

@media (min-width: 700px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
  .footer-icons {
    gap: 16px;
  }

  .footer-icons a {
    font-size: 1.5rem; /* smaller on mobile */
  }
}

/* RESPONSIVE BIG IDEAS */
@media (max-width: 768px) {
  .big-ideas-content {
    flex-direction: column;
    text-align: center;
  }

  .big-ideas-image img {
    max-width: 100%;
  }
}

@media (max-width: 700px) {
  .category-filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 16px;
    justify-items: center;
  }

  .filter-btn {
    width: 100%;
    max-width: 110px;
    text-align: center;
    padding: 10px 8px;
    font-size: 0.9rem;
    white-space: normal;
    word-break: break-word;
  }
}
