/* ==========================================================================
   Double Yummy — Mobile-first responsive styles
   ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #fafaf8;
}

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

a:hover {
  color: #b85a34;
  text-decoration: underline;
}

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

h1, h2, h3, h4 {
  line-height: 1.3;
  color: #2c2c2c;
}

/* --- Container --- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Header --- */
.site-header {
  background: #fff;
  border-bottom: 3px solid #d4764e;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #d4764e;
  letter-spacing: -0.5px;
}

.site-title:hover {
  text-decoration: none;
  color: #b85a34;
}

/* --- Mobile menu toggle --- */
.menu-toggle {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-icon {
  display: block;
  width: 24px;
  height: 2px;
  background: #333;
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: #333;
  position: absolute;
  left: 0;
}

.menu-icon::before { top: -7px; }
.menu-icon::after { top: 7px; }

/* --- Navigation --- */
.site-nav {
  display: none;
  width: 100%;
  padding-top: 0.75rem;
}

.site-nav.is-open {
  display: block;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.site-nav a {
  display: block;
  padding: 0.5rem 0;
  color: #555;
  font-weight: 500;
}

.site-nav a:hover {
  color: #d4764e;
  text-decoration: none;
}

/* --- Desktop nav --- */
@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    width: auto;
    padding-top: 0;
  }

  .site-nav ul {
    flex-direction: row;
    gap: 1.5rem;
  }

  .site-nav a {
    padding: 0;
  }
}

/* --- Main content --- */
.site-main {
  padding: 2rem 0;
  min-height: 60vh;
}

/* --- Hero (Start Here) --- */
.hero {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 2.5rem;
}

.hero-inner {
  display: flex;
  flex-direction: column;
}

.hero-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.hero-content {
  padding: 1.5rem;
}

.hero-content h1 {
  font-size: 1.6rem;
  color: #d4764e;
  margin-bottom: 0.75rem;
}

.hero-content p {
  color: #555;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.hero-content p a {
  text-decoration: underline;
}

.hero-search {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.hero-browse {
  text-align: center;
  padding-top: 0.5rem;
}

.hero-scroll-hint {
  font-size: 0.85rem;
  color: #999;
}

/* Pagefind UI overrides within hero */
.hero-search .pagefind-ui__search-input {
  border-radius: 6px;
  border: 2px solid #e8e8e4;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  min-height: 44px;
}

.hero-search .pagefind-ui__search-input:focus {
  border-color: #d4764e;
  outline: none;
}

.hero-search .pagefind-ui__search-clear {
  min-height: 44px;
}

/* Tablet: two-column hero */
@media (min-width: 600px) {
  .hero-inner {
    flex-direction: row;
  }

  .hero-image {
    flex: 0 0 35%;
    min-height: 0;
  }

  .hero-image img {
    aspect-ratio: auto;
    height: 100%;
    object-fit: cover;
  }

  .hero-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .visible-mobile {
    display: none;
  }
}

/* Desktop: larger hero */
@media (min-width: 900px) {
  .hero-image {
    flex: 0 0 40%;
  }

  .hero-content {
    padding: 2.5rem;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 1.05rem;
  }
}

/* --- Post list / cards --- */
.post-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .post-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .post-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease;
}

.post-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.post-card-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.post-card-content {
  padding: 1rem;
}

.post-card-title {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.post-card-title a {
  color: #2c2c2c;
}

.post-card-title a:hover {
  color: #d4764e;
  text-decoration: none;
}

.post-card-date {
  font-size: 0.85rem;
  color: #999;
  display: block;
  margin-bottom: 0.5rem;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Tag badges --- */
.tag-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: #f0ebe6;
  color: #8b6f5a;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 500;
}

.tag-badge:hover {
  background: #d4764e;
  color: #fff;
  text-decoration: none;
}

.tag-badge-sm {
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* --- Single post --- */
.post-header {
  margin-bottom: 1.5rem;
}

.post-title {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .post-title {
    font-size: 2.2rem;
  }
}

.post-meta {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 0.75rem;
}

.post-meta time {
  margin-right: 0.5rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.post-featured-image {
  margin-bottom: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
}

.post-featured-image img {
  width: 100%;
}

/* --- Post content --- */
.post-content {
  font-size: 1.05rem;
  line-height: 1.7;
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
}

.post-content h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.5rem;
  color: #d4764e;
}

.post-content img {
  border-radius: 6px;
  margin: 1rem 0;
}

.post-content a {
  text-decoration: underline;
}

.post-content ul, .post-content ol {
  margin: 0 0 1.25rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.3rem;
}

.post-content blockquote {
  border-left: 3px solid #d4764e;
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  color: #666;
  font-style: italic;
}

/* --- Post navigation --- */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e8e8e4;
}

.post-nav-link {
  display: block;
  padding: 0.75rem;
  background: #f8f7f5;
  border-radius: 6px;
}

.post-nav-link:hover {
  background: #f0ebe6;
  text-decoration: none;
}

.post-nav-older {
  text-align: right;
}

.post-nav-label {
  display: block;
  font-size: 0.8rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-nav-title {
  display: block;
  color: #d4764e;
  font-weight: 500;
  font-size: 0.95rem;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e8e8e4;
}

.pagination-link {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: #d4764e;
  color: #fff;
  border-radius: 4px;
  font-weight: 500;
}

.pagination-link:hover {
  background: #b85a34;
  color: #fff;
  text-decoration: none;
}

.pagination-info {
  font-size: 0.9rem;
  color: #888;
}

/* --- Tag cloud --- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag-cloud-item {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #555;
}

.tag-cloud-item:hover {
  background: #d4764e;
  color: #fff;
  border-color: #d4764e;
  text-decoration: none;
}

.tag-count {
  font-size: 0.8rem;
  color: #999;
}

/* --- Tag archive --- */
.tag-archive-title {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.tag-archive-count {
  color: #888;
  margin-bottom: 2rem;
}

/* --- Archive page --- */
.archive-year {
  font-size: 1.5rem;
  margin: 2rem 0 0.5rem;
  color: #d4764e;
}

.archive-month {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
  color: #666;
}

.archive-list {
  list-style: none;
  margin-left: 0;
}

.archive-item {
  padding: 0.35rem 0;
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.archive-item time {
  font-size: 0.85rem;
  color: #999;
  white-space: nowrap;
  min-width: 130px;
}

/* --- Search page --- */
.search-page h1 {
  margin-bottom: 1rem;
}

/* --- Error page --- */
.error-page {
  text-align: center;
  padding: 3rem 0;
}

.error-page h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #d4764e;
}

.error-page p {
  margin-bottom: 1.5rem;
  color: #666;
}

/* --- Footer --- */
.site-footer {
  background: #2c2c2c;
  color: #ccc;
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
}

.site-footer p {
  margin-bottom: 0.25rem;
}

.footer-sub {
  font-size: 0.85rem;
  color: #888;
}

/* --- Print --- */
@media print {
  .site-header,
  .site-footer,
  .post-nav,
  .pagination,
  .post-tags,
  .menu-toggle {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .post-content img {
    max-width: 50%;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}
