/*
 * hyd-site-info.css
 *
 * Info dialog (hyd-site-info.js, HydSiteInfo). A silver-chromed dialog with dark, readable content and three
 * tabs (about, share, credits): title bar, tab strip, scrolling content and footer. Text and surface colours
 * use the --paper-* tokens from hyd-theme.css with fallbacks; the window furniture (title bar, tabs, buttons)
 * stays silver in every theme. The first three rules size small icons outside the dialog (top bar, desktop
 * shortcuts, dock).
 *
 * Dormant: .little-things-icon is not produced by any shipped markup or script (6 Oct 2026), so the first two
 * rules do nothing today; the third sizes the dock's .desktop-render-icon images.
 */

/* A site Info window: silver window furniture, dark readable content. */
#world .shell .little-things-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: none;
}

#world #home .desktop-icons .little-things-icon {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px #0007);
}

#world #home .desktop-taskbar .desktop-render-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* --- Dialog frame and title bar --- */
html[data-theme] #credits-dialog.site-info-window {
  width: min(600px, calc(100vw - 32px));
  max-width: none;
  max-height: min(640px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #797d85;
  border-radius: 7px;
  background: var(--paper-surface,#28262c);
  color: var(--paper-text,#f5f3f6);
  box-shadow:
    0 18px 64px #0009,
    0 0 0 1px #fff5;
  font: 13px/1.6 var(--desktop-font,"Lucida Grande",Tahoma,sans-serif);
  text-shadow: none;
}

html[data-theme] #credits-dialog.site-info-window[open] {
  display: flex;
  flex-direction: column;
}

html[data-theme] #credits-dialog.site-info-window::backdrop {
  background: #08090c88;
  backdrop-filter: blur(3px);
}

#credits-dialog.site-info-window .site-info-titlebar {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  gap: 9px;
  align-items: center;
  flex: none;
  padding: 7px 11px;
  background: linear-gradient(#f5f5f5, #cacbcf);
  color: #25262a;
  border-bottom: 1px solid #82858d;
  box-shadow: inset 0 1px #fff;
}

html[data-theme] #credits-dialog.site-info-window h2 {
  margin: 0;
  text-align: center;
  font: 700 13px/1.4 var(--desktop-font,"Lucida Grande",Tahoma,sans-serif);
  letter-spacing: 0;
  color: #25262a;
  text-shadow: 0 1px #fff9;
}

#credits-dialog.site-info-window .site-info-close {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #965052;
  border-radius: 50%;
  background: linear-gradient(#ffb3a9, #e46c60 62%, #fba595);
  color: #692e2e;
  box-shadow: inset 0 1px #ffded7;
  font: bold 15px/1 Arial;
  position: static;
}

#credits-dialog.site-info-window .site-info-title-icon {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #8d939e;
  border-radius: 50%;
  background: #eef0f4;
  color: #515967;
  font: bold 13px Georgia;
}

/* --- Tab strip --- */
#credits-dialog.site-info-window .site-info-tabs {
  display: flex;
  justify-content: center;
  flex: none;
  padding: 15px 16px;
  border-bottom: 1px solid var(--paper-edge,#89818f);
  background: var(--paper-panel,#353239);
}

#credits-dialog.site-info-window .site-info-tabs button {
  min-height: 29px;
  padding: 4px 17px;
  border: 1px solid #777e87;
  border-left: 0;
  border-radius: 0;
  background: linear-gradient(#f6f7f9, #c3c8d0);
  color: #272c35;
  font: 12px/1.3 var(--desktop-font,"Lucida Grande",Tahoma,sans-serif);
  box-shadow: inset 0 1px #fff8;
  white-space: nowrap;
}

#credits-dialog.site-info-window .site-info-tabs button:first-child {
  border-left: 1px solid #777e87;
  border-radius: 5px 0 0 5px;
}

#credits-dialog.site-info-window .site-info-tabs button:last-child {
  border-radius: 0 5px 5px 0;
}

#credits-dialog.site-info-window .site-info-tabs button[aria-selected='true'] {
  background: linear-gradient(#80b6eb, #377bbf);
  border-color: #2a5d90;
  color: #fff;
  text-shadow: 0 1px #234e80;
  box-shadow: inset 0 1px #ffffff40;
}

/* --- Content area and typography --- */
#credits-dialog.site-info-window .site-info-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 24px 28px 26px;
}

#credits-dialog.site-info-window [role='tabpanel'] {
  max-width: 680px;
  margin: 0 auto;
  outline-offset: 7px;
}

html[data-theme] #credits-dialog.site-info-window h3 {
  margin: 0 0 14px;
  color: var(--paper-text,#f5f3f6);
  font: 700 23px/1.3 var(--desktop-font,"Lucida Grande",Tahoma,sans-serif);
  letter-spacing: -0.5px;
  text-shadow: none;
}

html[data-theme] #credits-dialog.site-info-window h4 {
  margin: 26px 0 8px;
  color: var(--paper-text,#f5f3f6);
  font: 700 14px/1.4 var(--desktop-font,"Lucida Grande",Tahoma,sans-serif);
}

html[data-theme] #credits-dialog.site-info-window p {
  max-width: 68ch;
  margin: 0 0 14px;
  font: 13px/1.65 var(--desktop-font,"Lucida Grande",Tahoma,sans-serif);
  color: var(--paper-text,#f5f3f6);
}

#credits-dialog.site-info-window a {
  color: var(--paper-accent,#b8c9e6);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

#credits-dialog.site-info-window a:hover {
  color: var(--paper-text,#fff);
}

#credits-dialog.site-info-window :is(a, button, [role='tabpanel']):focus-visible {
  outline: 2px solid #91c7ff;
  outline-offset: 3px;
}

/* --- Content blocks: intro, notes, actions, steps and detail lists --- */
#credits-dialog.site-info-window .site-info-external {
  font-size: 11px;
  text-decoration: none;
}

#credits-dialog.site-info-window .site-info-intro {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

#credits-dialog.site-info-window .site-info-intro > img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex: none;
}

#credits-dialog.site-info-window .site-info-intro h3 {
  margin-bottom: 6px;
}

html[data-theme] #credits-dialog.site-info-window .site-info-subtitle {
  margin: 0;
  color: var(--paper-muted,#c8c4cd);
  font-size: 12px;
}

#credits-dialog.site-info-window .site-info-note {
  margin: 21px 0;
  padding: 14px 16px;
  border: 1px solid var(--paper-edge,#89818f);
  border-left: 3px solid var(--paper-accent,#b8c9e6);
  background: var(--paper-inset,#1c1a20);
}

#credits-dialog.site-info-window .site-info-note p {
  margin: 5px 0 0;
  color: var(--paper-muted,#c8c4cd);
}

#credits-dialog.site-info-window .site-info-action {
  display: inline-block;
  border: 1px solid #818995;
  border-radius: 4px;
  background: linear-gradient(#e8ecf1, #b8c0cb);
  color: #242b36;
  padding: 4px 17px;
  font-size: 12px;
  text-decoration: none;
  box-shadow: inset 0 1px #fff9;
}

#credits-dialog.site-info-window .site-info-action:hover {
  background: #edf2f8;
  color: #172639;
}

html[data-theme] #credits-dialog.site-info-window .site-info-email {
  display: inline-block;
  margin: 0 0 0 13px;
  font-size: 11px;
  color: var(--paper-muted,#c8c4cd);
  overflow-wrap: anywhere;
}

#credits-dialog.site-info-window .site-info-steps {
  padding-left: 22px;
  margin: 21px 0;
}

#credits-dialog.site-info-window .site-info-steps li {
  padding-left: 5px;
  margin: 0 0 15px;
}

#credits-dialog.site-info-window .site-info-steps p {
  margin: 3px 0 0;
  color: var(--paper-muted,#c8c4cd);
}

#credits-dialog.site-info-window :is(.site-info-details, .site-info-credits) {
  margin: 20px 0;
}

#credits-dialog.site-info-window :is(.site-info-details, .site-info-credits) > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid color-mix(in srgb,var(--paper-edge,#89818f) 42%,transparent);
}

#credits-dialog.site-info-window :is(.site-info-details, .site-info-credits) > div:first-child {
  border-top: 1px solid color-mix(in srgb,var(--paper-edge,#89818f) 42%,transparent);
}

#credits-dialog.site-info-window dt {
  font-size: 12px;
  font-weight: 700;
  color: var(--paper-text,#f5f3f6);
}

#credits-dialog.site-info-window dd {
  margin: 0;
  color: var(--paper-muted,#c8c4cd);
  font-size: 12px;
  line-height: 1.65;
}

#credits-dialog.site-info-window .site-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 18px 0 14px;
  font-size: 13px;
}

#credits-dialog.site-info-window .site-info-privacy {
  margin: 18px 0;
  color: var(--paper-muted,#c8c4cd);
  font-size: 12px;
}

#credits-dialog.site-info-window .site-info-privacy summary {
  cursor: pointer;
  list-style-position: inside;
}

#credits-dialog.site-info-window .site-info-privacy[open] summary {
  margin-bottom: 8px;
}

html[data-theme] #credits-dialog.site-info-window .site-info-fine {
  font-size: 11px;
  color: var(--paper-muted,#c8c4cd);
  line-height: 1.6;
}

#credits-dialog.site-info-window .site-info-references {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 22px;
  font-size: 12px;
}

#credits-dialog.site-info-window .site-info-references span:not(.site-info-external) {
  display: block;
  color: var(--paper-muted,#c8c4cd);
  font-size: 11px;
  margin-top: 3px;
}

/* --- Footer --- */
#credits-dialog.site-info-window .site-info-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex: none;
  padding: 10px 15px;
  border-top: 1px solid var(--paper-edge,#89818f);
  background: var(--paper-panel,#353239);
  color: var(--paper-muted,#c8c4cd);
  font-size: 11px;
}

#credits-dialog.site-info-window .site-info-footer button {
  min-width: 74px;
  min-height: 28px;
  padding: 4px 15px;
  border: 1px solid #77808e;
  border-radius: 4px;
  background: linear-gradient(#e9ecf1, #bec6d0);
  color: #222b36;
  box-shadow: inset 0 1px #fff9;
  font: 12px/1.3 var(--desktop-font,"Lucida Grande",Tahoma,sans-serif);
}

/* Narrow screens (560px and below): tighter padding, single-column lists. */
@media (max-width: 560px) {
  html[data-theme] #credits-dialog.site-info-window {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  #credits-dialog.site-info-window .site-info-content {
    padding: 21px 18px 24px;
  }

  #credits-dialog.site-info-window .site-info-tabs {
    padding: 12px 10px;
  }

  #credits-dialog.site-info-window .site-info-tabs button {
    padding: 5px 10px;
    font-size: 11px;
    min-height: 34px;
  }

  #credits-dialog.site-info-window .site-info-intro {
    gap: 15px;
  }

  #credits-dialog.site-info-window .site-info-intro > img {
    width: 72px;
    height: 72px;
  }

  html[data-theme] #credits-dialog.site-info-window h3 {
    font-size: 20px;
  }

  #credits-dialog.site-info-window :is(.site-info-details, .site-info-credits) > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  #credits-dialog.site-info-window .site-info-references {
    grid-template-columns: 1fr;
  }

  html[data-theme] #credits-dialog.site-info-window .site-info-email {
    display: block;
    margin: 8px 0 0;
  }
}

/* Touch: a 44px press area around the close disc, kept inside the window's clipped edge. */
@media (pointer: coarse) {
  #credits-dialog.site-info-window .site-info-close {
    position: relative;
  }

  #credits-dialog.site-info-window .site-info-close::after {
    content: '';
    position: absolute;
    inset: -8px -11px -14px;
  }
}

/* Phone sheet: the same size on every tab (--phone-sheet-* in hyd-world.css). */
@media (max-width: 620px) {
  html[data-theme] #credits-dialog.site-info-window {
    position: fixed;
    inset: auto 8px var(--phone-sheet-bottom) 8px;
    margin: 0;
    width: auto;
    height: var(--phone-sheet-height);
    max-height: none;
  }
}

/* Quiet bottom-right reuse notice, below the dock and above the device inset. */
#world #home #web-desktop {
  --site-footer-safe-bottom: env(safe-area-inset-bottom, 0px);
}

#world #home #web-desktop > .site-copyright {
  position: fixed;
  right: calc(8px + env(safe-area-inset-right, 0px));
  bottom: var(--site-footer-safe-bottom);
  width: max-content;
  max-width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  margin: 0;
  color: var(--wallpaper-title-muted);
  text-shadow: var(--wallpaper-title-shadow);
  font-size: 8px;
  line-height: 10px;
  text-align: right;
}

/* Preserve the verified footer strip; the 10px line leaves a quiet 3px dock gap. */
html[data-theme] #world #home #web-desktop > .desktop-taskbar {
  bottom: calc(13px + var(--site-footer-safe-bottom));
}

/* Reclaim the footer's 7px dock lift from the existing counter gap on very short phones. */
@media (max-width: 620px) and (max-height: 350px) and (orientation: landscape) {
  html[data-theme] #world #home #web-desktop.mobile-desktop #home-uturns {
    margin-top: 1px;
  }

  /* Existing measured title top; 56px dock + 13px footer strip + 4px clearance. */
  html[data-theme] #world #home #web-desktop.mobile-desktop .desktop-icons:not(.desktop-free-shortcuts) {
    bottom: calc(73px + var(--site-footer-safe-bottom));
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  html[data-theme] #world #home #web-desktop.mobile-desktop .desktop-icons:not(.desktop-free-shortcuts) > [data-shortcut-id] {
    touch-action: pan-y;
  }
}
