/* =========================================================
   NEWS PORTAL — FRONTEND THEME
   Primary   : #ED3237 (brand red)
   Secondary : #FFA726 (brand orange)
   Text      : #000000
   Background: #FFFFFF
   Designed mobile-first to feel like a native news app.
   ========================================================= */

:root {
  --primary: #ED3237;
  --primary-dark: #c62026;
  --secondary: #FFA726;
  --secondary-dark: #f08c00;
  --text: #000000;
  --bg: #ffffff;
  --muted: #6b6b6b;
  --light: #f7f7f8;
  --border: #ececec;
  --radius: 14px;
  --header-h: 56px;
  --bottom-nav-h: 62px;
}

* { box-sizing: border-box; }

html, body {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--light);
  padding-bottom: var(--bottom-nav-h);
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4, .brand-link {
  font-family: 'Merriweather', serif;
  color: var(--text);
}

::selection { background: var(--secondary); color: #000; }

/* ---------- App bar (top header) ---------- */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.app-bar .top-strip {
  background: var(--primary);
  color: #fff;
  font-size: .72rem;
  padding: 4px 0;
}
.app-bar .top-strip .container { display: flex; justify-content: space-between; align-items: center; }

.app-bar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: .5rem;
}

.brand-link {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.brand-link span { color: var(--text); }

.app-bar-actions { display: flex; align-items: center; gap: .4rem; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  border: none;
  font-size: 1.15rem;
}
.icon-btn:hover, .icon-btn:focus { background: var(--light); color: var(--primary); }

/* Desktop nav row (hidden on mobile, shown from lg up) */
.desktop-nav { display: none; }
@media (min-width: 992px) {
  .desktop-nav { display: block; background: var(--primary); }
  .desktop-nav .nav-link { color: #fff; font-weight: 500; padding: 0.65rem 1rem; }
  .desktop-nav .nav-link:hover { background: rgba(255,255,255,.15); border-radius: 6px; }
  body { padding-bottom: 0; } /* no bottom tab bar needed on desktop */
}

/* Search bar shown under app bar on mobile */
.mobile-search { padding: .55rem 0; border-top: 1px solid var(--border); }
.mobile-search .form-control {
  border-radius: 24px;
  background: var(--light);
  border: 1px solid var(--border);
  padding: .5rem 1rem;
}
@media (min-width: 992px) { .mobile-search { display: none; } }

/* Off-canvas categories menu */
.offcanvas.app-offcanvas .offcanvas-header { background: var(--primary); color: #fff; }
.offcanvas.app-offcanvas .btn-close { filter: invert(1) brightness(2); }
.offcanvas.app-offcanvas .list-group-item {
  border: none;
  padding: .9rem 1rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.offcanvas.app-offcanvas .list-group-item.active { background: var(--primary); color: #fff; }

/* ---------- Main content ---------- */
main { min-height: 60vh; }

/* ---------- Post cards (feed) ---------- */
.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: transform .15s ease, box-shadow .15s ease;
}
.post-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.post-card .row { margin: 0; }
.post-card > .row > [class*="col-"] { padding: 0.9rem; }
.post-card img {
  width: 100%; height: 200px; object-fit: cover;
  border-radius: 0;
}
@media (min-width: 768px) {
  .post-card img { height: 170px; border-radius: 10px; }
  .post-card > .row > [class*="col-md-5"] { padding: 0.9rem 0.9rem 0.9rem 0.9rem; }
}
.post-card .category-badge {
  display: inline-block;
  background: var(--secondary);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .4px;
  text-decoration: none;
}
.post-card .category-badge:hover { background: var(--secondary-dark); color: #000; }
.post-card h2, .post-card h3 { margin-top: .5rem; font-size: 1.15rem; line-height: 1.35; }
.post-card a.title-link { color: var(--text); text-decoration: none; }
.post-card a.title-link:hover { color: var(--primary); }
.post-meta { font-size: .78rem; color: var(--muted); }

/* ---------- Single post ---------- */
.single-post { background: var(--bg); border-radius: var(--radius); padding: 1.1rem; }
.single-post img.featured {
  width: 100%; max-height: 420px; object-fit: cover; border-radius: 10px;
}
.single-post .content { font-size: 1.05rem; line-height: 1.8; margin-top: 1.3rem; color: var(--text); }
.single-post .content img { max-width: 100%; height: auto; border-radius: 8px; }

.tag-pill {
  display: inline-block; background: var(--light); border: 1px solid var(--border);
  padding: 5px 14px; border-radius: 20px; font-size: .8rem; color: var(--text);
  text-decoration: none; margin: 2px;
}
.tag-pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Sidebar widgets ---------- */
.sidebar-widget {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.2rem;
}
.sidebar-widget h5 {
  border-bottom: 3px solid var(--secondary);
  display: inline-block;
  padding-bottom: .4rem; margin-bottom: 1rem; font-size: 1rem;
}

/* ---------- Comments ---------- */
.comment-box { background: var(--light); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: .8rem; }

/* Inputs / buttons — app style, big touch targets everywhere */
.form-control, .form-select {
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(237,50,55,0.15);
}
.btn { border-radius: 10px; font-weight: 600; min-height: 44px; }
.btn-dark, .btn-primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.btn-dark:hover, .btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline-secondary { color: var(--text); border-color: var(--border); }
.btn-outline-secondary:hover { background: var(--light); color: var(--text); border-color: var(--border); }

/* ---------- Footer ---------- */
.site-footer { background: var(--text); color: #ccc; margin-top: 2rem; padding-bottom: 2rem; }
.site-footer h5, .site-footer h6 { color: #fff; }
.site-footer a.text-muted:hover { color: var(--secondary) !important; }

/* ---------- Pagination ---------- */
.pagination .page-link { color: var(--text); border-radius: 8px; margin: 0 2px; border: 1px solid var(--border); }
.pagination .active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Bottom App-style navigation (mobile only) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  padding: 8px 0 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: .68rem;
  font-weight: 600;
  border: none;
  background: none;
}
.bottom-nav a i { font-size: 1.25rem; }
.bottom-nav a.active, .bottom-nav a:hover { color: var(--primary); }
.bottom-nav a.nav-fab-wrap { flex: 1.1; margin-top: -22px; }
.bottom-nav .nav-fab {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(237,50,55,0.4);
  margin-bottom: 2px;
}
@media (min-width: 992px) { .bottom-nav { display: none; } }

/* Small helpers */
.text-muted { color: var(--muted) !important; }
