/* frontpage.css - desktop newspaper layout (2026-11-17), loaded after workspace.css.
 *
 * From 1200px: sections across the top (#ws-topnav), the left rail as the drawer it
 * already is from 768px, no right rail, one white page instead of cards on a canvas.
 * Αρχική is the front page (js/frontpage.js: lead story and a block per section), a
 * section page has the lead area above a two-column list, and a story opens in a
 * reading window over the page (html[data-ws-window]: the routed reading view).
 * Below 1200px this file only hides its own elements; phones and tablets are unchanged.
 *
 * Tokens come from editorial.css (--surface, --ink, --muted, --rule, --red, --signal).
 */

.ws-topnav { display: none; }
#ws-front[hidden] { display: none !important; }

@media (max-width: 1199px) {
  /* Never drawn below the desktop width (app.js hides it; this is the guarantee) */
  #ws-front { display: none !important; }
}

@media (min-width: 1200px) {
  :root {
    --ws-max: 1500px;
    --topnav-h: 44px;
  }

  /* ----- one page, no canvas ----- */
  html body,
  html body[class],
  html.dark body,
  html.dark body[class] { background-color: var(--surface); }
  .ws-shell {
    display: block;
    padding-top: 0;
  }
  .ws-appbar-inner { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 20px; }
  #content-container {
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
  }
  #content-container > .ws-content { padding-left: 0; padding-right: 0; }
  #right-sidebar.right-sidebar,
  .dark #right-sidebar.right-sidebar { display: none; }
  /* The tabs and the featured block give way to the section bar and the lead area.
     Not when js/frontpage.js failed to load (app.js sets .fp-off): the feed then
     keeps its own controls. */
  :root:not(.fp-off) .ws-tabs { display: none !important; }
  :root:not(.fp-off) #ws-featured { display: none !important; }

  /* ----- the left rail: a drawer, as between 768 and 1199px ----- */
  .ws-rail-toggle { display: inline-flex; margin-left: -8px; }
  .ws-rail {
    display: block;
    position: fixed;
    top: var(--appbar-h);
    bottom: 0;
    left: 0;
    z-index: 45;
    width: 288px;
    max-width: 85vw;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 12px 32px;
    background: var(--surface);
    border-right: 1px solid var(--rule);
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }
  .ws-rail.is-open {
    transform: none;
    visibility: visible;
    transition: transform 0.2s ease;
  }
  .ws-rail-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: var(--appbar-h) 0 0 0;
    z-index: 44;
    background: rgba(15, 20, 26, 0.32);
  }

  /* ----- section bar ----- */
  .ws-topnav {
    display: block;
    position: relative;
    z-index: 40;
    height: var(--topnav-h);
    background: var(--surface);
    border-bottom: 1px solid var(--ink);
  }
  .ws-topnav-inner {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: 100%;
    max-width: var(--ws-max);
    margin: 0 auto;
    padding: 0 var(--ws-gap);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .ws-topnav-inner::-webkit-scrollbar { display: none; }
  .ws-topnav-item {
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 2px 13px 0;
    border-bottom: 3px solid transparent;
    font: 600 15px/1 var(--font-ui);
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
  }
  .ws-topnav-item:first-child { margin-left: -13px; }
  .ws-topnav-item:hover { background: var(--hover); }
  .ws-topnav-item:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }
  .ws-topnav-item[aria-current="page"] { color: var(--accent); border-bottom-color: var(--signal); }
  .ws-topnav-gap { flex: 1 1 24px; min-width: 24px; }
  .ws-topnav-quiet { font-weight: 500; color: var(--muted); }
  .ws-topnav-quiet:hover { color: var(--ink); }

  /* The source filter bar no longer sticks: the section bar is the sticky bar */
  .ws-feedbar { position: static; padding: 0; border-bottom: 0; }
  /* Αρχική has no list to filter */
  :root[data-ws-view="home"]:not(.fp-off) #ws-feedbar { display: none; }
}

/* Sticky only in windows tall enough (the same rule as the workspace bars) */
@media (min-width: 1200px) and (min-height: 700px) {
  :root { --ws-stick-bar: var(--topnav-h); }
  .ws-topnav { position: sticky; top: var(--appbar-h); }
  html:root #content-container > .alert-banner,
  html:root[data-ws-view] #content-container > .alert-banner { top: calc(var(--appbar-h) + var(--topnav-h)); }
  html:root,
  html:root[data-ws-view] { scroll-padding-top: calc(var(--appbar-h) + var(--topnav-h) + var(--ws-stick-banner) + 12px); }
}
@media (min-width: 1200px) and (max-height: 699px) {
  :root { --ws-stick-bar: 0px; }
}

/* ==========================================================================
   Stories (front page and lead area)
   ========================================================================== */
.fp { margin: 0 0 8px; overflow-x: clip; }
.fp-story { min-width: 0; }
.fp-link { display: block; color: inherit; text-decoration: none; border-radius: 4px; }
.fp-link:hover .fp-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.fp-link:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.fp-text { display: block; min-width: 0; }
.fp-title {
  margin: 0;
  font: 600 16px/1.33 var(--font-headline);
  color: var(--ink);
  text-wrap: pretty;
  overflow-wrap: break-word;
}
.fp-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 7px 0 0;
  font: 400 14.5px/1.5 var(--font-ui);
  color: var(--muted);
}
.fp-img { display: block; width: 100%; object-fit: cover; border-radius: var(--r-img, 6px); background: var(--paper); }
.fp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 7px;
  margin-top: 7px;
  font: 400 13px/1.4 var(--font-ui);
  color: var(--muted);
}
.fp-meta > * + *::before { content: "·"; margin-right: 7px; color: var(--muted); font-weight: 400; }
.fp-meta > .fp-source::before { content: none; }
.fp-fav { flex: none; width: 16px; height: 16px; border-radius: 3px; background: var(--fav-plate); }
.fp-fav-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--rule);
  color: var(--muted);
  font: 700 10px/1 var(--font-ui);
}
.fp-meta span,
.fp-meta time { font-size: 13px; line-height: 1.4; }
.fp-source { color: var(--ink); }
.fp-count { color: var(--accent); font-weight: 600; }
.fp-kicker { margin: 0 0 10px; font: 700 13px/1.3 var(--font-ui); color: var(--accent); }

/* ----- lead area ----- */
.fp-leadarea {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
  column-gap: 36px;
  padding: 22px 0 26px;
  border-bottom: 1px solid var(--ink);
}
.fp-leadcol,
.fp-sidecol { min-width: 0; }
.fp-sidecol { padding-left: 28px; border-left: 1px solid var(--rule); }
.fp-lead > .fp-link {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  column-gap: 26px;
  align-items: start;
}
.fp-lead .fp-img { aspect-ratio: 5 / 4; }
.fp-lead .fp-title { font: 700 clamp(24px, 1.9vw, 30px)/1.2 var(--font-headline); letter-spacing: -0.012em; }
.fp-lead .fp-excerpt { -webkit-line-clamp: 6; margin-top: 12px; font-size: 16px; line-height: 1.55; }
.fp-lead > .fp-meta { margin-top: 12px; }
.fp-side { padding: 11px 0; border-top: 1px solid var(--rule); }
.fp-side:first-of-type { border-top: 0; padding-top: 0; }
.fp-side > .fp-link { display: grid; grid-template-columns: minmax(0, 1fr) 92px; column-gap: 12px; align-items: start; }
.fp-side .fp-img { width: 92px; height: 62px; }
.fp-side .fp-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.32;
}

/* ----- section blocks ----- */
.fp-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  row-gap: 34px;
  margin: 26px -24px 0;
}
.fp-block { min-width: 0; padding: 0 24px; border-left: 1px solid var(--rule); }
.fp-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 12px;
  border-top: 2px solid var(--ink);
}
.fp-block-title { margin: 0; font: 700 18px/1.3 var(--font-headline); color: var(--ink); }
.fp-block-title a { color: inherit; text-decoration: none; }
.fp-block-title a:hover,
.fp-block-more:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.fp-block-more { flex: none; font: 400 13px/1.3 var(--font-ui); color: var(--muted); text-decoration: none; }
.fp-block-head a:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 3px; }
.fp-top { padding-bottom: 12px; }
.fp-top .fp-img { aspect-ratio: 2 / 1; margin-bottom: 10px; }
.fp-top .fp-title { font: 700 18.5px/1.28 var(--font-headline); }
.fp-top .fp-excerpt { -webkit-line-clamp: 3; }
.fp-line { padding: 10px 0; border-top: 1px solid var(--rule); }
.fp-line .fp-title { font-size: 15px; line-height: 1.35; }
.fp-line .fp-img { display: none; }

/* ----- loading and failure ----- */
.fp-skeleton { padding: 22px 0 0; }
.fp-skel { border-radius: 6px; background: var(--paper); }
.fp-skel-lead { height: 330px; }
.fp-skel-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 28px; }
.fp-skel-block { height: 420px; }
.fp-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.fp-msg { padding: 72px 16px; text-align: center; color: var(--muted); }
.fp-msg-title { margin: 0 0 6px; font: 700 18px/1.3 var(--font-headline); color: var(--ink); }
.fp-msg-text { margin: 0; font: 400 15px/1.5 var(--font-ui); }
.fp-msg-btn {
  margin-top: 16px;
  padding: 8px 16px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-ui, 6px);
  background: var(--surface);
  color: var(--ink);
  font: 600 14px/1.2 var(--font-ui);
  cursor: pointer;
}
.fp-msg-btn:hover { background: var(--hover); }
.fp-msg-btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ==========================================================================
   The reading window: an article opened from a view that is on screen
   (app.js setWindow, html[data-ws-window]). The routed reading view
   (#ws-reader, ?a=<id>) shown as a window over the page, which stays where
   it is underneath. Desktop only; a landing ?a= link keeps the full page.
   ========================================================================== */
/* No box of its own outside window mode: the reading view lays out as before */
.ws-window { display: contents; }
.fp-winnav { display: none; }
.fp-rel-text {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  font: 400 14.5px/1.55 var(--font-ui);
  color: var(--ink);
}

@media (min-width: 1200px) {
  /* The view under the window stays painted (workspace.css hides it for the full page) */
  html[data-ws-window] #content-container { content-visibility: visible; }
  html[data-ws-window] #ws-main-heading { display: block; }
  /* The dialog: backdrop and scroll container. The page behind is inert and
     is not scroll-locked (locking the root shifts or strips the scrollbar);
     overscroll-behavior keeps the wheel from reaching it, and the 1px of extra
     height below makes this box a scroller even for a short article, which is
     what makes overscroll-behavior apply. */
  html[data-ws-window] .ws-window {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    padding: 28px 88px 40px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(15, 20, 26, 0.58);
  }
  html[data-ws-window] .ws-reader {
    display: block;
    min-height: calc(100% + 1px);
    /* Clicks beside the panel belong to the backdrop */
    pointer-events: none;
  }
  html[data-ws-window] .ws-reader > * { pointer-events: auto; }
  html[data-ws-window] .ws-reader > .rv {
    --rv-col: 780px;
    --rv-pad: 40px;
    max-width: 880px;
    margin: 0 auto;
    border: 0;
    border-radius: var(--r-panel, 10px);
    box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.5);
  }
  html[data-ws-window] .ws-reader .rv-bar {
    position: sticky;
    top: -28px;
    z-index: 2;
    background: var(--surface);
    border-radius: var(--r-panel, 10px) var(--r-panel, 10px) 0 0;
  }
  html[data-ws-window] .ws-reader .rv-crumbs { visibility: hidden; }
  html[data-ws-window] .ws-reader .rv-title { font-size: 32px; }
  html[data-ws-window] .ws-reader-boot { max-width: 880px; padding: 40px; border-radius: var(--r-panel, 10px); background: var(--surface); }

  /* Previous / next story: beside the window, always in the same place */
  html[data-ws-window] .fp-winnav:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 71;
    pointer-events: none;
  }
  .fp-win-btn {
    position: absolute;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-top: -26px;
    border: 1px solid var(--rule-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    font-size: 18px;
    cursor: pointer;
    pointer-events: auto;
  }
  .fp-win-prev { left: max(16px, calc(50% - 440px - 76px)); }
  .fp-win-next { right: max(16px, calc(50% - 440px - 76px)); }
  .fp-win-btn:hover:not(:disabled) { background: var(--paper); border-color: var(--ink); }
  .fp-win-btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
  .fp-win-btn:disabled { opacity: 0.35; cursor: default; }
  /* On its own dark plate: readable over the dimmed page and over the
     window's bar once that sticks to the top */
  .fp-win-count {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1px 10px;
    border-radius: 999px;
    background: rgba(15, 20, 26, 0.86);
    font: 600 12.5px/1.5 var(--font-ui);
    color: #fff;
    font-variant-numeric: tabular-nums;
  }
  .fp-win-count:empty { display: none; }

  /* ----- lists: two columns of stories ----- */
  #ws-feedview .ws-feed-list.ws-rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 56px;
    align-items: start;
  }
  #ws-feed { padding-top: 6px; }
  /* feed.css drops the rule above the first row only: the second row heads the
     right column */
  #ws-feedview .ws-rows > .ws-row:nth-child(2)::before { content: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ws-rail,
  .ws-rail.is-open { transition: none; }
}
@media (forced-colors: active) {
  .ws-topnav-item[aria-current="page"] { border-bottom-color: Highlight; }
  /* Shadows and the dimmed backdrop are dropped there: the window gets an edge */
  html[data-ws-window] .ws-reader > .rv { border: 1px solid CanvasText; }
  .fp-win-btn { border-color: ButtonText; }
}
