*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --re-content-max: 72rem;
  --re-page-margin: 1rem;
}

@media (min-width: 640px) {
  :root {
    --re-page-margin: 1.5rem;
  }
}

@media (min-width: 768px) {
  :root {
    --re-content-max: 50rem;
    --re-page-margin: 2rem;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: #e7e7e7;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  line-height: 1.5;
  color: #1a1a1a;
}

.re-page {
  width: 100%;
  max-width: calc(var(--re-content-max) + 2 * var(--re-page-margin));
  margin-inline: auto;
  padding-inline: var(--re-page-margin);
  padding-block: 1.5rem 3rem;
}

.menu-box {
  max-width: var(--re-content-max);
  margin-inline: auto;
  background-color: #fff;
  border: 1px solid #1a1a1a;
}

.re-content {
  max-width: var(--re-content-max);
  margin-inline: auto;
}

.re-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 1rem;
  margin-top: 1.5rem;
}

.re-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.re-box {
  width: 100%;
  background-color: #fff;
  border: 1px solid #1a1a1a;
  padding: 1rem 1.25rem;
  transition: opacity 0.45s ease, filter 0.45s ease;
}

.re-box__kind {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #555;
}

.re-box__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.re-box__text {
  margin: 0;
}

.re-box--enter {
  animation: re-dissolve-in var(--re-enter-ms, 480ms) ease forwards;
}

.re-box--exit {
  animation: re-dissolve-out var(--re-exit-ms, 380ms) ease forwards;
  pointer-events: none;
}

.re-box--moving {
  animation: none !important;
  opacity: 1 !important;
  filter: none !important;
  z-index: 1;
  position: relative;
}

@keyframes re-dissolve-in {
  from {
    opacity: 0;
    filter: blur(10px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes re-dissolve-out {
  from {
    opacity: 1;
    filter: blur(0);
  }
  to {
    opacity: 0;
    filter: blur(10px);
  }
}

.re-scroll-sentinel {
  height: 1px;
  margin-top: 1rem;
}

.re-feed-status {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: #555;
}

@media (max-width: 767px) {
  .re-columns {
    grid-template-columns: 1fr;
  }

  /* Full-width content images: clip from bottom; cap in JS (33vh & ≤50% height). */
  .post-box__hero-media,
  .post-prose__img-cap {
    overflow: hidden;
    max-height: 33vh;
  }

  .post-box__hero-media .post-box__hero,
  .post-prose__img-cap > img {
    display: block;
    width: 100%;
    height: auto;
  }
}

.menu-box__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1rem 1.25rem;
}

.menu-box__brand {
  flex-shrink: 0;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.menu-box__brand:hover {
  text-decoration: underline;
}

.menu-box__nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-box__nav a {
  color: inherit;
  text-decoration: none;
}

.menu-box__nav a:hover {
  text-decoration: underline;
}

.menu-box__nav a.is-active {
  font-weight: 600;
  text-decoration: underline;
}

/* LinkedIn-style social content */
.re-box--social {
  padding: 0.85rem 1rem 0;
  font-size: 0.875rem;
  line-height: 1.4;
}

.li-post__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.li-post__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.li-post__identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.li-post__name {
  font-weight: 600;
  color: #1a1a1a;
}

.li-post__headline {
  font-size: 0.75rem;
  color: #666;
}

.li-post__body {
  margin: 0 0 0.75rem;
  word-break: break-word;
  color: #1a1a1a;
}

.li-post__body:not(.post-prose) {
  white-space: pre-wrap;
}

.li-post__link-preview {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem;
  background: #eef3f8;
  border-radius: 0.35rem;
  text-decoration: none;
  color: inherit;
}

.li-post__link-preview:hover .li-post__link-title {
  text-decoration: underline;
}

.li-post__link-image {
  width: 112px;
  min-height: 58px;
  max-height: 72px;
  object-fit: cover;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.li-post__link-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
}

.li-post__link-title {
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: #1a1a1a;
}

.li-post__link-domain {
  font-size: 0.75rem;
  color: #666;
}

.li-post__metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0 0.65rem;
  font-size: 0.75rem;
  color: #666;
  border-top: 1px solid #e0e0e0;
}

.li-post__metrics-start {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex-wrap: wrap;
}

.li-post__reactions {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.li-post__reaction {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #fff;
  margin-left: -4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.li-post__reaction:first-child {
  margin-left: 0;
}

.li-post__reaction--like {
  background: #0a66c2;
  z-index: 3;
}

.li-post__reaction--celebrate {
  background: #6dae4f;
  z-index: 2;
}

.li-post__reaction--love {
  background: #df704d;
  z-index: 1;
}

.li-post__time {
  flex-shrink: 0;
  color: #666;
}

.li-post__actions {
  display: flex;
  align-items: stretch;
  margin: 0 -1rem;
  padding: 0.15rem 0.35rem 0.5rem;
  border-top: 1px solid #e0e0e0;
  text-decoration: none;
  color: #666;
  transition: background-color 0.15s ease;
}

.li-post__actions:hover {
  background-color: #f3f2ef;
  color: #1a1a1a;
}

.li-post__action {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.45rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  pointer-events: none;
}

.li-post__action-icon {
  display: block;
}

/* Widget content */
.re-box--widget {
  padding: 0.85rem 1rem 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
}

.re-box--widget.re-box--layout-anim {
  will-change: height;
}

.widget-box__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.widget-box__icon {
  width: 48px;
  height: 48px;
  border-radius: 0.35rem;
  object-fit: cover;
  flex-shrink: 0;
}

.widget-box__identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.widget-box__title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1a1a;
}

.widget-box__subtitle {
  font-size: 0.75rem;
  color: #666;
}

.widget-box__intro {
  margin: 0 0 0.85rem;
  color: #1a1a1a;
}

.widget-wizard__intro {
  margin: 0 0 0.85rem;
  color: #1a1a1a;
}

.widget-wizard__section-headline {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #444;
}

.widget-wizard__section-text {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: #1a1a1a;
}

.widget-wizard__radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.widget-wizard__radio {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.4;
  cursor: pointer;
}

.widget-wizard__radio input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.widget-wizard__stage {
  min-height: 5.5rem;
}

.widget-wizard__stage--flip {
  animation: widget-step-flip 320ms ease;
}

@keyframes widget-step-flip {
  from {
    opacity: 0;
    transform: perspective(600px) rotateY(-12deg);
  }
  to {
    opacity: 1;
    transform: perspective(600px) rotateY(0);
  }
}

.widget-wizard__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.widget-wizard__label {
  font-weight: 600;
  font-size: 0.875rem;
}

.widget-wizard__select,
.widget-wizard__input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  font: inherit;
  border: 1px solid #1a1a1a;
  background: #fff;
  border-radius: 0;
}

.widget-wizard__nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.widget-wizard__nav[hidden] {
  display: none !important;
}

.widget-wizard__result[hidden] {
  display: none !important;
}

.widget-wizard__btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid #1a1a1a;
  cursor: pointer;
  background: #fff;
}

.widget-wizard__btn--primary {
  background: #1a1a1a;
  color: #fff;
}

.widget-wizard__btn--primary:hover {
  background: #333;
}

.widget-wizard__btn--secondary:hover {
  background: #f0f0f0;
}

.widget-wizard__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.widget-wizard__result-headline {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.widget-wizard__result-detail {
  margin: 0 0 0.5rem;
}

.widget-wizard__result-meta {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: #555;
}

.widget-wizard--result .widget-wizard__result {
  margin-top: 0.15rem;
}

/* Post content */
.re-box--post {
  font-size: 0.875rem;
  line-height: 1.45;
}

.re-box--post-thumbnail {
  padding: 0.85rem 1rem 1rem;
}

.re-box--post-hero {
  padding: 0;
  overflow: hidden;
}

.post-box__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.post-box__thumb {
  width: 48px;
  height: 48px;
  border-radius: 0.35rem;
  object-fit: cover;
  flex-shrink: 0;
}

.post-box__identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.post-box__title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.post-box__subhead {
  font-size: 0.75rem;
  color: #666;
  margin: 0.15rem 0 0;
}

.post-box__hero {
  display: block;
  width: 100%;
  height: auto;
}

.post-box__hero-body {
  padding: 0.85rem 1rem 1rem;
}

.post-box__hero-body > .post-box__excerpt {
  margin-top: 0.75rem;
}

.post-box__hero-body > :first-child.post-box__excerpt {
  margin-top: 0;
}

.re-box--post-expandable {
  cursor: pointer;
}

.re-box--post-expandable:hover {
  background-color: #fafafa;
}

.post-prose p {
  margin: 0 0 0.65rem;
}

.post-prose p:has(> br:only-child),
.post-prose p:empty {
  min-height: 1.45em;
}

.post-prose p:last-child {
  margin-bottom: 0;
}

.post-prose em {
  font-style: italic;
}

.post-prose strong {
  font-weight: 600;
}

.post-prose a {
  color: inherit;
  text-decoration: underline;
}

.post-prose ul,
.post-prose ol {
  margin: 0 0 0.65rem;
  padding-left: 1.25rem;
}

.post-prose figure {
  margin: 0.75rem 0;
}

.post-prose figure img {
  display: block;
  max-width: 100%;
  height: auto;
}

.post-prose figcaption {
  font-size: 0.8125rem;
  color: #555;
  margin-top: 0.35rem;
}

.post-box__keep-reading {
  margin: 0.65rem 0 0;
  font-weight: 600;
  text-decoration: underline;
  color: inherit;
}

/* Expanded post reader */
body.post-reader-open {
  overflow: hidden;
}

.post-reader[hidden] {
  display: none !important;
}

.post-reader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}

.post-reader__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.post-reader__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 42rem);
  max-height: calc(100vh - 2.5rem);
  margin-top: 0.5rem;
  background: #fff;
  border: 1px solid #1a1a1a;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
}

.post-reader__close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #444;
}

.post-reader__close:hover {
  color: #1a1a1a;
}

.post-reader__scroll {
  overflow: auto;
  padding: 1.25rem 1.5rem 1.5rem;
}

.post-reader__title {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  line-height: 1.25;
  padding-right: 2rem;
}

.post-reader__subhead {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: #666;
}

.post-reader__subhead[hidden] {
  display: none !important;
}

.post-reader__body.post-prose {
  font-size: 1rem;
  line-height: 1.55;
}
