/*
Theme Name: HSNime News
Theme URI: https://hsnime.org/
Author: HSNime
Description: Breaking-news magazine theme for HSNime: news ticker, dense headline homepage with category sections, sticky sidebar, Most read, and clean single posts with table of contents and related stories.
Version: 1.0.0
Requires at least: 6.0
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: hsnime-news
*/

:root {
  --ink: #101828;
  --muted: #5b6475;
  --line: #e3e6ec;
  --soft: #f4f6f9;
  --bg: #ffffff;
  --red: #e0142e;
  --red-dark: #b30f24;
  --gold: #f2b705;
  --navy: #14204f;
  --head: "Archivo", "Arial Narrow", sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --wrap: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 70px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 999; width: auto; height: auto; clip: auto; background: #fff; padding: 10px 16px; }
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text, .wp-element-caption { font-size: 13px; color: var(--muted); }

/* Top bar */
.topbar { background: var(--ink); color: #c8cedb; font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; flex-wrap: wrap; }
.topbar a:hover { color: var(--gold); }
.topbar ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.trend-tags { display: flex; gap: 10px; align-items: center; overflow: hidden; white-space: nowrap; }
.trend-tags b { color: var(--gold); font-weight: 700; }

/* Masthead */
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 44px; height: 44px; border-radius: 10px; background: var(--red); display: grid; place-items: center; color: #fff; font-family: var(--head); font-weight: 900; font-size: 26px; font-stretch: 80%; flex: 0 0 auto; }
.logo-text { font-family: var(--head); font-weight: 900; font-size: 34px; letter-spacing: -0.02em; font-stretch: 85%; line-height: 1; color: var(--ink); }
.logo-text span { color: var(--red); }
.logo small { display: block; font-family: var(--body); font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 3px; }
.custom-logo { max-height: 64px; width: auto; }
.mast-right { display: flex; gap: 10px; align-items: center; }
.search { display: flex; }
.search input { height: 40px; width: 230px; border: 1px solid #cdd2dc; border-right: 0; border-radius: 6px 0 0 6px; padding: 0 12px; font: inherit; font-size: 14px; }
.search button { height: 40px; border: 0; border-radius: 0 6px 6px 0; background: var(--ink); color: #fff; padding: 0 14px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.search button:hover { background: var(--red); }
.btn-red { display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; border-radius: 6px; background: var(--red); color: #fff; font-weight: 700; font-size: 14px; }
.btn-red:hover { background: var(--red-dark); color: #fff; }
.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid #cdd2dc; border-radius: 6px; background: #fff; color: var(--ink); align-items: center; justify-content: center; cursor: pointer; }

/* Nav */
.mainnav { background: #fff; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.admin-bar .mainnav { top: 32px; }
.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; overflow-x: auto; scrollbar-width: none; }
.mainnav ul::-webkit-scrollbar { display: none; }
.mainnav a { display: block; padding: 13px 14px; font-family: var(--head); font-weight: 700; font-size: 15px; font-stretch: 90%; white-space: nowrap; border-bottom: 3px solid transparent; }
.mainnav a.on, .mainnav a:hover, .mainnav .current-menu-item > a, .mainnav .current-category-ancestor > a { color: var(--red); border-bottom-color: var(--red); }

/* Ticker */
.ticker { display: flex; align-items: stretch; border: 1px solid var(--line); margin-top: 16px; background: #fff; overflow: hidden; }
.ticker-label { background: var(--red); color: #fff; font-family: var(--head); font-weight: 900; font-stretch: 85%; font-size: 14px; padding: 10px 14px; display: flex; align-items: center; gap: 8px; white-space: nowrap; flex: 0 0 auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: hsn-blink 1.2s infinite; }
@keyframes hsn-blink { 50% { opacity: .25; } }
.ticker-track { flex: 1; overflow: hidden; display: flex; align-items: center; min-width: 0; }
.ticker-list { display: flex; white-space: nowrap; animation: hsn-scroll 50s linear infinite; font-weight: 600; font-size: 14.5px; }
.ticker-list .set { display: flex; gap: 36px; padding-left: 36px; }
.ticker:hover .ticker-list, .ticker:focus-within .ticker-list { animation-play-state: paused; }
.ticker-list a::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--red); margin-right: 10px; vertical-align: middle; transform: rotate(45deg); }
@keyframes hsn-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Shared bits */
.kicker { display: inline-block; font-family: var(--head); font-weight: 800; font-stretch: 90%; font-size: 12.5px; color: var(--c, var(--red)); letter-spacing: .02em; margin-top: 10px; }
.kicker:hover { color: var(--ink); }
.time { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ttl { font-family: var(--head); font-weight: 800; font-stretch: 88%; line-height: 1.18; margin: 4px 0 0; letter-spacing: -0.005em; }
.meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.meta .time { display: inline; margin: 0; }
.meta a { color: var(--ink); font-weight: 600; }
.th { display: block; position: relative; overflow: hidden; background: var(--c, #6b7280); aspect-ratio: 16 / 10; }
.th img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.th:hover img { transform: scale(1.04); }
.th i { position: absolute; left: 10px; bottom: 4px; font-style: normal; font-family: var(--head); font-weight: 900; font-size: 42px; color: rgba(255, 255, 255, .6); font-stretch: 80%; }
.th.wide { aspect-ratio: 16 / 9; }
.blockhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 3px solid var(--c, var(--ink)); margin-bottom: 10px; }
.blockhead h2, .blockhead h3 { margin: 0; font-family: var(--head); font-weight: 900; font-stretch: 85%; font-size: 21px; background: var(--c, var(--ink)); color: #fff; padding: 5px 12px 4px; line-height: 1.3; }
.blockhead h2 a, .blockhead h3 a { color: #fff; }
.blockhead > a { font-size: 13px; font-weight: 700; color: var(--c, var(--red)); white-space: nowrap; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) 300px; gap: 22px; margin-top: 20px; }
.lead .ttl { font-size: clamp(26px, 3vw, 38px); margin-top: 6px; }
.lead > p { color: var(--muted); margin: 10px 0 0; font-size: 16.5px; }
.lead-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.lead-sub .kicker { margin-top: 0; }
.lead-sub .ttl { font-size: 16.5px; }
.second { display: flex; flex-direction: column; gap: 16px; }
.second .ttl { font-size: 19px; }
.second article + article { padding-top: 16px; border-top: 1px solid var(--line); }
.latest { border-left: 1px solid var(--line); padding-left: 20px; }
.latest ol { list-style: none; margin: 0; padding: 0; }
.latest li { display: grid; grid-template-columns: 50px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.latest li:last-child { border-bottom: 0; }
.latest .stamp { font-family: var(--head); font-weight: 800; font-stretch: 85%; color: var(--red); font-size: 14px; }
.latest .ttl { font-size: 15px; margin: 0; }

/* Trending */
.trending { margin-top: 28px; background: var(--soft); border-top: 3px solid var(--red); padding: 16px 18px; }
.trending h2 { margin: 0 0 10px; font-family: var(--head); font-weight: 900; font-stretch: 85%; font-size: 20px; }
.trend-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.trend-grid a { display: grid; grid-template-columns: 30px 1fr; gap: 8px; }
.trend-grid b { font-family: var(--head); font-weight: 900; font-size: 30px; line-height: 1; color: var(--red); font-stretch: 80%; }
.trend-grid span { font-family: var(--head); font-weight: 700; font-stretch: 90%; font-size: 15px; line-height: 1.25; }

/* Ads */
.ad-wide { margin: 26px 0 0; text-align: center; }
.ad-wide .widget, .ad-slot .widget { margin: 0; }
.ad-slot { text-align: center; }

/* Main layout */
.main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 34px; margin-top: 32px; align-items: start; }
.main-col { min-width: 0; }
.section { margin-bottom: 34px; }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; }
.split .big .ttl { font-size: 23px; margin-top: 8px; }
.split .big p { color: var(--muted); margin: 8px 0 0; font-size: 15px; }
.rows article { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rows article:first-child { padding-top: 0; }
.rows article:last-child { border-bottom: 0; }
.rows .ttl { font-size: 15.5px; margin: 0; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.grid4 .ttl { font-size: 16px; margin-top: 8px; }
.headlines { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin-top: 8px; }
.headlines a { display: block; padding: 9px 0 9px 14px; border-bottom: 1px solid var(--line); font-family: var(--head); font-weight: 700; font-stretch: 90%; font-size: 15.5px; line-height: 1.3; position: relative; }
.headlines a::before { content: ""; position: absolute; left: 0; top: 16px; width: 6px; height: 6px; background: var(--c, var(--red)); }

/* Story rows (archives, more news) */
.stories { display: flex; flex-direction: column; }
.story { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.story:first-child { padding-top: 4px; }
.story.no-thumb { grid-template-columns: minmax(0, 1fr); }
.story .kicker { margin-top: 0; }
.story .ttl { font-size: 21px; }
.story .excerpt { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.pagination { margin-top: 24px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cdd2dc; font-weight: 700; }
.pagination .page-numbers.current { background: var(--red); border-color: var(--red); color: #fff; }

/* Sidebar */
.side { align-self: stretch; min-width: 0; }
.side-sticky { position: sticky; top: 68px; display: flex; flex-direction: column; gap: 26px; }
.admin-bar .side-sticky { top: 100px; }
.mostread ol { list-style: none; margin: 0; padding: 0; }
.mostread li { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mostread li:last-child { border-bottom: 0; }
.mostread b { font-family: var(--head); font-weight: 900; font-stretch: 80%; font-size: 28px; line-height: 1; color: #c5cad5; }
.mostread li:nth-child(-n+3) b { color: var(--red); }
.mostread .ttl { font-size: 15px; margin: 0; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.nl { background: var(--ink); color: #fff; padding: 18px; }
.nl h3 { margin: 0 0 6px; font-family: var(--head); font-weight: 900; font-stretch: 85%; font-size: 20px; }
.nl p { margin: 0 0 10px; font-size: 14px; color: #c8cedb; }
.nl input { width: 100%; height: 42px; border: 0; padding: 0 10px; font: inherit; margin-bottom: 8px; border-radius: 4px; }
.nl button { width: 100%; height: 42px; border: 0; background: var(--red); color: #fff; font: inherit; font-weight: 700; border-radius: 4px; cursor: pointer; }

/* Archive head */
.archive-head { padding: 24px 0 4px; border-bottom: 3px solid var(--c, var(--ink)); }
.archive-head h1 { margin: 8px 0 10px; font-family: var(--head); font-weight: 900; font-stretch: 85%; font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.02em; line-height: 1.05; }
.archive-desc { color: var(--muted); max-width: 720px; margin-bottom: 12px; }
.archive-search { margin: 10px 0 16px; }
.breadcrumb { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--red); }

/* Single */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 100; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--gold)); }
.admin-bar .read-progress { top: 32px; }
.single-grid { margin-top: 24px; }
.post-main { min-width: 0; max-width: 820px; }
.post-head { margin-top: 10px; }
.post-head .kicker { margin-top: 4px; }
.post-title { margin: 6px 0 0; font-family: var(--head); font-weight: 900; font-stretch: 88%; font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -0.02em; line-height: 1.1; }
.post-dek { margin: 12px 0 0; font-size: 19px; line-height: 1.5; color: var(--muted); }
.byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; margin-top: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.byline-author { display: flex; align-items: center; gap: 10px; }
.byline-author img { border-radius: 50%; width: 40px; height: 40px; }
.byline-name { font-weight: 700; font-size: 15px; }
.byline .meta { margin-top: 0; }
.share { display: flex; gap: 6px; }
.share a { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--soft); }
.share a:hover { background: var(--red); color: #fff; }
.post-figure { margin: 22px 0 0; }
.post-figure .frame { aspect-ratio: 16 / 9; max-height: 450px; width: 100%; overflow: hidden; background: var(--soft); }
.post-figure .frame img { width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; }
.post-figure figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.toc { margin: 24px 0 6px; border: 1px solid var(--line); border-left: 4px solid var(--red); background: var(--soft); }
.toc summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; font-family: var(--head); font-weight: 900; font-stretch: 88%; font-size: 18px; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); transition: transform .2s; }
.toc[open] summary::after { transform: rotate(-135deg); }
.toc ol { margin: 0; padding: 0 18px 16px 38px; font-size: 15.5px; }
.toc li { padding: 4px 0; }
.toc a { font-weight: 600; }
.entry-content { font-size: 18px; line-height: 1.75; margin-top: 18px; }
.entry-content::after { content: ""; display: table; clear: both; }
.entry-content h2 { font-family: var(--head); font-weight: 900; font-stretch: 88%; font-size: 28px; line-height: 1.2; margin: 1.6em 0 .5em; padding-left: 14px; border-left: 5px solid var(--red); }
.entry-content h3 { font-family: var(--head); font-weight: 800; font-stretch: 90%; font-size: 22px; line-height: 1.25; margin: 1.4em 0 .5em; }
.entry-content h4 { font-family: var(--head); font-weight: 800; font-size: 19px; margin: 1.3em 0 .4em; }
.entry-content a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.entry-content blockquote { margin: 1.6em 0; padding: 16px 22px; background: #fff6d6; border-left: 4px solid var(--gold); font-weight: 600; font-size: 19px; line-height: 1.5; }
.entry-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; font-size: 16px; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px; text-align: left; }
.entry-content th { background: var(--soft); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .4em; }
.entry-content img { height: auto; }
.entry-content iframe { max-width: 100%; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.post-tags a { font-size: 14px; padding: 6px 12px; background: var(--soft); font-weight: 600; }
.post-tags a:hover { background: var(--red); color: #fff; }
.author-box { margin-top: 26px; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 20px; background: var(--soft); border-top: 3px solid var(--ink); }
.author-box img { border-radius: 50%; width: 64px; height: 64px; }
.author-box h3 { margin: 0 0 4px; font-family: var(--head); font-weight: 800; font-size: 19px; }
.author-box p { margin: 0; color: var(--muted); font-size: 15px; }
.related-box { margin-top: 32px; background: var(--navy); color: #fff; padding: 24px; }
.related-box h2 { margin: 0 0 16px; font-family: var(--head); font-weight: 900; font-stretch: 85%; font-size: 22px; color: #fff; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 18px; }
.related-item { display: flex; flex-direction: column; gap: 8px; color: #fff; }
.related-item:hover { color: var(--gold); }
.r-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #24306a; }
.r-thumb img { width: 100%; height: 100%; object-fit: cover; }
.r-title { font-family: var(--head); font-weight: 700; font-stretch: 92%; font-size: 15.5px; line-height: 1.3; }
.page-wrap { max-width: 860px; padding-top: 30px; }

/* Comments */
.comments-area { margin-top: 36px; }
.comments-area ol { list-style: none; padding: 0; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; border: 1px solid #cdd2dc; padding: 10px 12px; font: inherit; }
.comment-form .submit { min-height: 44px; padding: 0 20px; border: 0; background: var(--red); color: #fff; font-weight: 700; cursor: pointer; }

/* Footer */
.site-footer { margin-top: 48px; background: var(--ink); color: #c8cedb; font-size: 14px; }
.fgrid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 28px; padding-top: 36px; padding-bottom: 28px; }
.site-footer h4 { color: #fff; font-family: var(--head); font-weight: 800; font-stretch: 90%; font-size: 16px; margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.site-footer a:hover { color: var(--gold); }
.site-footer .logo-text { color: #fff; }
.site-footer p { margin: 12px 0 0; }
.fbottom { border-top: 1px solid #253046; padding: 14px 18px; text-align: center; font-size: 13px; }

/* Responsive */
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .latest { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
  .trend-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero, .main-grid, .split { grid-template-columns: minmax(0, 1fr); }
  .side-sticky { position: static; }
  .post-main { max-width: none; }
  .masthead .search { display: none; }
  .menu-toggle { display: inline-flex; }
  .mainnav { position: static; }
  .mainnav ul { display: none; flex-direction: column; overflow: visible; }
  .mainnav.is-open ul { display: flex; }
  .mainnav a { border-bottom: 1px solid var(--line); }
  .fgrid { grid-template-columns: 1fr 1fr; }
  .story { grid-template-columns: 180px minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .logo-text { font-size: 27px; }
  .logo small, .trend-tags { display: none; }
  .trend-grid, .headlines, .lead-sub, .related-grid { grid-template-columns: minmax(0, 1fr); }
  .grid4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rows article { grid-template-columns: 100px 1fr; }
  .story { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 14px 0; }
  .story .ttl { font-size: 17px; }
  .story .excerpt { display: none; }
  .related-item { flex-direction: row; align-items: center; gap: 12px; }
  .r-thumb { width: 110px; flex: 0 0 110px; }
  .entry-content { font-size: 17px; }
  .entry-content h2 { font-size: 24px; }
  .fgrid { grid-template-columns: 1fr; }
}
@media (max-width: 782px) {
  .admin-bar .read-progress { top: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-list { animation: none; }
  .ticker-track { overflow-x: auto; }
  .ticker-list .set[aria-hidden] { display: none; }
  .dot { animation: none; }
  .th img, .toc summary::after { transition: none; }
}
