/* ===== Mobile-first design — Sip mocha, share soul. ===== */
:root {
  --bg: #ffffff;
  --bg-alt: #faf7f5;
  --text: #1a1a1a;
  --text-soft: #555;
  --text-muted: #888;
  --accent: #8B5A3C;          /* mocha brown */
  --accent-soft: #f4e8e0;     /* light cream */
  --accent-deep: #5C3A24;     /* deep espresso */
  --line: #ececec;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --maxw: 480px;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bot: env(safe-area-inset-bottom, 0);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 15px;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* ===== Top bar (logo + sitename + drawer trigger) ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  padding-top: calc(10px + var(--safe-top));
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
}

.topbar__logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar__logo-fallback {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
}

.topbar__title {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.topbar__sitename {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__tagline {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.topbar__menu {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar__menu:active {
  background: var(--line);
}

.topbar__menu-icon {
  width: 22px;
  height: 16px;
  position: relative;
}

.topbar__menu-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
}

.topbar__menu-icon span:nth-child(1) { top: 0; }
.topbar__menu-icon span:nth-child(2) { top: 7px; }
.topbar__menu-icon span:nth-child(3) { top: 14px; }

.topbar__menu.is-open .topbar__menu-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.topbar__menu.is-open .topbar__menu-icon span:nth-child(2) { opacity: 0; }
.topbar__menu.is-open .topbar__menu-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Drawer menu ===== */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 200;
}

.drawer-mask.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 78%;
  max-width: 320px;
  background: var(--bg);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__header {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.drawer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer__brand-name {
  font-weight: 700;
  font-size: 18px;
}

.drawer__brand-url {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.drawer__nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.drawer__nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  font-size: 15px;
  color: var(--text);
  border-left: 3px solid transparent;
  transition: background 0.15s;
}

.drawer__nav-item:active,
.drawer__nav-item:hover {
  background: var(--bg-alt);
  border-left-color: var(--accent);
}

.drawer__nav-item.is-active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.drawer__nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.drawer__footer {
  padding: 14px 18px calc(14px + var(--safe-bot));
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Main layout ===== */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 14px;
  padding-bottom: calc(20px + var(--safe-bot));
}

/* ===== Page header ===== */
.page-header {
  padding: 18px 0 12px;
}

.page-header__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
}

.page-header__title {
  font-size: 24px;
  font-weight: 800;
  margin-top: 4px;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.page-header__sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-soft);
}

/* ===== Hero (index) ===== */
.hero {
  margin: 14px 0 18px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  box-shadow: var(--shadow);
}

.hero__media {
  position: relative;
  aspect-ratio: 16/10;
  background: var(--line);
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.hero__body {
  padding: 12px 14px 16px;
}

.hero__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.hero__desc {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero__meta {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== Section ===== */
.section {
  margin: 22px 0;
}

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.section__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.section__link {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

/* ===== Card list ===== */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.card {
  display: flex;
  gap: 12px;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}

.card:active {
  transform: scale(0.98);
}

.card__media {
  flex: 0 0 110px;
  aspect-ratio: 1/1;
  background: var(--line);
  overflow: hidden;
  border-radius: 8px;
  position: relative;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 4px 4px 0;
}

.card__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.1px;
}

.card__meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card__meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}

.card__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  letter-spacing: 0.4px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.card__media {
  position: relative;
}
.card--horizontal {
  flex-direction: column;
}

.card--horizontal .card__media {
  flex: none;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 0;
}

/* ===== List page controls ===== */
.list-toolbar {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.search {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-alt);
  border-radius: 10px;
  padding: 8px 12px;
  gap: 8px;
}

.search input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
}

.search input::placeholder {
  color: var(--text-muted);
}

.search__icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pagination button,
.pagination a {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 0 10px;
  transition: background 0.15s;
}

.pagination button:disabled,
.pagination a.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.pagination button.is-active,
.pagination a.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pagination button:active:not(:disabled),
.pagination a:active {
  background: var(--bg-alt);
}

/* ===== Detail page ===== */
.detail {
  padding-bottom: 30px;
}

.detail__cover {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--line);
  overflow: hidden;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: -1px;
}

.detail__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail__head {
  padding: 16px 0 8px;
}

.detail__cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail__title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 6px;
  letter-spacing: -0.4px;
}

.detail__meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.detail__meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.detail__meta-author {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed transparent;
  transition: border-color .25s;
}
.detail__meta-author:hover {
  border-bottom-color: var(--accent);
}

.detail__desc {
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.6;
}

.detail__body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}

.detail__body p {
  margin: 14px 0;
}

.detail__body h2,
.detail__body h3,
.detail__body h4 {
  margin: 22px 0 10px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.detail__body h2 { font-size: 19px; }
.detail__body h3 { font-size: 17px; }
.detail__body h4 { font-size: 15px; }

.detail__body img {
  width: 100%;
  border-radius: var(--radius);
  margin: 16px 0;
  background: var(--line);
}

.detail__body video {
  width: 100%;
  border-radius: var(--radius);
  margin: 16px 0;
  background: #000;
  display: block;
}

.detail__body ul,
.detail__body ol {
  padding-left: 22px;
  margin: 12px 0;
}

.detail__body li {
  margin: 6px 0;
}

.detail__body blockquote {
  margin: 16px 0;
  padding: 10px 14px;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  color: var(--text-soft);
  font-style: italic;
}

.detail__body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Source-site gallery chrome cleaned up — keep inline images clean */
.detail__body svg {
  display: none !important;
}

.detail__body .bb-cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  letter-spacing: 0.2px;
}

.detail__body .bb-cta-pill::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><rect x='3' y='3' width='18' height='18' rx='2'/><circle cx='9' cy='9' r='1.6' fill='currentColor'/><path d='M21 15l-5-5L5 21'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><rect x='3' y='3' width='18' height='18' rx='2'/><circle cx='9' cy='9' r='1.6' fill='currentColor'/><path d='M21 15l-5-5L5 21'/></svg>") center / contain no-repeat;
}

/* WordPress gallery wrappers — strip default flex behaviour, just stack */
.detail__body .wp-block-gallery {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}
.detail__body .wp-block-gallery figure {
  margin: 0;
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
}
.detail__body .wp-block-gallery figure img {
  width: 100%;
  margin: 0;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.detail__body figure {
  margin: 16px 0;
}

.detail__body figcaption {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.detail__tags {
  margin: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail__tag {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--text-soft);
}

.detail__nav {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ===== Author info card at bottom of article ===== */
.detail__author-box {
  margin: 28px 0 20px;
  padding: 18px;
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.detail__author-box-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.detail__author-avatar {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  overflow: hidden;
  flex-shrink: 0;
}
.detail__author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail__author-meta {
  flex: 1;
  min-width: 0;
}
.detail__author-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}
.detail__author-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  text-decoration: none;
  display: inline-block;
}
.detail__author-title {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 3px;
}
.detail__author-loc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.detail__author-creds {
  margin-top: 12px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.5;
  border-left: 3px solid var(--accent);
}
.detail__author-bio {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.65;
}
.detail__author-more {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.detail__author-more-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail__author-more-title::before {
  content: "📚";
  font-size: 14px;
}
.detail__author-more-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail__author-more-grid .card {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.detail__author-more-grid .card__media {
  flex: 0 0 88px;
}
.detail__author-viewall {
  display: block;
  margin-top: 12px;
  padding: 10px;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.detail__author-viewall:hover {
  background: var(--accent-soft);
}

.detail__nav-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  text-align: left;
}

.detail__nav-btn:active {
  background: var(--line);
}

.detail__nav-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.detail__nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.detail__nav-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.detail__nav-btn--next {
  text-align: right;
  align-items: flex-end;
}

/* ===== Skeleton / loader ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 0%, var(--line) 50%, var(--bg-alt) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty {
  padding: 40px 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== Footer ===== */
.foot {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding: 22px 14px 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}
.foot__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-bottom: 12px;
}
.foot__nav-item {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.foot__nav-item:hover,
.foot__nav-item:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.foot__nav-item.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.foot__contact {
  margin-bottom: 10px;
  font-size: 12px;
}
.foot__contact a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.foot__contact a:hover {
  text-decoration: underline;
}
.foot__contact-label {
  color: var(--text-muted);
  font-weight: 600;
}
.foot__copy {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.drawer__footer {
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-muted);
}
.drawer__footer-link {
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 600;
}
.drawer__footer-link:hover {
  color: var(--accent);
}

/* ===== Utilities ===== */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.3s ease-out both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive — but ONLY mobile. No desktop layouts. */
@media (min-width: 640px) {
  body {
    background: #f0f0f0;
  }
  .topbar,
  .container,
  .drawer {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
  .drawer {
    margin-right: auto;
  }
  .topbar {
    border-radius: 0 0 var(--radius) var(--radius);
    margin-top: 12px;
  }
  .container {
    background: var(--bg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border-radius: var(--radius);
    margin-top: 12px;
    padding: 0 16px 24px;
    overflow: hidden;
  }
  .topbar__menu {
    margin-right: 12px;
  }
}