/* Hanfan v1.1.0 responsive design system — loaded last. */
:root{
  --hf-page:1440px;
  --hf-gap:clamp(12px,1.5vw,24px);
  --hf-space:clamp(12px,1.8vw,26px);
  --hf-card-radius:14px;
}
html{overflow-x:hidden;-webkit-text-size-adjust:100%}
body{overflow-wrap:anywhere}
*,*::before,*::after{box-sizing:border-box}
img,video,iframe,embed,object,svg{max-width:100%;height:auto}
.container,.hfnews-wrap,.hf33-wrap,.hf33-search-wrap{width:min(var(--hf-page),calc(100% - 32px));max-width:var(--hf-page);margin-left:auto;margin-right:auto}

/* Home grid only. Never override the composite archive grid used by category pages. */
body.home .hf33-body,
body.front-page .hf33-body{min-width:0}
body.home .hf33-left,
body.home .hf33-right,
body.home .hf33-card,
body.front-page .hf33-left,
body.front-page .hf33-right,
body.front-page .hf33-card{min-width:0}
body.home .hf33-grid,
body.front-page .hf33-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:var(--hf-gap)!important}
body.home .hf33-poster,
body.home .hf33-card .thumb,
body.front-page .hf33-poster,
body.front-page .hf33-card .thumb{width:100%;aspect-ratio:2/3;overflow:hidden}
body.home .hf33-poster img,
body.home .hf33-card .thumb img,
body.front-page .hf33-poster img,
body.front-page .hf33-card .thumb img{width:100%;height:100%;object-fit:cover;display:block}
.hf33-name,.hf33-rank-name{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Category archive: preserve the intended poster area + sidebar structure. */
body.tax-vod_type .hf33-grid,
body.tax-vod_genre .hf33-grid,
body.tax-vod_topic .hf33-grid,
body.post-type-archive-vod .hf33-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 220px!important;
  gap:16px!important;
  align-items:start;
}
body.tax-vod_type .hf33-grid-left,
body.tax-vod_genre .hf33-grid-left,
body.tax-vod_topic .hf33-grid-left,
body.post-type-archive-vod .hf33-grid-left{min-width:0;width:100%}
body.tax-vod_type .hf33-poster-grid,
body.tax-vod_genre .hf33-poster-grid,
body.tax-vod_topic .hf33-poster-grid,
body.post-type-archive-vod .hf33-poster-grid{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:16px 14px!important;
  width:100%!important;
}
body.tax-vod_type .hf33-poster,
body.tax-vod_genre .hf33-poster,
body.tax-vod_topic .hf33-poster,
body.post-type-archive-vod .hf33-poster{width:100%!important;max-width:none!important;min-width:0!important}
body.tax-vod_type .hf33-poster-thumb,
body.tax-vod_genre .hf33-poster-thumb,
body.tax-vod_topic .hf33-poster-thumb,
body.post-type-archive-vod .hf33-poster-thumb{width:100%;aspect-ratio:2/3;overflow:hidden}
body.tax-vod_type .hf33-poster-thumb img,
body.tax-vod_genre .hf33-poster-thumb img,
body.tax-vod_topic .hf33-poster-thumb img,
body.post-type-archive-vod .hf33-poster-thumb img{width:100%;height:100%;object-fit:cover;display:block}

/* News content: readable measure and predictable flow. */
.hfnews-grid{grid-template-columns:minmax(0,1fr) minmax(280px,340px);gap:var(--hf-space)}
.hfnews-grid>main,.hfnews-sidebar{min-width:0}
.hfnews-post{overflow:hidden}
.hfnews-article-hd{border-bottom:1px solid rgba(15,23,42,.08);padding-bottom:14px}
.hfnews-single .hfnews-title{font-size:clamp(24px,3vw,32px)!important;line-height:1.35;margin:0}
.hfnews-content{font-size:clamp(15px,1.1vw,17px);line-height:1.9;overflow-wrap:anywhere;word-break:break-word}
.hfnews-content>*{max-width:100%}
.hfnews-content img{display:block;margin:12px auto;max-width:100%!important;height:auto!important}
.hfnews-content table{display:block;width:100%;max-width:100%;overflow-x:auto;border-collapse:collapse}
.hfnews-content pre{max-width:100%;overflow:auto;white-space:pre-wrap}
.hfnews-content iframe,.hfnews-content video{display:block;width:100%!important;max-width:100%!important;aspect-ratio:16/9;height:auto!important}
.hfnews-prevnext{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0 18px}
.hfnews-prevnext-item{min-width:0;background:#fff;border-radius:12px;padding:12px;box-shadow:0 1px 0 rgba(0,0,0,.04)}
.hfnews-prevnext-item a{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hfnews-tags{margin-top:18px}.hfnews-tags-label{font-size:12px;opacity:.7;margin-bottom:8px}.hfnews-tags-list{display:flex;flex-wrap:wrap;gap:8px}
.hfnews-tag{display:inline-flex;align-items:center;padding:6px 10px;border:1px solid #eee;border-radius:999px;background:#fafafa;font-size:12px;text-decoration:none}

/* Archive pagination: tap-friendly and crawlable links. */
.hf33-pagination,.nav-links{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:24px 0}
.hf33-pagination .page-numbers,.nav-links .page-numbers{min-width:40px;height:40px;padding:0 12px;display:inline-flex;align-items:center;justify-content:center;border:1px solid rgba(15,23,42,.12);border-radius:10px;background:#fff;text-decoration:none}
.hf33-pagination .current,.nav-links .current{background:#0b78d1;color:#fff;border-color:#0b78d1}

@media (max-width:1199px){
  body.home .hf33-grid,body.front-page .hf33-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  body.tax-vod_type .hf33-poster-grid,body.tax-vod_genre .hf33-poster-grid,body.tax-vod_topic .hf33-poster-grid,body.post-type-archive-vod .hf33-poster-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .hfnews-grid{grid-template-columns:minmax(0,1fr) 300px}
}
@media (max-width:991px){
  .container,.hfnews-wrap,.hf33-wrap,.hf33-search-wrap{width:min(100% - 24px,var(--hf-page))}
  .hfnews-grid{grid-template-columns:1fr}
  .hfnews-sidebar{position:static!important;width:100%;max-width:none}
  body.home .hf33-body,body.front-page .hf33-body{display:block!important}
  body.home .hf33-left,body.front-page .hf33-left{width:100%!important;max-width:none!important}
  body.home .hf33-right,body.front-page .hf33-right{width:100%!important;max-width:none!important;margin-top:18px}
  body.home .hf33-grid,body.front-page .hf33-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  body.tax-vod_type .hf33-grid,body.tax-vod_genre .hf33-grid,body.tax-vod_topic .hf33-grid,body.post-type-archive-vod .hf33-grid{grid-template-columns:1fr!important}
  body.tax-vod_type .hf33-grid-right,body.tax-vod_genre .hf33-grid-right,body.tax-vod_topic .hf33-grid-right,body.post-type-archive-vod .hf33-grid-right{margin-top:14px}
  body.tax-vod_type .hf33-poster-grid,body.tax-vod_genre .hf33-poster-grid,body.tax-vod_topic .hf33-poster-grid,body.post-type-archive-vod .hf33-poster-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}
@media (max-width:767px){
  .container,.hfnews-wrap,.hf33-wrap,.hf33-search-wrap{width:calc(100% - 20px);padding-left:0;padding-right:0}
  .hanfan-wrap{padding:12px 0}
  .hf33-block,.hfnews-post,.hfnews-sidebox{border-radius:12px}
  .hf33-head{gap:8px;align-items:center}.hf33-title{font-size:19px}.hf33-more{font-size:13px;white-space:nowrap}
  body.home .hf33-grid,body.front-page .hf33-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px 10px!important}
  body.tax-vod_type .hf33-poster-grid,body.tax-vod_genre .hf33-poster-grid,body.tax-vod_topic .hf33-poster-grid,body.post-type-archive-vod .hf33-poster-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px 10px!important}
  .hf33-name{font-size:14px}.hf33-meta{font-size:12px}
  .hf33-pills,.hf33-filter-items,.hfnews-subcats{flex-wrap:nowrap!important;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding-bottom:4px}
  .hf33-pills::-webkit-scrollbar,.hf33-filter-items::-webkit-scrollbar,.hfnews-subcats::-webkit-scrollbar{display:none}
  .hf33-pill,.hfnews-tab{flex:0 0 auto;white-space:nowrap}
  .hfnews-post{padding:14px}
  .hfnews-single .hfnews-title{font-size:23px!important}
  .hfnews-content{font-size:16px;line-height:1.85}
  .hfnews-prevnext{grid-template-columns:1fr}
  .hfnews-prevnext-item a{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .hfnews-mini-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .hfnews-mini-item .t,.hfnews-mini-item .name{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
@media (max-width:380px){
  .container,.hfnews-wrap,.hf33-wrap,.hf33-search-wrap{width:calc(100% - 16px)}
  body.home .hf33-grid,body.front-page .hf33-grid{gap:10px 8px!important}
  body.tax-vod_type .hf33-poster-grid,body.tax-vod_genre .hf33-poster-grid,body.tax-vod_topic .hf33-poster-grid,body.post-type-archive-vod .hf33-poster-grid{gap:12px 8px!important}
  .hfnews-mini-grid{gap:8px}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
