/**
 * Serambi - Shared Styles
 * Brand Color: #285642
 * Mobile-first responsive design
 */

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

:root {
  --brand: #285642;
  --brand-dark: #193d2e;
  --brand-light: #e8eee8;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg: #fbf9f3;
  --bg-alt: #f2efe5;
  --bg-dark: #172c23;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --max-width: 1200px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --transition: 0.2s ease;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--brand-dark); }
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

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

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}
button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

ul, ol { list-style: none; }

/* ========== Skip Link ========== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--brand);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  z-index: 10000;
  font-weight: 600;
  transition: top var(--transition);
}
.skip-link:focus {
  top: 16px;
}

/* ========== Container ========== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}
.site-header.scrolled {
  box-shadow: var(--shadow);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { color: var(--brand); }
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--brand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
}
.logo-text span {
  color: var(--brand);
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-list a {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
  min-height: 44px;
}
.nav-list a:hover,
.nav-list a.active {
  color: var(--brand);
  background: var(--brand-light);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
}
.search-btn:hover {
  background: var(--bg-alt);
  color: var(--brand);
}

/* Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  gap: 5px;
  border-radius: var(--radius-sm);
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== Search Overlay ========== */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.search-overlay.active {
  opacity: 1;
  visibility: visible;
}
.search-overlay[aria-hidden="true"] {
  pointer-events: none;
}
.search-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 640px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 16px;
}
.search-header svg {
  flex-shrink: 0;
  color: var(--text-light);
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.1rem;
  font-family: var(--font);
  color: var(--text);
}
.search-input::placeholder {
  color: var(--text-light);
}
.search-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.search-close:hover {
  background: var(--bg-alt);
}
.search-results {
  min-height: 100px;
}
.search-hint, .search-count {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.search-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* ========== Hero Section ========== */
.hero {
  padding: 60px 0 50px;
  background: linear-gradient(135deg, var(--brand-light) 0%, #fff 50%, #f0f4ff 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,107,53,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.hero-badge-dot {
  width: 8px;
  height: 8px;
  background: var(--brand);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}
.hero h1 .highlight {
  color: var(--brand);
  position: relative;
}
.hero-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 580px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  min-height: 44px;
  text-decoration: none;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,107,53,0.3);
}
.btn-primary:hover {
  background: var(--brand-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,107,53,0.35);
}
.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 16px;
}
.btn-ghost:hover {
  color: var(--brand);
  background: var(--brand-light);
}

/* ========== Section ========== */
.section {
  padding: 60px 0;
}
.section-alt {
  background: var(--bg-alt);
}
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.section-title .accent {
  color: var(--brand);
}
.section-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 6px;
  max-width: 500px;
}
.section-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.section-link:hover {
  gap: 8px;
}

/* ========== Editorial Intro ========== */
.editorial-intro {
  padding: 50px 0;
  border-bottom: 1px solid var(--border-light);
}
.editorial-intro-inner {
  max-width: 720px;
}
.editorial-intro h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.editorial-intro p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ========== Cards ========== */
.card-grid {
  display: grid;
  gap: 24px;
}
.card-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.card-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.card-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.article-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.card-image-wrap {
  display: block;
  overflow: hidden;
}
.card-image-container {
  position: relative;
  padding-top: 56.25%;
  overflow: hidden;
  background: var(--bg-alt);
}
.card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.article-card:hover .card-image {
  transform: scale(1.05);
}

.card-body {
  padding: 20px;
}
.card-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-category {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  text-decoration: none;
  transition: opacity var(--transition);
}
.card-category:hover { opacity: 0.8; }

.card-rating {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.8rem;
}
.star { color: #fbbf24; }
.star.empty { color: #d1d5db; }
.rating-num {
  margin-left: 4px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}
.card-title a {
  color: var(--text);
  text-decoration: none;
}
.card-title a:hover {
  color: var(--brand);
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-light);
  flex-wrap: wrap;
}
.card-sep { color: var(--border); }
.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.tag {
  font-size: 0.72rem;
  color: var(--text-light);
  background: var(--bg-alt);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Featured card (large) */
.card-featured .card-title {
  font-size: 1.25rem;
}
.card-featured .card-desc {
  -webkit-line-clamp: 3;
}
.card-large .card-image-container {
  padding-top: 50%;
}

/* ========== Advertisement ========== */
.ad-slot {
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  margin: 40px 0;
}

/* ========== Newsletter ========== */
.newsletter {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 50px 40px;
  text-align: center;
  color: #fff;
  margin: 40px 0;
}
.newsletter h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.newsletter p {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 24px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}
.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}
.newsletter-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
}
.newsletter-input::placeholder {
  color: rgba(255,255,255,0.6);
}
.newsletter-input:focus {
  border-color: #fff;
}
.newsletter-btn {
  padding: 14px 24px;
  background: #fff;
  color: var(--brand);
  font-weight: 700;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: all var(--transition);
  white-space: nowrap;
  min-height: 44px;
}
.newsletter-btn:hover {
  background: var(--brand-light);
  transform: translateY(-1px);
}

/* ========== Footer ========== */
.site-footer {
  background: var(--bg-dark);
  color: #d1d5db;
  padding: 60px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand .logo {
  color: #fff;
  margin-bottom: 14px;
}
.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #9ca3af;
  max-width: 280px;
}
.footer-col h4 {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-col a {
  display: block;
  color: #9ca3af;
  font-size: 0.88rem;
  padding: 5px 0;
  transition: color var(--transition);
}
.footer-col a:hover {
  color: var(--brand);
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom p {
  font-size: 0.82rem;
  color: #6b7280;
}
.footer-bottom a {
  color: #6b7280;
  font-size: 0.82rem;
}
.footer-bottom a:hover {
  color: var(--brand);
}

/* ========== Breadcrumb ========== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-size: 0.85rem;
  color: var(--text-light);
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--text-secondary);
}
.breadcrumb a:hover {
  color: var(--brand);
}
.breadcrumb-sep {
  color: var(--border);
}

/* ========== Category Page ========== */
.category-hero {
  padding: 50px 0 40px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border-light);
}
.category-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.category-hero h1 .cat-icon {
  margin-right: 8px;
}
.category-hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
}

/* Filters */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 30px;
}
.filter-btn {
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all var(--transition);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.filter-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.filter-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.sort-select {
  margin-left: auto;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font);
  color: var(--text-secondary);
  background: #fff;
  min-height: 44px;
}

/* ========== Article Page ========== */
.article-hero {
  padding: 40px 0 30px;
}
.article-hero-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}
.article-header {
  max-width: 780px;
  margin: 0 auto;
}
.article-header .card-category {
  margin-bottom: 16px;
}
.article-header h1 {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}
/* Article Content */
.article-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 0 60px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}
.article-content p {
  margin-bottom: 20px;
}
.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 16px;
  letter-spacing: -0.01em;
}
.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 12px;
}
.article-content ul, .article-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li {
  margin-bottom: 8px;
}
.article-content blockquote {
  border-left: 3px solid var(--brand);
  padding: 12px 20px;
  margin: 24px 0;
  color: var(--text-secondary);
  font-style: italic;
  background: var(--brand-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-content code {
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Related Articles */
.related-articles {
  padding: 40px 0 60px;
  border-top: 1px solid var(--border-light);
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}
.pagination-list {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-btn {
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.page-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.page-dots {
  padding: 0 8px;
  color: var(--text-light);
}

/* ========== Back to Top ========== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(255,107,53,0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 900;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,107,53,0.4);
}

/* ========== Error / Empty State ========== */
.error-state, .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.error-state p, .empty-state p {
  margin: 16px 0;
}
.btn-retry {
  background: var(--brand);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* ========== Tool Card Specific ========== */
.tool-card .card-body {
  position: relative;
}
.tool-card .tool-rating-badge {
  position: absolute;
  top: -12px;
  right: 16px;
  background: var(--brand);
  color: #fff;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .card-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  /* Header */
  .menu-toggle {
    display: flex;
  }
  .main-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    flex-direction: column;
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto;
  }
  .main-nav.nav-open {
    transform: translateX(0);
  }
  .nav-list {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }
  .nav-list a {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-light);
  }

  /* Hero */
  .hero {
    padding: 40px 0 35px;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero-desc {
    font-size: 1rem;
  }
  .hero-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Grids */
  .card-grid-2,
  .card-grid-3,
  .card-grid-4 {
    grid-template-columns: 1fr;
  }

  /* Section */
  .section {
    padding: 40px 0;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .section-title {
    font-size: 1.35rem;
  }

  /* Category */
  .category-hero h1 {
    font-size: 1.7rem;
  }
  .filters-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filters-bar::-webkit-scrollbar {
    display: none;
  }

  /* Article */
  .article-header h1 {
    font-size: 1.7rem;
  }
  .article-content {
    font-size: 1rem;
  }

  /* Newsletter */
  .newsletter {
    padding: 35px 20px;
  }
  .newsletter-form {
    flex-direction: column;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.65rem;
  }
  .container {
    padding: 0 16px;
  }
  .card-body {
    padding: 16px;
  }
}

/* ========== Print ========== */
@media print {
  .site-header, .site-footer, .newsletter, .ad-slot,
  .back-to-top, .search-overlay, .related-articles {
    display: none !important;
  }
  .article-content {
    max-width: 100%;
  }
}

/* =========================================================
   Serambi — Extended Components (AdSense-Ready)
   Added for Trust Pages, Article Body, Guides, Tools & 404
   ========================================================= */

/* ---------- Page Hero (inner pages) ---------- */
.page-hero {
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border-light);
}
.page-hero h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  margin-bottom: 12px;
}
.page-hero .lead {
  color: var(--text-secondary);
  max-width: 680px;
  font-size: 1.05rem;
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 16px;
}
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--border); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--brand); }

/* ---------- Prose / Article Body ---------- */
.prose {
  max-width: 720px;
  font-size: 1.06rem;
}
.prose p { margin: 0 0 1.2em; }
.prose h2 {
  font-size: 1.55rem;
  margin: 2em 0 0.7em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--border-light);
}
.prose h3 { font-size: 1.25rem; margin: 1.6em 0 0.5em; }
.prose ul, .prose ol { margin: 0 0 1.2em 1.3em; }
.prose li { margin-bottom: 0.4em; }
.prose strong { color: var(--text); }
.prose a { text-decoration: underline; }
.prose blockquote {
  border-left: 4px solid var(--brand);
  background: var(--brand-light);
  padding: 12px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.4em 0;
  color: var(--text-secondary);
}
.prose img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.4em 0;
}

/* ---------- Table of Contents ---------- */
.toc {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 1.8em 0;
}
.toc h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); margin-bottom: 10px; }
.toc ol { margin: 0 0 0 1.1em; }
.toc a { color: var(--text); }
.toc a:hover { color: var(--brand); }

/* ---------- Article Meta / Author Card ---------- */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 18px 0 8px;
}
/* ---------- Abstracted callout (disclaimer) ---------- */
.disclaimer {
  font-size: 0.82rem;
  color: var(--text-light);
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 2em 0 0;
}

/* ---------- Trust / Policy pages ---------- */
.legal-page {
  max-width: 760px;
  padding: 48px 0 64px;
}
.legal-page h1 { font-size: 2rem; margin-bottom: 8px; }
.legal-page .updated { color: var(--text-light); font-size: 0.85rem; margin-bottom: 28px; }
.legal-page h2 { font-size: 1.3rem; margin: 1.8em 0 0.6em; }
.legal-page h3 { font-size: 1.05rem; margin: 1.3em 0 0.4em; color: var(--text); }
.legal-page p, .legal-page li { color: var(--text-secondary); line-height: 1.75; }
.legal-page ul, .legal-page ol { margin: 0 0 1em 1.3em; }
.legal-page a { text-decoration: underline; }
.legal-page .legal-meta { color: var(--text-secondary); }

/* ---------- Contact form ---------- */
.contact-wrap { max-width: 720px; }
.contact-form .field { margin-bottom: 20px; }
.contact-form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.contact-form input[type=text],
.contact-form input[type=email],
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  transition: border-color var(--transition);
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--brand);
}
.contact-form textarea { min-height: 160px; resize: vertical; }
.contact-note { color: var(--text-secondary); font-size: 0.9rem; margin-top: 12px; }

/* ---------- Empty state ---------- */
.empty-state-lg {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state-lg svg { color: var(--border); margin-bottom: 14px; }

/* ---------- Simple filter chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}
.chip:hover, .chip.active { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

/* ---------- Guides landing ---------- */
.guide-menu { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 18px; margin-top: 28px; }
.guide-card { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 22px; background: var(--bg); transition: box-shadow var(--transition); }
.guide-card:hover { box-shadow: var(--shadow); border-color: var(--border); }
.guide-card h3 { margin-bottom: 8px; }
.guide-card p { color: var(--text-secondary); font-size: 0.95rem; }
.guide-card .guide-count { color: var(--brand); font-size: 0.85rem; font-weight: 600; margin-top: 12px; display: inline-block; }


/* Serambi brand refinement: forest green and warm ivory */
:root {
  --brand: #285642;
  --brand-dark: #193d2e;
  --brand-light: #e8eee8;
  --text: #24332b;
  --text-secondary: #657168;
  --text-light: #89938b;
  --bg: #fbf9f3;
  --bg-alt: #f2efe5;
  --bg-dark: #172c23;
  --border: #e3e5dc;
  --border-light: #eeeee7;
}
body { background: var(--bg); color: var(--text); }
.site-header { background: rgba(251,249,243,.94); border-bottom: 1px solid rgba(40,86,66,.10); }
.logo { display: inline-flex; align-items: center; }
.site-wordmark { display:block; width:150px; height:36px; object-fit:contain; }
.btn-primary, .newsletter-btn { background: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); }
.card, .guide-card, .search-box, .article-single { border-color: var(--border); }
.prose { color: #34443a; }
.prose h2, .prose h3 { color: #203d2e; }
.editorial-expansion { margin-top: 2rem; }
.editorial-expansion h2 { margin-top: 2.1rem; }
@media (max-width: 640px) {
  .site-wordmark { width: 128px; height: 32px; }
}

/* =====================================================
   SERAMBI - LIGHT GREY CARD GRID REDESIGN
   No homepage hero banner
   ===================================================== */

:root {
  --brand: #526b83;
  --brand-dark: #3c5268;
  --brand-light: #e9eff5;
  --text: #252d36;
  --text-secondary: #687583;
  --text-light: #929da8;
  --bg: #f3f5f7;
  --bg-alt: #edf0f3;
  --bg-dark: #252d36;
  --border: #e1e6eb;
  --border-light: #e9edf1;
  --shadow-sm: 0 1px 4px rgba(30, 45, 60, .04);
  --shadow: 0 4px 14px rgba(30, 45, 60, .07);
  --shadow-lg: 0 8px 22px rgba(30, 45, 60, .09);
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 12px;
  --max-width: 1120px;
}

/* Base background and content width */
html {
  scroll-behavior: auto;
}

body {
  background: #f3f5f7;
  color: var(--text);
}

.container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Header */
.site-header {
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

.logo,
.logo-text {
  color: var(--text);
}

.logo-icon {
  background: var(--brand);
}

.nav-list a {
  color: var(--text-secondary);
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--brand-dark);
  background: var(--brand-light);
}

/* Homepage: remove hero banner */
#main-content > .hero {
  display: none !important;
}

/* Keep editorial introduction compact */
#main-content > .editorial-intro {
  padding: 22px 0 8px;
  border: 0;
}

.editorial-intro-inner {
  max-width: 760px;
}

.editorial-intro h2 {
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.editorial-intro p {
  font-size: .92rem;
  line-height: 1.65;
}

/* Section spacing */
.section {
  padding: 34px 0;
}

.section-alt {
  background: #edf0f3;
}

.section-header {
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.4rem;
  color: var(--text);
}

.section-title .accent {
  color: var(--brand);
}

.section-desc {
  font-size: .9rem;
}

/* Consistent article grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card-grid-2,
.card-grid-3,
.card-grid-4 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Clean white cards */
.article-card {
  min-width: 0;
  background: #fff;
  border: 1px solid #e6eaee;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease;
}

.article-card:hover {
  transform: none;
  border-color: #d8e0e8;
  box-shadow: var(--shadow);
}

.card-image-container {
  padding-top: 56.25%;
  background: #e9edf1;
}

.card-image {
  transition: none;
}

.article-card:hover .card-image {
  transform: none;
}

.card-body {
  padding: 16px;
}

.card-title {
  font-size: 1rem;
  line-height: 1.45;
}

.card-title a {
  color: var(--text);
}

.card-title a:hover {
  color: var(--brand-dark);
}

.card-desc {
  font-size: .85rem;
  line-height: 1.55;
}

.card-category {
  background: var(--brand-light);
  color: var(--brand-dark);
}

.tag {
  background: #f0f2f4;
  color: var(--text-secondary);
}

/* Buttons and links */
.btn-primary,
.button-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-primary:hover,
.button-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.section-link {
  color: var(--brand-dark);
}

/* Advertisement slots */
.ad-slot {
  background: #edf0f3;
  border-color: #dce2e8;
  color: var(--text-light);
}

/* Newsletter */
.newsletter {
  background: #e8edf2;
  color: var(--text);
  border: 1px solid var(--border);
}

.newsletter h3,
.newsletter p {
  color: var(--text);
}

/* Footer */
.site-footer,
footer {
  background: #252d36;
  color: #f3f5f7;
}

/* Tablet */
@media (max-width: 1024px) {
  .container {
    max-width: 960px;
  }

  .card-grid-2,
  .card-grid-3,
  .card-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 768px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  #main-content > .editorial-intro {
    padding-top: 18px;
  }

  .section {
    padding: 26px 0;
  }

  .section-header {
    margin-bottom: 16px;
  }

  .card-grid,
  .card-grid-2,
  .card-grid-3,
  .card-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .card-body {
    padding: 12px;
  }

  .card-title {
    font-size: .92rem;
  }

  .card-desc {
    font-size: .8rem;
  }

  .newsletter {
    padding: 28px 16px;
  }
}

/* Small phones */
@media (max-width: 380px) {
  .card-grid,
  .card-grid-2,
  .card-grid-3,
  .card-grid-4 {
    grid-template-columns: 1fr;
  }

  .card-body {
    padding: 14px;
  }
}

/* Reduce motion and rendering overhead */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}


/* ===== SERAMBI CENTERED LAYOUT & SIDE SPACE ===== */

:root {
  --max-width: 1040px;
  --page-width: 1040px;
}

/* Unified centered page */
.container {
  width: calc(100% - 40px) !important;
  max-width: var(--page-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Header logo and navigation aligned with page */
.site-header > .container {
  width: calc(100% - 40px) !important;
  max-width: var(--page-width) !important;
}

.header-inner {
  width: 100%;
  margin: 0 auto;
  justify-content: space-between;
}

/* Main sections use the same centered axis */
#main-content,
.site-footer,
footer {
  width: 100%;
}

#main-content > section {
  width: 100%;
}

/* Grid cards stay inside the centered content */
.card-grid {
  width: 100%;
  min-width: 0;
}

.article-card {
  min-width: 0;
}

/* Tablet */
@media (max-width: 1080px) {
  .container,
  .site-header > .container {
    width: calc(100% - 40px) !important;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .container,
  .site-header > .container {
    width: calc(100% - 32px) !important;
  }
}

/* Small mobile */
@media (max-width: 380px) {
  .container,
  .site-header > .container {
    width: calc(100% - 24px) !important;
  }
}


/* ===== SERAMBI COMPACT WORDMARK & LAYOUT ===== */

:root {
  --max-width: 900px;
  --page-width: 900px;
}

.container,
.site-header > .container {
  width: calc(100% - 40px) !important;
  max-width: 900px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Text-only vector wordmark */
.site-wordmark {
  display: block;
  width: 140px;
  height: 36px;
  flex-shrink: 0;
}

/* Compact header alignment */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start !important;
  gap: 20px;
  width: 100%;
}

.logo {
  flex: 0 0 140px;
  width: 140px;
  margin: 0;
  padding: 0;
}

.main-nav {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}

.nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  white-space: nowrap;
}

.nav-list a {
  padding-left: 9px;
  padding-right: 9px;
  font-size: 0.95rem;
}

.header-actions {
  flex: 0 0 auto;
  margin-left: 0;
  gap: 2px;
}

.search-btn {
  width: 38px;
  height: 40px;
}

/* Tablet navigation spacing */
@media (max-width: 1024px) and (min-width: 769px) {
  .header-inner {
    gap: 10px;
  }

  .nav-list a {
    padding-left: 6px;
    padding-right: 6px;
    font-size: 0.86rem;
  }

  .logo {
    flex-basis: 125px;
    width: 125px;
  }

  .site-wordmark {
    width: 125px;
  }
}

/* Preserve existing mobile navigation behavior */
@media (max-width: 768px) {
  .container,
  .site-header > .container {
    width: calc(100% - 32px) !important;
  }

  .header-inner {
    justify-content: space-between !important;
    gap: 8px;
  }

  .logo {
    flex: 0 0 140px;
    width: 140px;
  }
}

@media (max-width: 380px) {
  .container,
  .site-header > .container {
    width: calc(100% - 24px) !important;
  }
}


/* Homepage: three featured articles */
#featured-grid.card-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Homepage: editorial topic list */
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 28px;
  border-top: 1px solid var(--border);
}

.topic-list .topic-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: center;
  gap: 28px;
  padding: 25px 8px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

.topic-list .topic-row:hover {
  background: var(--bg-alt);
  box-shadow: none;
}

.topic-list .topic-row h3 {
  margin: 0;
  font-size: 1.15rem;
}

.topic-list .topic-row p {
  margin: 0;
  color: var(--text-secondary);
  font-size: .95rem;
}

.topic-list .guide-count {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 768px) {
  #featured-grid.card-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topic-list .topic-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  #featured-grid.card-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Footer brand contrast fix */
.site-footer .footer-brand .logo,
.site-footer .footer-brand .logo *,
.site-footer .footer-brand a {
  color: #ffffff !important;
  fill: #ffffff;
}

/* Article top advertisement */
.article-ad-placeholder {
  width: 300px;
  height: 250px;
  max-width: 100%;
  margin: 24px auto 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f3f3;
  border: 1px solid #e5e5e5;
  color: #888;
  font-size: 11px;
  letter-spacing: .08em;
  overflow: hidden;
}

.cover-image {
  display: block;
  width: 100%;
  max-width: 560px;
  max-height: 315px;
  height: auto;
  object-fit: contain;
  margin: 24px auto;
}

@media (max-width: 600px) {
  .article-ad-placeholder {
    margin: 18px auto 24px;
  }
  .cover-image {
    max-width: 100%;
    max-height: 240px;
  }
}


/* Unified editorial disclaimer */
.article-single .disclaimer {
  margin: 36px 0 24px;
  padding: 18px 20px;
  background: #f7f5ed;
  border: 1px solid #e5e0d2;
  border-left: 3px solid #71836b;
  border-radius: 8px;
  color: #4b514b;
  font-size: 14px;
  line-height: 1.7;
}

.article-single .disclaimer strong {
  display: block;
  margin-bottom: 6px;
  color: #303a32;
  font-size: 14px;
  font-weight: 650;
}

.article-single .disclaimer p {
  margin: 0;
  color: #4b514b;
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 600px) {
  .article-single .disclaimer {
    margin: 28px 0 20px;
    padding: 15px 16px;
    font-size: 13px;
  }
}
/* Compact breadcrumb - category and article pages */
.breadcrumb {
  margin: 8px 0 10px !important;
  padding: 0 !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  gap: 5px !important;
}

.breadcrumb li {
  margin: 0 !important;
  padding: 0 !important;
}

.article-breadcrumb {
  margin: 8px 0 10px !important;
}

.article-single h1 {
  margin-top: 8px !important;
}

/* Serambi GAM ad slots */
.ad-placement-wrap {
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
  margin: 18px auto;
  padding: 0 20px;
  text-align: center;
}
.ad-slot {
  min-height: 250px;
  margin: 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot.has-ad { min-height: 250px; }
.ad-hidden { display: none !important; }
@media (max-width: 767px) {
  .ad-placement-wrap { padding-left: 12px; padding-right: 12px; }
}