/*
Theme Name: 網管人
Theme URI: https://netadmin.iba.works
Author: HMG
Description: 網管人雜誌網站主題
Version: 0.4.31
Text Domain: netadmin
*/

:root {
  /* Brand: 網管人 */
  --brand: #0536b6;
  --brand-dark: #042a92;
  --accent: #4a69c0;
  --hmg-green: #0536b6;
  --nav-active: #e31c23;
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #15162e;
  --ink-soft: #4a4d6a;
  --rule: #e5e7ef;
  --max: 1200px;
  --home-max: 1070px;
  --header-fg: #0536b6;
  --header-h: 220px;
  --wp-admin-bar-h: 0px;
}

body.admin-bar {
  --wp-admin-bar-h: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar {
    --wp-admin-bar-h: 46px;
  }
}

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

html {
  scroll-padding-top: calc(var(--header-h) + var(--wp-admin-bar-h));
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", 微軟正黑體, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* WP global-styles inline resets body padding; keep room for fixed header */
body.hmg-fixed-header {
  padding-top: var(--header-h) !important;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.home-wrap {
  max-width: min(var(--home-max), calc(100% - 2rem));
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

/* —— Ad slots (mem.com.tw: ≥1070px → 728×90, else 300×250 for leaderboard) —— */
.hmg-ad {
  margin: 0 0 1.25rem;
  line-height: 0;
}

.hmg-ad__panel {
  margin: 0 auto;
}

.hmg-ad__panel img,
.hmg-ad__panel iframe {
  max-width: 100%;
  vertical-align: bottom;
}

.hmg-ad__panel--728 {
  width: 728px;
  max-width: 100%;
  min-height: 90px;
}

.hmg-ad--leaderboard .hmg-ad__panel--300 {
  display: none;
  width: 300px;
  max-width: 100%;
  min-height: 250px;
}

@media (max-width: 1069px) {
  .hmg-ad--leaderboard .hmg-ad__panel--728 {
    display: none;
  }

  .hmg-ad--leaderboard .hmg-ad__panel--300 {
    display: block;
  }
}

.hmg-ad--mrec .hmg-ad__panel--only {
  width: 300px;
  max-width: 100%;
  min-height: 250px;
}

.hmg-ad__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: repeating-linear-gradient(
    -45deg,
    #eef0f6,
    #eef0f6 8px,
    #e3e6ef 8px,
    #e3e6ef 16px
  );
  border: 1px dashed #c5cad9;
  color: #6b7088;
  font-size: 0.78rem;
  line-height: 1.35;
  padding: 0.5rem;
  text-align: center;
}

.hmg-ad__panel--728 .hmg-ad__placeholder {
  min-height: 90px;
}

.hmg-ad__panel--300 .hmg-ad__placeholder {
  min-height: 250px;
}

.home-side .hmg-ad {
  margin-bottom: 1.5rem;
}

.site-header {
  position: fixed;
  top: var(--wp-admin-bar-h);
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  color: var(--header-fg);
  box-shadow: 0 6px 8px rgb(0 0 0 / 8%);
}

.site-header__bar {
  background: var(--brand);
  color: #fff;
  font-size: 0.82rem;
}

.site-header__bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 28px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.site-header__tagline { opacity: 0.95; }

.site-header__brand-row { background: #fff; }

.site-header__brand-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1.25rem;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.site-header__ad {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.site-header__ad .hmg-ad {
  margin-bottom: 0;
  width: 100%;
}

@media (max-width: 1069px) {
  .site-header__ad {
    flex: 1 1 100%;
    order: 3;
  }
}

.site-brand {
  display: flex;
  align-items: center;
  line-height: 0;
  flex: 0 0 auto;
}

.site-brand__logo {
  display: block;
  height: 52px;
  width: auto;
}

.site-search {
  display: flex;
  align-items: stretch;
  flex: 0 1 360px;
  max-width: 360px;
  width: 100%;
  margin-left: auto;
}

.site-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid #cfd3e2;
  border-right: 0;
  border-radius: 0;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-size: 0.92rem;
}

.site-search button {
  flex: 0 0 auto;
  border: 0;
  background: var(--brand);
  color: #fff;
  padding: 0 1rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.site-search button:hover { background: var(--brand-dark); }

.site-nav {
  border-top: 1px solid var(--rule);
  background: #fff;
}

.site-nav__logo-shrink {
  display: none;
  align-items: center;
  line-height: 0;
  flex: 0 0 auto;
}

.site-nav__logo-shrink img {
  display: block;
  height: 32px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

.site-header--shrink {
  box-shadow: 0 6px 8px rgb(0 0 0 / 8%);
}

.site-header--shrink .site-header__bar,
.site-header--shrink .site-header__brand-row,
.site-header--shrink .site-header__tools,
.site-header--shrink .site-header__ticker {
  display: none;
}

.site-header__tools {
  background: #fff;
  border-bottom: 1px solid var(--rule);
}

.site-header__tools-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1.25rem;
  padding: 0.55rem 0;
}

.site-header__keywords {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.85rem;
  flex: 1 1 280px;
  min-width: 0;
  font-size: 0.88rem;
}

.site-header__keywords-label {
  color: var(--ink-soft);
  flex: 0 0 auto;
}

.site-header__keywords-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.site-header__keywords-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.site-header__keywords-list a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.site-search--tools {
  flex: 0 1 360px;
  max-width: 360px;
  width: 100%;
  margin-left: auto;
}

.site-header__ticker {
  background: #fff;
  border-bottom: 1px solid var(--rule);
}

.site-header__ticker-inner {
  padding: 0.35rem 0 0.55rem;
}

.site-header__ticker-bar {
  position: relative;
  min-height: 2rem;
  max-width: min(740px, 100%);
  overflow: hidden;
}

.site-header__ticker-item {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 2rem;
  color: var(--nav-active);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header__ticker-item.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.site-header__ticker-item a {
  color: inherit;
  text-decoration: none;
}

.site-header__ticker-item a:hover {
  text-decoration: underline;
}

.site-header--shrink .site-nav {
  border-top: 0;
}

.site-header--shrink .site-nav__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.site-header--shrink .site-nav__logo-shrink {
  display: flex;
}

.site-header--shrink .site-nav ul {
  flex: 1 1 auto;
}

.site-header--shrink .site-nav ul a {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  font-size: 0.92rem;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.site-nav ul a {
  display: block;
  padding: 0.85rem 1rem;
  color: #111;
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  position: relative;
}

.site-nav ul a:hover {
  color: var(--brand);
  text-decoration: none;
}

.site-nav .current-menu-item > a::after,
.site-nav .current_page_item > a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.35rem;
  width: 1.4rem;
  height: 3px;
  margin-left: -0.7rem;
  background: var(--nav-active);
}

.site-header__inner,
.site-footer__inner,
.site-main {
  max-width: min(var(--max), calc(100% - 2.5rem));
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-main.home-portal,
.site-main.portal-page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.site-footer__inner.home-wrap {
  max-width: min(var(--home-max), calc(100% - 2rem));
  padding: 0 1rem;
}


/* —— mem-inspired homepage —— */
.home-hero {
  background: var(--paper);
  padding: 1.25rem 0 1.5rem;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 198px;
  gap: 4px;
}

.post-grid__item {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.post-grid__item > a {
  position: relative;
  display: block;
  color: #fff;
  text-decoration: none;
  height: 100%;
  overflow: hidden;
}

.post-grid__media {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  background: #1a1a1a;
}

.post-grid__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(0,0,0,0.72), rgba(0,10,0,0.35) 55%, rgba(61,61,61,0));
  pointer-events: none;
}

.post-grid__media--empty {
  background: linear-gradient(145deg, var(--brand-dark), var(--brand));
}

.post-grid__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease-in-out;
}

.post-grid__item > a:hover .post-grid__media img {
  transform: scale3d(1.08, 1.08, 1);
}

.post-grid__info {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.55rem 0.9rem 0.75rem;
  line-height: 1.4;
}

.post-grid__title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.post-grid__item--lead .post-grid__title {
  font-size: 1.55rem;
}

.post-grid__time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  opacity: 0.88;
  font-weight: 400;
}

/* Mobile: lead spans the row, the rest pair up; an unpaired last item also spans. */
@media (max-width: 767px) {
  .post-grid__item--lead,
  .post-grid__item:not(.post-grid__item--lead):last-child:nth-child(even) {
    grid-column: 1 / -1;
  }
  .post-grid {
    grid-auto-rows: auto;
  }
  .post-grid__item {
    height: 198px;
  }
  .post-grid__item--lead {
    height: 240px;
  }
}

@media (min-width: 768px) {
  .post-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: 198px 198px;
    grid-auto-rows: 198px;
  }
  .post-grid__item--lead {
    grid-column: 1 / span 2;
    grid-row: 1 / span 2;
  }
  .post-grid__item--lead .post-grid__title {
    font-size: 1.85rem;
  }
}

.home-main,
.home-side {
  min-width: 0;
}

.home-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-top: 1.75rem;
  padding-bottom: 2.5rem;
}

@media (min-width: 960px) {
  .home-body {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 2.25rem;
  }
}

.home-block {
  margin: 0 0 2rem;
}

.home-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0;
}

.home-block__title {
  display: inline-block;
  margin: 0;
  color: #fff;
  background: var(--brand);
  line-height: 1;
  padding: 7px 12px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}

a.home-block__title:hover {
  color: #fff;
  text-decoration: none;
  filter: brightness(1.08);
}

.home-block__more {
  color: var(--brand);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  padding-right: 0.15rem;
}

.home-block__more:hover {
  text-decoration: underline;
}

.home-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem 1.25rem;
}

.home-list__item {
  min-width: 0;
}

.home-list__item a {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
}

.home-list__item a:hover {
  color: var(--brand);
  text-decoration: none;
}

.home-list__thumb {
  display: block;
  overflow: hidden;
  background: #eee;
  aspect-ratio: 16 / 9;
  width: 100%;
}

.home-list__thumb--empty {
  background: linear-gradient(145deg, var(--brand-dark), var(--accent));
}

.home-list__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.home-list__body {
  display: block;
  min-width: 0;
}

.home-list__title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
}

.home-list__time {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .home-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .home-list {
    grid-template-columns: 1fr;
  }
}

.home-issues {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .home-issues {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.home-issues a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
}

.home-issues a:hover {
  color: var(--brand);
  text-decoration: none;
}

.home-issues__cover {
  display: block;
  overflow: hidden;
  background: #eee;
  border: 1px solid var(--rule);
  aspect-ratio: 3 / 4;
  margin-bottom: 0.45rem;
}

.home-issues__cover--empty {
  background: linear-gradient(160deg, var(--brand-dark), var(--brand));
}

.home-issues__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-issues__label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.home-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-side-list li {
  border-bottom: 1px solid var(--rule);
}

.home-side-list a {
  display: block;
  padding: 0.75rem 0;
  color: var(--ink);
  text-decoration: none;
}

.home-side-list a:hover {
  color: var(--brand);
  text-decoration: none;
}

.home-side-list__title {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
}

.home-side-list__time {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.home-focus {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.home-focus:hover {
  color: var(--brand);
  text-decoration: none;
}

.home-focus img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
  margin-bottom: 0.65rem;
}

.home-focus__label {
  display: block;
  font-weight: 700;
  font-size: 1rem;
}

.home-focus__meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.banner {
  background: linear-gradient(120deg, var(--brand-dark), var(--brand));
  color: #fff;
  padding: 2.5rem 0;
  margin-bottom: 1.5rem;
}

.banner h1 { margin: 0 0 0.5rem; font-size: 1.75rem; }
.banner p { margin: 0; opacity: 0.9; }

.restore-note {
  background: #fff3cd;
  border: 1px solid #ffe08a;
  color: #664d03;
  padding: 0.75rem 1rem;
  margin: 1rem auto;
  max-width: var(--max);
  border-radius: 6px;
  font-size: 0.9rem;
}

.article-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  padding-bottom: 1.5rem;
}

.navigation.pagination,
.hmg-pagination {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 2.75rem;
}

.navigation.pagination .nav-links,
.hmg-pagination .nav-links,
.navigation.pagination > ul.page-numbers,
.hmg-pagination > ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navigation.pagination ul.page-numbers li,
.hmg-pagination ul.page-numbers li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.navigation.pagination .nav-links > .page-numbers,
.hmg-pagination .nav-links > .page-numbers,
.navigation.pagination ul.page-numbers > li > .page-numbers,
.hmg-pagination ul.page-numbers > li > .page-numbers,
.navigation.pagination ul.page-numbers > li > span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  min-height: 2.4rem;
  padding: 0 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.navigation.pagination a.page-numbers:hover,
.hmg-pagination a.page-numbers:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  text-decoration: none;
}

.navigation.pagination .page-numbers.current,
.hmg-pagination .page-numbers.current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  cursor: default;
}

.navigation.pagination .page-numbers.dots,
.hmg-pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
  min-width: 1.5rem;
  padding: 0 0.2rem;
}

.navigation.pagination .prev,
.navigation.pagination .next,
.hmg-pagination .prev,
.hmg-pagination .next {
  padding: 0 1rem;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card__body { padding: 1rem 1.1rem 1.25rem; flex: 1; }
.card__meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.card__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  line-height: 1.4;
}
.card__title a { color: var(--ink); }
.card__excerpt { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }

.single-article {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 2rem 1.75rem 2.75rem;
  margin: 1.5rem auto 2.5rem;
  max-width: 720px;
}

.site-main.single-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 1.5rem 1.75rem;
  align-items: start;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  max-width: min(var(--max), calc(100% - 2.5rem));
  width: 100%;
}

.single-layout .single-article {
  margin: 0 0 0.5rem;
  max-width: 760px;
  justify-self: start;
  width: 100%;
}

.issue-rail {
  position: sticky;
  top: calc(var(--header-h) + var(--wp-admin-bar-h) + 0.85rem);
  max-height: calc(100vh - var(--header-h) - var(--wp-admin-bar-h) - 1.75rem);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.issue-rail__inner {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.95rem 0.85rem 1.1rem;
}

.issue-rail__heading {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand-dark);
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--rule);
}

.issue-rail__heading a {
  color: var(--brand-dark);
  text-decoration: none;
}

.issue-rail__heading a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.issue-rail__section {
  margin: 0 0 0.85rem;
}

.issue-rail__section:last-child {
  margin-bottom: 0;
}

.issue-rail__section-title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--brand);
}

.issue-rail__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.issue-rail__list li {
  margin: 0;
}

.issue-rail__list a {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.38rem 0.45rem;
  margin: 0 -0.2rem;
  border-radius: 5px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.4;
}

.issue-rail__list a:hover {
  background: rgba(29, 32, 136, 0.08);
  text-decoration: none;
}

.issue-rail__list .is-current a {
  background: rgba(29, 32, 136, 0.12);
  color: var(--brand-dark);
  font-weight: 600;
}

.issue-rail__title {
  flex: 1 1 auto;
  min-width: 0;
}

.issue-rail__page {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  padding-top: 0.08rem;
}

.single-article .entry-title {
  margin: 0 0 0.85rem;
  font-size: 1.75rem;
  line-height: 1.4;
  color: var(--brand-dark);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.entry-meta {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.entry-content {
  font-size: 1.0625rem;
  line-height: 1.95;
  letter-spacing: 0.03em;
  color: var(--ink);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.entry-content p {
  margin: 0 0 1.5em;
  text-align: justify;
  text-justify: inter-ideograph;
}

.entry-content p:last-child {
  margin-bottom: 0;
}

.entry-content h2,
.entry-content h3 {
  color: var(--brand-dark);
  margin: 1.85em 0 0.75em;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 1.5em;
  padding-left: 1.4em;
  line-height: 1.9;
}

.entry-content li {
  margin: 0 0 0.45em;
}

.entry-content figure.hmg-pdf-figure,
.entry-content figure.hmg-figure,
.entry-content figure.hmg-table,
.entry-content figure {
  margin: 1.75em 0;
  padding: 0;
}

.entry-content figure img,
.entry-content img.hmg-pdf-image,
.entry-content img.hmg-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
  background: #eef0f8;
}

.entry-content figcaption,
.entry-content .hmg-caption {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-top: 0.55rem;
  line-height: 1.6;
}

.entry-content .hmg-lead {
  font-size: 1.05rem;
  line-height: 1.9;
  background: #eef0f8;
  border-left: 3px solid var(--accent);
  padding: 1rem 1.15rem;
  margin: 0 0 1.75rem;
  border-radius: 0 4px 4px 0;
}

.entry-content h2 {
  border-left: 4px solid var(--accent);
  padding-left: 0.65rem;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0.5rem 0 0;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--rule);
  padding: 0.45rem 0.65rem;
  vertical-align: top;
}

.entry-content pre.hmg-code {
  background: #eef0f8;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.7;
}

.entry-content aside.hmg-aside {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.15rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: 1.75rem 0;
}

.article-back {
  margin: 0 0 1rem;
  font-size: 0.92rem;
}

.toc-page {
  padding-top: 1.75rem;
  padding-bottom: 2.5rem;
}

.toc-page > .article-back {
  margin: 0 0 1.25rem;
}

.issue-grid {
  list-style: none;
  margin: 1.75rem 0 2.5rem;
  padding: 0;
  display: grid;
  gap: 1.35rem;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
}

.issue-card {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 61, 46, 0.04);
}

.issue-card a {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
  height: 100%;
}

.issue-card a:hover {
  background: transparent;
}

.issue-card a:hover .issue-card__label {
  color: var(--brand);
}

.issue-card__cover {
  display: block;
  aspect-ratio: 3 / 4;
  background: #d8dcf0;
  overflow: hidden;
}

.issue-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.issue-card__cover--empty {
  background: linear-gradient(145deg, #d8dcf0, #9aa6d8);
}

.issue-card__body {
  display: block;
  padding: 0.85rem 0.95rem 1.05rem;
}

.issue-card__label {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.issue-card__meta {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.site-main.front-issues,
.site-main.toc-page,
.site-main.archive-list {
  max-width: min(var(--max), calc(100% - 2.5rem));
  width: 100%;
}

.front-issues {
  padding-top: 1.5rem;
  flex: 1 0 auto;
}

.issue-hero {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  margin: 0 0 2.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.issue-hero__cover {
  flex: 0 0 8.5rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: 0 6px 18px rgba(15, 61, 46, 0.12);
}

.issue-hero__cover img {
  display: block;
  width: 100%;
  height: auto;
}

.issue-hero__text h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  color: var(--brand-dark);
}

.issue-hero__text p {
  margin: 0;
  color: var(--ink-soft);
}

.browse-alt {
  display: none;
}

.banner--issue .banner__crumb {
  margin: 0 0 0.4rem;
  opacity: 0.9;
  font-size: 0.9rem;
}

.banner--issue .banner__crumb a {
  color: #fff;
}

.toc-section {
  margin: 0 0 2rem;
}

.toc-section__title {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--brand);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.4rem;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-list li {
  border-bottom: 1px solid var(--rule);
}

.toc-list a {
  display: block;
  padding: 0.85rem 0;
  color: var(--ink);
  text-decoration: none;
}

.toc-list a:hover .toc-list__title {
  text-decoration: underline;
  color: var(--brand);
}

.toc-list__title {
  display: block;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.5;
}

.toc-list__meta {
  display: block;
  margin-top: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.site-footer {
  margin-top: auto;
  flex-shrink: 0;
  background: var(--brand);
  color: #fff;
  padding: 1.5rem 0;
  font-size: 0.85rem;
}

.site-footer a { color: #fff; }

.resource-archive {
  padding-top: 0;
  padding-bottom: 0;
}

.portal-crumb {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.portal-crumb a {
  color: var(--ink-soft);
  text-decoration: none;
}

.portal-crumb a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.portal-crumb__current {
  color: var(--ink);
}

.portal-crumb__muted {
  color: var(--ink-soft);
}

/* mem.com.tw /magazine/ — post_layout_4 */
.magazine-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem 1.25rem;
}

.magazine-grid__item {
  min-width: 0;
}

.magazine-grid__item a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
}

.magazine-grid__item a:hover .magazine-grid__title {
  color: var(--brand);
  text-decoration: underline;
}

.magazine-grid__cover {
  display: block;
  margin: 0 auto 0.7rem;
  max-width: 267px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(145deg, #d8dcf0, #9aa6d8);
}

.magazine-grid__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.magazine-grid__cover--empty {
  min-height: 12rem;
}

.magazine-grid__title {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.45;
}

.magazine-grid__date {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.magazine-empty {
  color: var(--ink-soft);
  padding: 1rem 0 2rem;
}

.magazine-archive .hmg-pagination,
.magazine-archive .nav-links {
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .magazine-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .magazine-grid {
    grid-template-columns: 1fr;
  }
}

/* Issue page — mem 各期雜誌 switcher */
.issue-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 0 1rem;
}

.issue-switcher__label {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  white-space: nowrap;
}

.issue-switcher__control {
  flex: 1 1 14rem;
  min-width: 0;
  max-width: 100%;
}

.issue-switcher__select {
  display: block;
  width: 100%;
  max-width: 36rem;
  padding: 0.55rem 2.25rem 0.55rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230536b6' d='M1.4 0 6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.15s ease;
}

.issue-switcher__select:hover {
  border-color: var(--brand);
}

.issue-switcher__select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.issue-switcher__select option {
  background: #fff;
  color: #222;
}

/* mem.com.tw magazine issue TOC — post_layout_2 */
.issue-mast {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
  align-items: flex-end;
  margin: 0 0 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.issue-mast__cover {
  flex: 0 0 8.75rem;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: 0 6px 18px rgba(21, 22, 46, 0.1);
}

.issue-mast__cover img {
  display: block;
  width: 100%;
  height: auto;
}

.issue-mast__text {
  flex: 1 1 16rem;
  min-width: 0;
}

.issue-mast__kicker {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.issue-mast__title {
  margin: 0 0 0.45rem;
  font-size: 1.65rem;
  line-height: 1.35;
  color: var(--brand-dark);
}

.issue-mast__date,
.issue-mast__count {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.magazine-toc {
  margin: 0 0 2rem;
}

.magazine-toc__head {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-dark);
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--brand);
}

.magazine-toc__item + .magazine-toc__item {
  margin-top: 1.15rem;
}

.magazine-toc__item a {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.magazine-toc__item a:hover .magazine-toc__title {
  color: var(--brand);
  text-decoration: underline;
}

.magazine-toc__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
}

.magazine-toc__meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* Magazine article (mem breadcrumb + main + sidebar) */
.magazine-single__layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  align-items: start;
  min-width: 0;
}

.magazine-single__article {
  min-width: 0;
}

.magazine-single .portal-crumb {
  margin-bottom: 1rem;
}

.magazine-single .single-article.magazine-article {
  margin: 0;
  max-width: none;
  padding: 0 0 2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.magazine-single .entry-title {
  font-size: 1.75rem;
  line-height: 1.35;
  margin: 0 0 0.75rem;
}

@media (max-width: 960px) {
  .magazine-single__layout {
    grid-template-columns: 1fr;
  }

  .magazine-single--with-rail .issue-rail {
    position: static;
    max-height: none;
  }
}

/* Single post — same portal shell as category archive */
.post-single__article.single-article {
  margin: 0;
  max-width: none;
  padding: 0 0 2.5rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.post-single .entry-title {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  line-height: 1.35;
  color: var(--brand-dark);
}

.post-single .entry-meta {
  margin-bottom: 1.25rem;
}

.post-single .entry-meta a {
  color: var(--brand);
  text-decoration: none;
}

.post-single .entry-meta a:hover {
  text-decoration: underline;
}

.category-archive .article-grid,
.post-single .entry-content {
  min-width: 0;
}

/* mem.com.tw search — post_layout_5 */
.search-archive {
  padding-top: 0;
  padding-bottom: 0;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-results__item {
  border-bottom: 1px solid var(--brand);
  padding: 1.15rem 0;
}

.search-results__item:first-child {
  padding-top: 0;
}

.search-results__item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.search-results__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 1rem 1.35rem;
  align-items: start;
  color: var(--ink);
  text-decoration: none;
}

.search-results__link:hover {
  color: var(--brand);
  text-decoration: none;
}

.search-results__link:hover .search-results__title {
  text-decoration: underline;
}

.search-results__thumb {
  display: block;
  overflow: hidden;
  background: linear-gradient(145deg, #d8dcf0, #9aa6d8);
  max-height: 150px;
}

.search-results__thumb img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.search-results__thumb--empty {
  min-height: 6rem;
  height: 150px;
}

.search-results__body {
  min-width: 0;
}

.search-results__title {
  margin: 0 0 0.45rem;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.45;
  color: inherit;
}

.search-results__excerpt {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.search-results__date {
  display: block;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.search-empty {
  color: var(--ink-soft);
  padding: 0.5rem 0 2rem;
  margin: 0;
}

.search-archive .hmg-pagination,
.search-archive .nav-links,
.search-archive .pagination,
.category-archive .hmg-pagination,
.category-archive .nav-links,
.category-archive .pagination {
  margin-top: 1.5rem;
}

.category-archive {
  padding-top: 0;
  padding-bottom: 0;
}

@media (max-width: 640px) {
  .search-results__link {
    grid-template-columns: 1fr;
  }

  .search-results__thumb,
  .search-results__thumb img,
  .search-results__thumb--empty {
    max-height: 180px;
    height: auto;
  }

  .search-results__thumb img {
    height: auto;
    max-height: 180px;
  }
}

.resource-archive__head h1 {
  margin: 0 0 1.25rem;
  font-size: 1.75rem;
  color: var(--brand-dark);
}

/* mem.com.tw whitepaper archive — post_layout_4 */
.whitepaper-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
  .whitepaper-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.whitepaper-grid__item {
  min-width: 0;
}

.whitepaper-grid__item a {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr);
  gap: 1rem;
  align-items: start;
  color: var(--ink);
  text-decoration: none;
}

@media (min-width: 768px) {
  .whitepaper-grid__item a {
    grid-template-columns: minmax(0, 1fr);
  }
}

.whitepaper-grid__item a:hover {
  color: var(--brand);
  text-decoration: none;
}

.whitepaper-grid__image {
  display: block;
  line-height: 0;
}

.whitepaper-grid__image img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 250px;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.whitepaper-grid__image--empty {
  min-height: 140px;
  background: linear-gradient(145deg, #d8dcf0, #9aa6d8);
}

@media (min-width: 768px) {
  .whitepaper-grid__image--empty {
    min-height: 180px;
  }
}

.whitepaper-grid__text {
  min-width: 0;
}

.whitepaper-grid__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  color: inherit;
}

.whitepaper-grid__date {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ink-soft);
  font-weight: 400;
}

.whitepaper-grid__item a:hover .whitepaper-grid__title {
  color: var(--brand);
}

.resource-archive--whitepaper .nav-links,
.resource-archive--whitepaper .pagination {
  margin-top: 1.75rem;
}

/* mem.com.tw /seminar/ */
.seminar-section {
  margin: 0 0 2.25rem;
}

.seminar-section--recap {
  margin-top: 2rem;
}

.seminar-section__head {
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.seminar-section__title {
  display: inline-block;
  margin: 0;
  color: #fff;
  background: var(--brand);
  line-height: 1;
  padding: 7px 12px;
  font-size: 1rem;
  font-weight: 500;
}

.seminar-section__empty {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.seminar-lists {
  list-style: none;
  margin: 0;
  padding: 0;
}

.seminar-lists__item + .seminar-lists__item {
  margin-top: 1rem;
}

.seminar-lists a {
  color: var(--ink);
  text-decoration: none;
  line-height: 1.55;
  font-size: 0.95rem;
}

.seminar-lists a:hover {
  color: var(--brand);
  text-decoration: none;
}

.seminar-lists__tag {
  color: var(--nav-active);
  font-weight: 700;
}

.seminar-recap-item {
  margin: 0 0 1.5rem;
}

.seminar-recap-item__link {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.seminar-recap-item__link:hover {
  color: var(--brand);
  text-decoration: none;
}

.seminar-recap-item__link:hover .seminar-recap-item__title {
  text-decoration: underline;
}

.seminar-recap-item__kicker {
  margin: 0 0 3px;
  color: var(--nav-active);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
}

.seminar-recap-item__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  color: inherit;
}

.seminar-recap-item__date {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.seminar-recap-item__excerpt {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.65;
}

.resource-archive--seminar .nav-links,
.resource-archive--seminar .pagination {
  margin-top: 0.5rem;
}

/* mem.com.tw /video/ — post_layout_3 */
.video-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem 1.1rem;
}

.video-grid__item {
  min-width: 0;
}

.video-grid__item a {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.video-grid__item a:hover .video-grid__title {
  color: var(--brand);
  text-decoration: underline;
}

.video-grid__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
  margin-bottom: 0.65rem;
}

.video-grid__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-grid__media--empty {
  background: linear-gradient(145deg, #2a2d4a, #111);
}

.video-grid__title {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.45;
  margin-bottom: 0.35rem;
}

.video-grid__date {
  display: block;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.resource-archive--video .nav-links,
.resource-archive--video .pagination {
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}

.resource-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.resource-rows__item {
  min-width: 0;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.35rem;
}

.resource-rows__item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.resource-rows__item a {
  display: grid;
  grid-template-columns: minmax(140px, 38%) minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: start;
  color: var(--ink);
  text-decoration: none;
}

.resource-rows__item a:hover {
  color: var(--brand);
  text-decoration: none;
}

.resource-rows__item a:hover .resource-rows__title {
  text-decoration: underline;
}

.resource-rows__thumb {
  display: block;
  overflow: hidden;
  background: linear-gradient(145deg, #d8dcf0, #9aa6d8);
  aspect-ratio: 16 / 10;
}

.resource-rows__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resource-rows__thumb--empty {
  min-height: 6.5rem;
}

.resource-rows__title {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.45;
  margin-bottom: 0.35rem;
}

.resource-rows__meta {
  display: block;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

@media (max-width: 560px) {
  .resource-rows__item a {
    grid-template-columns: 1fr;
  }
}

.resource-empty {
  color: var(--ink-soft);
  padding: 1rem 0 2rem;
}

.resource-cover {
  margin: 0 0 1.5rem;
}

.resource-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.resource-embed {
  margin: 0 0 1.5rem;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}

.resource-embed iframe,
.resource-embed video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.resource-download {
  display: inline-block;
  background: var(--brand);
  color: #fff !important;
  font-weight: 700;
  padding: 0.7rem 1.25rem;
  text-decoration: none !important;
  border-radius: 4px;
}

.resource-download:hover {
  background: var(--brand-dark);
}

.whitepaper-gate {
  margin: 2rem 0 0;
  padding: 1.35rem 1.25rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #f8f9fc;
}

.whitepaper-gate__title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  color: var(--brand-dark);
}

.whitepaper-gate__lead {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.whitepaper-gate__hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.whitepaper-gate__field {
  margin: 0 0 0.85rem;
}

.whitepaper-gate__field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.whitepaper-gate__req {
  color: var(--nav-active);
}

.whitepaper-gate__input {
  width: 100%;
  max-width: 28rem;
  border: 1px solid #cfd3e2;
  border-radius: 4px;
  padding: 0.5rem 0.65rem;
  font: inherit;
}

.whitepaper-gate__field--consent label {
  font-weight: 400;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  line-height: 1.5;
}

.whitepaper-gate__check input {
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.whitepaper-gate__actions {
  margin: 1rem 0 0;
}

.whitepaper-gate__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.whitepaper-gate__status {
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
  color: var(--brand-dark);
}

.whitepaper-gate__status--error {
  color: #b42318;
}

@media (max-width: 960px) {
  .site-main.single-layout {
    grid-template-columns: 1fr;
    padding-top: 1rem;
  }
  .issue-rail { display: none; }
  .single-layout .single-article {
    margin: 0 auto;
    max-width: 720px;
  }
}

@media (max-width: 720px) {
  .post-grid__item--lead .post-grid__title { font-size: 1.25rem; }
  .single-article { padding: 1.35rem 1.1rem 2rem; margin-top: 1rem; }
  .single-article .entry-title { font-size: 1.4rem; }
  .entry-content { font-size: 1.02rem; line-height: 1.9; letter-spacing: 0.02em; }
  .entry-content p { text-align: left; margin-bottom: 1.35em; }
  .issue-hero { flex-direction: row; align-items: center; }
  .issue-hero__cover { flex-basis: 6.5rem; }
  .issue-hero__text h1 { font-size: 1.35rem; }
}

/* —— Mobile header (mem.com.tw style): hamburger + centered logo, slide-in drawer —— */

.site-header__toggler,
.site-nav__search {
  display: none;
}

@media (max-width: 1069px) {
  .site-header__brand-inner {
    position: relative;
    flex-wrap: nowrap;
    justify-content: center;
    min-height: 56px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .site-brand__logo {
    height: 44px;
  }

  .site-header__toggler {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 0 6px;
    border: 0;
    background: none;
    cursor: pointer;
  }

  .site-header__toggler span {
    display: block;
    height: 3px;
    border-radius: 2px;
    background: #222;
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  .site-header--nav-open .site-header__toggler span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .site-header--nav-open .site-header__toggler span:nth-child(2) { opacity: 0; }
  .site-header--nav-open .site-header__toggler span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

  .site-header__ad,
  .site-header__tools,
  .site-header__ticker {
    display: none;
  }

  .site-nav {
    position: fixed;
    top: calc(var(--wp-admin-bar-h) + var(--header-h));
    left: 0;
    width: 100%;
    height: calc(100vh - var(--wp-admin-bar-h) - var(--header-h));
    height: calc(100dvh - var(--wp-admin-bar-h) - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 0;
    background: rgb(72 72 72 / 95%);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
  }

  .site-header--nav-open .site-nav {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.3s ease;
  }

  .site-nav__inner {
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  .site-nav__search {
    display: flex;
    max-width: none;
    margin: 0 0 0.5rem;
  }

  .site-nav__search input[type="search"] {
    border-color: #fff;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
  }

  .site-nav ul {
    flex-direction: column;
  }

  .site-nav ul a {
    padding: 1.05rem 0.25rem;
    color: #fff;
    font-size: 1.25rem;
  }

  .site-nav ul a:hover {
    color: #fff;
    opacity: 0.8;
  }

  .site-nav .current-menu-item > a::after,
  .site-nav .current_page_item > a::after {
    left: 0.25rem;
    bottom: 0.6rem;
    margin-left: 0;
  }

  body.has-nav-open {
    overflow: hidden;
  }
}
