/* Sidebar controls keep the same native arrows as the shared end navigation. */
body.ipp-site.single-post .ipp-journal-post-navigation .ipp-post-cartouche {
  display: flex; align-items: center; justify-content: space-between;
  box-sizing: border-box; width: 100%; min-width: 0; margin: 0 !important;
  color: var(--ipp-journal-nav-ink, var(--ipp-uncode-dark)) !important;
  text-align: right; text-transform: uppercase !important; text-decoration: none !important;
  border-radius: 0; box-shadow: none !important;
}
body.ipp-site.single-post .ipp-journal-post-navigation .ipp-post-cartouche::before,
body.ipp-site.single-post .ipp-journal-post-navigation .ipp-post-cartouche::after { content: none !important; }
body.ipp-site.single-post .ipp-journal-post-navigation .ipp-post-cartouche span { color: inherit; }
body.ipp-site.single-post .ipp-journal-post-navigation .ipp-post-cartouche__arrow {
  display: block; background: currentColor;
  -webkit-mask: var(--sw-arrow-right) center / contain no-repeat;
  mask: var(--sw-arrow-right) center / contain no-repeat;
}
body.ipp-site.single-post .ipp-journal-post-navigation .ipp-post-cartouche--previous .ipp-post-cartouche__arrow {
  -webkit-mask-image: var(--sw-arrow-left); mask-image: var(--sw-arrow-left);
}
body.ipp-site.single-post .ipp-journal-post-navigation a.ipp-post-cartouche { cursor: pointer; }
body.ipp-site.single-post .ipp-journal-post-navigation a.ipp-post-cartouche:focus-visible {
  outline: 2px solid var(--ipp-journal-nav-ink); outline-offset: 3px;
}

/* Shared reading order: pictograms, quotation, calendar, article navigation. */
body.ipp-site .col-widgets-sidebar :is(#custom_html-2, #ipp_journal_quotes-2, #calendar-3) { margin: 0 0 32px !important; }
body.ipp-site.single-post .ipp-journal-post-navigation {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin: 0 0 32px !important;
  padding: 0;
}
body.ipp-site.single-post .ipp-journal-post-navigation .ipp-post-cartouche { gap: 8px; padding-left: 12px !important; }
body.ipp-site.single-post .ipp-journal-post-navigation .ipp-post-cartouche__barcode { flex-basis: 26px; }

/* Inline calendar: no date-archive or month-archive links. */
body.ipp-site .ipp-calendar {
  --ipp-calendar-ink: var(--ipp-uncode-dark, #0f1116);
  --ipp-calendar-paper: var(--ipp-uncode-light, #f0eee9);
  --ipp-calendar-rule: color-mix(in srgb, var(--ipp-calendar-ink) 62%, transparent);
  position: relative;
  width: 100%;
  color: var(--ipp-calendar-ink);
  font-family: var(--ipp-uncode-font-label, lores-12, monospace);
  font-size: 12px;
}
body.ipp-site .ipp-calendar [hidden] { display: none !important; }
body.ipp-site .ipp-calendar__header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: stretch;
  border: 1px solid var(--ipp-calendar-rule);
}
body.ipp-site .ipp-calendar__month {
  min-width: 0;
  padding: 8px 4px;
  font: 400 12px/1.4 var(--ipp-uncode-font-label, lores-12, monospace);
  text-align: center;
  text-transform: uppercase;
}
body.ipp-site .ipp-calendar__month-control {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
body.ipp-site .ipp-calendar__month-control:disabled { opacity: .25; cursor: default; }
body.ipp-site .ipp-calendar__arrow {
  display: block;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--sw-arrow-right) center / contain no-repeat;
  mask: var(--sw-arrow-right) center / contain no-repeat;
}
body.ipp-site .ipp-calendar__arrow--previous { -webkit-mask-image: var(--sw-arrow-left); mask-image: var(--sw-arrow-left); }
body.ipp-site .ipp-calendar__grid { width: 100%; table-layout: fixed; margin: 12px 0 0; border: 0; border-collapse: separate; border-spacing: 2px; }
body.ipp-site .ipp-calendar__grid :is(th, td) { padding: 0; border: 0; background: transparent; text-align: center; vertical-align: top; }
body.ipp-site .ipp-calendar__grid th { height: 28px; color: inherit; opacity: .6; font-size: 11px; font-weight: 400; line-height: 28px; }
body.ipp-site .ipp-calendar__grid abbr { text-decoration: none; border: 0; cursor: default; }
body.ipp-site .ipp-calendar :is(.ipp-calendar__post, .ipp-calendar__empty-day, .ipp-calendar__multiple > summary) {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 32px;
  margin: 0;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  color: inherit !important;
  background: transparent !important;
  box-shadow: none !important;
  font: 400 12px/1.4 var(--ipp-uncode-font-label, lores-12, monospace);
  text-decoration: none !important;
}
body.ipp-site .ipp-calendar :is(.ipp-calendar__post, .ipp-calendar__multiple > summary) { border-bottom: 1px solid currentColor; cursor: pointer; }
body.ipp-site .ipp-calendar__empty-day { opacity: .32; }
body.ipp-site .ipp-calendar__today > :is(a, span),
body.ipp-site .ipp-calendar__today > details > summary { outline: 1px solid var(--ipp-calendar-rule); outline-offset: -1px; }
body.ipp-site .ipp-calendar :is(.ipp-calendar__post[aria-current="page"], .ipp-calendar__post:hover, .ipp-calendar__post:focus-visible, .ipp-calendar__multiple[open] > summary, .ipp-calendar__multiple > summary:hover),
body.ipp-site .ipp-calendar__month-control:not(:disabled):is(:hover, :focus-visible) { color: var(--ipp-calendar-paper) !important; background: var(--ipp-calendar-ink) !important; }
body.ipp-site .ipp-calendar :is(a, summary, button):focus-visible { outline: 2px solid var(--ipp-calendar-ink); outline-offset: 2px; }
body.ipp-site .ipp-calendar :is(a, button):active { color: var(--ipp-uncode-accent) !important; }
body.ipp-site .ipp-calendar__multiple > summary { list-style: none; gap: 3px; }
body.ipp-site .ipp-calendar__multiple > summary::-webkit-details-marker { display: none; }
body.ipp-site .ipp-calendar__multiple small { font: inherit; font-size: 9px; opacity: .7; }
body.ipp-site .ipp-calendar__day-posts { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; padding: 6px 12px; border: 1px solid var(--ipp-calendar-rule); background: var(--ipp-calendar-paper); }
body.ipp-site .ipp-calendar__day-posts .ipp-calendar__post { justify-content: flex-start; min-height: 40px; padding: 8px; text-align: left; }
body.ipp-site .ipp-calendar :is(.ipp-calendar__empty, .ipp-calendar__status) { margin: 12px 0 0; padding: 0; font: 400 12px/1.5 var(--ipp-uncode-font-label, lores-12, monospace); }
@media (pointer: coarse) {
  body.ipp-site .ipp-calendar__header { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  body.ipp-site .ipp-calendar :is(.ipp-calendar__month-control, .ipp-calendar__post, .ipp-calendar__empty-day, .ipp-calendar__multiple > summary) { min-height: 44px; }
}

/* Journal pictograms: white at rest, green on interaction. */
body.ipp-site #custom_html-2 .ipp-journal-channel__visual :is(
  .ipp-blog-mixtape-button__accent,
  .ipp-journal-rss-button__accent,
  .ipp-journal-tumblr-button__accent
) {
  fill: var(--ipp-white, #f0eee9);
}

body.ipp-site #custom_html-2 .ipp-journal-channel__visual:is(:hover, :focus-visible) :is(
  .ipp-blog-mixtape-button__accent,
  .ipp-journal-rss-button__accent,
  .ipp-journal-tumblr-button__accent
) {
  fill: var(--ipp-green, #00ff00);
}

/* Keep the navigation's place when its arrows reach the top of the viewport.
   The child script handles Uncode's nested table layout and stops at the article end. */
body.ipp-site.single-post .ipp-journal-navigation-slot {
  width: 100%;
  margin: 0 !important;
  padding: 0;
}
body.ipp-site.single-post .ipp-journal-navigation-slot > nav.ipp-journal-post-navigation {
  margin: 0 !important;
}
@media (min-width: 960px) {
  body.ipp-site.single-post nav.ipp-journal-post-navigation.ipp-journal-navigation-fixed {
    position: fixed;
    top: var(--ipp-journal-nav-top);
    left: var(--ipp-journal-nav-left);
    width: var(--ipp-journal-nav-width);
    z-index: 20;
  }
}

/* Journal sidebar: shared inner edges and an even vertical rhythm. */
body.ipp-site .col-widgets-sidebar {
  --ipp-journal-inset: 16px;
  --ipp-journal-gap: 32px;
  --ipp-journal-detail-gap: 12px;
  --ipp-journal-row-height: 36px;
}
body.ipp-site .col-widgets-sidebar :is(#custom_html-2, #ipp_journal_quotes-2, #calendar-3) {
  margin: 0 0 var(--ipp-journal-gap) !important;
  padding: 0;
}

/* The first and last pictograms share the quotation's inner edges. */
body.ipp-site .col-widgets-sidebar #custom_html-2 .ipp-journal-channels {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--ipp-journal-inset);
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0 var(--ipp-journal-inset);
}
body.ipp-site .col-widgets-sidebar #custom_html-2 .ipp-journal-channel {
  flex: 0 1 96px;
  min-width: 0;
  margin: 0;
}
body.ipp-site .col-widgets-sidebar #custom_html-2 .ipp-journal-channel > .ipp-journal-channel__visual {
  width: 100%;
  margin: 0;
}
body.ipp-site .col-widgets-sidebar #custom_html-2 h3.ipp-journal-channel__title {
  margin: var(--ipp-journal-detail-gap) 0 0 !important;
  line-height: 1.4 !important;
  overflow-wrap: anywhere;
}

/* Border + padding total 16px from the outside edge of each framed row. */
body.ipp-site .col-widgets-sidebar #ipp_journal_quotes-2 .ipp-journal-quotes {
  box-sizing: border-box;
}
body.ipp-site .col-widgets-sidebar #ipp_journal_quotes-2 .ipp-journal-quotes__header,
body.ipp-site .col-widgets-sidebar #ipp_journal_quotes-2 .ipp-journal-quotes :is(a.ipp-journal-quotes__link, button.ipp-journal-quotes__refresh) {
  box-sizing: border-box;
  min-height: var(--ipp-journal-row-height);
  gap: var(--ipp-journal-inset);
  padding: 8px calc(var(--ipp-journal-inset) - 1px);
}
body.ipp-site .col-widgets-sidebar #ipp_journal_quotes-2 :is(.ipp-journal-quotes__figure, .ipp-journal-quotes__status) {
  margin: 0;
  padding: 24px calc(var(--ipp-journal-inset) - 1px);
}

/* The calendar shares the quotation's site-paper background and inner inset. */
body.ipp-site .col-widgets-sidebar #calendar-3 .ipp-calendar {
  box-sizing: border-box;
  padding-bottom: calc(var(--ipp-journal-inset) - 3px);
  border: 1px solid var(--ipp-calendar-rule);
  background: var(--ipp-calendar-paper);
}

/* The month controls and date cells use the same inset as the quotation. */
body.ipp-site .col-widgets-sidebar #calendar-3 .ipp-calendar__header {
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid var(--ipp-calendar-rule);
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  min-height: var(--ipp-journal-row-height);
  padding: 0 calc(var(--ipp-journal-inset) - 1px);
}
body.ipp-site .col-widgets-sidebar #calendar-3 .ipp-calendar__month {
  padding: 8px 0;
}
body.ipp-site .col-widgets-sidebar #calendar-3 .ipp-calendar__month-control {
  min-height: calc(var(--ipp-journal-row-height) - 2px);
}
body.ipp-site .col-widgets-sidebar #calendar-3 .ipp-calendar__month-control[data-month-direction="previous"] {
  justify-content: flex-start;
}
body.ipp-site .col-widgets-sidebar #calendar-3 .ipp-calendar__month-control[data-month-direction="next"] {
  justify-content: flex-end;
}
body.ipp-site .col-widgets-sidebar #calendar-3 .ipp-calendar__grid {
  /* Keep the 16px inner edge, including the frame and the table cell gap. */
  width: calc(100% - var(--ipp-journal-inset) - var(--ipp-journal-inset) + 6px);
  margin: var(--ipp-journal-inset) calc(var(--ipp-journal-inset) - 3px) 0;
  border-spacing: 2px;
}
body.ipp-site .col-widgets-sidebar #calendar-3 :is(.ipp-calendar__empty, .ipp-calendar__status) {
  margin: var(--ipp-journal-inset) calc(var(--ipp-journal-inset) - 1px) 0;
}

/* Article navigation uses the same paper, frame and label type as the widgets. */
body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation {
  --ipp-journal-nav-ink: var(--ipp-sl24-fg, #0f1116);
  --ipp-journal-nav-paper: var(--ipp-sl24-bg, #f0eee9);
  --ipp-journal-nav-rule: color-mix(in srgb, var(--ipp-journal-nav-ink) 62%, transparent);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  box-sizing: border-box;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 1px solid var(--ipp-journal-nav-rule);
  background: var(--ipp-journal-nav-paper);
  box-shadow: var(--ipp-media-shadow, 0 0 20px rgba(0, 0, 0, .2));
}
body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation .ipp-post-cartouche {
  aspect-ratio: auto;
  min-height: var(--ipp-journal-row-height);
  padding: 8px calc(var(--ipp-journal-inset) - 1px) !important;
  border: 0 !important;
  background: transparent !important;
  font-family: var(--ipp-uncode-font-label, lores-12, monospace) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  letter-spacing: normal !important;
}
body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation .ipp-post-cartouche + .ipp-post-cartouche {
  border-inline-start: 1px solid var(--ipp-journal-nav-rule) !important;
}
body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation .ipp-post-cartouche__barcode {
  display: none;
}
body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation .ipp-post-cartouche__label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  gap: 8px;
}
body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation .ipp-post-cartouche--previous .ipp-post-cartouche__label {
  flex-direction: row-reverse;
}
body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation .ipp-post-cartouche__arrow {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
}
body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation a.ipp-post-cartouche:is(:hover, :focus-visible, :active) {
  background: var(--ipp-journal-nav-ink) !important;
  color: var(--ipp-journal-nav-paper) !important;
}
body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation a.ipp-post-cartouche:is(:hover, :focus-visible, :active) .ipp-post-cartouche__arrow {
  color: var(--ipp-uncode-accent, #69f619);
}
body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation a.ipp-post-cartouche:active .ipp-post-cartouche__label {
  color: inherit !important;
}
body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation .ipp-post-cartouche[aria-disabled="true"] {
  opacity: 1;
  color: color-mix(in srgb, var(--ipp-journal-nav-ink) 28%, var(--ipp-journal-nav-paper)) !important;
  cursor: default;
}
@media (max-width: 959px) {
  body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation .ipp-post-cartouche {
    min-height: max(44px, var(--ipp-journal-row-height));
  }
}

@media (pointer: coarse) {
  body.ipp-site .col-widgets-sidebar {
    --ipp-journal-row-height: 46px;
  }
  body.ipp-site .col-widgets-sidebar #calendar-3 .ipp-calendar__header {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }
}

/* A short directional nudge keeps labels and the surrounding frame still. */
@media (prefers-reduced-motion: no-preference) {
  body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation a.ipp-post-cartouche .ipp-post-cartouche__arrow {
    transition: transform 180ms var(--ipp-ease, ease);
  }
  body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation a.ipp-post-cartouche--previous:is(:hover, :focus-visible) .ipp-post-cartouche__arrow {
    transform: translateX(-2px);
  }
  body.ipp-site.single-post .col-widgets-sidebar nav.ipp-journal-post-navigation a.ipp-post-cartouche--next:is(:hover, :focus-visible) .ipp-post-cartouche__arrow {
    transform: translateX(2px);
  }
}

