/* ==================================================
   Apple Newsroom Style – main.css (Clean Version)
   Works with: nav.ejs + index.ejs + post.ejs
   ================================================== */

/* ---------- Design Tokens ---------- */
:root {
  --bg-color: #f5f5f7;
  --card-bg: #ffffff;

  --text-primary: #1d1d1f;
  --text-secondary: #86868b;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, sans-serif;

  --content-width: 980px;     /* 内容宽度 */
  --content-padding-x: 22px;  /* 两侧 padding */
  --grid-gap: 28px;

  --radius-lg: 28px;
  --radius-md: 20px;

  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.04);
}

/* ---------- Global Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.47;
  color: var(--text-primary);
  background-color: var(--card-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

ul,
li {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

/* ==================================================
   1. NAVIGATION – Desktop & Mobile
   nav.ejs 使用的 .ac-ln-* 系列
   ================================================== */

.ac-ln-shell {
  position: sticky;
  top: 0;
  z-index: 999;
  height: 52px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* 2. 特例状态（仅在 Archive 页面）：
   因为 Archive 页面有筛选器需要吸顶，所以 Nav 必须“让位”滚走 */
body.page-archive .ac-ln-shell {
  position: relative !important; /* 强制覆盖，让它随页面滚走 */
  /* 其他样式继承上面的，不需要重写 */
}

/* 宽度 & 对齐：与正文、卡片完全一致 */
.ac-ln-wrapper {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  height: 52px;
  padding: 0 var(--content-padding-x);
  display: flex;
  align-items: center;
}

.ac-ln-content {
  width: 100%;
  height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

/* 左侧 Blog 标题 */
.ac-ln-title a {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 52px;
}

/* 右侧菜单（桌面） */
.ac-ln-menu {
  display: flex;
  align-items: center;
  height: 52px;
}

.ac-ln-menu-items {
  display: flex;
  align-items: center;
  gap: 28px;
}

.ac-ln-menu-items-desktop  {
  display: flex;
  align-items: center;
}

.ac-ln-menu-item {
  display: flex;
  align-items: center;
  list-style: none;
}

.ac-ln-menu-link {
  display: inline-block;
  line-height: 52px;
  font-size: 17px;
  letter-spacing: -0.374px;
  display: inline-flex;
  align-items: center;
  height: 52px;
}

.ac-ln-menu-link:hover {
  color: #06c;
}

/* 桌面端 Search 胶囊按钮（带 .is-search 类） */
.ac-ln-menu-item.is-search .ac-ln-menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  height: 24px;
  line-height: 24px;
  padding: 0 14px;
  border-radius: 999px;
  background-color: #e8e8ed;
}

.ac-ln-menu-item.is-search .ac-ln-menu-link:hover {
  background-color: #d2d2d7;
}

/* 默认隐藏移动端相关元素 */
.ac-ln-actions,
.ac-ln-menu-tray,
.ac-ln-menucta,
.ac-ln-overlay {
  display: none;
}

/* -------------------------------
   MOBILE NAV (max-width: 768px)
   ------------------------------- */
@media (max-width: 768px) {
  /* 标题稍微缩小，避免挤压右侧 */
  .ac-ln-title a {
    font-size: 19px;
  }

  /* 桌面菜单隐藏 */
  .ac-ln-menu-items-desktop {
    display: none !important;
  }

  /* 显示右侧移动端 actions（菜单 + 搜索） */
  .ac-ln-actions {
    display: flex !important;
    position: absolute;
    right: 14px;
    top: 0;
    height: 52px;
    align-items: center;
    gap: 12px;
    z-index: 2;
  }

  .ac-ln-action {
    display: flex;
    align-items: center;
  }

  /* 移动端搜索胶囊 */
  .ac-ln-search-capsule {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 18px;
    background: #f2f2f7;
    font-size: 13px;
  }

  .ac-ln-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .ac-ln-search-text {
    margin-left: 4px;
  }


  /* 按钮触控区域 */
  .ac-ln-menucta {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    margin: 0;
    margin-right: -12px;
    -webkit-tap-highlight-color: transparent;
  }

  /* Chevron SVG 容器 */
  .ac-ln-menucta-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
  }

  /* SVG 本体 */
  .ac-ln-chevron-svg {
    width: 16px;
    height: 9px;
    stroke-width: 1.6px;
    overflow: visible;
  }
  /* =========================================
     全屏菜单 (Full Screen Overlay) - 布局精修版
     ========================================= */
  .ac-ln-menu-tray {
    display: block !important;
    position: fixed;
    top: 52px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 52px);
    
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: saturate(180%) blur(60px);
    -webkit-backdrop-filter: saturate(180%) blur(60px);
    
    /* 修正点：减小顶部内边距，让选项靠近导航栏 */
    padding: 24px 40px; 
    box-sizing: border-box;
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s step-end;
    z-index: 1;
  }

  .ac-ln-menu.ac-ln-menu-open .ac-ln-menu-tray {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s step-start;
  }

  .ac-ln-menu-tray .ac-ln-menu-items {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    /* 修正点：保持紧凑的垂直间距 */
    gap: 20px; 
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .ac-ln-menu-tray .local-nav-link {
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f;
    text-decoration: none;
    line-height: 1.1; /* 紧凑行高 */
    display: block;
    width: 100%;
    
    /* 初始状态：位移距离稍微加大一点，增加滑入感 */
    opacity: 0;
    transform: translateY(-25px);
    
    /* 慢速物理曲线：更优雅 */
    transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  }

  .ac-ln-menu-tray .local-nav-link.revealed {
    opacity: 1;
    transform: translateY(0);
  }

  /* 遮罩层 (隐藏) */
  .ac-ln-overlay {
    display: none;
  }


}

/* ==================================================
   2. INDEX PAGE – Everydayfeed Grid (index.ejs)
   ================================================== */

.newsroom-main {
  padding: 40px 0 80px;
  background: var(--bg-color);
}

.everydayfeed {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--content-padding-x);
}

.everydayfeed-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: var(--grid-gap);
}

/* 基础卡片外观 */
.newsroom-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.newsroom-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

/* 图片区 */
.newsroom-card__media {
  position: relative;
  overflow: hidden;
}

.newsroom-card__media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;

  opacity: 0.92;
  transform: scale(1);
  transform-origin: center;
  transition:
    transform 400ms cubic-bezier(0.4, 0, 0.25, 1),
    opacity 1000ms cubic-bezier(0.4, 0, 0.25, 1);
}

@media (hover: hover) and (pointer: fine) {
  .newsroom-card:hover .newsroom-card__media img {
    transform: scale(1.005);
    opacity: 1;
  }
}



/* 文字区 */
.newsroom-card__body {
  padding: 20px 24px 24px;
}

.newsroom-card__tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.newsroom-card__title {
  font-size: 24px;
  line-height: 1.25;
  margin: 10px 0 8px;
}

.newsroom-card__date {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ---------- Desktop Grid (≥1024px) ---------- */
@media (min-width: 1024px) {
  /* Hero：独占一行，左右结构（图左文右） */
  .card-hero {
    grid-column: span 6;
    border-radius: var(--radius-lg);
  }

  .card-hero .newsroom-card__link {
    flex-direction: row;
  }

  .card-hero .newsroom-card__media {
    flex: 7;
    min-height: 320px;
  }

  .card-hero .newsroom-card__media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background-color: #fff;
  }

  .card-hero .newsroom-card__body {
    flex: 3;                       /* 保持 Apple Newsroom 文字区宽度比例 */
    display: flex;
    flex-direction: column;
    justify-content: center;       /* 垂直居中，苹果 Newsroom 风 */
    padding: 32px 32px;            /* 更大的留白 */
  }

  .card-hero .newsroom-card__tag {
    margin-bottom: 12px;
  }

  .card-hero .newsroom-card__title {
    font-size: 32px;
    line-height: 1.22;
    margin: 0 0 18px;
  }

  .card-hero .newsroom-card__date {
    margin-top: auto;              /* 日期压到正文块底部 */
    font-size: 17px;
    color: #6e6e73;
  }

  /* Secondary：2 列布局（每个占 3 列） */
  .card-secondary {
    grid-column: span 3;
  }

  /* Standard：3 列布局（每个占 2 列） */
  .card-standard {
    grid-column: span 2;
  }

  /* 默认图片比例，让卡片高度更统一 */
  .card-secondary .newsroom-card__media,
  .card-standard .newsroom-card__media {
    aspect-ratio: 16 / 9;
  }
}

/* ---------- Tablet (735px ~ 1023px)：2 列 ---------- */
@media (min-width: 735px) and (max-width: 1023px) {
  .everydayfeed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-hero,
  .card-secondary,
  .card-standard {
    grid-column: span 2;
  }

  .card-hero .newsroom-card__link {
    flex-direction: column;
  }

  .card-hero .newsroom-card__media {
    aspect-ratio: 16 / 9;
  }
}

/* ---------- Mobile (≤734px)：1 列 ---------- */
@media (max-width: 734px) {
  .everydayfeed {
    padding: 0 12px;
  }

  .everydayfeed-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .card-hero,
  .card-secondary,
  .card-standard {
    grid-column: auto;
  }

  .card-hero .newsroom-card__link {
    flex-direction: column;
  }

  .newsroom-card__body {
    padding: 16px 18px 20px;
  }

  .newsroom-card__title {
    font-size: 20px;
  }
}

/* ==================================================
   3. ARTICLE PAGE (post.ejs) – 基础版
   ================================================== */
/* === Full-width sections (align with navbar & cards) === */

.article-header-outer,
.article-hero-outer {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 22px;
}


.newsroom-article {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 22px 60px;
}


.article-hero {
  width: 100%;
  border-radius: 28px;
  overflow: hidden;
  margin: 0 0 48px;
}

.article-hero img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.article-content {
  font-size: 18px;
  line-height: 1.6;
}

.article-header {
  text-align: left;
  max-width: 700px;
  margin: 0 auto 48px;
  padding-top: 40px;
}

.article-meta-category {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.article-meta-date {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 4px auto 16px;
}

.article-title {
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--text-primary);
}

@media (max-width: 734px) {
  .article-header-outer,
  .article-hero-outer {
    padding: 0 16px;
  }

  /* Article Header */
  .article-header {
    padding-top: 20px;
    margin-bottom: 32px;
    text-align: left; 
  }

  .article-title {
    font-size: 30px;   /* Apple Newsroom Mobile 标题尺寸 */
    
  }

  /* Article Layout */
  .newsroom-article {
    max-width: none;
    padding: 24px 16px 40px;   /* 左右留白，避免贴边 */
  }

  .article-hero {
    border-radius: 16px;
    margin-bottom: 32px;
  }

  .article-content {
    padding: 0 4px;              /* 给文字额外留白 */
  }

  /* 图片等 Media 元素：不能撑破容器 */
  .article-content img,
  .article-content figure,
  .article-content pre,
  .article-content code,
  .article-content blockquote,
  .article-content table {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
  }
}




/* ==================================================
   4. Pagination
   ================================================== */

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 40px 0 0;
}

.pagination .page-number,
.pagination .extend {
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 14px;
}

.pagination .page-number.current {
  background-color: #1d1d1f;
  color: #ffffff;
}

/* ==================================================
   5.Footer — Apple Newsroom Inspired (Centered Layout)
================================================== */

.footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;            /* 核心：让内容水平居中 */
  justify-content: center;

  margin: 80px 0 60px;
  padding: 0 var(--content-padding-x);

  color: var(--text-secondary);
  font-size: 13px;
}

.footer-inner {
  max-width: var(--content-width); /* 与卡片 / 文章保持一致 */
  width: 100%;
}

.footer-line {
  margin: 4px 0;
  text-align: center;              /* 文本居中 (Newsroom footer风格) */
}

/* 链接 hover 效果 */
.footer-line a {
  color: #06c;
  text-decoration: none;
}

.footer-line a:hover {
  text-decoration: underline;
}




