/* File: CSS/css_sitewide.css
   FULL REWRITE

   Purpose: Site-wide formatting ONLY.
   Notes:
   - Header/Footer styling is in: CSS/css_header_footer.css
   - Session rules:
     1) CSS changes always occur in master CSS files
     2) Full rewrites only
*/

/* =========================
   Global Reset + Typography
   ========================= */

html,
body {
  margin: 0;
  padding: 0;

  /* FRAME (outside the page) - dark blue */
  background-color: #0b1d2a;
  color: #ffffff;

  font-family: "Clarendon LT", "Lulo Cleanl", Georgia, serif;
  font-size: 16px;
  line-height: 1.5;

  /* page scroll is controlled by the article container */
  overflow: hidden;

  height: 100%;
  width: 100%;
}

body {
  /* visible frame around the "page" */
  height: 100vh;
  width: 100vw;
  padding: 10px;
}

* {
  box-sizing: border-box;
}

/* =========================
   Site-wide Page Layout Grid
   ========================= */

article {
  height: 100%;
  width: 100%;

  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto 1fr auto auto;

  overflow-x: visible;
  overflow: auto;

  /* PAGE BASE (inside the frame) - deeper navy */
  background-color: #071521;
  border-radius: 18px;
}

/* =========================
   Site-wide Elements
   ========================= */

nav {
  grid-column: 1;
  grid-row: 2;

  background: transparent;
  padding: 1rem;
}

#menus {
  float: left;
}

/* Headings */
h1,
h2,
h3 {
  text-align: center;
}

/* Lists */
ul {
  list-style-type: none;
  text-align: left;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

li {
  padding-bottom: 2px;
}

/* Images */
img {
  display: block;
  position: relative;
  margin-left: auto;
  margin-right: auto;
}

/* =========================
   Main Content Container
   ========================= */

main {
  grid-column: 1 / -1; /* full width by default */
  grid-row: 2;

  border-radius: 25px;

  /* MAIN PANEL (darker blue-gray for contrast) */
  background-color: #1f3342;

  padding: 1rem;

  float: left;

  /* global paragraph indent look (details panels override this) */
  text-indent: 30px;
  overflow-wrap: normal;
}

/* If nav exists (and is before main), main becomes column 2 */
nav ~ main {
  grid-column: 2;
}

/* =========================
   Shared Content Wrapper
   ========================= */

.dgs-content {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 18px;
}

.dgs-content p {
  margin: 0 0 16px 0;
  line-height: 1.5;
}

/* =========================
   Index Page Helpers (moved from index.html)
   ========================= */

.dgs-content h3 {
  margin: 28px 0 14px 0;
  text-align: center;
}

.dgs-bullets {
  list-style-type: disc;
  max-width: 900px;
  margin: 0 auto 18px auto;
  padding-left: 1.4em;
}

.dgs-bullets li {
  margin: 10px 0;
  line-height: 1.5;
  padding-bottom: 0; /* override global li spacing */
}

.dgs-note {
  margin-top: 10px;
}

/* =========================
   Hotkeys: Topics Block
   ========================= */

.hk-topics {
  max-width: 1100px;
  margin: 18px auto 0 auto;
  padding: 12px 14px;

  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);

  /* override main's global indent inside this light panel */
  text-indent: 0;
}

/* Readability on the light panel */
.hk-topics h3 {
  margin: 0 0 12px 0;
  text-align: center;
  font-size: 1.05rem;
  color: #111;
  text-shadow: none;
}

/* Hotkeys: Category headings inside the light panel (reusable) */
.hk-category-title {
  margin: 18px 0 10px 0;
  text-align: left;
  font-size: 1.05rem;
  font-weight: bold;
  color: #111;
  text-shadow: none;
  text-indent: 0;
}

/* Also apply to h4 inside .hk-topics so existing pages remain readable */
.hk-topics h4 {
  margin: 18px 0 10px 0;
  text-align: left;
  font-size: 1.05rem;
  font-weight: bold;
  color: #111;
  text-shadow: none;
  text-indent: 0;
}

/* GRID: 4 per row (desktop) */
.hk-topic-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: stretch;
  justify-items: stretch;
}

/* Responsive fallback */
@media (max-width: 1100px) {
  .hk-topic-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .hk-topic-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .hk-topic-row {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* Hotkey topic buttons: BLACK with WHITE text */
.hk-topic {
  width: 100%;
  cursor: pointer;

  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;

  border-radius: 999px;
  padding: 10px 12px;
  font-size: 0.95rem;
  line-height: 1.1;

  /* keep all buttons the same height across rows */
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 56px;

  white-space: normal;
  text-align: center;
  user-select: none;
  text-indent: 0;
}

/* make the shortcut line consistent (always its own line) */
.hk-topic small {
  display: block;
  color: rgba(255, 255, 255, 0.75);
  margin-left: 0;
  margin-top: 6px;
  font-size: 0.85em;
}

.hk-topic:hover {
  background: rgba(0, 0, 0, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
}

.hk-topic:focus {
  outline: 2px solid rgba(140, 200, 220, 0.8);
  outline-offset: 2px;
}

.hk-hint {
  margin: 12px 0 0 0;
  font-size: 0.95rem;
  text-align: center;

  color: #222;
  opacity: 0.9;
  text-shadow: none;
}

/* =========================
   Hotkeys: Details Panel
   ========================= */

.hk-details {
  max-width: 1100px;
  margin: 18px auto 0 auto;
  padding: 18px 22px;

  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);

  /* override main's global indent inside this light panel */
  text-indent: 0;

  color: #111;
}

.hk-details h3 {
  margin: 0 0 12px 0;
  text-align: center;
  color: #111;
  text-shadow: none;
}

.hk-details h4 {
  margin: 0 0 14px 0;
  text-align: center;
  font-size: 1.15rem;
}

.hk-details p {
  margin: 0 0 14px 0;
  line-height: 1.5;
}

/* Details header row: actions */
.hk-details-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px 0;
}

.hk-action-btn {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;

  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.92rem;
  line-height: 1.1;
  text-indent: 0;
}

.hk-action-btn:hover {
  background: rgba(0, 0, 0, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
}

.hk-action-btn:focus {
  outline: 2px solid rgba(140, 200, 220, 0.8);
  outline-offset: 2px;
}

/* Shortcut row (label + key graphics) */
.hk-shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;

  margin: 0 0 14px 0;
}

.hk-shortcut .hk-label {
  font-weight: bold;
}

/* Key graphics */
.key-seq {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.keycap {
  height: 34px;
  width: auto;
  display: inline-block;
  margin: 0;
}

.key-plus {
  font-weight: bold;
  font-size: 1.05rem;
  color: #111;
  line-height: 1;
}

/* Fallback "key chip" if an image doesn't exist */
.keychip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.75);
  color: #111;
  font-size: 0.95rem;
  line-height: 1.1;
}

@media (max-width: 480px) {
  .keycap {
    height: 30px;
  }
}