/*
Theme Name: Gossip Gazette
Description: ColorNews 中文新闻子主题。
Template: colornews
Version: 1.2.1
License: GNU General Public License v2 or later
Text Domain: jianwen
*/

:root {
  /* ColorNews reduces the root font size to 62.5%. Use the reader's default. */
  font-size: 100%;
  --news-ink: #202329;
  --news-muted: #5b626d;
  --news-red: #a01e35;
  --news-red-dark: #791326;
  --news-border: #e4e7ec;
  --news-surface: #f6f7f9;
  --news-focus: #1768bd;
  --news-font: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --news-size-meta: .8125rem;
  --news-size-item: 1rem;
  --news-size-nav: 1.125rem;
  --news-size-section: 1.375rem;
  --news-size-lead: 1.625rem;
  --news-gap: clamp(1.25rem, 2.5vw, 2.25rem);
}

body {
  background: #fff;
  color: var(--news-ink);
  font: var(--news-size-item)/1.65 var(--news-font);
}

h1, h2, h3, h4, h5, h6, button, input, textarea, select {
  font-family: inherit;
}

#page { box-shadow: none; }
.tg-container { max-width: 1240px; width: calc(100% - 48px); }
.home .tg-container { max-width: 1440px; }
.tg-container > .tg-inner-wrap { width: 100%; }
#main { padding-top: var(--news-gap); }
#primary, #secondary { min-width: 0; }

:is(a, button, input, textarea, select):focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--news-focus);
  outline-offset: 3px;
}

/* Masthead and primary navigation */
.middle-header-wrapper { padding: 1.125rem 0; }
.middle-header-wrapper .tg-inner-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#header-text { min-width: 0; }
#site-title {
  margin: 0;
  font-size: clamp(1.625rem, 2.8vw, 2.125rem);
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
#site-title a { color: var(--news-red); }
#site-description {
  margin: .25rem 0 0;
  color: var(--news-muted);
  font-size: .875rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.header-advertise {
  min-width: 0;
  width: min(100%, 25rem);
  margin: 0 0 0 auto;
}
.header-advertise .widget_search {
  border: 0;
  margin: 0;
  padding: 0;
}

.bottom-header-wrapper { background: var(--news-red); }
.bottom-header-wrapper::before,
.bottom-header-wrapper::after,
.bottom-header-wrapper > .bottom-arrow-wrap::before,
.bottom-header-wrapper > .bottom-arrow-wrap::after { display: none; }

#site-navigation :is(ul > li, ul > li.menu-item-has-children) { padding: 0; }
#site-navigation ul > li a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: .55rem 1.05rem;
  font-size: var(--news-size-nav);
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
#site-navigation ul > li.menu-item-has-children > a { padding-inline-end: 2rem; }
#site-navigation ul > li.menu-item-has-children > a::after { right: .85rem; }
#site-navigation ul > li:is(:hover, :focus-within, .current-menu-item, .current-menu-ancestor, .current-menu-parent) > a {
  background: var(--news-red-dark);
}
#site-navigation ul > li:is(.current-menu-item, .current-menu-ancestor, .current-menu-parent, .current_page_item) > a {
  box-shadow: inset 0 -3px #fff;
}
#site-navigation :is(.sub-menu, .children) { background: var(--news-red-dark); }
#site-navigation :is(.sub-menu, .children) a { font-size: var(--news-size-item); }
#site-navigation :is(a, .menu-toggle):focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}
#site-navigation:not(:has(.menu)) .menu-toggle { display: none; }

@media (min-width: 769px) {
  .bottom-header-wrapper .tg-inner-wrap {
    display: flex;
    align-items: flex-start;
  }
  #site-navigation { min-width: 0; }
  #site-navigation > .menu { display: block !important; }
  #site-navigation > ul,
  #site-navigation > .menu > ul {
    display: flex;
    flex-wrap: wrap;
  }
  .share-search-wrap { flex: none; margin-inline-start: auto; }
}

.searchform {
  display: flex;
  max-width: 100%;
}

.searchform input.search-field {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
  height: 44px;
  margin: 0;
  padding: .55rem .8rem;
  border: 1px solid #c8cdd5;
  border-radius: 5px 0 0 5px;
  background: var(--news-surface);
  color: var(--news-ink);
  font-size: var(--news-size-item);
}
.searchform button.searchsubmit {
  position: static;
  flex: 0 0 auto;
  width: auto;
  min-width: 4.5rem;
  height: 44px;
  margin: 0;
  padding: 0 .75rem;
  border-radius: 0 5px 5px 0;
  background: var(--news-red);
  color: #fff;
  font-size: var(--news-size-item);
}
.searchform button.searchsubmit:hover { background: var(--news-red-dark); }
.home-search .searchform button.searchsubmit {
  position: static;
  height: 44px;
  background: var(--news-red-dark);
}

/* Homepage uses the same widget areas as ColorNews. */
.news-home-layout {
  /* The main region contains two tracks and their shared gutter. */
  --news-sidebar-column: calc((100% - 2 * var(--news-gap)) / 3);
  display: grid;
  gap: var(--news-gap);
}
.news-home-layout::before,
.news-home-layout::after { display: none; }
.news-home-layout > :is(#primary, #secondary) { width: 100%; margin: 0; }

@media (min-width: 961px) {
  .news-home-layout:has(> #secondary) {
    grid-template-columns: minmax(0, 1fr) var(--news-sidebar-column);
  }
  .left-sidebar .news-home-layout:has(> #secondary) {
    grid-template-columns: var(--news-sidebar-column) minmax(0, 1fr);
  }
  .left-sidebar .news-home-layout > #secondary { grid-area: 1 / 1; }
  .left-sidebar .news-home-layout:has(> #secondary) > #primary { grid-area: 1 / 2; }
  .no-sidebar .news-home-layout > #primary {
    width: min(100%, 58rem);
    margin-inline: auto;
  }
}

#main .title-block-wrap {
  margin: 0 0 1rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--news-border);
  background: transparent;
  color: var(--news-ink);
  font-size: var(--news-size-section);
  font-weight: 700;
  line-height: 1.35;
  overflow: visible;
  overflow-wrap: anywhere;
}
#main .title-block-wrap .block-title {
  padding: 0;
  background: transparent !important; /* Parent category widgets set an inline fill. */
}
.block-title::after { display: none; }
#main .block-title > span { z-index: auto; }

.news-home-layout :is(.magazine-block-1, .magazine-block-2) > .tg-block-wrapper {
  margin: 0 0 var(--news-gap);
  padding: 0;
  border: 0;
}
.news-home-layout .magazine-block-1 .featured-post-wrapper > .tg-column-wrapper,
.news-home-layout .middle-section-wrapper > .tg-column-wrapper,
.news-featured-columns {
  display: grid;
  gap: var(--news-gap);
  margin: 0;
  width: auto;
}
.news-home-layout :is(.magazine-block-1 .featured-post-wrapper, .middle-section-wrapper) > .tg-column-wrapper::before,
.news-home-layout :is(.magazine-block-1 .featured-post-wrapper, .middle-section-wrapper) > .tg-column-wrapper::after { display: none; }
.news-home-layout :is(.magazine-block-1 .featured-post-wrapper, .middle-section-wrapper) > .tg-column-wrapper > .tg-column-2 {
  min-width: 0;
  margin: 0;
  width: auto;
}

@media (min-width: 641px) {
  .news-home-layout :is(.middle-section-wrapper, .magazine-block-1 .featured-post-wrapper)
    > .tg-column-wrapper:has(> .tg-column-2 + .tg-column-2),
  .news-featured-columns:has(> .news-story-column + .news-story-column) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.news-home-featured { margin-bottom: var(--news-gap); }
.news-story-column { min-width: 0; }

#main .news-home-layout .news-lead-link {
  position: relative;
  display: grid;
  align-items: end;
  isolation: isolate;
  aspect-ratio: 16 / 9;
  padding: clamp(.875rem, 1.4vw, 1.25rem);
  overflow: hidden;
  border-radius: 6px;
  background: var(--news-surface);
  color: var(--news-ink);
}
#main .news-home-layout .news-lead-link:has(.news-lead-image) {
  background: var(--news-ink);
  color: #fff;
}
.news-lead-image,
.news-lead-link:has(.news-lead-image)::after {
  position: absolute;
  inset: 0;
}
.news-lead-image {
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-lead-link:has(.news-lead-image)::after {
  content: "";
  z-index: -1;
  background: linear-gradient(to bottom, transparent 25%, #11151da6 66%, #11151df5 100%);
}
.news-lead-copy,
.news-story-copy { min-width: 0; }
.news-lead-title {
  margin: 0;
  color: inherit;
  font-size: clamp(1.125rem, 1.35vw, 1.25rem);
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.news-lead-link:is(:hover, :focus-visible) .news-lead-title,
.news-story-link:is(:hover, :focus-visible) .news-story-title { text-decoration: underline; }
.news-story-date {
  display: block;
  margin-top: .3rem;
  color: var(--news-muted);
  font-size: var(--news-size-meta);
  font-weight: 400;
  line-height: 1.4;
}
.news-lead-link:has(.news-lead-image) .news-story-date { color: #f0f1f4; }

#main .news-story-list {
  margin: .75rem 0 0;
  padding: 0;
  list-style: none;
}
#main .news-story-list > li {
  margin: 0;
  padding: 0;
  border: 0;
}
#main .news-story-list > li + li { border-top: 1px solid var(--news-border); }
#main .news-home-layout .news-story-link {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: .75rem;
  padding: .75rem 0;
  color: var(--news-ink);
  font-size: var(--news-size-item);
  line-height: 1.5;
}
.news-story-title { font-weight: 600; overflow-wrap: anywhere; }
.news-story-thumbnail {
  flex: 0 0 auto;
  width: clamp(4rem, 27%, 7.75rem);
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  object-fit: cover;
}

.entry-title {
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-transform: none;
}
.entry-title a { color: var(--news-ink); }
.entry-title a:hover { color: var(--news-red); }

.news-home-layout .first-post figure img,
.news-home-layout .following-post figure img,
.news-listing-media img {
  display: block;
  width: 100%;
  border-radius: 5px;
  object-fit: cover;
}

.news-home-layout .first-post figure img { aspect-ratio: 16 / 9; }
.news-home-layout :is(.first-post, .following-post) figure > a { display: block; }
.news-home-layout .first-post .entry-title {
  margin: .75rem 0 .375rem;
  font-size: var(--news-size-lead);
  font-weight: 700;
  line-height: 1.4;
}
.news-home-layout .magazine-block-2 .first-post .entry-title {
  font-size: var(--news-size-section);
}
.news-home-layout .entry-btn a,
.news-listing a.more-link {
  color: var(--news-red);
  font-size: .875rem;
  font-weight: 600;
}

.news-home-layout .following-post .single-article {
  display: flex;
  gap: .75rem;
  margin: 0 0 .75rem;
  padding: 0 0 .75rem;
  border-bottom: 1px solid var(--news-border);
}
.news-home-layout .following-post .single-article::before,
.news-home-layout .following-post .single-article::after { display: none; }
.news-home-layout .following-post .single-article:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.news-home-layout .following-post figure {
  flex: 0 0 clamp(4rem, 27%, 7.75rem);
  width: auto;
  margin: 0;
}
.news-home-layout .following-post figure img { aspect-ratio: 16 / 9; }
.news-home-layout .following-post .article-content {
  min-width: 0;
  padding: 0;
}
.news-home-layout .following-post .entry-title {
  display: block;
  margin: 0 0 .25rem;
  font-size: var(--news-size-item);
  font-weight: 600;
}

.below-entry-meta,
#main .posted-on {
  color: var(--news-muted);
  font: 400 var(--news-size-meta)/1.45 var(--news-font);
}
#main .below-entry-meta a,
#main .posted-on a { color: inherit; }
#main .below-entry-meta a:hover,
#main .posted-on a:hover { color: var(--news-red); }
#main .below-entry-meta .comments { display: none; }
#main .following-post .below-entry-meta.featured-no-image { margin-inline-start: 0; }

.news-home-layout > #secondary {
  align-self: start;
}
#secondary .widget { margin-bottom: var(--news-gap); }
#secondary :is(.widget_text, .widget_recent_entries, .widget_categories) {
  padding: 0;
  border: 0;
}
#secondary :is(.widget_recent_entries, .widget_categories) ul { padding-inline-start: 0; }
#secondary :is(.widget_recent_entries, .widget_categories) li {
  padding: .5rem 0;
  border-bottom: 1px solid var(--news-border);
}
#secondary :is(.widget_recent_entries, .widget_categories) a {
  padding: 0;
  color: var(--news-ink);
  font-size: var(--news-size-item);
  line-height: 1.5;
}
#secondary :is(.widget_recent_entries, .widget_categories) a::before { display: none; }
#secondary :is(.widget_recent_entries, .widget_categories) a:hover { color: var(--news-red); }
#secondary .post-date {
  display: block;
  margin-top: .15rem;
  color: var(--news-muted);
  font-size: var(--news-size-meta);
}
.site .widget a { overflow-wrap: anywhere; }
.news-intro {
  padding: .875rem 1rem;
  border-inline-start: 3px solid var(--news-red);
  background: var(--news-surface);
  color: var(--news-muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}

/* Editorial hierarchy for the homepage sidebar's existing widgets. */
.news-home-layout > #secondary > :is(.widget_recent_entries, .widget_categories, .widget_text:has(.news-intro)) {
  margin-bottom: 1.75rem;
}
#main .news-home-layout > #secondary > .widget_text:has(.news-intro) > .widget-title {
  margin-bottom: .3rem;
  padding: 0;
  border: 0;
  color: var(--news-muted);
  font-size: var(--news-size-meta);
}
.news-home-layout > #secondary .news-intro {
  padding: 0;
  border: 0;
  background: transparent;
  line-height: 1.65;
}
.news-home-layout > #secondary .news-intro small { font-size: var(--news-size-meta); }

#main .news-home-layout > #secondary > .widget_categories > .widget-title {
  margin-bottom: .375rem;
  font-size: var(--news-size-nav);
}
.news-home-layout > #secondary > .widget_categories > ul:not(:has(ul)) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.125rem;
  max-inline-size: 32rem;
  margin-bottom: 0;
}
.news-home-layout > #secondary > .widget_categories > ul:not(:has(ul)) > li {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  padding: 0;
  color: var(--news-muted);
  font-size: var(--news-size-meta);
}
.news-home-layout > #secondary > .widget_categories > ul:not(:has(ul)) > li > a {
  flex: 1;
  min-width: 0;
  padding-block: .5rem;
}

/* Category feeds, search results, and article pages */
#main .page-header .page-title {
  padding: 0 0 .6rem;
  border-bottom: 1px solid var(--news-border);
  border-radius: 0;
  background: transparent;
  color: var(--news-ink);
  font-size: var(--news-size-lead);
  line-height: 1.4;
  text-transform: none;
  overflow-wrap: anywhere;
}
#main article.news-listing {
  margin: 0 0 1rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--news-border);
}
.news-listing-layout {
  display: flex;
  align-items: flex-start;
  gap: clamp(.75rem, 2.2vw, 1.5rem);
}
.news-listing-copy { flex: 1 1 auto; min-width: 0; }
.news-listing-media { flex: 0 0 clamp(6rem, 16vw, 11rem); }
.news-listing-media img { aspect-ratio: 4 / 3; }
article.news-listing.post.hentry h2.entry-title {
  margin: 0 0 .35rem;
  font-size: var(--news-size-section);
  line-height: 1.38;
  text-transform: none;
}
.news-listing.post .entry-title a { font: inherit; }

.news-listing-meta,
.news-article-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .25rem .75rem;
  overflow-wrap: anywhere;
}
#main :is(.news-listing-meta, .news-article-meta) .posted-on > a,
#main :is(.news-listing-meta, .news-article-meta) .below-entry-meta { margin: 0; }
:is(.news-listing-meta, .news-article-meta) .below-entry-meta > span::after { display: none; }
:is(.news-listing-meta, .news-article-meta) .cat-links { margin-inline-end: .25rem; }
:is(.news-listing-meta, .news-article-header) .cat-links a {
  display: inline-block;
  padding: .15rem .4rem;
  border-radius: 3px;
  background: var(--news-red);
  color: #fff;
  font-size: var(--news-size-meta);
  font-weight: 600;
}
:is(.news-listing-meta, .news-article-header) .cat-links a:hover { text-decoration: underline; }

.news-listing :is(.entry-content, .entry-summary) {
  margin: .45rem 0 0;
  color: var(--news-muted);
  overflow-wrap: anywhere;
}
.news-listing :is(.entry-content, .entry-summary) p { margin: 0 0 .35rem; }
.news-listing a.more-link {
  margin: 0;
  padding: 0;
  background: transparent;
}
.news-listing a.more-link:hover {
  background: transparent;
  color: var(--news-red-dark);
  text-decoration: underline;
}
.no-results .searchform { max-width: 28rem; }
.no-results .searchform input.search-field,
.error-404 .searchform input.search-field {
  width: 0 !important; /* Override the parent empty-page input width. */
}
.error-404 .searchform { max-width: 28rem; margin-inline: auto; }

.news-article-header { margin: 0 0 1.25rem; }
.news-article-header .category-collection { margin-bottom: .55rem; }
article.news-article.post.hentry h1.entry-title {
  margin: 0 0 .65rem;
  font-size: clamp(1.75rem, 3vw, 2.375rem);
  line-height: 1.35;
  font-weight: 700;
  text-transform: none;
}
.news-article-image { margin: 0 0 1.25rem; }
.news-article-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
}
.news-article .entry-content {
  font-size: 1.125rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.news-article .entry-content > :is(p, h2, h3, h4, ul, ol, blockquote) { max-width: 42em; }

@media (max-width: 960px) {
  #main .news-home-layout > #secondary {
    grid-area: auto;
    padding: var(--news-gap) 0 0;
    border: 0;
    border-top: 1px solid var(--news-border);
  }
}

@media (min-width: 641px) and (max-width: 960px) {
  .news-home-recent:not(:has(> nav)),
  .news-home-recent > nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--news-gap);
  }
  .news-home-recent > .widget-title { grid-column: 1 / -1; }
  .news-home-recent .news-lead-card { align-self: start; }
  #main .news-home-recent .news-story-list { margin-top: 0; }
}

@media (max-width: 768px) {
  .tg-container { width: calc(100% - 32px); }
  .middle-header-wrapper { padding: .9rem 0; }
  .middle-header-wrapper .tg-inner-wrap { flex-wrap: wrap; gap: .65rem; }
  #header-text { max-width: 100%; }
  .header-advertise { width: 100%; }

  #site-navigation .menu-toggle {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: auto;
    min-height: 46px;
    padding: 0 .6rem;
    color: #fff;
    font: 500 var(--news-size-item)/1.4 var(--news-font);
  }
  #site-navigation .menu-toggle::before { font-size: 1.125rem; line-height: 1; }
  #site-navigation .menu { background: var(--news-red); }
  #site-navigation ul > li a { padding-inline: 1rem; font-size: var(--news-size-item); }
  #site-navigation ul > li.menu-item-has-children > a { padding-inline-end: 3.25rem; }
  #site-navigation ul.sub-menu li > a { padding-inline-start: 2rem; }
}

@media (max-width: 640px) {
  .news-home-layout .first-post { margin-bottom: 0; }
  .news-home-layout .magazine-block-2 .first-post { margin-bottom: 1rem; }
  .news-home-layout .first-post .entry-title { font-size: var(--news-size-section); }
  article.news-listing.post.hentry h2.entry-title { font-size: var(--news-size-nav); }
  .news-listing-media { flex-basis: 5.5rem; }
  .news-article .entry-content { font-size: 1.0625rem; }
}

@media (max-width: 360px) {
  .news-listing-layout { flex-direction: column; }
  .news-listing-media { flex-basis: auto; width: min(100%, 11rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
