/* =========================================================================
   BriefNepal — Hindustan Times-style editorial skin (blue + red), mobile-first.
   Same layout as before; this is the visual theme. responsive.css = breakpoints.
   ========================================================================= */

:root {
  --brand: #034ea2;          /* HT editorial blue */
  --brand-dark: #023b7a;
  --accent: #d11a2a;         /* breaking / section red */
  --ink: #14202e;            /* dark nav */
  --ink-2: #0f1620;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-soft: #4a4a4a;
  --text-faint: #767676;
  --border: #e3e3e3;
  --radius: 2px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, .12);
  --maxw: 1240px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --head: "Merriweather", Georgia, "Times New Roman", "Noto Serif", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.22; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* ---------------- Utility / date bar ---------------- */
.datebar { background: var(--surface); border-bottom: 1px solid var(--border); font-size: .76rem; color: var(--text-faint); }
.datebar__inner { display: flex; align-items: center; justify-content: space-between; height: 34px; }
.datebar__date { font-weight: 600; letter-spacing: .2px; }
.datebar__links { display: flex; align-items: center; gap: 18px; }
.datebar__links a { color: var(--text-soft); font-weight: 600; }
.datebar__links a:hover { color: var(--brand); }

/* ---------------- Masthead ---------------- */
.masthead { background: var(--surface); border-bottom: 3px solid var(--brand); }
.masthead__inner { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 22px 18px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--head);
  font-weight: 700; font-size: 2.4rem; letter-spacing: -1px; color: var(--ink-2);
  white-space: nowrap;
}
.brand__logo { display: block; border-radius: 5px; }
.brand__name span { color: var(--brand); }
.brand small { font-family: var(--font); font-size: .62rem; font-weight: 700; color: var(--text-faint); text-transform: uppercase; vertical-align: super; letter-spacing: 1px; }

/* ---------------- Primary nav (deep blue, sticky) ---------------- */
.nav { background: var(--brand); position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.nav__inner { display: flex; align-items: center; gap: 0; }
.nav__links { display: flex; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav__links::-webkit-scrollbar { display: none; }
.nav__link {
  position: relative;
  padding: 13px 15px;
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: rgba(255,255,255,.9); white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.nav__link:hover { background: var(--brand-dark); color: #fff; }
.nav__link.is-active { color: #fff; border-bottom-color: var(--accent); background: var(--brand-dark); }
.nav-toggle { display: none; border: 0; background: var(--accent); color: #fff; font-weight: 700; font-size: .82rem; cursor: pointer; padding: 12px 16px; }

.search { display: flex; align-items: center; background: rgba(255,255,255,.16); border-radius: 2px; margin: 0 0 0 8px; padding: 0 4px 0 12px; }
.search__input { border: 0; background: transparent; font-size: .82rem; padding: 8px 4px; outline: none; color: #fff; width: 150px; }
.search__input::placeholder { color: rgba(255,255,255,.75); }
.search__btn { border: 0; background: transparent; cursor: pointer; font-size: .9rem; padding: 6px 8px; color: #fff; }

/* ---------------- Breaking / trending ticker ---------------- */
.ticker { background: var(--surface); border-bottom: 1px solid var(--border); overflow: hidden; }
.ticker__inner { display: flex; align-items: stretch; height: 42px; }
.ticker__label {
  flex: none; z-index: 2;
  background: var(--accent); color: #fff; font-weight: 800; text-transform: uppercase;
  font-size: .74rem; letter-spacing: .6px; display: flex; align-items: center;
  padding: 0 16px; white-space: nowrap;
}
.ticker__viewport { flex: 1; min-width: 0; overflow: hidden; position: relative; }
.ticker__track { display: flex; align-items: center; gap: 30px; height: 100%; white-space: nowrap; padding-left: 26px; width: max-content; animation: ticker 42s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { font-size: .84rem; font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 8px; }
.ticker__item:hover { color: var(--brand); }
.ticker__bullet { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--accent) !important; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------------- NEPSE stock ticker ---------------- */
.stockbar { background: var(--ink-2); border-bottom: 1px solid #000; overflow: hidden; }
.stockbar__inner { display: flex; align-items: stretch; height: 38px; }
.stockbar__label {
  flex: none; z-index: 2;
  background: var(--brand); color: #fff; font-weight: 800; letter-spacing: 1px;
  font-size: .74rem; display: flex; align-items: center; padding: 0 16px; white-space: nowrap;
}
.stockbar__viewport { flex: 1; min-width: 0; overflow: hidden; position: relative; }
.stockbar__track { display: flex; align-items: center; gap: 26px; height: 100%; white-space: nowrap; padding-left: 24px; width: max-content; animation: ticker 80s linear infinite; }
.stockbar:hover .stockbar__track { animation-play-state: paused; }
.stock { display: inline-flex; align-items: baseline; gap: 6px; font-size: .8rem; font-family: var(--font); }
.stock__sym { color: #fff; font-weight: 700; }
.stock__ltp { color: #d7dde4; font-weight: 600; }
.stock__chg { font-weight: 600; font-size: .76rem; }
.stock--up .stock__chg { color: #3fcf6b; }
.stock--down .stock__chg { color: #ff6b6b; }
.stock--flat .stock__chg { color: #9aa3ad; }

/* ---------------- Layout ---------------- */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 34px; padding-top: 26px; padding-bottom: 44px; align-items: start; }
.layout__side { position: sticky; top: 64px; }

/* ---------------- HT-style section heading ---------------- */
.block-head, .section__head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 18px; padding-bottom: 9px;
  border-bottom: 2px solid var(--ink-2);
}
.block-head__title, .section__title {
  font-family: var(--head);
  font-size: 1.25rem; font-weight: 700; color: var(--ink-2);
  padding-left: 12px; position: relative; line-height: 1.1;
}
.block-head__title::before, .section__title::before {
  content: ""; position: absolute; left: 0; top: 2px; bottom: 2px;
  width: 4px; background: var(--accent); border-radius: 1px;
}
.block-head__more, .section__more {
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--brand);
}
.block-head__more:hover, .section__more:hover { color: var(--accent); }

.section { margin-bottom: 38px; }

/* ---------------- Featured hero block ---------------- */
.featured { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; margin: 24px 0 8px; }
.featured__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.feature { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: #111; }
.feature--lg { min-height: 430px; height: 100%; }
.feature--sm { min-height: 205px; }
.feature__img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; transition: transform .45s; }
.feature:hover .feature__img { transform: scale(1.05); }
.feature__shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.4) 48%, rgba(0,0,0,0) 78%); }
.feature__content { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px; display: flex; flex-direction: column; gap: 9px; }
.feature__cat { align-self: flex-start; background: var(--accent); color: #fff; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; padding: 4px 9px; border-radius: 1px; }
.feature__title { color: #fff; font-family: var(--head); font-weight: 700; line-height: 1.22; text-shadow: 0 1px 6px rgba(0,0,0,.55); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feature--lg .feature__title { font-size: 1.85rem; }
.feature--sm .feature__title { font-size: 1.02rem; -webkit-line-clamp: 2; }
.feature__meta { color: #dcdcdc; font-size: .73rem; font-weight: 600; }

/* ---------------- Grid + Cards ---------------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .18s, transform .18s; }
.card:hover { box-shadow: var(--shadow-hover); }
.card__media { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--border); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card__media img { transform: scale(1.04); }
.card__cat { position: absolute; left: 0; bottom: 0; background: var(--brand); color: #fff; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 4px 10px; }
.card__body { padding: 13px 15px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__title { font-family: var(--head); font-size: 1.08rem; font-weight: 700; line-height: 1.3; }
.card__title a:hover { color: var(--brand); }
.card__summary { margin: 0; font-size: .87rem; color: var(--text-soft); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { margin-top: auto; display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--text-faint); }
.card__source { font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .3px; font-size: .7rem; }
.dot { opacity: .5; }
.card--compact .card__media { aspect-ratio: 16/10; }
.card--compact .card__title { font-size: .94rem; }

/* ---------------- Sidebar widgets ---------------- */
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 16px 14px; margin-bottom: 24px; }
.widget__title { font-family: var(--head); color: var(--ink-2); font-size: 1.05rem; font-weight: 700; margin: 0 -16px 12px; padding: 12px 16px 10px; border-bottom: 2px solid var(--ink-2); position: relative; }
.widget__title::before { content: ""; position: absolute; left: 16px; bottom: -2px; width: 56px; height: 2px; background: var(--accent); }
.widget__list { display: flex; flex-direction: column; }
.side-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); counter-increment: side; }
.side-item:last-child { border-bottom: 0; }
.side-item__img { width: 82px; height: 60px; object-fit: cover; border-radius: 1px; flex: none; background: var(--border); }
.side-item__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.side-item__title { font-family: var(--head); font-size: .9rem; font-weight: 700; line-height: 1.28; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-item:hover .side-item__title { color: var(--brand); }
.side-item__meta { display: flex; align-items: center; gap: 5px; font-size: .7rem; color: var(--text-faint); }
.side-item__source { color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.side-item__time { font-size: .7rem; color: var(--text-faint); }

/* ---------------- Article page ---------------- */
.article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; }
.article__loading { color: var(--text-faint); padding: 40px 0; text-align: center; }
.crumbs { font-size: .78rem; color: var(--text-faint); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .4px; }
.crumbs a:hover { color: var(--brand); }
.article__cat { display: inline-block; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; padding: 4px 11px; border-radius: 1px; margin-bottom: 14px; }
.article__title { font-family: var(--head); font-size: 2.35rem; font-weight: 700; letter-spacing: -.5px; line-height: 1.18; margin-bottom: 16px; }
.article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-faint); font-size: .84rem; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.article__source { font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: .3px; }
.article__hero { margin: 0 0 22px; border-radius: var(--radius); overflow: hidden; background: var(--border); }
.article__hero img { width: 100%; max-height: 480px; object-fit: cover; }
.article__summary { font-size: 1.18rem; line-height: 1.8; color: #2a2a2a; }
.article__summary p { margin: 0 0 1em; }
.article__cta { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.article__note { font-size: .8rem; color: var(--text-faint); margin: 12px 0 0; }

/* ---------------- Buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: .88rem; padding: 9px 16px; border-radius: 2px; cursor: pointer; transition: background .15s, box-shadow .15s, border-color .15s; }
.btn:hover { box-shadow: var(--shadow); border-color: #c9c9c9; }
.btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); text-transform: uppercase; letter-spacing: .4px; }
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn--lg { padding: 14px 28px; font-size: .95rem; }
.btn--sm { padding: 5px 12px; font-size: .78rem; }
.btn--danger { background: #fff; color: var(--accent); border-color: #efbfc3; }
.btn--danger:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--disabled { opacity: .45; pointer-events: none; }

/* ---------------- Pager ---------------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 30px; }
.pager__info { font-size: .85rem; color: var(--text-soft); }

/* ---------------- Search page ---------------- */
.search--page { display: flex; max-width: 100%; margin: 4px 0 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 2px; padding: 0 4px 0 14px; }
.search--page .search__input { color: var(--text); width: 100%; }
.search--page .search__input::placeholder { color: var(--text-faint); }
.search--page .search__btn { background: var(--brand); color: #fff; border-radius: 2px; padding: 10px 22px; font-weight: 700; margin: 5px 0; text-transform: uppercase; letter-spacing: .4px; }
.search__status { color: var(--text-soft); font-size: .9rem; margin: 0 0 18px; }

/* ---------------- Footer ---------------- */
.footer { background: var(--ink-2); color: #aeb6c0; margin-top: 34px; border-top: 4px solid var(--brand); }
.footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 34px; padding: 44px 18px 28px; }
.footer__col h4 { font-family: var(--head); font-size: 1rem; color: #fff; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); display: inline-block; }
.footer__col a { display: block; color: #9aa3ad; font-size: .9rem; padding: 5px 0; }
.footer__col a:hover { color: #fff; padding-left: 4px; transition: padding .15s; }
.brand--footer { color: #fff; font-size: 1.7rem; margin-bottom: 12px; }
.brand--footer .brand__name span { color: #5b9be0; }
.footer__tag { font-size: .88rem; color: #828b95; max-width: 380px; line-height: 1.6; }
.footer__bar { border-top: 1px solid #2a323c; padding: 18px; text-align: center; }
.footer__copy { font-size: .8rem; color: #717a84; margin: 0; }

/* ---------------- States ---------------- */
.empty { color: var(--text-faint); padding: 24px; text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); grid-column: 1 / -1; }
.empty code { background: var(--bg); padding: 1px 6px; border-radius: 3px; }

/* Skeleton loaders */
.card--skeleton { pointer-events: none; border: 1px solid var(--border); }
.sk { background: linear-gradient(90deg, #ececec 25%, #f6f6f6 37%, #ececec 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 2px; }
.sk--media { aspect-ratio: 16/9; }
.sk--line { height: 14px; margin: 8px 14px; }
.sk--line.short { width: 55%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------------- Admin ---------------- */
.admin { background: var(--bg); }
.admin__bar { background: var(--ink); }
.admin__bar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.admin__bar .brand { color: #fff; font-size: 1.5rem; }
.admin__bar .brand__name span { color: #5b9be0; }
.admin__key input { border: 1px solid #2c3947; background: #1c2733; color: #fff; border-radius: 3px; padding: 8px 12px; font: inherit; }
.admin__key input::placeholder { color: #8a96a3; }
.admin__main { padding: 26px 18px 60px; }
.admin__cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--brand); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.stat-card__label { font-size: .78rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .5px; }
.stat-card__value { font-size: 2.2rem; font-weight: 800; color: var(--brand); }
.stat-card--action { align-items: flex-start; justify-content: center; }
.stat-card__hint { font-size: .82rem; color: var(--text-soft); }
.admin__breakdown { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: .82rem; }

/* Admin editor form */
.admin__editor { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; }
.admin__editor h2 { font-family: var(--head); font-size: 1.25rem; margin-bottom: 18px; }
.form__row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.form__field { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }
.form__field--full { flex-basis: 100%; }
.form__field span { font-size: .82rem; font-weight: 700; color: var(--text-soft); }
.form__field span em { color: var(--accent); font-style: normal; }
.form__field span small { font-weight: 400; color: var(--text-faint); }
.form__field input, .form__field select, .form__field textarea {
  border: 1px solid var(--border); border-radius: 3px; padding: 10px 12px;
  font: inherit; font-size: .92rem; color: var(--text); background: #fff; width: 100%;
}
.form__field input:focus, .form__field select:focus, .form__field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(3,78,162,.14);
}
.form__field textarea { resize: vertical; }
.form__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form__status { font-size: .85rem; font-weight: 600; }
.cell-actions { display: flex; gap: 6px; white-space: nowrap; }

.admin__table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.admin__table-wrap h2 { font-family: var(--head); font-size: 1.15rem; margin-bottom: 14px; }
.table-scroll { overflow-x: auto; }
.admin__table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin__table th, .admin__table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin__table th { font-size: .73rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); }
.cell-title { max-width: 460px; }
.cell-title a:hover { color: var(--brand); }
