/*
Theme Name: Journal
Description: Twenty Twenty-Five 子主题：中文衬线阅读排版，细线分隔，单一强调色。
Template: twentytwentyfive
Version: 1.13
Text Domain: journal
*/

:root{
  --j-serif:"Songti SC","Noto Serif CJK SC","Source Han Serif SC","STSong","Songti TC","Journal Noto Serif",Georgia,"Times New Roman",serif;
  --j-sans:"PingFang SC","Heiti SC","Noto Sans CJK SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
  --j-ink:#1b1f24;
  --j-muted:#6b7380;
  --j-line:#e3e5e8;
  --j-accent:#1f4e79;
  --j-soft:#f6f6f3;
  --j-gutter:32px;
}

/* ---------- 全局 ---------- */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{
  font-family:var(--j-serif);
  font-size:18px;
  line-height:1.9;
  color:var(--j-ink);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
a{color:var(--j-accent);text-underline-offset:.18em;text-decoration-thickness:1px}
a:hover{text-decoration-thickness:2px}

/* ---------- 报头：站名 + 一行说明 + 分类导航，底下一条粗线 ---------- */
.j-masthead{
  display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:.5rem 2rem;
  max-width:960px;margin:0 auto;padding:1.5rem var(--j-gutter) .9rem;
  box-sizing:content-box;
  border-bottom:0;
}
.j-masthead-wrap,header.wp-block-template-part{border-bottom:4px solid var(--j-ink)}
.j-brand{display:block}
.j-brand > *{margin:0 !important}
.wp-block-site-title,.wp-block-site-title a{
  font-family:var(--j-serif);
  font-size:1.75rem !important;
  line-height:1.2;
  font-weight:700;
  text-decoration:none;
  color:var(--j-ink);
}
.wp-block-site-tagline{
  font-family:var(--j-sans);
  font-size:.875rem !important;
  line-height:1.5;
  color:var(--j-muted);
  margin-top:.25rem !important;
}
.j-nav{
  display:flex;flex-wrap:wrap;gap:0 1.25rem;
  list-style:none;margin:0;padding:0;
  font-family:var(--j-sans);font-size:.9375rem;line-height:1.5;
}
.j-nav a{display:inline-block;padding:.35rem 0;color:var(--j-ink);text-decoration:none}
.j-nav a:hover{color:var(--j-accent);text-decoration:underline}

/* ---------- 文章标题与元信息 ---------- */
.wp-block-post-title{
  font-family:var(--j-serif);
  font-weight:700;
  font-size:clamp(1.9rem,4.4vw,2.7rem) !important;
  line-height:1.35 !important;
  letter-spacing:.01em;
  margin-bottom:.6em;
}
.wp-block-post-title a{text-decoration:none;color:inherit}
.wp-block-post-title a:hover{text-decoration:underline}

/* 作者名不公开：隐藏「Written by … in …」整行，只保留日期和分类在文末 */
.wp-block-post-author-name,
.wp-block-post-author{display:none !important}
main .wp-block-group.is-layout-flex:has(.wp-block-post-author-name){display:none !important}

.wp-block-post-date,.wp-block-post-terms{
  font-family:var(--j-sans);
  font-size:.85rem;
  color:var(--j-muted);
}
.wp-block-post-terms a{color:var(--j-muted);text-decoration:none;border-bottom:1px solid var(--j-line)}

/* ---------- 正文 ---------- */
.wp-block-post-content{font-size:1.0625rem}
.wp-block-post-content p{margin:1.05em 0;text-align:justify;text-justify:inter-ideograph;line-break:strict;word-break:normal}
.wp-block-post-content > p:first-child{font-size:1.1em;color:#2b3138}

/* 二级标题：粗黑线起头，像报刊分栏 */
.wp-block-post-content h2{
  font-family:var(--j-serif);
  font-size:1.5rem;
  line-height:1.45;
  font-weight:700;
  margin:2.8em 0 .9em;
  padding-top:.7em;
  border-top:4px solid var(--j-ink);
}
.wp-block-post-content h3{
  font-family:var(--j-sans);
  font-size:1.05rem;
  font-weight:700;
  letter-spacing:.08em;
  margin:2em 0 .6em;
  color:var(--j-ink);
}

/* 景点简介：编号列表，每条之间留出呼吸，条首名称加粗 */
.wp-block-post-content ol{padding-left:1.6em;margin:1em 0}
.wp-block-post-content ol > li{margin:0 0 1.15em;padding-left:.2em;text-align:justify;text-justify:inter-ideograph}
.wp-block-post-content ol > li::marker{font-family:var(--j-sans);font-weight:700;color:var(--j-accent)}
.wp-block-post-content ul{padding-left:1.4em}
.wp-block-post-content li > strong:first-child{color:var(--j-ink)}

/* 提示块 */
.wp-block-post-content blockquote{
  margin:1.6em 0;padding:.9em 1.2em;
  background:var(--j-soft);
  border-left:3px solid var(--j-accent);
  font-size:.95em;
}
.wp-block-post-content blockquote p{margin:.3em 0}

/* ---------- 图片 ---------- */
.wp-block-post-content img{max-width:100%;height:auto}
.wp-block-post-content figure{margin:2em 0;text-align:center}
.wp-block-post-content figcaption{
  font-family:var(--j-sans);
  font-size:.82rem;color:var(--j-muted);margin-top:.6em;line-height:1.5;
}
/* 路线图：竖版，限宽居中，不撑满 */
.wp-block-post-content img.map{
  display:block;margin:0 auto;
  width:100%;max-width:520px;
  border:1px solid var(--j-line);
}
/* 照片：发布脚本按横竖加 class。横图占满内容宽；竖图限宽居中，避免一屏全是一张图 */
.wp-block-post-content img.photo-wide,
.wp-block-post-content img.photo-tall{display:block;height:auto}
.wp-block-post-content img.photo-wide{width:100%}
.wp-block-post-content img.photo-tall{width:100%;max-width:480px;margin:0 auto}
/* 照片组（发布脚本生成）。电脑上并成一排等高不裁切；四张以上网格，统一裁成 4:3 */
.wp-block-post-content .photo-group{display:flex;gap:.6rem;margin-top:2em;margin-bottom:2em}
.wp-block-post-content .photo-group figure{margin:0;min-width:0;flex:var(--r,1.5) 1 0;text-align:left}
.wp-block-post-content .photo-group img{display:block;width:100%;height:auto;max-width:none;margin:0}
.wp-block-post-content .photo-group figcaption{margin-top:.4em;text-align:left}
.wp-block-post-content .photo-swipe-wrap{flex-wrap:wrap}
.wp-block-post-content .photo-swipe-wrap figure{flex:var(--r,1.5) 1 calc(var(--r,1.5) * 300px)}
.wp-block-post-content .photo-swipe-two-col,
.wp-block-post-content .photo-swipe-many{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.wp-block-post-content .photo-swipe-two-col{grid-template-columns:repeat(2,minmax(0,1fr))}
.wp-block-post-content .photo-swipe-two-col img,
.wp-block-post-content .photo-swipe-many img{aspect-ratio:4/3;object-fit:cover}

/* 封面：按内容宽度，3:2 裁切，不超过 460px 高 */
.wp-block-post-featured-image{margin:1.2em 0 1.6em}
.wp-block-post-featured-image img{
  width:100% !important;height:auto !important;
  aspect-ratio:3/2;max-height:460px;object-fit:cover;object-position:50% 40%;
}

/* ---------- 表格：三线表，行程用 ---------- */
.wp-block-post-content table{
  display:block;overflow-x:auto;
  width:100%;border-collapse:collapse;
  font-family:var(--j-sans);
  font-size:.88rem;line-height:1.6;
  margin:1.4em 0;
}
.wp-block-post-content thead th{
  text-align:left;font-weight:700;
  padding:.55em .8em;
  border-top:2px solid var(--j-ink);border-bottom:1px solid var(--j-ink);
  white-space:nowrap;
}
.wp-block-post-content td{
  padding:.65em .8em;
  border-bottom:1px solid var(--j-line);
  vertical-align:top;
}
.wp-block-post-content td:first-child{white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:600}
.wp-block-post-content td:nth-child(2){min-width:9em}
.wp-block-post-content tbody tr:last-child td{border-bottom:2px solid var(--j-ink)}
/* 交通行（时间格为空）：淡一点、紧一点 */
.wp-block-post-content tbody tr:has(td:first-child:empty) td{
  color:var(--j-muted);font-size:.84em;padding:.25em .8em;border-bottom:0;
}

/* ---------- 首页与分类页：最新一篇作头条，其余一行一篇 ---------- */
.j-main{max-width:960px;margin:0 auto !important;padding:0 var(--j-gutter);box-sizing:content-box}
.j-archive-title{font-family:var(--j-sans);font-size:1rem !important;font-weight:700;margin:1.5rem 0 0}
.j-feed .wp-block-post-template{display:block;list-style:none;margin:0;padding:0}
.j-feed .wp-block-post{
  display:grid;grid-template-columns:minmax(0,1fr) 180px;column-gap:2rem;
  margin:0;padding:1.5rem 0;border-bottom:1px solid var(--j-line);
}
.j-feed .wp-block-post:not(:has(.wp-block-post-featured-image)){grid-template-columns:minmax(0,1fr)}
.j-card-body{grid-column:1;grid-row:1;min-width:0}
.j-card-body > *{margin:0 !important}
.j-feed .wp-block-post-featured-image{grid-column:2;grid-row:1;margin:0;align-self:start}
.j-feed .wp-block-post-featured-image img{aspect-ratio:3/2;max-height:none;display:block}
.j-kicker,.j-kicker a{
  font-family:var(--j-sans);font-size:.8125rem;line-height:1.5;font-weight:700;
  color:var(--j-accent);text-decoration:none;border:0;
}
.j-feed .wp-block-post-title{
  font-size:1.375rem !important;line-height:1.45 !important;letter-spacing:0;
  margin-top:.25rem !important;
}
.j-feed .wp-block-post-excerpt{margin-top:.4rem !important}
.j-feed .wp-block-post-excerpt__excerpt{
  margin:0;font-size:1rem;line-height:1.7;color:#3a4048;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;
}
.j-feed .wp-block-post-excerpt__more-text{display:none}
.j-feed .wp-block-post-date{margin-top:.4rem !important;font-size:.8125rem;line-height:1.5}

/* 头条，只在第一页 */
body:not(.paged) .j-feed .wp-block-post:first-child{
  grid-template-columns:minmax(0,5fr) minmax(0,7fr);align-items:center;padding:2rem 0;
}
body:not(.paged) .j-feed .wp-block-post:first-child:not(:has(.wp-block-post-featured-image)){grid-template-columns:minmax(0,1fr)}
body:not(.paged) .j-feed .wp-block-post:first-child .wp-block-post-title{font-size:2.25rem !important;line-height:1.3 !important}
body:not(.paged) .j-feed .wp-block-post:first-child .wp-block-post-excerpt__excerpt{-webkit-line-clamp:4;font-size:1.0625rem}

.j-feed .wp-block-query-pagination{
  margin:1.5rem 0 0;font-family:var(--j-sans);font-size:.9375rem;
}

/* 中文正文两端对齐：文章段落、列表、提示块、首页摘要，手机也一样 */
.wp-block-post-content p,
.wp-block-post-content li,
.j-feed .wp-block-post-excerpt__excerpt{text-align:justify;text-justify:inter-ideograph}

/* 标题避免末行只剩一个字；最后一篇不要底线，避免和页脚的线重叠 */
.wp-block-post-title{text-wrap:balance}
.j-feed .wp-block-post:last-child{border-bottom:0}

/* ---------- 文章页 ---------- */
.j-single{padding-top:2.5rem;padding-left:var(--j-gutter);padding-right:var(--j-gutter)}
.j-single .wp-block-post-title{margin:.25rem auto .4rem}
.j-single .wp-block-post-content{margin-top:1.5rem}
.j-tags{margin-top:2.5rem}

/* ---------- 页脚 ---------- */
.j-footer{
  max-width:960px;margin:1.5rem auto 0;padding:1.25rem var(--j-gutter) 2.5rem;box-sizing:content-box;
}
footer.wp-block-template-part{margin-top:0}
.j-footer > *{margin:0 !important}
.j-footer .wp-block-site-title,.j-footer .wp-block-site-title a{font-size:1rem !important}
.j-footer{border-top:1px solid var(--j-line)}

/* ---------- 全屏查看（lightbox.js）---------- */
img.j-zoomable{cursor:zoom-in}
img.j-zoomable:focus:not(:focus-visible){outline:none}
.j-lightbox-open{overflow:hidden}
.j-lightbox{
  position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;
  margin:0;padding:0;border:0;background:#000;cursor:zoom-out;overflow:hidden;
}
.j-lightbox[open]{display:flex;flex-direction:column}
.j-lightbox::backdrop{background:#000}
.j-lb-track{
  flex:1 1 auto;min-height:0;display:flex;overflow-x:auto;overflow-y:hidden;
  scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;scrollbar-width:none;
}
.j-lb-track::-webkit-scrollbar{display:none}
.j-lb-slide{
  flex:0 0 100%;min-width:0;height:100%;display:flex;flex-direction:column;
  scroll-snap-align:center;scroll-snap-stop:always;
}
.j-lb-slide img{display:block;flex:1 1 auto;min-height:0;width:100%;object-fit:contain}
.j-lb-slide p{
  flex:none;margin:0;padding:.6rem var(--j-gutter) calc(.8rem + env(safe-area-inset-bottom));
  font-family:var(--j-sans);font-size:.875rem;line-height:1.5;color:#e8e8e8;text-align:center;
}
.j-lb-count{
  position:absolute;top:calc(.6rem + env(safe-area-inset-top));right:.75rem;
  padding:.1rem .5rem;font-family:var(--j-sans);font-size:.8125rem;line-height:1.5;
  color:#fff;background:rgba(0,0,0,.55);pointer-events:none;
}
.j-lb-count:empty{display:none}
/* 左右按钮只给鼠标设备，手机上直接滑 */
.j-lb-nav{display:none}
@media (hover:hover) and (pointer:fine){
  .j-lb-nav{
    display:block;position:absolute;top:50%;transform:translateY(-50%);
    width:3rem;height:4.5rem;padding:0;border:0;cursor:pointer;
    font-size:2.25rem;line-height:1;color:#fff;background:rgba(0,0,0,.45);
  }
  .j-lb-nav:hover{background:rgba(0,0,0,.75)}
  .j-lb-nav:disabled{opacity:.25;cursor:default}
  .j-lb-prev{left:.75rem}
  .j-lb-next{right:.75rem}
  .j-lb-single .j-lb-nav{display:none}
}

/* ---------- 不需要的区块 ---------- */
.wp-block-comments,
.wp-block-post-comments-form,
.wp-block-comments-query-loop{display:none !important}

/* ---------- 手机 ---------- */
@media (max-width:640px){
  :root{--j-gutter:20px}
  .j-single{padding-top:1.25rem}
  body{font-size:18px;line-height:1.85}
  /* 文章页：正文 18px，标题 26px，左右留白 20px */
  .wp-block-post-title{font-size:1.625rem !important;line-height:1.4 !important}
  .wp-block-post-content{font-size:1.125rem}
  .wp-block-post-content > p:first-child{font-size:1em}
  .wp-block-post-content h2{font-size:1.3125rem;margin-top:2.2em}
  .wp-block-post-content h3{font-size:1.0625rem}
  /* 报头 */
  .j-masthead{padding-top:1.1rem;padding-bottom:.6rem}
  .wp-block-site-title,.wp-block-site-title a{font-size:1.5rem !important}
  .wp-block-site-tagline{font-size:.8125rem !important}
  /* 列表：标题在左、小图在右，不放摘要 */
  .j-feed .wp-block-post{grid-template-columns:minmax(0,1fr) 88px;column-gap:1rem;padding:1.1rem 0}
  .j-feed .wp-block-post-featured-image img{aspect-ratio:1/1;max-height:none}
  .j-feed .wp-block-post-title{font-size:1.1875rem !important;line-height:1.45 !important}
  .j-feed .wp-block-post-excerpt{display:none}
  /* 头条：图在上，通栏 */
  body:not(.paged) .j-feed .wp-block-post:first-child{display:block;padding:0 0 1.25rem}
  body:not(.paged) .j-feed .wp-block-post:first-child .wp-block-post-featured-image{margin:0 calc(-1 * var(--j-gutter)) .9rem}
  body:not(.paged) .j-feed .wp-block-post:first-child .wp-block-post-featured-image img{aspect-ratio:3/2}
  body:not(.paged) .j-feed .wp-block-post:first-child .wp-block-post-title{font-size:1.625rem !important;line-height:1.4 !important}
  body:not(.paged) .j-feed .wp-block-post:first-child .wp-block-post-excerpt{display:block}
  body:not(.paged) .j-feed .wp-block-post:first-child .wp-block-post-excerpt__excerpt{font-size:1rem;-webkit-line-clamp:3}
  .wp-block-post-featured-image img{max-height:260px}
  /* 照片和封面在手机上通栏，图注仍留白；竖图也用满宽度 */
  .wp-block-post-content > figure:has(img.photo-wide),
  .wp-block-post-content > figure:has(img.photo-tall),
  .j-single .wp-block-post-featured-image{
    margin-left:calc(-1 * var(--j-gutter)) !important;
    margin-right:calc(-1 * var(--j-gutter)) !important;
    max-width:none !important;width:auto;
  }
  .wp-block-post-content > figure img.photo-tall{max-width:none;max-height:420px;object-fit:cover}
  .wp-block-post-content > figure figcaption{padding:0 var(--j-gutter)}
  /* 并排：手机上也两列，裁成统一比例 */
  .wp-block-post-content .photo-pair figure{flex:1 1 0}
  .wp-block-post-content .photo-pair-wide img{aspect-ratio:1/1;object-fit:cover}
  .wp-block-post-content .photo-pair-tall img{aspect-ratio:3/4;object-fit:cover}
  /* 横滑：固定高 300px，露出下一张的边缘，右上角标张数 */
  .wp-block-post-content .photo-swipe{
    display:flex;flex-wrap:nowrap;gap:.5rem;overflow-x:auto;
    scroll-snap-type:x mandatory;scroll-padding-left:var(--j-gutter);
    -webkit-overflow-scrolling:touch;scrollbar-width:none;
    margin-left:calc(-1 * var(--j-gutter)) !important;
    margin-right:calc(-1 * var(--j-gutter)) !important;
    max-width:none !important;
    padding:0 var(--j-gutter);
  }
  .wp-block-post-content .photo-swipe::-webkit-scrollbar{display:none}
  .wp-block-post-content .photo-swipe figure{
    flex:none;position:relative;scroll-snap-align:start;width:min(calc(300px * var(--r,1.5)),84vw);
  }
  .wp-block-post-content .photo-swipe img{height:300px;width:100%;aspect-ratio:auto;object-fit:cover}
  .wp-block-post-content .photo-swipe figure::after{
    content:attr(data-i) " / " attr(data-total);
    position:absolute;top:.5rem;right:.5rem;padding:.1rem .5rem;
    font-family:var(--j-sans);font-size:.75rem;line-height:1.5;color:#fff;background:rgba(0,0,0,.55);
  }
  /* 行程表：手机上改成竖排，每个地点一块，时间在上 */
  .wp-block-post-content table{display:block;overflow:visible;font-size:.9rem}
  .wp-block-post-content thead{display:none}
  .wp-block-post-content tbody,
  .wp-block-post-content tr,
  .wp-block-post-content td{display:block;width:auto}
  .wp-block-post-content tr{padding:.75em 0;border-bottom:1px solid var(--j-line)}
  .wp-block-post-content td{border:0 !important;padding:.05em 0 !important;min-width:0 !important}
  .wp-block-post-content td:first-child{font-size:.85em;color:var(--j-accent)}
  .wp-block-post-content td:nth-child(2){font-weight:700;font-size:1.02em}
  .wp-block-post-content td:nth-child(3){color:#3a4048}
  .wp-block-post-content td:empty{display:none}
  .wp-block-post-content tbody tr:last-child{border-bottom:2px solid var(--j-ink)}
  .wp-block-post-content tbody tr:has(td:first-child:empty){padding:.15em 0;border-bottom:0}
  .wp-block-post-content tbody tr:has(td:first-child:empty) td:nth-child(2){
    font-weight:400;font-size:.82em;color:var(--j-muted);padding-left:.4em !important}
}
@media print{
  .wp-block-post-content h2{break-after:avoid}
  .wp-block-post-content img.map{max-width:420px}
}
