/* ============================================================
   Tidewater — Blog landing page (index) styles
   Builds on styles-blog.css; adds index-specific patterns.
   ============================================================ */

/* ===== Landing hero ===== */
.tw-bi-hero {
  position: relative;
  background: var(--tw-dark);
  color: var(--tw-cream);
  overflow: hidden;
  isolation: isolate;
}
.tw-bi-hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse at 15% 25%, rgba(58,146,166,0.30) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(191,172,95,0.14) 0%, transparent 50%),
    var(--tw-dark);
}
.tw-bi-hero-paper {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='2.4' numOctaves='1' stitchTiles='stitch' seed='4'/><feColorMatrix values='0 0 0 0 0.30  0 0 0 0 0.22  0 0 0 0 0.12  0 0 0 1.6 -0.4'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px; mix-blend-mode: screen; opacity: 0.18;
}
.tw-bi-hero-inner {
  position: relative; z-index: 5;
  max-width: 1080px; margin: 0 auto;
  padding: 56px 32px 48px;
  text-align: center;
}
.tw-bi-hero-crumb {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-bottom: 20px;
  font-family: var(--tw-font-heading);
  font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: rgba(254,252,248,0.6);
}
.tw-bi-hero-crumb a { color: rgba(254,252,248,0.6); text-decoration: none; }
.tw-bi-hero-crumb a:hover { color: var(--tw-gold); }
.tw-bi-hero-crumb .sep { color: rgba(254,252,248,0.3); }
.tw-bi-hero-crumb .cur { color: var(--tw-gold); }

.tw-bi-hero h1 {
  font-family: var(--tw-font-heading);
  font-weight: 800;
  font-size: clamp(40px, 4.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  color: var(--tw-cream);
  margin: 0 0 18px;
  text-wrap: balance;
}
.tw-bi-hero h1 em { font-style: italic; font-weight: 300; color: var(--tw-gold); }
.tw-bi-hero p {
  font-family: var(--tw-font-body);
  font-size: 18px; line-height: 1.6;
  color: rgba(254,252,248,0.78);
  margin: 0 auto 28px;
  max-width: 600px;
}

.tw-bi-search {
  display: flex; align-items: center;
  background: rgba(254,252,248,0.08);
  border: 1.5px solid rgba(254,252,248,0.20);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  max-width: 540px; margin: 0 auto;
  transition: all .15s ease;
}
.tw-bi-search:focus-within {
  border-color: var(--tw-gold);
  background: rgba(254,252,248,0.12);
}
.tw-bi-search svg { width: 16px; height: 16px; color: rgba(254,252,248,0.5); flex-shrink: 0; }
.tw-bi-search input {
  flex: 1;
  background: transparent;
  border: 0; outline: 0;
  color: var(--tw-cream);
  font-family: var(--tw-font-body);
  font-size: 15px;
  padding: 11px 14px;
  min-width: 0;
}
.tw-bi-search input::placeholder { color: rgba(254,252,248,0.5); }
.tw-bi-search button {
  background: var(--tw-gold);
  color: var(--tw-dark);
  border: 0; border-radius: 999px;
  padding: 10px 20px;
  font-family: var(--tw-font-heading);
  font-weight: 700; font-size: 13px;
  cursor: pointer; transition: background .15s ease;
  white-space: nowrap;
}
.tw-bi-search button:hover { background: #d4c179; }

.tw-bi-hero-stats {
  display: flex; align-items: center; justify-content: center;
  gap: 28px; margin-top: 30px;
  font-family: var(--tw-font-body); font-size: 13px;
  color: rgba(254,252,248,0.6);
  flex-wrap: wrap;
}
.tw-bi-hero-stats strong {
  font-family: var(--tw-font-heading);
  color: var(--tw-cream); font-weight: 700;
  margin-right: 6px;
}

/* ===== Category filter (sticky) ===== */
.tw-bi-cats {
  position: sticky; top: 80px;
  z-index: 10;
  background: rgba(254,252,248,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--tw-border);
  padding: 14px 0;
}
.tw-bi-cats-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 0 32px;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.tw-bi-cat-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--tw-cream);
  border: 1.5px solid var(--tw-border);
  border-radius: 999px;
  font-family: var(--tw-font-heading);
  font-weight: 600; font-size: 13px;
  color: var(--tw-dark);
  cursor: pointer; user-select: none;
  transition: all .15s ease;
  white-space: nowrap;
}
.tw-bi-cat-chip:hover { border-color: var(--tw-teal); color: var(--tw-teal); }
.tw-bi-cat-chip.is-active {
  background: var(--tw-teal);
  border-color: var(--tw-teal);
  color: var(--tw-cream);
}
.tw-bi-cat-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px; padding: 0 6px;
  border-radius: 999px;
  background: var(--tw-warm-100);
  color: var(--tw-fg-muted);
  font-family: var(--tw-font-mono);
  font-weight: 700; font-size: 11px;
}
.tw-bi-cat-chip.is-active .tw-bi-cat-count {
  background: rgba(254,252,248,0.18);
  color: var(--tw-cream);
}

/* ===== Featured post (big editorial card) ===== */
.tw-bi-featured-section {
  background: var(--tw-cream);
  padding: 56px 0 32px;
  position: relative; overflow: hidden;
}
.tw-bi-featured-section::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='2.4' numOctaves='1' stitchTiles='stitch' seed='4'/><feColorMatrix values='0 0 0 0 0.30  0 0 0 0 0.22  0 0 0 0 0.12  0 0 0 1.6 -0.4'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px; mix-blend-mode: multiply; opacity: 0.05;
}
.tw-bi-featured-section > * { position: relative; z-index: 1; }

.tw-bi-featured-eyebrow-row {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
}
.tw-bi-featured-eyebrow-row .tw-divider { width: 36px; height: 2px; background: var(--tw-gold); }
.tw-bi-featured-eyebrow-row .tw-eyebrow { color: var(--tw-gold); }

.tw-bi-featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px; align-items: center;
  background: var(--tw-cream);
  border: 1px solid var(--tw-border);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: all .22s var(--tw-ease-standard);
}
.tw-bi-featured:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 56px rgba(23,35,37,.12);
  border-color: var(--tw-teal-100);
}
.tw-bi-featured-img {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--tw-teal-700) 0%, var(--tw-teal) 100%);
  position: relative; overflow: hidden;
}
.tw-bi-featured-img.gold { background: linear-gradient(135deg, #8a7a3d 0%, var(--tw-gold) 100%); }
.tw-bi-featured-img.sage { background: linear-gradient(135deg, var(--tw-sage) 0%, #88a071 100%); }
.tw-bi-featured-img.clay { background: linear-gradient(135deg, #9a5a3a 0%, var(--tw-clay) 100%); }
.tw-bi-featured-img img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
.tw-bi-featured-img::after {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='2.4' numOctaves='1' stitchTiles='stitch' seed='4'/><feColorMatrix values='0 0 0 0 0.30  0 0 0 0 0.22  0 0 0 0 0.12  0 0 0 1.6 -0.4'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px; mix-blend-mode: screen; opacity: 0.20;
}
.tw-bi-featured-body { padding: 40px 48px 40px 0; }
.tw-bi-featured-cat {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--tw-font-heading);
  font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--tw-teal-50); color: var(--tw-teal-700);
  margin-bottom: 18px;
}
.tw-bi-featured-cat.gold { background: rgba(191,172,95,0.18); color: #8a7a3d; }
.tw-bi-featured-cat.sage { background: rgba(100,125,87,0.18); color: var(--tw-sage); }
.tw-bi-featured-cat.clay { background: rgba(206,142,114,0.18); color: #9a5a3a; }
.tw-bi-featured-body h2 {
  font-family: var(--tw-font-heading);
  font-weight: 800;
  font-size: clamp(28px, 3.0vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.018em;
  color: var(--tw-dark);
  margin: 0 0 14px;
  text-wrap: balance;
}
.tw-bi-featured-body h2 em { font-style: italic; font-weight: 300; color: var(--tw-teal); }
.tw-bi-featured-body p {
  font-family: var(--tw-font-body);
  font-size: 16.5px; line-height: 1.6;
  color: var(--tw-fg-muted);
  margin: 0 0 24px;
}
.tw-bi-featured-meta {
  display: flex; align-items: center; gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--tw-divider);
  font-family: var(--tw-font-heading);
  font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--tw-fg-muted);
}
.tw-bi-featured-meta .sep { color: var(--tw-border-strong); }
.tw-bi-featured-meta .cta {
  margin-left: auto;
  color: var(--tw-teal);
  font-weight: 700; font-size: 13px;
}

/* ===== Posts grid ===== */
.tw-bi-grid-section {
  background: var(--tw-cream);
  padding: 32px 0 96px;
  position: relative; overflow: hidden;
}
.tw-bi-grid-section::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='2.4' numOctaves='1' stitchTiles='stitch' seed='4'/><feColorMatrix values='0 0 0 0 0.30  0 0 0 0 0.22  0 0 0 0 0.12  0 0 0 1.6 -0.4'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px; mix-blend-mode: multiply; opacity: 0.05;
}
.tw-bi-grid-section > * { position: relative; z-index: 1; }

.tw-bi-grid-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; margin-bottom: 32px; flex-wrap: wrap;
}
.tw-bi-grid-head h2 {
  font-family: var(--tw-font-heading);
  font-weight: 800;
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1.2; letter-spacing: -0.015em;
  color: var(--tw-dark); margin: 0;
}
.tw-bi-grid-head-count {
  font-family: var(--tw-font-mono);
  font-size: 12px; color: var(--tw-fg-subtle);
  letter-spacing: 0.06em;
}
.tw-bi-sort {
  font-family: var(--tw-font-heading);
  font-weight: 600; font-size: 12.5px;
  color: var(--tw-fg-muted);
}
.tw-bi-sort select {
  font-family: var(--tw-font-heading);
  font-weight: 700; font-size: 12.5px;
  color: var(--tw-dark);
  background: transparent;
  border: 0; outline: 0;
  cursor: pointer;
  margin-left: 4px;
}

.tw-bi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.tw-bi-card {
  background: var(--tw-cream);
  border: 1px solid var(--tw-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  display: flex; flex-direction: column;
  transition: all .22s var(--tw-ease-standard);
}
.tw-bi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(23,35,37,.12);
  border-color: var(--tw-teal-100);
}
.tw-bi-card-img {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--tw-teal-700) 0%, var(--tw-teal) 100%);
  position: relative; overflow: hidden;
  flex-shrink: 0;
}
.tw-bi-card-img.gold { background: linear-gradient(135deg, #8a7a3d 0%, var(--tw-gold) 100%); }
.tw-bi-card-img.sage { background: linear-gradient(135deg, var(--tw-sage) 0%, #88a071 100%); }
.tw-bi-card-img.clay { background: linear-gradient(135deg, #9a5a3a 0%, var(--tw-clay) 100%); }
.tw-bi-card-img img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
.tw-bi-card-img::after {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='2.4' numOctaves='1' stitchTiles='stitch' seed='4'/><feColorMatrix values='0 0 0 0 0.30  0 0 0 0 0.22  0 0 0 0 0.12  0 0 0 1.6 -0.4'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px; mix-blend-mode: screen; opacity: 0.20;
}
.tw-bi-card-body {
  padding: 22px 24px 24px;
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}
.tw-bi-card-cat {
  font-family: var(--tw-font-heading);
  font-weight: 700; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--tw-teal);
}
.tw-bi-card-cat.gold { color: #8a7a3d; }
.tw-bi-card-cat.sage { color: var(--tw-sage); }
.tw-bi-card-cat.clay { color: #9a5a3a; }
.tw-bi-card h3 {
  font-family: var(--tw-font-heading);
  font-weight: 800; font-size: 19px;
  line-height: 1.25; letter-spacing: -0.005em;
  color: var(--tw-dark); margin: 0;
  text-wrap: balance;
}
.tw-bi-card p {
  font-family: var(--tw-font-body); font-size: 14px;
  line-height: 1.55; color: var(--tw-fg-muted);
  margin: 0;
}
.tw-bi-card-meta {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--tw-font-mono);
  font-size: 11px; color: var(--tw-fg-subtle);
  letter-spacing: 0.04em;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--tw-divider);
}
.tw-bi-card-meta .sep { color: var(--tw-border-strong); }

/* ===== Empty / loading state ===== */
.tw-bi-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 32px;
  background: var(--tw-warm-100);
  border: 1px dashed var(--tw-border-strong);
  border-radius: 12px;
}
.tw-bi-empty h3 {
  font-family: var(--tw-font-heading); font-weight: 800;
  font-size: 22px; color: var(--tw-dark); margin: 0 0 10px;
}
.tw-bi-empty p {
  font-family: var(--tw-font-body); font-size: 14.5px;
  color: var(--tw-fg-muted); margin: 0 0 20px;
}

/* ===== Load more / pagination ===== */
.tw-bi-more {
  text-align: center;
  margin-top: 48px;
}
.tw-bi-more button {
  background: var(--tw-cream);
  border: 1.5px solid var(--tw-border-strong);
  color: var(--tw-dark);
  font-family: var(--tw-font-heading);
  font-weight: 700; font-size: 14px;
  padding: 14px 28px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}
.tw-bi-more button:hover {
  border-color: var(--tw-teal);
  color: var(--tw-teal);
}
.tw-bi-more-count {
  margin-top: 12px;
  font-family: var(--tw-font-mono);
  font-size: 11.5px;
  color: var(--tw-fg-subtle);
  letter-spacing: 0.06em;
}

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .tw-bi-featured { grid-template-columns: 1fr; }
  .tw-bi-featured-body { padding: 32px 32px 36px; }
  .tw-bi-grid { grid-template-columns: 1fr 1fr; }
  .tw-bi-cats { top: 0; }
}
@media (max-width: 640px) {
  .tw-bi-grid { grid-template-columns: 1fr; }
  .tw-bi-hero-stats { gap: 16px; }
}

/* ============================================================
   MOBILE RESPONSIVE — 768px breakpoint
   ============================================================ */
@media (max-width: 768px) {
  /* Hero padding */
  .tw-bi-hero-inner { padding: 40px 20px 36px; }

  /* Featured card */
  .tw-bi-featured { grid-template-columns: 1fr; }
  .tw-bi-featured-body { padding: 24px 20px 28px; }

  /* Filter chips — horizontal scroll instead of wrapping */
  .tw-bi-cats-inner {
    padding: 0 20px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }
  .tw-bi-cats-inner::-webkit-scrollbar { display: none; }
  .tw-bi-cat-chip { flex-shrink: 0; }

  /* Grid inner padding */
  .tw-bi-grid { padding: 0 20px; }
}

/* ============================================================
   MOBILE RESPONSIVE — 480px breakpoint
   ============================================================ */
@media (max-width: 480px) {
  /* Hero tighten */
  .tw-bi-hero-inner { padding: 32px 16px 28px; }
  .tw-bi-hero p { font-size: 16px; }

  /* Search bar — hide button text on very small screens */
  .tw-bi-search button span { display: none; }
  .tw-bi-search button { padding: 10px 14px; }

  /* Featured body */
  .tw-bi-featured-body { padding: 20px 16px 24px; }

  /* Filter chips padding tighten */
  .tw-bi-cats-inner { padding: 0 16px; }

  /* Grid */
  .tw-bi-grid { padding: 0 16px; }
}
