/* ============================================================
   david.bottomley.us — shared layout
   Replaces the old left.html / main.html frameset with a
   responsive flex layout that keeps the original look:
   a navy (#000066) left nav beside white content.
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #ffffff;
}

/* Page is a 2-column flex: sidebar + content */
.layout {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

/* ---- Left navigation (was the "left" frame) ---- */
.sidebar {
  flex: 0 0 150px;
  width: 150px;
  background: #000066;
  color: #ffffff;
  padding: 0 0 16px 0;
  /* stay visible like the old fixed frame, but scroll if too tall */
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .crest {
  display: block;
  width: 120px;
  height: auto;
  margin: 0;
}

.sidebar nav {
  padding: 10px 8px 0 8px;
}

.sidebar nav a {
  display: block;
  color: #ffffff;
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: bold;
  line-height: 1.7;
  padding: 1px 0;
}

.sidebar nav a:hover,
.sidebar nav a:focus {
  color: #0099ff;
}

/* ---- Right content (was the "right" frame) ---- */
.content {
  flex: 1 1 auto;
  min-width: 0;        /* allow legacy fixed-width tables to shrink container */
  overflow-x: auto;    /* legacy fixed-width tables scroll instead of breaking layout */
  background: #ffffff;
}

/* Hamburger toggle — hidden on desktop, shown on small screens */
.nav-toggle {
  display: none;
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  background: #000066;
  color: #fff;
  border: 1px solid #3a3a8c;
  border-radius: 4px;
  font-size: 20px;
  line-height: 1;
  padding: 8px 11px;
  cursor: pointer;
}

/* ============================================================
   Mobile: stack the nav on top, hidden behind the hamburger
   ============================================================ */
@media (max-width: 768px) {
  .layout { display: block; }

  .nav-toggle { display: block; }

  .sidebar {
    position: static;
    width: 100%;
    flex: none;
    height: auto;
    padding-top: 52px;       /* clear the fixed toggle button */
    display: none;           /* collapsed by default */
  }

  .sidebar.open { display: block; }

  .sidebar .crest { margin: 0 auto; }

  .sidebar nav { text-align: center; }

  .sidebar nav a { line-height: 2.2; font-size: 15px; }

  .content { overflow-x: auto; }
}

/* ============================================================
   YouTube thumbnail links — clicking opens the video on YouTube.
   Used instead of inline <iframe> embeds so videos work in every
   context, including pages opened directly from disk (file://),
   where YouTube blocks embedded playback.
   ============================================================ */
.ytlink { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.ytlink img { width: 100%; height: auto; border: 0; display: block; border-radius: 4px; }
.ytlink .ytplay {
  position: absolute; top: 50%; left: 50%;
  width: 68px; height: 48px; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.72); border-radius: 14%; transition: background .2s;
}
.ytlink .ytplay::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  transform: translate(-40%, -50%);
  border-style: solid; border-width: 11px 0 11px 19px;
  border-color: transparent transparent transparent #fff;
}
.ytlink:hover .ytplay, .ytlink:focus .ytplay { background: #f00; }
