/* ============================================================
   Almost Social — dark navy mirror of Daring Fireball
   ============================================================ */

/* ---- Reset & base ---- */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 14px;
}

body {
  margin: 0;
  padding: 0;
  background-color: #13151f;
  color: #cac7bf;
  font-family: Verdana, system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

/* ---- Page wrapper ---- */

#page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 15px 0 15px;
}


/* ---- Banner ---- */

#banner {
  padding: 58px 0 20px;
}

#banner h1 {
  margin: 0;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 24px;
  font-weight: normal;
  letter-spacing: -0.02em;
  line-height: 1;
}

#banner h1 a {
  color: #e4e0d8;
  text-decoration: none;
}

#banner h1 a:hover {
  color: #ffffff;
}

/* ---- Two-column layout ---- */

.columns {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  padding-top: 5px;
  border-top: 1px solid #2e3450;
}

/* ---- Main content column ---- */

#main {
  flex: 0 0 430px;
  min-width: 0;
  padding-right: 20px;
}

/* ---- Sidebar ---- */

#sidebar {
  flex: 0 0 160px;
  min-width: 0;
  padding-top: 10px;
  order: -1;
}

/* ---- Sidebar nav ---- */

#sidebar nav ul {
  list-style: none;
  margin: 0 0 20px 0;
  padding: 0;
}

#sidebar nav ul li {
  margin-bottom: 2px;
}

#sidebar nav ul li a {
  display: block;
  color: #9098aa;
  text-decoration: none;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 0.79rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
}

#sidebar nav ul li a:hover {
  color: #e4e0d8;
}

#sidebar nav ul li a:visited {
  color: #7a8095;
}

/* ---- Sidebar sponsor ---- */

.sidebar-sponsor {
  border-top: 1px solid #2e3450;
  padding-top: 12px;
  margin-top: 4px;
}

.sidebar-sponsor p {
  margin: 0 0 6px 0;
  font-size: 0.79rem;
  line-height: 1.45;
  color: #9098aa;
}

.sidebar-sponsor a {
  color: #b8b4ac;
  text-decoration: none;
  border-bottom: 1px solid #4a5270;
}

.sidebar-sponsor a:hover {
  color: #e4e0d8;
  border-bottom-color: #e4e0d8;
}

.sidebar-sponsor .sponsor-label {
  display: block;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 0.72rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888886;
  margin-bottom: 6px;
}

/* ---- Date headers ---- */

h2.date-header {
  margin: 3.5em 0 1.8em;
  padding-top: 0;
  border-top: none;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 0.8rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888886;
}

h2.date-header:first-child {
  margin-top: 1em;
  border-top: none;
}

/* ---- Linked list items ---- */

dl.linked-item {
  margin: 0 0 2.6em 0;
  padding-bottom: 0;
}

dl.linked-item dt {
  font-size: 1rem;
  font-weight: normal;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.9em;
  line-height: 1.3;
}

dl.linked-item dt a.external {
  color: #d8d4cc;
  text-decoration: none;
  border-bottom: 1px solid #505870;
}

dl.linked-item dt a.external:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

dl.linked-item dt a.external:visited {
  color: #a8a5a0;
  border-bottom-color: #3a4060;
}

dl.linked-item dt a.permalink,
#main dl.linked-item dt a.permalink {
  color: #888886;
  text-decoration: none;
  border-bottom: none;
  font-size: 0.8rem;
  margin-left: 3px;
}

dl.linked-item dt a.permalink:hover {
  color: #cac7bf;
}

dl.linked-item dd {
  margin: 0;
  padding: 0;
  font-size: 0.93rem;
  line-height: 1.6;
  color: #b8b4ac;
}

dl.linked-item dd p {
  margin: 0 0 0.6em 0;
}

dl.linked-item dd p:last-child {
  margin-bottom: 0;
}

/* ---- Feature articles ---- */

div.article {
  margin: 0 0 2.6em 0;
  padding-bottom: 0;
}

div.article h2 {
  margin: 0 0 0.9em 0;
  font-size: 1.15rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  line-height: 1.3;
  letter-spacing: normal;
}

div.article h2 a {
  color: #e4e0d8;
  text-decoration: none;
  border-bottom: 1px solid #505870;
}

div.article h2 a:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

div.article h2 a:visited {
  color: #b0acaa;
}

div.article .article-body {
  font-size: 0.93rem;
  line-height: 1.6;
  color: #b8b4ac;
}

div.article .article-body p {
  margin: 0 0 0.7em 0;
}

div.article .article-body p:last-child {
  margin-bottom: 0;
}

div.article .article-body .dek {
  font-style: italic;
  color: #9a9890;
  margin-bottom: 1.2em;
}

/* ---- Images ---- */

div.article .article-body img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
}

div.article .article-body figure {
  margin: 1.4em 0;
}

div.article .article-body figure img {
  width: 100%;
}

div.article .article-body figcaption {
  margin-top: 0.45em;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 0.78rem;
  color: #6a7088;
  line-height: 1.45;
}

/* Float small images inline with text */
div.article .article-body figure.float-right {
  float: right;
  width: 48%;
  margin: 0.3em 0 1em 1.4em;
}

div.article .article-body figure.float-left {
  float: left;
  width: 48%;
  margin: 0.3em 1.4em 1em 0;
}

div.article .article-body .clearfix::after {
  content: '';
  display: table;
  clear: both;
}

div.article .article-body h2 {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 0.85rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888886;
  margin: 2em 0 0.7em;
}

div.article .article-body h3 {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 1.05rem;
  font-weight: normal;
  font-style: normal;
  color: #9098aa;
  margin: 1.6em 0 0.75em;
}

div.article .article-body ul,
div.article .article-body ol {
  margin: 0 0 0.7em 0;
  padding-left: 1.6em;
  font-size: inherit;
  color: #b8b4ac;
  line-height: 1.6;
}

div.article .article-body li {
  margin-bottom: 0.3em;
}

div.article .article-body hr {
  border: none;
  text-align: center;
  color: #888886;
  margin: 1.8em 0;
}

div.article .article-body hr::after {
  content: '* * *';
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
}

div.article .article-body sup {
  font-size: 0.7em;
  line-height: 0;
  vertical-align: super;
}

div.article .article-body sup a {
  color: #9098aa;
  border-bottom: none;
  text-decoration: none;
}

div.article .article-body sup a:hover {
  color: #cac7bf;
}

div.article .article-permalink {
  margin-top: 0.6em;
  font-size: 0.85rem;
}

div.article .article-permalink a {
  color: #888886;
  text-decoration: none;
}

div.article .article-permalink a:hover {
  color: #cac7bf;
}

/* ---- Notes ---- */

div.note {
  margin: 0 0 2.6em 0;
  padding-bottom: 0;
}

div.note .note-meta {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 0.72rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888886;
  margin-bottom: 0.4em;
}

div.note .note-body {
  font-size: 0.93rem;
  line-height: 1.6;
  color: #b8b4ac;
}

div.note .note-body p {
  margin: 0 0 0.6em 0;
}

div.note .note-body p:last-child {
  margin-bottom: 0;
}

/* ---- Shared: body links ---- */

#main a {
  color: #c8c4bc;
  text-decoration: none;
  border-bottom: 1px solid #505870;
}

#main a:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

#main a:visited {
  color: #9a9890;
  border-bottom-style: dotted;
}

/* Override link style for specific elements that have their own */
#main dl.linked-item dt a,
#main div.article h2 a,
#main div.article .article-permalink a,
#main dl.linked-item dt a.permalink,
#main div.note .note-meta a {
  border-bottom: none;
}

#main dl.linked-item dt a.external,
#main div.article h2 a {
  border-bottom: 1px solid #505870;
}

/* ---- Blockquotes ---- */

blockquote {
  margin: 1.5em 0 1.5em 1.2em;
  padding: 0 0 0 0.8em;
  border-left: 2px solid #3a4260;
  color: #9a9890;
  font-style: italic;
}

blockquote p {
  margin: 0 0 0.4em 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ---- Tables ---- */

div.article .article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

div.article .article-body th {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  color: #888886;
  text-align: left;
  padding: 0.4em 0.8em 0.4em 0;
  border-bottom: 1px solid #2e3450;
}

div.article .article-body td {
  padding: 0.4em 0.8em 0.4em 0;
  border-bottom: 1px solid #1e2235;
  color: #b8b4ac;
  vertical-align: top;
}

div.article .article-body tr:last-child td {
  border-bottom: none;
}

/* ---- Via attribution (linked post source credit) ---- */

dl.linked-item dd .via {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 0.8rem;
  color: #6a7088;
  margin-top: 0.5em;
}

dl.linked-item dd .via a {
  color: #6a7088;
  border-bottom-color: #3a4060;
}

dl.linked-item dd .via a:hover {
  color: #9098aa;
}

/* ---- Code ---- */

code, pre {
  font-family: ui-monospace, Menlo, Monaco, 'Courier New', monospace;
  font-size: 0.88rem;
  background-color: #222640;
  color: #c8c4bc;
}

code {
  padding: 1px 4px;
  border-radius: 2px;
}

pre {
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: 3px;
  line-height: 1.45;
}

pre code {
  background: none;
  padding: 0;
}

/* ---- Footnotes ---- */

ol.footnotes {
  border-top: 1px solid #2e3450;
  padding-top: 0.8em;
  margin-top: 1.5em;
  font-size: 0.84rem;
  color: #9098aa;
  line-height: 1.5;
}

ol.footnotes li {
  margin-bottom: 0.5em;
}

/* ---- Keyboard shortcut ---- */

kbd {
  font-family: ui-monospace, Menlo, Monaco, 'Courier New', monospace;
  font-size: 0.8em;
  background-color: #1e2235;
  color: #c8c4bc;
  border: 1px solid #3a4260;
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0.1em 0.4em;
  white-space: nowrap;
}

/* ---- Pull quote ---- */

div.article .article-body .pullquote {
  margin: 1.6em 0;
  padding: 0 1.2em;
  border-left: none;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.5;
  color: #c8c4bc;
  text-align: left;
}

/* ---- Responsive video embed ---- */

.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  margin: 1.4em 0;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 3px;
}

/* ---- Abbreviations ---- */

abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: help;
  text-decoration-color: #4a5270;
}

/* ---- Prev/Next article navigation ---- */

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 2.5em;
  padding-top: 1em;
  border-top: 1px solid #2e3450;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 0.8rem;
}

.post-nav a {
  color: #9098aa;
  text-decoration: none;
  border-bottom: none;
  line-height: 1.4;
  max-width: 48%;
}

.post-nav a:hover {
  color: #e4e0d8;
}

.post-nav .post-nav-prev {
  text-align: left;
}

.post-nav .post-nav-next {
  text-align: right;
  margin-left: auto;
}

.post-nav .post-nav-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #555d75;
  margin-bottom: 0.25em;
}

/* ---- Standalone pages ---- */

.page-content {
  padding: 1em 0;
}

.page-content h1 {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 1.6rem;
  font-weight: normal;
  color: #e4e0d8;
  margin: 0 0 0.8em;
  letter-spacing: -0.01em;
}

.page-content h2 {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 0.85rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888886;
  margin: 1.8em 0 0.5em;
  border-top: 1px solid #2e3450;
  padding-top: 1em;
}

.page-content p {
  margin: 0 0 0.8em;
  font-size: 0.93rem;
  line-height: 1.6;
  color: #b8b4ac;
}

.page-content p:last-child {
  margin-bottom: 0;
}

.feed-url {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: #c8c4bc;
  background-color: #222640;
  padding: 2px 6px;
  border-radius: 2px;
}

/* ---- Footer ---- */

/* ---- Archive list ---- */

ul.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.93rem;
}

ul.archive-list li {
  padding: 4px 0;
  border-bottom: 1px solid #1e2235;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

ul.archive-list li:last-child {
  border-bottom: none;
}

.archive-date {
  color: #888886;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 0.78rem;
  white-space: nowrap;
}

/* ---- Footer ---- */

#footer {
  border-top: 1px solid #2e3450;
  margin-top: 2em;
  padding: 12px 0 20px;
  text-align: center;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 0.78rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555d75;
}

#footer a {
  color: #555d75;
  text-decoration: none;
  border-bottom: none;
}

#footer a:hover {
  color: #9098aa;
}

/* ---- Responsive ---- */

@media (max-width: 660px) {
  .columns {
    flex-direction: column-reverse;
    gap: 0;
  }

  #main {
    flex: 1 1 auto;
  }

  #sidebar {
    flex: 1 1 auto;
    width: 100%;
    border-bottom: 1px solid #2e3450;
    padding-bottom: 15px;
    margin-bottom: 5px;
  }

  #sidebar nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-bottom: 14px;
  }

  #banner h1 {
    font-size: 24px;
  }
}
