/* 1999.LOC — the mail tool's own face: Outlook Express.
 *
 * Third of the per-app identities. Same convention as app-pdf.css and
 * app-zip.css: one stylesheet per tool, loaded only by that tool's page,
 * scoped entirely under [data-app="email"].
 *
 * Outlook Express, as distinct from every other Windows program of the
 * period, was three things:
 *
 *   1. The folder pane. A tree down the left with "Local Folders" at the
 *      top and Inbox, Outbox, Sent Items, Deleted Items, Drafts under it,
 *      each with its own small coloured icon and the unread count in
 *      brackets after the name. Nothing else on the machine looked like it.
 *   2. The blue. Its toolbar and selection blue is #0a246a / #316ac5, not
 *      the grey of the rest of Windows, and the folder pane's header is a
 *      solid band of it.
 *   3. The toolbar. Large icons with their names underneath, like WinZip,
 *      but narrower and with a lighter face.
 *
 * The mail list itself is styled by .mail-client in style.css and is left
 * alone here: it already reads as a message list, and duplicating it would
 * be two places to change one thing.
 */

/* ==================================================================
   THE CHROME
   ================================================================== */

/* ---- the menu bar, pinned to the window --------------------------- */
[data-app="email"] .app-window > .ol-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 2px 4px;
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
  /* Stated, not inherited: this sits outside the tool's body and would
     otherwise come out in the page's serif. */
  font-family: Tahoma, "MS Sans Serif", Verdana, Geneva, sans-serif;
  font-size: 11px;
  line-height: 1.3;
  color: #000000;
}
[data-app="email"] .app-window > .ol-menu .menu-title {
  font-family: Tahoma, "MS Sans Serif", Verdana, Geneva, sans-serif;
  font-size: 11px;
  /* A thumb needs a target; 20px of span was most of why Help felt
     like it did not work. */
  min-height: 26px;
}

/* ---- the toolbar --------------------------------------------------- */
[data-app="email"] .app-window > .ol-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1px;
  padding: 3px 4px;
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
}
[data-app="email"] .olbar-sep {
  width: 0;
  height: 40px;
  margin: 0 5px;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
}
[data-app="email"] .olbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 54px;
  padding: 3px 5px 2px 5px;
  border: 1px solid transparent;
  background: transparent;
  font-family: Tahoma, "MS Sans Serif", Verdana, Geneva, sans-serif;
  font-size: 11px;
  color: #000000;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
[data-app="email"] .olbtn:hover:not(:disabled) {
  border-color: #ffffff #808080 #808080 #ffffff;
}
[data-app="email"] .olbtn:active:not(:disabled) {
  border-color: #808080 #ffffff #ffffff #808080;
  background: #c4c0b8;
}
[data-app="email"] .olbtn:disabled { opacity: 0.4; cursor: default; }
[data-app="email"] .olbtn:focus-visible { outline: 1px dotted #000000; outline-offset: -3px; }
[data-app="email"] .olbtn svg { display: block; }
/* The two view buttons (Inbox, Check a message) light up to show which pane is
   open, the pressed-in twin of the folder rail's highlight. */
[data-app="email"] .olbtn.is-current {
  border-color: #808080 #ffffff #ffffff #808080;
  background: #c4c0b8;
}

/* ==================================================================
   THE TWO PANES
   ================================================================== */

[data-app="email"] .ol-client {
  display: flex;
  align-items: stretch;
  border: 2px inset #d4d0c8;
  background: #d4d0c8;
  font-family: Tahoma, "MS Sans Serif", Verdana, Geneva, sans-serif;
  font-size: 11px;
  min-height: 300px;
}

/* ---- the folder tree -----------------------------------------------
   Only the Inbox does anything, and the page says so rather than
   pretending: the other four are where a mail program's folders are,
   drawn because their absence is what would look wrong. */
[data-app="email"] .ol-folders {
  flex: 0 0 132px;
  background: #ffffff;
  border-right: 1px solid #808080;
}
[data-app="email"] .ol-store {
  margin: 0;
  padding: 3px 6px;
  background: #0a246a;
  color: #ffffff;
  font-weight: bold;
}
[data-app="email"] .ol-folders ul { margin: 4px 0 0 0; padding: 0; }
[data-app="email"] .ol-folders li {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px 2px 10px;
  color: #333333;
}
[data-app="email"] .ol-folders li[data-view] { cursor: pointer; }
[data-app="email"] .ol-folders li[data-view]:hover { background: #d8e4f4; }
[data-app="email"] .ol-folders li[data-view]:focus-visible { outline: 1px dotted #000000; }
[data-app="email"] .ol-folders li.is-current,
[data-app="email"] .ol-folders li.is-current:hover {
  background: #316ac5;
  color: #ffffff;
  font-weight: bold;
}
/* The four that are drawn because a mail client has them and that hold
   nothing. Greyed rather than hidden: their absence is what would look
   wrong, and their being live is what would be a lie. */
/* #767676 is the lightest grey that clears AA on white; still clearly muted. */
[data-app="email"] .ol-folders li.is-inert { color: #767676; cursor: default; }
[data-app="email"] .ol-folders li.is-inert .ol-ico { opacity: 0.5; }
[data-app="email"] #ol-count { font-weight: bold; }

/* The little folder icons, drawn in CSS rather than shipped as five more
   files. Each is a 12px square with the colour that folder had. */
[data-app="email"] .ol-ico {
  width: 12px;
  height: 10px;
  flex: 0 0 12px;
  border: 1px solid #6a5a1a;
  border-radius: 1px;
  background: #f5d074;
}
[data-app="email"] .ol-ico-in { background: #6aa9e0; border-color: #23557f; }
[data-app="email"] .ol-ico-out { background: #e0b06a; border-color: #7f5a23; }
[data-app="email"] .ol-ico-sent { background: #8fd08f; border-color: #2c5f2c; }
[data-app="email"] .ol-ico-del { background: #d08f8f; border-color: #5f2c2c; }
[data-app="email"] .ol-ico-draft { background: #cccccc; border-color: #666666; }
[data-app="email"] .ol-ico-check { background: #c8a8e0; border-color: #5a3a7a; }

/* ---- the message pane ---------------------------------------------- */
[data-app="email"] .ol-pane {
  flex: 1;
  min-width: 0;
  padding: 6px;
  background: #d4d0c8;
}
[data-app="email"] .ol-addr.hidden { display: none; }
[data-app="email"] .ol-addr {
  margin: 0 0 6px 0;
  padding: 4px 6px;
  background: #ece9d8;
  border: 1px solid #808080;
}
[data-app="email"] .ol-addr-active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
}
[data-app="email"] .ol-addr label { font-weight: bold; }
[data-app="email"] .ol-addr code {
  padding: 2px 5px;
  border: 1px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  background: #ffffff;
  font-family: "Courier New", Courier, monospace;
  /* An address you cannot read is an address you cannot give out, so it
     wraps rather than being cut off by the pane. */
  overflow-wrap: anywhere;
}
[data-app="email"] #address[role="button"] { cursor: pointer; }

/* The little clipboard button: beside the headline address, and one on each
   row of the held-address list. A 3D bevel like everything else here. */
[data-app="email"] .ol-clip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px;
  width: 20px;
  height: 20px;
  border: 1px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  background: #d4d0c8;
  cursor: pointer;
  touch-action: manipulation;
}
[data-app="email"] .ol-clip:active { border-color: #808080 #ffffff #ffffff #808080; background: #c4c0b8; }
[data-app="email"] .ol-clip:focus-visible { outline: 1px dotted #000000; outline-offset: 1px; }
[data-app="email"] .ol-clip svg { display: block; }

/* The wallet of addresses: every one this tab holds, the active one lit like
   the current folder. Click a row to make it active and copy it. */
[data-app="email"] .ol-addr-lead { margin: 6px 0 3px 0; }
[data-app="email"] .ol-addr-lead.hidden { display: none; }
[data-app="email"] .ol-addr-list { margin: 4px 0 0 0; padding: 0; }
[data-app="email"] .ol-addr-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  border: 1px solid transparent;
}
[data-app="email"] .ol-addr-item.is-active {
  background: #d8e4f4;
  border-color: #a6c0e0;
}
[data-app="email"] .ol-addr-text {
  flex: 1;
  min-width: 0;
  font-family: "Courier New", Courier, monospace;
  cursor: pointer;
  overflow-wrap: anywhere;
}
[data-app="email"] .ol-addr-item.is-active .ol-addr-text { font-weight: bold; }
[data-app="email"] .ol-addr-text:focus-visible { outline: 1px dotted #000000; }
[data-app="email"] .ol-addr-actions { margin: 6px 0 0 0; }

/* A held address's short name, shown on each message row when more than one
   address is in play, so it is clear which signup a message came from. */
[data-app="email"] .mail-to {
  padding: 0 4px;
  border: 1px solid #a6c0e0;
  background: #eef4fc;
  color: #23557f;
  font-family: "Courier New", Courier, monospace;
}
[data-app="email"] .ol-pane #inbox-status,
[data-app="email"] .ol-pane #mail-error,
[data-app="email"] .ol-pane .note {
  font-family: Tahoma, "MS Sans Serif", Verdana, Geneva, sans-serif;
  font-size: 11px;
}

/* ---- the status bar ------------------------------------------------ */
[data-app="email"] .ol-status {
  display: flex;
  margin: 0 0 10px 0;
  background: #d4d0c8;
  border: 2px inset #d4d0c8;
  border-top: none;
  font-family: Tahoma, "MS Sans Serif", Verdana, Geneva, sans-serif;
  font-size: 11px;
  color: #1a1a1a;
}
[data-app="email"] .ol-status > span {
  flex: 1;
  padding: 3px 8px;
  margin: 2px;
  border: 1px solid;
  border-color: #808080 #ffffff #ffffff #808080;
}

/* ==================================================================
   RESPONSIVE
   ================================================================== */

@media (max-width: 700px) {
  /* The folder tree goes above the messages rather than beside them.
     It could have been hidden, but it is the one thing that says this is
     a mail program and not a web form, and it costs one line. */
  [data-app="email"] .ol-client { display: block; }
  [data-app="email"] .ol-folders {
    border-right: none;
    border-bottom: 1px solid #808080;
  }
  [data-app="email"] .ol-folders ul {
    display: flex;
    overflow-x: auto;
    margin: 0;
  }
  [data-app="email"] .ol-folders li { flex: 0 0 auto; padding: 3px 8px; }
  [data-app="email"] .app-window > .ol-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  [data-app="email"] .olbtn { flex: 0 0 auto; }
  /* Six menu titles do not fit a phone. The first four carry the ones
     whose commands are on the toolbar underneath, and Help survives
     regardless: it is the only way back to what the program has to say
     about itself, and it is needed most where there is least room. */
  [data-app="email"] .menu-optional { display: none; }
}
