/* ==========================================================================
   rssnews.io page shell (2026-11-05)
   The home shell on the pages beside it: statistics.html, alerts.html,
   changelog.html. Loaded after workspace.css; colours and type are the
   editorial.css tokens, the app bar, rails and bottom nav are workspace.css's
   own classes. This file adds only:
   - the base rules home gets from custom.css, which these pages do not load
     (the skip link's position, the fixed bottom nav and its items as links);
   - the main column width (from 1200px the layout is frontpage.css's: section
     bar, the rail as a drawer);
   - the current page in the rail and footer, the rail as a drawer below
     768px (bottom nav Μενού) and the phone search row (js/page-shell.js);
   - the page head, panel and filter toolbar the three pages share.
   ========================================================================== */

/* ----- From custom.css on home ----- */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 50%;
  z-index: 10000;
  transform: translateX(-50%);
  padding: 12px 24px;
  font: 600 15px/1.2 var(--font-ui);
  text-decoration: none;
}
.skip-to-content:focus,
.skip-to-content:focus-visible { top: 0; }

.ws-bottomnav.mobile-bottom-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.ws-bottomnav .mobile-bottom-bar-item {
  display: flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

/* ----- Shell from 1200px: the newspaper layout (frontpage.css, loaded after
   this file): section bar on top, the rail as a drawer, one column -----
   Alerts and changelog keep home's reading width, centred; statistics takes
   the page. */
@media (min-width: 1200px) {
  .ws-shell.pg-shell { padding-top: 24px; }
  .pg-shell .ws-main.pg-narrow { max-width: 880px; margin: 0 auto; }
}
/* No feed bar sticks under the app bar here */
@media (min-width: 768px) and (min-height: 700px) {
  :root { --ws-stick-bar: 0px; }
}

/* ----- The current page: Στατιστικά, Ειδοποιήσεις (links, not views) ----- */
#ws-rail .ws-navitem[aria-current="page"],
.dark #ws-rail .ws-navitem[aria-current="page"] {
  background: var(--nav-active);
  color: var(--ink);
  font-weight: 600;
}
#ws-rail .ws-navitem[aria-current="page"]::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--signal);
}
#ws-rail .ws-navitem[aria-current="page"] > i:first-child { color: var(--ink); }
.site-foot a[aria-current="page"] { color: var(--ink); font-weight: 600; }
/* The credit link: a 24px target too */
.site-foot-credit a { display: inline-block; padding: 3px 0; }
@media (forced-colors: active) {
  #ws-rail .ws-navitem[aria-current="page"] { outline: 2px solid Highlight; outline-offset: -2px; }
  #ws-rail .ws-navitem[aria-current="page"]::before { forced-color-adjust: none; background: Highlight; }
}

/* ----- Phones: the rail as a drawer from the bottom nav's Μενού (home has
   a bottom sheet there; its tools are links here) ----- */
@media (max-width: 767px) {
  .ws-rail {
    display: block;
    position: fixed;
    top: var(--appbar-h);
    bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
    left: 0;
    z-index: 45;
    width: 288px;
    max-width: 85vw;
    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 calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px)) 0;
    z-index: 44;
    background: rgba(15, 20, 26, 0.32);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ws-rail,
  .ws-rail.is-open { transition: none; }
}
/* While the drawer is open (below 1200px) the page under the backdrop does
   not scroll. js/page-shell.js pads the root by the scrollbar's width while
   it is gone, so nothing shifts sideways. */
html.pg-scroll-lock { overflow: hidden; }

/* ----- Phones: the app bar's search button opens the field as a row under
   the bar (workspace.css hides the field below 768px) ----- */
@media (max-width: 767px) {
  .ws-appbar.is-searching .ws-search {
    display: flex !important;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    max-width: none;
    padding: 8px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow);
  }
  .ws-appbar.is-searching .ws-search-icon { left: 26px; }
  .ws-appbar.is-searching .ws-search-input { height: 44px; padding-right: 52px; font-size: 16px; }
  .ws-appbar.is-searching .ws-search .ws-search-clear { right: 18px; width: 40px; height: 40px; }
  .ws-appbar.is-searching .ws-kbd { display: none; }
}
#ws-search-open[aria-expanded="true"] { background: var(--hover); }

/* ==========================================================================
   Shared page parts
   ========================================================================== */

/* One surface on the canvas, like home's main column */
.pg-panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
  padding: 24px 28px 32px;
}
@media (max-width: 767px) {
  .pg-panel { border: 0; border-radius: 0; padding: 20px 16px 32px; }
}

/* Page head: the h1 at the size of home's "Τελευταίες δημοσιεύσεις" */
.pg-head { margin: 0 0 20px; }
.pg-title,
.dark .pg-title {
  margin: 0;
  font: 700 20px/1.3 var(--font-headline);
  color: var(--ink);
  text-wrap: balance;
}
/* The heading takes focus after a successful retry (alerts) */
.pg-title:focus { outline: none; }
.pg-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.pg-sub {
  max-width: 70ch;
  margin: 4px 0 0;
  font: 400 14px/1.5 var(--font-ui);
  color: var(--muted);
}

/* Filters: a visible label over each select */
.pg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin: 0 0 20px;
}
.pg-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pg-field-label {
  font: 600 13px/1.3 var(--font-ui);
  color: var(--muted);
}
.pg-select-wrap { position: relative; display: block; }
.pg-select-wrap::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.pg-select {
  display: block;
  width: 100%;
  min-width: 180px;
  height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--field);
  border-radius: var(--r-ui);
  background: var(--surface);
  color: var(--ink);
  font: 500 14px/1.2 var(--font-ui);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.dark .pg-select { color-scheme: dark; }
.pg-select:hover { border-color: var(--ink); }
.pg-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse) {
  .pg-select { height: 44px; }
}
/* Phones: a select per line once two would cut their text (16px: iOS does
   not zoom on focus) */
@media (max-width: 767px) {
  .pg-toolbar > .pg-field { flex: 1 1 200px; }
  .pg-select { min-width: 0; font-size: 16px; }
}

/* Buttons are workspace.css .ws-btn; an icon inside one */
.ws-btn i { margin-right: 8px; font-size: 14px; color: var(--muted); }
