/* Kamadeyle page chrome: the header and footer every app shares.
   SOURCE OF TRUTH: kamadeyle-chrome/src/chrome/. Apps hold a synced copy in
   <web>/chrome/ -- change it there and run sync.py, never in an app.

   Needs these tokens from the host page (all apps already define them):
     --line --ink --ink-2 --ink-3 --accent --accent-bg --raised
   Font and logo are relative to this file (brand/), so the folder works under
   any mount point. */

@font-face { font-family: Superclarendon; src: url("brand/Superclarendon-Regular.woff2") format("woff2");
             font-display: swap; }

/* ---- header: logo + app name left, live status right, a line beneath ---- */
.site-top { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap;
            padding-bottom: 14px; border-bottom: 1px solid var(--line); }
/* For pages whose own toolbar follows straight away and draws its own rule
   (Links' sticky search row). */
.site-top.no-rule { border-bottom: 0; padding-bottom: 4px; }
.site-brand { display: flex; align-items: center; gap: 12px; min-width: 0;
              color: inherit; text-decoration: none; }
/* Hover and focus too: a host page with a bare `a:hover { text-decoration: underline }`
   outranks the rule above (0,1,1 beats 0,1,0) and would underline the app name. The
   host should scope its link styles, but the header must not depend on that. */
.site-brand:hover, .site-brand:focus, .site-brand:focus-visible { text-decoration: none; }
/* Exact brand colours: the supplied dark-background logo, unfiltered. */
.site-brand img { display: block; height: 36px; width: auto; }
.site-brand .app { font-family: Superclarendon, Georgia, serif; font-size: 27px; line-height: 1;
                   color: var(--ink); padding-left: 12px; border-left: 1px solid var(--line); }
/* The full name where it fits; the short one on a phone, where a long one
   wrapped to three lines. Use both spans, or just .app when the name is short. */
.site-brand .app-short { display: none; }

/* Right-hand slot: the app's own live status pills, then the weather. */
.top-status { display: flex; align-items: center; gap: 10px 16px; margin-left: auto; flex: none; }

.weather { display: flex; align-items: center; gap: 8px; flex: none;
           white-space: nowrap; color: var(--ink-2); font-size: 15px; line-height: 1.3; }
.weather img { display: block; margin: -6px 0; }
.weather b { color: var(--ink); font-weight: 600; font-size: 17px; }
.weather .wx2 { font-size: 13.5px; color: var(--ink-3); }
.weather .wind-arrow { vertical-align: -2px; color: var(--accent); }
.weather.stale { opacity: .6; }

/* ---- footer: Confidential · copyright · links and version ---- */
.site-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px 16px;
             margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line);
             color: var(--ink-3); font-size: 13.5px; }
.site-foot .foot-l { justify-self: start; }
.site-foot .foot-c { justify-self: center; text-align: center; }
.site-foot .foot-r { justify-self: end; text-align: right; display: flex; flex-wrap: wrap;
                     align-items: center; justify-content: flex-end; gap: 4px 14px; }
.site-foot a { color: var(--accent); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot .conf { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
                   color: #9D755C; /* brand Leather -- not amber, which means "degraded" */
                   border: 1px solid currentColor; border-radius: 4px; padding: 1px 7px; }

/* The page links, folded into one small menu that opens upward. <details>,
   so it works with the keyboard and without script; chrome.js only adds
   close-on-outside-click and Escape. */
.foot-menu { position: relative; }
.foot-menu > summary { list-style: none; cursor: pointer; color: var(--accent);
                       border: 1px solid var(--line); border-radius: 6px; padding: 2px 10px; }
.foot-menu > summary::-webkit-details-marker { display: none; }
.foot-menu > summary::after { content: " ▾"; font-size: 11px; }
.foot-menu[open] > summary::after { content: " ▴"; }
.foot-menu > summary:hover, .foot-menu[open] > summary { border-color: var(--accent); }
.foot-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.foot-menu nav { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; min-width: 150px;
                 display: flex; flex-direction: column; padding: 6px 0; text-align: left;
                 background: var(--raised); border: 1px solid var(--line); border-radius: 8px;
                 box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.foot-menu nav a { padding: 7px 14px; color: var(--ink); font-size: 15px; }
.foot-menu nav a:hover { background: var(--accent-bg); text-decoration: none; }
.foot-menu nav a[aria-current="page"] { color: var(--ink-3); }
.foot-menu nav a[aria-current="page"]::after { content: " · here"; font-size: 12.5px; }

@media (max-width: 700px) {
  .site-brand img { height: 30px; }
  .site-brand .app { font-size: 22px; }
  .site-brand .app-long { display: none; }
  .site-brand .app-short { display: inline; }
  .top-status { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 4px 16px; }
  .site-foot { grid-template-columns: 1fr; justify-items: center; }
  .site-foot .foot-l, .site-foot .foot-c, .site-foot .foot-r { justify-self: center; text-align: center; }
  .foot-menu nav { right: auto; left: 50%; transform: translateX(-50%); }
}
