/*
Theme Name: Himali Patrika News
Theme URI: https://himalipatrika.example
Author: Himali Patrika
Author URI: https://himalipatrika.example
Description: Himali Patrika News is a modern, secure Nepali news-portal theme inspired by classic online newspaper layouts. Blue brand palette matching the Himali Patrika logo, card-based homepage, category archives, and a readable single-article design. Built with escaped output, nonces, and hardened defaults.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: himali-patrika-news
Tags: news, magazine, blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, two-columns, right-sidebar
*/

/* ==========================================================================
   Tokens — logo-matched blues
   ========================================================================== */
:root {
  --hp-blue: #0077c8;
  --hp-blue-mid: #0066b3;
  --hp-blue-dark: #004f8a;
  --hp-blue-deep: #00325c;
  --hp-blue-soft: #e6f3fb;
  --hp-sky: #1aa3e0;
  --hp-ink: #12161c;
  --hp-body: #2a3038;
  --hp-muted: #5d6670;
  --hp-line: #e3e8ee;
  --hp-paper: #ffffff;
  --hp-canvas: #f4f7fa;
  --hp-danger: #c4161c;
  --hp-ok: #0a8f4a;
  --hp-radius: 12px;
  --hp-shadow: 0 8px 24px rgba(0, 50, 92, 0.08);
  --hp-shadow-sm: 0 2px 8px rgba(0, 50, 92, 0.06);
  --hp-font: "Noto Sans Devanagari", "Mukta", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hp-serif: "Noto Serif Devanagari", "Source Serif 4", Georgia, serif;
  --hp-max: 1240px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--hp-font);
  color: var(--hp-body);
  background: var(--hp-canvas);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--hp-blue-dark); text-decoration: none; }
a:hover { color: var(--hp-blue); }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--hp-sky);
  outline-offset: 2px;
}

h1, h2, h3, h4, h5 {
  color: var(--hp-ink);
  line-height: 1.28;
  font-weight: 700;
  margin: 0 0 0.5em;
}

.hp-wrap {
  width: min(var(--hp-max), calc(100% - 32px));
  margin-inline: auto;
}

.screen-reader-text {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px; width: 1px;
  overflow: hidden; white-space: nowrap;
}

/* ==========================================================================
   Topbar + Header
   ========================================================================== */
.hp-topbar {
  background: var(--hp-blue-deep);
  color: #d7e8f5;
  font-size: 13px;
}
.hp-topbar .hp-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
}
.hp-topbar a { color: #d7e8f5; }
.hp-topbar a:hover { color: #fff; }
.hp-top-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.hp-social { display: flex; gap: 10px; }
.hp-social a {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.hp-header {
  background: var(--hp-paper);
  border-bottom: 1px solid var(--hp-line);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--hp-shadow-sm);
}
.hp-header-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
}
.hp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--hp-blue-deep);
}
.hp-brand img {
  width: 56px; height: 56px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,77,160,0.25);
}
.hp-brand-text { display: flex; flex-direction: column; }
.hp-brand-text .name {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--hp-blue-dark);
  line-height: 1.1;
}
.hp-brand-text .tag {
  font-size: 11px;
  color: var(--hp-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hp-header-tools { display: flex; gap: 8px; align-items: center; }
.hp-icon-btn {
  border: 1px solid var(--hp-line);
  background: #fff;
  width: 40px; height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--hp-blue-dark);
}
.hp-icon-btn:hover { background: var(--hp-blue-soft); }

/* Nav */
.hp-nav {
  background: var(--hp-blue);
  color: #fff;
}
.hp-nav .hp-wrap {
  display: flex;
  align-items: center;
}
.hp-menu {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.hp-menu > li > a {
  display: block;
  color: #fff;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
}
.hp-menu > li > a:hover,
.hp-menu > li.current-menu-item > a,
.hp-menu > li.current-menu-ancestor > a {
  background: var(--hp-blue-dark);
  color: #fff;
}
.hp-menu .sub-menu {
  display: none;
  position: absolute;
  background: #fff;
  min-width: 220px;
  box-shadow: var(--hp-shadow);
  border-radius: 0 0 10px 10px;
  list-style: none;
  padding: 8px 0;
  z-index: 50;
}
.hp-menu > li { position: relative; }
.hp-menu > li:hover > .sub-menu { display: block; }
.hp-menu .sub-menu a {
  display: block;
  padding: 8px 16px;
  color: var(--hp-ink);
  font-size: 14px;
}
.hp-menu .sub-menu a:hover { background: var(--hp-blue-soft); color: var(--hp-blue-dark); }

.hp-burger { display: none; }

/* Search overlay */
.hp-search-panel {
  display: none;
  background: #fff;
  border-bottom: 1px solid var(--hp-line);
  padding: 16px 0;
}
.hp-search-panel.is-open { display: block; }
.hp-search-panel form { display: flex; gap: 8px; }
.hp-search-panel input[type="search"] {
  flex: 1;
  border: 1px solid var(--hp-line);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
}
.hp-search-panel button {
  background: var(--hp-blue);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
}

/* Breaking */
.hp-breaking {
  background: linear-gradient(90deg, var(--hp-blue-deep), var(--hp-blue));
  color: #fff;
  overflow: hidden;
}
.hp-breaking .hp-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 40px;
  gap: 12px;
}
.hp-breaking-label {
  background: #fff;
  color: var(--hp-blue-dark);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}
.hp-breaking a { color: #fff; font-weight: 600; }
.hp-breaking a:hover { text-decoration: underline; }

/* ==========================================================================
   Cards / grids
   ========================================================================== */
.hp-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
  padding: 22px 0 8px;
}
.hp-card {
  background: #fff;
  border-radius: var(--hp-radius);
  overflow: hidden;
  box-shadow: var(--hp-shadow-sm);
  border: 1px solid var(--hp-line);
  transition: transform .2s ease, box-shadow .2s ease;
}
.hp-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--hp-shadow);
}
.hp-card .thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #d9e6f0;
  position: relative;
}
.hp-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.hp-card:hover .thumb img { transform: scale(1.04); }
.hp-card .body { padding: 14px 16px 16px; }
.hp-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--hp-blue);
  margin-bottom: 6px;
}
.hp-card h2, .hp-card h3 {
  font-size: 1.05rem;
  margin: 0 0 8px;
}
.hp-card h2 a, .hp-card h3 a, .hp-list-item h3 a { color: var(--hp-ink); }
.hp-card h2 a:hover, .hp-card h3 a:hover { color: var(--hp-blue); }
.hp-excerpt { color: var(--hp-muted); font-size: 0.95rem; margin: 0; }
.hp-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--hp-muted); margin-top: 10px;
}

.hp-hero-main .body { padding: 18px 20px 20px; }
.hp-hero-main h2 { font-size: 1.7rem; font-family: var(--hp-serif); }
.hp-hero-side { display: flex; flex-direction: column; gap: 14px; }
.hp-hero-side .hp-card { display: grid; grid-template-columns: 140px 1fr; }
.hp-hero-side .thumb { aspect-ratio: 4 / 3; }
.hp-hero-side h3 { font-size: 1rem; }

.hp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  padding: 18px 0 40px;
}

.hp-section { margin-bottom: 28px; }
.hp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--hp-blue);
  margin-bottom: 16px;
  padding-bottom: 6px;
}
.hp-section-head h2 {
  font-size: 1.2rem;
  margin: 0;
  color: var(--hp-blue-dark);
}
.hp-section-head a {
  font-size: 13px;
  font-weight: 700;
  color: var(--hp-blue);
}

.hp-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.hp-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.hp-list-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hp-line);
}
.hp-list-item:last-child { border-bottom: 0; }
.hp-list-item .thumb {
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  background: #d9e6f0;
}
.hp-list-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.hp-list-item h3 { font-size: 0.98rem; margin: 0 0 4px; }

/* Sidebar */
.hp-sidebar .widget {
  background: #fff;
  border: 1px solid var(--hp-line);
  border-radius: var(--hp-radius);
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: var(--hp-shadow-sm);
}
.hp-sidebar .widget-title {
  font-size: 1rem;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--hp-blue);
  color: var(--hp-blue-dark);
}
.hp-trend-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--hp-line);
}
.hp-trend-item:last-child { border-bottom: 0; }
.hp-trend-num {
  font-weight: 800;
  color: var(--hp-blue);
  font-size: 1.1rem;
}
.hp-trend-item a { color: var(--hp-ink); font-weight: 600; }
.hp-trend-item a:hover { color: var(--hp-blue); }

/* Single */
.hp-single { background: #fff; border: 1px solid var(--hp-line); border-radius: 16px; padding: 28px; box-shadow: var(--hp-shadow-sm); }
.hp-breadcrumb { font-size: 13px; color: var(--hp-muted); margin-bottom: 14px; }
.hp-breadcrumb a { color: var(--hp-blue-dark); }
.hp-single-title {
  font-family: var(--hp-serif);
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  margin-bottom: 10px;
}
.hp-single-featured {
  border-radius: 12px;
  overflow: hidden;
  margin: 18px 0;
}
.hp-single-featured img { width: 100%; }
.hp-content {
  font-size: 1.08rem;
  line-height: 1.85;
}
.hp-content p { margin: 0 0 1.1em; }
.hp-content h2, .hp-content h3 { margin-top: 1.3em; }
.hp-content a { text-decoration: underline; text-underline-offset: 3px; }
.hp-share { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.hp-share a {
  border: 1px solid var(--hp-line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hp-blue-dark);
  background: var(--hp-blue-soft);
}
.hp-author-box {
  display: flex; gap: 14px; align-items: center;
  background: var(--hp-blue-soft);
  border-radius: 12px;
  padding: 16px;
  margin-top: 28px;
}
.hp-related { margin-top: 28px; }

/* Comments */
.hp-comments { margin-top: 28px; }
.comment-form input, .comment-form textarea {
  width: 100%;
  border: 1px solid var(--hp-line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}
.comment-form .submit {
  background: var(--hp-blue);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
}

/* Footer */
.hp-footer {
  background: var(--hp-blue-deep);
  color: #c9dcea;
  margin-top: 20px;
}
.hp-footer a { color: #e8f4fc; }
.hp-footer a:hover { color: #fff; }
.hp-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 24px;
  padding: 36px 0 24px;
}
.hp-footer .name { color: #fff; font-size: 1.25rem; font-weight: 800; }
.hp-footer ul { list-style: none; margin: 0; padding: 0; }
.hp-footer li { margin: 6px 0; }
.hp-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 14px 0 22px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Pagination */
.hp-pagination { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0; }
.hp-pagination a, .hp-pagination span {
  min-width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--hp-line);
  background: #fff;
  color: var(--hp-ink);
  font-weight: 700;
}
.hp-pagination .current { background: var(--hp-blue); color: #fff; border-color: var(--hp-blue); }

.hp-page-head {
  padding: 22px 0 8px;
}
.hp-page-head h1 { font-size: 1.7rem; color: var(--hp-blue-dark); }

/* 404 */
.hp-empty { text-align: center; padding: 60px 16px; background: #fff; border-radius: 16px; }

/* Widgets in footer */
.hp-footer .widget-title { color: #fff; border-bottom: 2px solid var(--hp-sky); padding-bottom: 6px; margin-bottom: 10px; }

/* Responsive */
@media (max-width: 980px) {
  .hp-hero, .hp-layout, .hp-grid-3, .hp-footer-grid {
    grid-template-columns: 1fr;
  }
  .hp-header-main { grid-template-columns: auto 1fr; }
  .hp-header-ad { display: none; }
  .hp-burger { display: grid; }
  .hp-nav .hp-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--hp-blue-dark);
  }
  .hp-nav.is-open .hp-menu { display: flex; }
  .hp-menu .sub-menu { position: static; box-shadow: none; display: none; background: var(--hp-blue-deep); }
  .hp-menu .sub-menu a { color: #fff; }
  .hp-hero-side .hp-card { grid-template-columns: 110px 1fr; }
}
@media (max-width: 640px) {
  .hp-hero-side .hp-card, .hp-list-item { grid-template-columns: 88px 1fr; }
  .hp-single { padding: 16px; }
  .hp-brand-text .tag { display: none; }
}

/* WP align helpers */
.aligncenter { margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-block-image { margin: 1.2em 0; }
.sticky { outline: 2px solid var(--hp-blue-soft); }

.hp-pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.hp-pagination .page-numbers {
  min-width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--hp-line);
  background: #fff;
  color: var(--hp-ink);
  font-weight: 700;
  padding: 0 8px;
}
.hp-pagination .page-numbers.current {
  background: var(--hp-blue);
  color: #fff;
  border-color: var(--hp-blue);
}
.hp-top-links { list-style: none; display: flex; gap: 12px; margin: 0; padding: 0; }
.hp-comments .comment-list { list-style: none; padding: 0; }
.hp-comments .comment { padding: 12px 0; border-bottom: 1px solid var(--hp-line); }
