/* ═══════════════════════════════════════════
   House & Garden — Global Stylesheet
═══════════════════════════════════════════ */

/* ─── Variables ─────────────────────────── */
:root {
  --cream: #f5f1ea;
  --warm-white: #faf8f4;
  --sand: #e6ddd0;
  --tan: #c4aa87;
  --brown: #8b6840;
  --dark: #2e2016;
  --text: #2a1f14;
  --muted: #7a6a58;
  --green: #6d9470;
  --serif: 'Playfair Display', Georgia, serif;
  --cormorant: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --max-w: 1240px;
  --side-pad: 24px;
}

/* ─── Reset ──────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--warm-white);
  color: var(--text);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--sans); cursor: pointer; border: none; background: none; }

/* ─── Layout helpers ──────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--side-pad);
}

/* ─── Animations ─────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.fade-up { animation: fadeUp .45s var(--ease) both; }

/* ─── Loading state ───────────────────────── */
.state-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 16px;
}
.loader {
  width: 30px; height: 30px;
  border: 2px solid var(--sand);
  border-top-color: var(--brown);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
.state-loading p {
  font-size: .72rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── Section divider ────────────────────── */
.section-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  padding-top: 8px;
}
.section-label {
  font-family: var(--serif);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dark);
  white-space: nowrap;
}
.section-rule { flex: 1; height: 1px; background: var(--sand); }

/* ─── Category tag ───────────────────────── */
.cat-tag {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--green);
  cursor: pointer;
  display: inline-block;
}
.cat-tag:hover { text-decoration: underline; }

/* ─── Article Card ───────────────────────── */
.card { cursor: pointer; }
.card-img {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--sand);
  margin-bottom: 14px;
}
.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .55s var(--ease);
}
.card:hover .card-img img { transform: scale(1.05); }
.card-cat {
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
  cursor: pointer;
}
.card-cat:hover { text-decoration: underline; }
.card-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--dark);
  margin-bottom: 8px;
  transition: color .2s;
}
.card:hover .card-title { color: var(--brown); }
.card-desc {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-date {
  font-size: .63rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tan);
}

/* ─── Cards Grid ─────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 36px 28px;
}

/* ─── HEADER ─────────────────────────────── */
.site-header {
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 0 var(--sand);
}
.header-brand { text-align: center; padding: 16px 20px 12px; }
.brand-link {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dark);
  cursor: pointer;
  display: inline-block;
}
.brand-link .amp {
  font-style: italic;
  font-weight: 400;
  color: var(--brown);
  font-size: .82em;
  margin: 0 .15em;
}
.site-nav { border-top: 1px solid var(--sand); }
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--side-pad);
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav-btn {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 2px solid transparent;
  transition: all .25s var(--ease);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-btn:hover,
.nav-btn.active { color: var(--dark); border-bottom-color: var(--brown); }

/* ─── FOOTER ──────────────────────────────── */
.site-footer {
  background: var(--dark);
  color: var(--sand);
  padding: 44px 24px;
  text-align: center;
  margin-top: 40px;
}
.footer-brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cream);
  margin-bottom: 12px;
  cursor: pointer;
  display: inline-block;
}
.footer-brand .amp {
  font-style: italic;
  font-weight: 400;
  color: var(--tan);
  font-size: .85em;
  margin: 0 .13em;
}
.footer-cats {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.footer-cat {
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--tan);
  cursor: pointer;
  transition: color .22s;
}
.footer-cat:hover { color: var(--cream); }
.footer-copy { font-size: .62rem; letter-spacing: .08em; color: #6a5848; }

/* ─── Pagination ─────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 56px;
  flex-wrap: wrap;
}
.pg-btn {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 11px 22px;
  border: 1px solid var(--sand);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: all .22s var(--ease);
}
.pg-btn:not(:disabled):hover {
  border-color: var(--brown);
  color: var(--brown);
  background: var(--cream);
}
.pg-btn:disabled { opacity: .3; cursor: not-allowed; }
.pg-info {
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 0 10px;
}

/* ═══════════════════════════════════════════
   HOME PAGE
═══════════════════════════════════════════ */
.home-wrap { padding-bottom: 64px; }
.home-wrap .container { padding-top: 40px; }

/* Banner */
.banner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  cursor: pointer;
  margin-bottom: 52px;
  background: var(--cream);
  border: 1px solid var(--sand);
  overflow: hidden;
}
.banner-img { overflow: hidden; min-height: 400px; max-height: 540px; }
.banner-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease);
}
.banner:hover .banner-img img { transform: scale(1.04); }
.banner-body {
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--cream);
}
.banner-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  font-weight: 600;
  line-height: 1.22;
  color: var(--dark);
  margin-bottom: 18px;
}
.banner-desc {
  font-family: var(--cormorant);
  font-size: 1.12rem;
  font-weight: 300;
  font-style: italic;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 28px;
}
.banner-meta {
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tan);
}
.banner .cat-tag { margin-bottom: 18px; }
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brown);
  margin-top: 20px;
  transition: gap .25s var(--ease);
}
.read-more svg { transition: transform .25s var(--ease); }
.banner:hover .read-more { gap: 14px; }
.banner:hover .read-more svg { transform: translateX(4px); }

/* ═══════════════════════════════════════════
   LIST PAGE
═══════════════════════════════════════════ */
.list-wrap { padding-bottom: 64px; }
.cat-hero {
  background: var(--cream);
  border-bottom: 1px solid var(--sand);
  text-align: center;
  padding: 52px 24px 40px;
  margin-bottom: 40px;
}
.cat-hero-name {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dark);
  margin-bottom: 8px;
}
.cat-hero-sub {
  font-family: var(--cormorant);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.cat-hero-count {
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tan);
}
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 40px 28px;
}

/* ═══════════════════════════════════════════
   DETAIL PAGE
═══════════════════════════════════════════ */
.detail-wrap { padding-bottom: 80px; }
.article-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px var(--side-pad) 40px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 40px;
  transition: color .22s;
  background: none;
  border: none;
}
.back-btn:hover { color: var(--brown); }
.back-btn svg { transition: transform .22s; }
.back-btn:hover svg { transform: translateX(-3px); }
.art-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.art-cat {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--green);
  cursor: pointer;
}
.art-cat:hover { text-decoration: underline; }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--sand); }
.art-date {
  font-size: .63rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tan);
}
.art-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.18;
  color: var(--dark);
  margin-bottom: 22px;
}
.art-lead {
  font-family: var(--cormorant);
  font-size: 1.22rem;
  font-weight: 300;
  font-style: italic;
  color: var(--muted);
  line-height: 1.62;
  margin-bottom: 30px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--sand);
}
.author-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}
.author-av {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--tan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.author-info {}
.author-name { font-size: .75rem; font-weight: 500; letter-spacing: .05em; color: var(--text); }
.author-role { font-size: .63rem; color: var(--muted); }
.read-time {
  margin-left: auto;
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tan);
}
.art-cover {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  margin-bottom: 36px;
}
.art-body {
  font-family: var(--cormorant);
  font-size: 1.12rem;
  font-weight: 400;
  line-height: 1.82;
  color: var(--text);
}
.art-body p { margin-bottom: 1.5em; }
.art-body h2,
.art-body h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--dark);
  margin: 1.8em 0 .65em;
  line-height: 1.3;
}
.art-body h2 { font-size: 1.55rem; }
.art-body h3 { font-size: 1.25rem; }
.art-body figure { margin: 2.2em -8px; }
.art-body figure img { width: 100%; max-height: 460px; object-fit: cover; }
.art-body figcaption {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 8px;
  padding: 0 8px;
}
.art-body ul,
.art-body ol { padding-left: 1.6em; margin-bottom: 1.4em; }
.art-body li { margin-bottom: .4em; }
.art-body strong { font-weight: 600; color: var(--dark); }

/* Related */
.related-section {
  border-top: 1px solid var(--sand);
  margin-top: 60px;
  padding-top: 40px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px;
  margin-top: 24px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — Tablet  ≤ 900px
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --side-pad: 20px; }

  .banner { grid-template-columns: 1fr; }
  .banner-img { min-height: 280px; max-height: 360px; }
  .banner-body { padding: 28px 24px 32px; }
  .banner-title { font-size: 1.45rem; }

  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px 20px; }
  .list-grid  { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px 20px; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — Mobile  ≤ 600px
═══════════════════════════════════════════ */
@media (max-width: 600px) {
  :root { --side-pad: 16px; }

  /* Header */
  .header-brand { padding: 12px 16px 10px; }
  .nav-btn { padding: 10px 12px; font-size: .65rem; letter-spacing: .12em; }

  /* Home banner → stacked, compact */
  .banner { border: none; border-bottom: 1px solid var(--sand); margin-bottom: 32px; }
  .banner-img { min-height: 220px; max-height: 260px; }
  .banner-body { padding: 20px 16px 24px; }
  .banner-title { font-size: 1.25rem; margin-bottom: 10px; }
  .banner-desc  { font-size: 1rem; margin-bottom: 14px; }
  .banner-meta  { font-size: .6rem; }
  .read-more    { font-size: .62rem; margin-top: 14px; }

  /* Grids → single column */
  .cards-grid  { grid-template-columns: 1fr; gap: 28px; }
  .list-grid   { grid-template-columns: 1fr; gap: 28px; }
  .related-grid { grid-template-columns: 1fr 1fr; gap: 20px; }

  /* Category hero */
  .cat-hero { padding: 36px 16px 28px; margin-bottom: 28px; }
  .cat-hero-name { font-size: 2rem; }

  /* Article detail */
  .article-inner { padding: 28px 16px 32px; }
  .art-title { font-size: 1.55rem; }
  .art-lead  { font-size: 1.05rem; }
  .art-body  { font-size: 1.05rem; }
  .art-body figure { margin: 1.8em -16px; }
  .art-cover { max-height: 260px; margin-bottom: 24px; }
  .back-btn  { margin-bottom: 24px; }
  .author-row { margin-bottom: 24px; }
  .read-time { display: none; }

  /* Section head on mobile */
  .section-head { margin-bottom: 20px; }

  /* Pagination */
  .pagination { gap: 8px; margin-top: 40px; }
  .pg-btn { padding: 10px 16px; font-size: .62rem; }

  /* Footer */
  .site-footer { padding: 32px 16px; }
  .footer-cats { gap: 14px; }

  /* Home container top padding */
  .home-wrap .container { padding-top: 28px; }
}

/* ─── Very small screens ≤ 380px ─────────── */
@media (max-width: 380px) {
  .brand-link { font-size: 1.3rem; letter-spacing: .1em; }
  .banner-img { min-height: 180px; max-height: 220px; }
  .related-grid { grid-template-columns: 1fr; }
}
