/* >>>>>>>>>> MODULE: Instagram (posts, comments, DMs) (start) >>>>>>>>>> */

/* ==========================================================
   MODULE: INSTAGRAM (POSTS, COMMENTS, DMS)   (classes: ig, igdm)
   Instagram posts and comments (ig), including the clickable like and save buttons,
   and Instagram DMs (igdm).
   Needs the CORE block.
   ========================================================== */

#workskin .ig {
  background: #ffffff;
  color: #262626;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
}

#workskin .ig .ig-top {
  display: block;
  overflow: hidden;
  padding: 0.7em 0.9em;
  font-weight: bold;
  border-bottom: 1px solid #efefef;
}

#workskin .ig .ig-top span {
  display: block;
  font-weight: normal;
  font-size: 0.8em;
  color: #737373;
}

/* stands in for the photo: describe the image in here */
#workskin .ig .ig-photo {
  display: block;
  background: #efefef;
  color: #737373;
  font-style: italic;
  text-align: center;
  padding: 3em 1.5em;
  border-bottom: 1px solid #efefef;
}

/* a real photo instead: <div class="ig-photo real"><img src="..."></div> */
#workskin .ig .ig-photo.real { padding: 0; }

#workskin .ig .ig-photo img { display: block; width: 100%; height: auto; }

/* a profile picture beside the account name:
   <span class="ig-pfp"><span class="pfp"><img src="..." alt="..."></span></span>
   as the first thing in ig-top (pfp is explained in the CORE) */
#workskin .ig .ig-top .ig-pfp {
  float: left;
  width: 32px;
  height: 32px;
  margin: 0 0.6em 0 0;
  border-radius: 50%;
  overflow: hidden;
}

#workskin .ig .ig-actions {
  display: block;
  overflow: hidden;
  padding: 0.6em 0.9em 0.1em 0.9em;
  font-size: 1.1em;
  letter-spacing: 0.4em;
}

#workskin .ig .ig-likes { display: block; padding: 0.1em 0.9em; font-weight: bold; }

#workskin .ig .ig-caption { display: block; padding: 0.15em 0.9em; }

#workskin .ig .ig-caption b,
#workskin .ig .ig-comment b {
  font-weight: bold;
}

#workskin .ig .ig-comment { display: block; padding: 0.1em 0.9em; }

#workskin .ig .ig-tag { color: #00376b; }

#workskin .ig .ig-viewall {
  display: block;
  padding: 0.15em 0.9em;
  color: #737373;
  font-size: 0.9em;
}

#workskin .ig .ig-time {
  display: block;
  padding: 0.3em 0.9em 0.8em 0.9em;
  color: #737373;
  font-size: 0.7em;
  text-transform: uppercase;
}

/* ---- more for the top line (put these inside ig-top) ----
   ig-menu is the three dots at the far right, so it goes FIRST in the line.
   ig-tick is the blue verified tick, ig-follow is the "• Follow" link, both go straight after the name.
   Put a song (♫ Artist - Song) or a place in the usual location span underneath. */
#workskin .ig .ig-top .ig-menu {
  display: block;
  float: right;
  margin: 0 0 0 0.6em;
  color: inherit;
  font-size: 1.3em;
  font-weight: bold;
  line-height: 1;
}

#workskin .ig .ig-top .ig-tick {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  margin-left: 0.3em;
  border-radius: 50%;
  background: #0095f6;
  color: #ffffff;
  font-size: 0.7em;
  font-weight: bold;
  line-height: 1.25em;
  text-align: center;
  vertical-align: middle;
}

#workskin .ig .ig-top .ig-follow {
  display: inline;
  color: #0095f6;
  font-size: 1em;
  font-weight: bold;
}

#workskin .ig .ig-top .ig-follow::before {
  content: "\2022\00a0";
  color: #8e8e8e;
  font-weight: normal;
}

/* the colourful stories ring: add "story" to the ig-pfp span: <span class="ig-pfp story"> */
#workskin .ig .ig-top .ig-pfp.story {
  box-sizing: content-box;
  padding: 2px;
  background-color: #d62976;
  background-image: linear-gradient(45deg, #fcaf45 0%, #fd1d1d 45%, #c13584 70%, #833ab4 100%);
}

#workskin .ig .ig-top .ig-pfp.story .pfp {
  box-sizing: border-box;
  border: 2px solid #ffffff;
}

/* ---- the row of buttons with counts: <div class="ig-actions"> holding any of these ----
   ig-btn   a button that just sits there: <div class="ig-btn"><span class="ig-icon cm"></span><span class="ig-count">93</span></div>
   ig-tog  a button you can click (see below) */
#workskin .ig .ig-actions br { display: none; }

/* AO3 sometimes wraps loose bits in a <p>; keep those from breaking the row */
#workskin .ig .ig-actions p:not(.ig-btn) {
  display: inline;
  margin: 0;
  padding: 0;
}

#workskin .ig .ig-btn,
#workskin .ig .ig-tog {
  display: inline-block;
  margin: 0 0.9em 0 0;
  letter-spacing: 0;
  vertical-align: middle;
}

#workskin .ig .ig-actions .ig-icon {
  font-size: 1.25em;
  vertical-align: middle;
}

#workskin .ig .ig-actions .ig-count {
  margin-left: 0.35em;
  font-size: 0.8em;
  font-weight: bold;
  vertical-align: middle;
}

/* ---- clickable buttons: <details class="ig-tog like"> or "ig-tog save" ----
   Inside is a <summary> holding two versions of the same thing: "off" parts (shown at first)
   and "on" parts (shown once clicked). Click again and it goes back. */
#workskin .ig .ig-tog summary {
  display: inline-block;
  list-style: none;
}

#workskin .ig .ig-tog summary { cursor: pointer; }

#workskin .ig .ig-tog summary::-webkit-details-marker { display: none; }

#workskin .ig .ig-tog summary::marker { content: ""; }

#workskin .ig .ig-tog .on { display: none; }

#workskin .ig .ig-tog[open] .on { display: inline; }

#workskin .ig .ig-tog[open] .bm.on { display: inline-block; }

#workskin .ig .ig-tog[open] .off { display: none; }

/* the save button sits at the far right */
#workskin .ig .ig-tog.save {
  float: right;
  margin-right: 0;
}

/* a liked heart is red */
#workskin .ig .ig-tog.like .on.ig-icon { color: #ed4956; }

/* a bookmark drawn with CSS: <span class="ig-icon bm off"></span> (outline) and <span class="ig-icon bm on"></span> (filled) */
#workskin .ig .bm {
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  width: 14px;
  height: 18px;
  border: 2px solid currentColor;
  border-bottom: 0;
  vertical-align: middle;
}

#workskin .ig .bm::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  box-sizing: border-box;
  width: 7px;
  height: 7px;
  margin: 0 0 -3px -3px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
}

#workskin .ig .bm.on { background: currentColor; }

/* a comment bubble drawn with CSS: <span class="ig-icon cm"></span> */
#workskin .ig .cm {
  display: inline-block;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-bottom-left-radius: 0;
  vertical-align: middle;
}

#workskin .ig .bm.on::after {
  border: 0;
  background: #ffffff;
}

/* ---- "Liked by" with little overlapping faces ----
   <p class="ig-likes liked-by"><span class="ig-like-pfps"><span class="ig-like-pfp"><span class="pfp"><img ...></span></span> ...</span>
   Liked by <b>name</b> and <b>others</b></p>   (keep the faces on one line of code, with no gaps) */
#workskin .ig .ig-likes.liked-by { font-weight: normal; }

#workskin .ig .ig-like-pfps {
  display: inline-block;
  margin-right: 0.4em;
  vertical-align: middle;
}

#workskin .ig .ig-like-pfp {
  display: inline-block;
  box-sizing: content-box;
  width: 18px;
  height: 18px;
  margin-left: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  overflow: hidden;
  vertical-align: middle;
}

#workskin .ig .ig-like-pfp:first-child { margin-left: 0; }

#workskin .igdm {
  background: #ffffff;
  color: #262626;
  border: 1px solid #dbdbdb;
  border-radius: 14px;
}

#workskin .igdm .mob-head {
  background: #ffffff;
  color: #262626;
  border-bottom: 1px solid #efefef;
  font-size: 0.9em;
}

#workskin .igdm .mob-head span {
  display: block;
  font-weight: normal;
  color: #737373;
  font-size: 0.85em;
}

#workskin .igdm .msg {
  display: table;
  max-width: 72%;
  margin: 0.2em 0;
  padding: 0.55em 0.9em;
  border-radius: 22px;
}

/* solid colour first; the gradient replaces it where AO3 allows it */
#workskin .igdm .out {
  margin-left: auto;
  background-color: #7b3ff2;
  background-image: linear-gradient(#8a3ffc, #5b4df5);
  color: #ffffff;
}

#workskin .igdm .in { margin-right: auto; background: #efefef; color: #262626; }

#workskin .igdm .who {
  display: block;
  font-size: 0.72em;
  color: #737373;
  margin: 0.5em 0 0 1em;
}

#workskin .igdm .igdm-status {
  display: block;
  text-align: right;
  font-size: 0.7em;
  color: #737373;
  margin: 0.1em 0.5em 0.4em 0;
}

/* shared post / reel / story reply inside a DM */
#workskin .igdm .igdm-shared {
  display: table;
  max-width: 72%;
  margin: 0.2em auto 0.2em 0;
  padding: 0.5em 0.9em;
  border: 1px solid #dbdbdb;
  border-radius: 14px;
  font-size: 0.88em;
  color: #737373;
}

/* ---------- Instagram: Links ---------- */

#workskin .ig .fake-link, #workskin .ig a:not(.tl) { color: #00376b; }

#workskin .igdm .in .fake-link, #workskin .igdm .in a:not(.tl) { color: #0095f6; }

#workskin .igdm .out .fake-link, #workskin .igdm .out a:not(.tl) { color: #ffffff; }

/* ---------- Instagram: Scrolling ---------- */

#workskin .ig {
  max-height: 700px;
  overflow-y: auto;
  overflow-x: hidden;
}

#workskin .ig::-webkit-scrollbar {
  width: 6px;
}

#workskin .ig::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.5);
  border-radius: 6px;
}

/* ---------- Instagram: Dark theme (theme-dark) ---------- */

#workskin .ig.theme-dark .fake-link, #workskin .ig.theme-dark a:not(.tl) { color: #e0f1ff; }

#workskin .ig.theme-dark { background: #000000; color: #f5f5f5; border-color: #262626; }

#workskin .ig.theme-dark .ig-top { border-bottom-color: #262626; }

#workskin .ig.theme-dark .ig-top span,
#workskin .ig.theme-dark .ig-viewall,
#workskin .ig.theme-dark .ig-time {
  color: #a8a8a8;
}

#workskin .ig.theme-dark .ig-photo { background: #1c1c1c; color: #a8a8a8; border-bottom-color: #262626; }

#workskin .ig.theme-dark .ig-tag { color: #e0f1ff; }

#workskin .ig.theme-dark .ig-top .ig-pfp.story .pfp { border-color: #000000; }

#workskin .ig.theme-dark .ig-like-pfp { border-color: #000000; }

#workskin .ig.theme-dark .ig-tog.like .on.ig-icon { color: #ff3040; }

#workskin .ig.theme-dark .bm.on::after { background: #000000; }

#workskin .igdm.theme-dark { background: #000000; color: #f5f5f5; border-color: #262626; }

#workskin .igdm.theme-dark .mob-head { background: #000000; color: #f5f5f5; border-bottom-color: #262626; }

#workskin .igdm.theme-dark .mob-head span,
#workskin .igdm.theme-dark .who,
#workskin .igdm.theme-dark .igdm-status {
  color: #a8a8a8;
}

#workskin .igdm.theme-dark .in { background: #262626; color: #f5f5f5; }

#workskin .igdm.theme-dark .igdm-shared { border-color: #363636; color: #a8a8a8; }

/* ---------- Instagram: Auto theme (theme-auto): light, switching to dark when the reader's device is in dark mode ---------- */

@media (prefers-color-scheme: dark) {
  #workskin .ig.theme-auto .fake-link, #workskin .ig.theme-auto a:not(.tl) { color: #e0f1ff; }

  #workskin .ig.theme-auto { background: #000000; color: #f5f5f5; border-color: #262626; }

  #workskin .ig.theme-auto .ig-top { border-bottom-color: #262626; }

  #workskin .ig.theme-auto .ig-top span,
    #workskin .ig.theme-auto .ig-viewall,
    #workskin .ig.theme-auto .ig-time {
      color: #a8a8a8;
    }

  #workskin .ig.theme-auto .ig-photo { background: #1c1c1c; color: #a8a8a8; border-bottom-color: #262626; }

  #workskin .ig.theme-auto .ig-tag { color: #e0f1ff; }

  #workskin .ig.theme-auto .ig-top .ig-pfp.story .pfp { border-color: #000000; }

  #workskin .ig.theme-auto .ig-like-pfp { border-color: #000000; }

  #workskin .ig.theme-auto .ig-tog.like .on.ig-icon { color: #ff3040; }

  #workskin .ig.theme-auto .bm.on::after { background: #000000; }

  #workskin .igdm.theme-auto { background: #000000; color: #f5f5f5; border-color: #262626; }

  #workskin .igdm.theme-auto .mob-head { background: #000000; color: #f5f5f5; border-bottom-color: #262626; }

  #workskin .igdm.theme-auto .mob-head span,
    #workskin .igdm.theme-auto .who,
    #workskin .igdm.theme-auto .igdm-status {
      color: #a8a8a8;
    }

  #workskin .igdm.theme-auto .in { background: #262626; color: #f5f5f5; }

  #workskin .igdm.theme-auto .igdm-shared { border-color: #363636; color: #a8a8a8; }
}

/* <<<<<<<<<< MODULE: Instagram (posts, comments, DMs) (end) <<<<<<<<<< */
