/* Mobile reading surfaces. Desktop cards and all underlying content stay intact. */
.reading-date-short { display: none; }

@media (max-width: 760px) {
  body.front-ui .reading-date-full { display: none; }
  body.front-ui .reading-date-short { display: inline; }

  /* Topic directory: compact, readable cards instead of narrow text columns. */
  body.front-ui .topic-catalog-heading { gap: 10px; margin-bottom: 16px; }
  body.front-ui .topic-catalog-grid { gap: 10px; }
  body.front-ui .topic-catalog-card {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 13px; padding: 14px; align-items: center;
    border-radius: 12px; box-shadow: none;
  }
  body.front-ui .topic-catalog-card > .topic-catalog-art { width: 76px; border-radius: 8px; }
  body.front-ui .topic-catalog-card-copy { min-width: 0; }
  body.front-ui .topic-catalog-card h2 { margin: 0 0 4px; font-size: 16px; line-height: 1.45; }
  body.front-ui .topic-catalog-card-copy > p { margin: 0; font-size: 12px; line-height: 1.6; -webkit-line-clamp: 2; }
  body.front-ui .topic-catalog-card-meta { margin-top: 8px; font-size: 11px; }

  /* The topic introduction reads full-width; the art is only an accent. */
  body.front-ui .topic-catalog-hero {
    position: relative; display: block; padding: 16px; margin-bottom: 14px;
    border-radius: 12px; box-shadow: none; min-height: 0;
  }
  body.front-ui .topic-catalog-hero > .topic-catalog-art {
    position: absolute; top: 16px; right: 16px; width: 52px; height: 35px;
    border-radius: 6px; opacity: .9;
  }
  body.front-ui .topic-catalog-hero-copy { min-width: 0; }
  body.front-ui .topic-catalog-hero-copy > span { display: none; }
  body.front-ui .topic-catalog-hero h1 { padding-right: 65px; margin: 0 0 8px; font-size: 22px; line-height: 1.45; }
  body.front-ui .topic-catalog-hero-copy > p { font-size: 13px; line-height: 1.7; margin: 0 0 10px; }
  body.front-ui .topic-catalog-hero-copy > small { font-size: 12px; }
  body.front-ui .topic-catalog-submit { display: inline-flex; width: auto; min-height: 36px; padding: 7px 12px; margin-top: 12px; font-size: 12px; }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-main { border-radius: 12px; box-shadow: none; }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-list-heading { padding: 13px 14px; gap: 6px; }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-list-heading h2 { font-size: 16px; }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-list-heading small { font-size: 10px; }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-list-heading > div > span { font-size: 11px; padding: 2px 6px; }

  /* Shared article/category/topic lists: title and cover share the first row;
     metadata uses the entire second row. Keep one mobile layout for all three. */
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-row {
    display: grid; grid-template-columns: minmax(0, 1fr) 68px;
    grid-template-rows: auto auto; align-items: start; gap: 10px 12px;
    padding: 15px 14px; min-height: 0;
  }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-copy { display: contents; }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-copy h2 {
    grid-column: 1; grid-row: 1; margin: 0; min-width: 0;
    font-size: 16px; font-weight: 600; line-height: 1.55;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
    overflow: hidden; overflow-wrap: anywhere;
  }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-cover {
    grid-column: 2; grid-row: 1; width: 68px; height: 54px;
    aspect-ratio: auto; border-radius: 7px; margin: 2px 0 0;
  }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-summary,
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-tags { display: none; }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-meta {
    grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center;
    flex-wrap: wrap; gap: 6px 10px; margin: 0; font-size: 11px; line-height: 1.5;
  }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-category { padding: 2px 6px; font-size: 11px; flex-shrink: 0; }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-author { min-width: 0; max-width: 42%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-meta time { flex-basis: auto; margin-left: auto; white-space: nowrap; font-size: 11px; color: #7a8580; }

  /* Legacy keyword/author cards are enriched by public-interactions.js after load.
     Explicit areas override that late stylesheet without modifying the script. */
  body.front-ui .compact-news { display: grid; gap: 0; padding: 0; border: 1px solid #dfe6e2; border-radius: 12px; background: #fff; overflow: clip; }
  body.front-ui .compact-news > article,
  body.front-ui .compact-news article.deepui-auto-card {
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "meta";
    align-items: start; gap: 10px 12px; margin: 0; padding: 15px 14px;
    border: 0; border-bottom: 1px solid #e9eeeb; border-radius: 0; box-shadow: none; min-height: 0;
  }
  body.front-ui .compact-news article.deepui-auto-card { grid-template-columns: minmax(0, 1fr) 68px; grid-template-areas: "title cover" "meta meta"; }
  body.front-ui .compact-news > article:last-child { border-bottom: 0; }
  body.front-ui .compact-news > article > h2 {
    grid-area: title; margin: 0; min-width: 0; font-size: 16px; line-height: 1.55; font-weight: 600;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere;
  }
  body.front-ui .compact-news article.deepui-auto-card > .deepui-auto-cover {
    grid-area: cover; width: 68px; height: 54px; margin: 2px 0 0; aspect-ratio: auto; border-radius: 7px;
  }
  body.front-ui .compact-news article.deepui-auto-card > h2 { margin: 0; font-size: 16px; }
  body.front-ui .compact-news > article > p,
  body.front-ui .compact-news article.deepui-auto-card > p,
  body.front-ui .compact-news > article > .article-list-tags { display: none; }
  body.front-ui .compact-news > article > small {
    grid-area: meta; display: flex; flex-wrap: wrap; align-items: center;
    gap: 6px 10px; margin: 0; font-size: 11px; line-height: 1.5; color: #7a8580;
  }
  body.front-ui .compact-news > article > small > a { min-width: 0; max-width: 43%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.front-ui .compact-news > article > small > a:first-child { background: #edf4ee; color: #48674c; padding: 2px 6px; border-radius: 4px; }
  body.front-ui .compact-news .reading-meta-dot { display: none; }
  body.front-ui .compact-news .reading-date-short { margin-left: auto; white-space: nowrap; font-size: 11px; }
  body.front-ui.page-keyword .keyword-hero { padding: 16px 14px 12px; margin-bottom: 0; }
  body.front-ui.page-keyword .keyword-hero h1 { font-size: 23px; line-height: 1.4; }
  body.front-ui.page-keyword .keyword-hero .eyebrow,
  body.front-ui.page-keyword .keyword-hero > div > p,
  body.front-ui.page-keyword .tag-intro-panel .listing-intro-copy { display: none; }
  body.front-ui.page-keyword .tag-intro-panel { padding: 12px 14px; margin-bottom: 12px; border-radius: 10px; min-height: 0; }
  body.front-ui.page-keyword .tag-intro-panel::before { display: none; }
  body.front-ui.page-keyword .tag-intro-panel .listing-intro-aside { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 0; border: 0; }
  body.front-ui.page-keyword .listing-intro-count { display: flex; align-items: baseline; gap: 5px; }
  body.front-ui.page-keyword .listing-intro-count strong { font-size: 16px; }
  body.front-ui.page-keyword .listing-intro-aside > a { font-size: 12px; }

  /* Reading page: comfortable text, light metadata and secondary blocks below. */
  body.front-ui.page-article .article-layout { width: calc(100% - 28px); margin: 16px auto; }
  body.front-ui.page-article .article-prose { padding: 18px 16px; border-radius: 12px; }
  body.front-ui.page-article .article-prose > h1 { margin: 0 0 12px; font-size: 23px; line-height: 1.5; letter-spacing: 0; }
  body.front-ui.page-article .article-prose > .lead { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid #cadbc9; background: #f5f8f5; font-size: 14px; line-height: 1.75; }
  body.front-ui.page-article .article-byline { font-size: 12px; line-height: 1.6; gap: 5px 8px; margin: 0; }
  body.front-ui.page-article .article-prose > hr { margin: 14px 0; }
  body.front-ui.page-article .detail-actions { margin-bottom: 18px; gap: 10px; }
  body.front-ui.page-article .article-taxonomy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 0; font-size: 12px; line-height: 1.7; }
  body.front-ui.page-article .article-taxonomy > i { display: none; }
  body.front-ui.page-article .article-taxonomy > nav { display: flex; flex-wrap: wrap; flex-basis: 100%; gap: 6px; }
  body.front-ui.page-article .article-taxonomy > nav > a { padding: 3px 7px; border-radius: 5px; background: #f0f5ef; font-size: 11px; }
  body.front-ui.page-article .article-topic-list > a { padding: 12px 17px; gap: 10px; }
  body.front-ui.page-article .article-topic-list > p { padding: 12px 17px; }
  body.front-ui.page-article .article-topic-list b { font-size: 14px; line-height: 1.5; }
  body.front-ui.page-article .article-topic-list p { margin: 3px 0; font-size: 12px; line-height: 1.6; }
}

@media (max-width: 360px) {
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-row { grid-template-columns: minmax(0, 1fr); }
  body.front-ui:is(.page-articles, .page-category, .page-topic) .article-index-cover { display: none; }
  body.front-ui .compact-news article.deepui-auto-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "meta"; }
  body.front-ui .compact-news article.deepui-auto-card > .deepui-auto-cover { display: none; }
  body.front-ui .topic-catalog-card { grid-template-columns: 60px minmax(0, 1fr); gap: 10px; }
  body.front-ui .topic-catalog-card > .topic-catalog-art { width: 60px; }
}
