/* Pendar homepage — editorial UI, phase 1.
   Presentation only: existing data, rankings, links and routes are unchanged.
   Scoped to homepage so other views keep their established layout. */

#home-view .home-daily{
  margin-block:14px 24px;
}
#home-daily .home-news-panel{
  min-width:0;
  border-radius:16px;
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:var(--shadow-soft);
}

/* All five editorial modes remain visible at a glance on desktop. */
#home-daily .home-main-tabs{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:6px;
  padding:9px;
  margin:0;
  border-bottom:1px solid var(--line);
  background:var(--surface);
}
#home-daily .home-main-tabs button{
  position:relative;
  width:100%;
  min-width:0;
  min-height:44px;
  padding:8px 9px;
  border:1px solid transparent;
  border-radius:10px;
  color:var(--ink-soft);
  background:transparent;
  white-space:nowrap;
  font:650 clamp(12px,1.4vw,15px)/1.55 "Vazirmatn",sans-serif;
  cursor:pointer;
  transition:background-color .16s,border-color .16s,color .16s;
}
#home-daily .home-main-tabs button:hover{
  color:var(--ink);
  background:var(--surface-2);
}
#home-daily .home-main-tabs button.on,
#home-daily .home-main-tabs button[aria-selected="true"]{
  color:var(--accent);
  background:var(--accent-soft);
  border-color:color-mix(in srgb,var(--accent) 22%,transparent);
  font-weight:800;
}
#home-daily .home-main-tabs button:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
}

/* Consistent editorial rows: strong title, quiet attribution, no decorative
   source-count bar that might be mistaken for a reliability score. */
#home-daily-stories .home-intel-row-rich{
  gap:14px;
  min-height:104px;
  padding:14px 17px;
  align-items:center;
  border-bottom:1px solid var(--line);
  transition:background-color .15s;
}
#home-daily-stories .home-intel-row-rich:last-child{
  border-bottom:0;
}
#home-daily-stories .home-intel-row-rich:hover{
  background:var(--surface-2);
}
#home-daily-stories .home-intel-copy{
  gap:4px;
  align-items:stretch;
  min-width:0;
}
#home-daily-stories .home-intel-copy>b{
  font-family:"Vazirmatn",system-ui,sans-serif;
  font-size:clamp(15px,1.35vw,17px);
  font-weight:700;
  line-height:1.8;
  letter-spacing:0;
  text-align:right;
  overflow-wrap:break-word;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}
#home-daily-stories .home-intel-copy>small{
  color:var(--ink-faint);
  font-size:11.5px;
  line-height:1.6;
  font-weight:450;
}
#home-daily-stories .home-intel-rank{
  flex:0 0 26px;
  width:26px;
  height:26px;
  font:700 12px/1 "Vazirmatn",sans-serif;
}
#home-daily-stories .home-news-source-line{
  margin:3px 0 1px;
  gap:6px;
  min-height:0;
}
#home-daily-stories .home-intel-go{
  color:var(--ink-faint);
  opacity:.7;
  font-size:20px;
  flex:0 0 auto;
}
#home-daily-stories .home-intel-row-rich:hover .home-intel-go{
  color:var(--accent);
  opacity:1;
}
#home-daily-stories .home-intel-meter{
  display:none;
}

/* The event list and the figure timeline share the same comfortable rhythm. */
#home-daily-stories.home-events-in-table .home-event-list-item{
  padding:13px 17px;
  min-height:92px;
  gap:14px;
}
#home-daily-stories.home-events-in-table .home-event-copy>b{
  color:var(--ink);
  font:700 16px/1.8 "Vazirmatn",sans-serif;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}
#home-daily-stories.home-events-in-table .home-event-copy>small{
  font-size:11.5px;
  line-height:1.7;
}
#home-daily-stories.home-people-in-table .home-people-timeline-title{
  font-family:"Vazirmatn",system-ui,sans-serif;
  font-weight:700;
  line-height:1.8;
}
#home-daily-stories.home-people-in-table .home-people-timeline-excerpt{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  line-height:1.85;
}

/* The activity dashboard stays below the editorial content. */
#home-view .home-status-panel{
  margin-top:30px!important;
  border-radius:12px;
}
#home-view .home-status-panel .home-dashboard-strip{
  border-bottom-color:var(--line);
}
#home-view .home-status-panel .home-freshness{
  padding:12px 15px;
  margin:0;
  border-top:0;
}

/* Mobile: never wrap tabs into an uneven second line. */
@media(max-width:600px){
  #home-view .home-daily{margin-top:10px;}
  #home-daily .home-main-tabs{
    display:flex;
    flex-wrap:nowrap;
    justify-content:flex-start;
    overflow-x:auto;
    overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    gap:4px;
    padding:7px;
  }
  #home-daily .home-main-tabs button{
    flex:1 0 auto;
    min-height:42px;
    width:auto;
    font-size:12px;
    padding:7px 11px;
  }
  #home-daily-stories .home-intel-row-rich{
    min-height:88px;
    gap:8px;
    padding:11px 9px;
  }
  #home-daily-stories .home-intel-rank{
    flex-basis:22px;
    width:22px;
    height:22px;
    font-size:11px;
  }
  #home-daily-stories .home-intel-copy>b{
    font-size:14px;
    line-height:1.8;
    -webkit-line-clamp:3;
  }
  #home-daily-stories .home-intel-copy>small{
    font-size:10.5px;
  }
  #home-daily-stories .home-intel-go{
    font-size:17px;
  }
  #home-daily-stories.home-events-in-table .home-event-list-item{
    min-height:82px;
    gap:9px;
    padding:10px 9px;
  }
  #home-daily-stories.home-events-in-table .home-event-copy>b{
    font-size:14px;
  }
  #home-view .home-status-panel .home-freshness{
    padding:10px 12px;
  }
}
@media(max-width:390px){
  #home-daily .home-main-tabs button{
    flex:0 0 auto;
    font-size:11.5px;
    padding:7px 10px;
  }
  #home-daily-stories .home-intel-go{display:none;}
}
@media(prefers-reduced-motion:reduce){
  #home-daily .home-main-tabs button,
  #home-daily-stories .home-intel-row-rich{transition:none}
}

/* Homepage editorial modes — visual identity, phase 2 */
/* Accent signatures stay subdued and are emphasized only on the active tab.
   No mode is presented as intrinsically more trustworthy than the others. */
#home-daily .home-main-tabs button[data-home-news="events"]{--home-tab-accent:#367d72}
#home-daily .home-main-tabs button[data-home-news="people"]{--home-tab-accent:#656b92}
#home-daily .home-main-tabs button[data-home-news="latest"]{--home-tab-accent:var(--accent)}
#home-daily .home-main-tabs button[data-home-news="selected"]{--home-tab-accent:#8b6b38}
#home-daily .home-main-tabs button[data-home-news="viral"]{--home-tab-accent:#a15b60}

#home-daily .home-main-tabs button.on,
#home-daily .home-main-tabs button[aria-selected="true"]{
  color:var(--home-tab-accent,var(--accent));
  background:color-mix(in srgb,var(--home-tab-accent,var(--accent)) 10%,var(--surface));
  border-color:color-mix(in srgb,var(--home-tab-accent,var(--accent)) 24%,var(--surface));
  box-shadow:inset 0 -3px 0 var(--home-tab-accent,var(--accent));
}
#home-daily .home-main-tabs button:not(.on):not([aria-selected="true"]){
  box-shadow:none;
}

/* Trends: a subtle editorial rail. Figure views retain their existing
   vertical timeline and video recency marker. */
#home-daily-stories[data-home-mode="events"] .home-event-list-item:hover{
  box-shadow:inset -3px 0 0 #367d72;
}
#home-daily-stories[data-home-mode="events"] .home-event-badge{
  color:#367d72;
}
#home-daily-stories.home-people-in-table[data-home-mode="people"] .home-people-timeline::before{
  background:color-mix(in srgb,#656b92 38%,var(--line));
}
#home-daily-stories.home-people-in-table[data-home-mode="people"] .home-people-timeline-row::before{
  border-color:#656b92;
}
#home-daily-stories[data-home-mode="people"] .home-people-timeline-meta strong{
  color:var(--ink);
}
#home-daily-stories[data-home-mode="people"] .home-people-timeline-read{
  color:#656b92;
}

/* Curated headlines: restrained ochre indexing. Viral: red only for a
   separate editorial mode, not an implied reliability/safety indication. */
#home-daily-stories[data-home-mode="selected"] .home-intel-rank{
  background:color-mix(in srgb,#8b6b38 12%,var(--surface));
  color:#8b6b38;
  border-radius:8px;
}
#home-daily-stories[data-home-mode="viral"] .home-intel-rank{
  background:color-mix(in srgb,#a15b60 12%,var(--surface));
  color:#a15b60;
}
#home-daily-stories[data-home-mode="latest"] .home-intel-rank{
  background:var(--accent-soft);
  color:var(--accent);
}

/* Header appearance control, aligned with the search and other icons.
   The button lives in the masthead; no duplicate footer control. */
.top .header-theme-toggle{
  appearance:none;
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  min-width:42px;
  flex:0 0 42px;
  padding:9px;
  color:#e9e9e7;
  border:1px solid #ffffff29;
  background:#ffffff09;
  border-radius:12px;
  cursor:pointer;
}
.top .header-theme-toggle:hover{
  color:#fff;
  border-color:#ffffff55;
  background:#ffffff18;
}
.top .header-theme-toggle:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
}
.top .header-theme-toggle svg{
  display:block;
  width:22px;
  height:22px;
  grid-area:1/1;
  pointer-events:none;
}
.top .header-theme-toggle svg[hidden]{display:none!important}
@media(max-width:560px){
  .top .header-theme-toggle{
    width:36px;
    height:36px;
    min-width:36px;
    flex-basis:36px;
    padding:7px;
    border-radius:10px;
  }
  .top .header-theme-toggle svg{width:19px;height:19px}
}
:root[data-theme="dark"] #home-daily .home-main-tabs button[data-home-news="events"]{--home-tab-accent:#70b6a7}
:root[data-theme="dark"] #home-daily .home-main-tabs button[data-home-news="people"]{--home-tab-accent:#a9b0d8}
:root[data-theme="dark"] #home-daily .home-main-tabs button[data-home-news="selected"]{--home-tab-accent:#d4ad6b}
:root[data-theme="dark"] #home-daily .home-main-tabs button[data-home-news="viral"]{--home-tab-accent:#df9fa4}
:root[data-theme="dark"] #home-daily-stories[data-home-mode="people"] .home-people-timeline-read{color:#a9b0d8}
:root[data-theme="dark"] #home-daily-stories[data-home-mode="selected"] .home-intel-rank{color:#d4ad6b}
:root[data-theme="dark"] #home-daily-stories[data-home-mode="viral"] .home-intel-rank{color:#df9fa4}
:root[data-theme="dark"] #home-daily-stories[data-home-mode="events"] .home-event-badge{color:#70b6a7}
@media(prefers-color-scheme:dark){
  :root:not([data-theme="light"]) #home-daily .home-main-tabs button[data-home-news="events"]{--home-tab-accent:#70b6a7}
  :root:not([data-theme="light"]) #home-daily .home-main-tabs button[data-home-news="people"]{--home-tab-accent:#a9b0d8}
  :root:not([data-theme="light"]) #home-daily .home-main-tabs button[data-home-news="selected"]{--home-tab-accent:#d4ad6b}
  :root:not([data-theme="light"]) #home-daily .home-main-tabs button[data-home-news="viral"]{--home-tab-accent:#df9fa4}
  :root:not([data-theme="light"]) #home-daily-stories[data-home-mode="people"] .home-people-timeline-read{color:#a9b0d8}
  :root:not([data-theme="light"]) #home-daily-stories[data-home-mode="selected"] .home-intel-rank{color:#d4ad6b}
  :root:not([data-theme="light"]) #home-daily-stories[data-home-mode="viral"] .home-intel-rank{color:#df9fa4}
  :root:not([data-theme="light"]) #home-daily-stories[data-home-mode="events"] .home-event-badge{color:#70b6a7}
}

/* Mark only actually generated editorial reports in the existing news tabs. */
#home-daily-stories .home-report-pill{
  display:inline-flex;align-items:center;align-self:flex-start;
  width:max-content;max-width:100%;
  margin-top:2px;padding:2px 8px;
  border:1px solid color-mix(in srgb,var(--accent) 30%,transparent);
  background:var(--accent-soft);
  color:var(--accent);
  border-radius:6px;
  font:700 11.5px/1.8 "Vazirmatn",sans-serif;
}
@media(max-width:600px){
  #home-daily-stories .home-report-pill{font-size:11px;padding:1px 7px;}
}
