@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 75px; /* Clearance for fixed bottom banner ad */
}

/* Navbar Header */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  padding: 1rem 1.5rem;
}

.nav-brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
}

.nav-brand span {
  color: #38bdf8;
}

.search-box input {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid #334155;
  background: #1e293b;
  color: white;
  outline: none;
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #38bdf8;
}

/* Category Filter Bar */
.categories {
  display: flex;
  gap: 8px;
  padding: 1rem 1.5rem;
  background: white;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cat-btn {
  background: #f1f5f9;
  border: none;
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.cat-btn.active {
  background: var(--primary);
  color: white;
}

/* Grid Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  max-width: 1100px;
  margin: 25px auto;
  padding: 0 15px;
}

@media (min-width: 768px) {
  .layout {
    grid-template-columns: 2fr 1fr;
  }
}

/* Article Cards with Image Handling */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 25px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.card-img-wrapper {
  width: 100%;
  height: 220px;
  background: #e2e8f0;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-content {
  padding: 20px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* Category Badges */
.badge.tech { background: #dbeafe; color: #1e40af; }
.badge.business { background: #dcfce7; color: #166534; }
.badge.estate { background: #f3e8ff; color: #6b21a8; }
.badge.lifestyle { background: #fef3c7; color: #92400e; }

.title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.35;
  color: var(--text);
}

.excerpt {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.read-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.2s;
}

.read-btn:hover {
  background: var(--primary-hover);
}

/* Sidebar & Ads */
.widget {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.widget h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.ad-container {
  text-align: center;
  margin: 10px 0;
}

.ad-placeholder {
  background: #e2e8f0;
  border: 1px dashed #94a3b8;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 15px;
  border-radius: 8px;
}

.sidebar-ad { height: 250px; }
.sticky-ad { height: 50px; background: #0f172a; color: white; border: none; }

.ad-sticky-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 99;
  margin: 0;
}

/* Article Modal Reader */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  overflow-y: auto;
}

.modal-content {
  background: white;
  max-width: 720px;
  margin: 30px auto;
  padding: 25px;
  border-radius: 12px;
  position: relative;
}

.modal-img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
  background: #e2e8f0;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.8rem;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
}

footer {
  text-align: center;
  padding: 20px;
  background: #0f172a;
  color: white;
  margin-top: 40px;
}

.loader {
  text-align: center;
  color: var(--text-muted);
  padding: 30px;
  font-weight: 500;
}
