/* Layout */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--s-9);
  align-items: start;
  padding-top: var(--s-8);
  padding-bottom: var(--s-11);
}

.post-main {
  min-width: 0;
}

/* Header */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.breadcrumbs li + li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1.5px solid var(--line-strong);
  border-right: 1.5px solid var(--line-strong);
  transform: rotate(45deg);
}

.breadcrumbs a {
  transition: color var(--t-fast) var(--ease);
}

.breadcrumbs a:hover {
  color: var(--green-800);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-header h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.875rem);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.post-meta-author {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}

.post-meta-author img {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  object-fit: cover;
}

.post-meta-author strong {
  font-weight: 600;
  color: var(--ink);
  transition: color var(--t-fast) var(--ease);
}

.post-meta-author:hover strong {
  color: var(--green-600);
}

.post-meta-sep {
  width: 4px;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--line-strong);
}

.post-meta-read {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
}

.post-meta-read .icon {
  width: 16px;
  height: 16px;
}

.post-featured {
  margin-top: var(--s-6);
  aspect-ratio: 16 / 9;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--green-100);
}

.post-featured img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Content */
.entry-content {
  max-width: 720px;
  margin-top: var(--s-7);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.entry-content > * + * {
  margin-top: var(--s-5);
}

.entry-content h2 {
  margin-top: var(--s-8);
  font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
}

.entry-content h3 {
  margin-top: var(--s-6);
  font-size: 1.3125rem;
}

.entry-content h2 + *,
.entry-content h3 + * {
  margin-top: var(--s-3);
}

.entry-content ul,
.entry-content ol {
  padding-left: var(--s-5);
}

.entry-content ul {
  list-style: disc;
}

.entry-content ol {
  list-style: decimal;
}

.entry-content li + li {
  margin-top: var(--s-2);
}

.entry-content li::marker {
  color: var(--green-500);
  font-weight: 600;
}

.entry-content strong {
  font-weight: 600;
  color: var(--green-800);
}

.entry-content a:not(.btn) {
  color: var(--green-600);
  text-decoration: underline;
  text-decoration-color: var(--green-300);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--t-fast) var(--ease);
}

.entry-content a:not(.btn):hover {
  text-decoration-color: currentColor;
}

.entry-content figure {
  margin-top: var(--s-7);
  margin-bottom: var(--s-7);
}

.entry-content figure img {
  width: 100%;
  height: auto;
  border-radius: var(--r-lg);
}

.entry-content figcaption {
  margin-top: var(--s-3);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-muted);
  text-align: center;
}

.entry-content li > ul,
.entry-content li > ol {
  margin-top: var(--s-2);
}

.entry-content li > ul {
  list-style: circle;
}

.wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wp-block-table table {
  width: 100%;
  min-width: 480px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
  font-size: 0.9375rem;
  line-height: 1.5;
  overflow: hidden;
}

.wp-block-table th,
.wp-block-table td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.wp-block-table thead th {
  background: var(--green-800);
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 0;
}

.wp-block-table tbody th {
  font-weight: 600;
  color: var(--green-800);
}

.wp-block-table tbody tr:nth-child(even) {
  background: var(--cream);
}

.wp-block-table tbody tr {
  transition: background-color var(--t-fast) var(--ease);
}

.wp-block-table tbody tr:hover {
  background: var(--green-50);
}

.wp-block-table tbody tr:last-child th,
.wp-block-table tbody tr:last-child td {
  border-bottom: 0;
}

.wp-block-table tfoot th,
.wp-block-table tfoot td {
  border-top: 1.5px solid var(--line-strong);
  border-bottom: 0;
  background: var(--sage-100);
  font-weight: 600;
  color: var(--green-800);
}

.post-callout {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  margin: var(--s-7) 0;
  padding: var(--s-6);
  border-radius: var(--r-xl);
  background: var(--green-800);
  color: var(--green-100);
  line-height: 1.5;
}

.entry-content .post-callout {
  margin-top: var(--s-7);
}

.post-callout-title {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: var(--s-2);
}

.post-callout p:not(.post-callout-title) {
  font-size: 0.9375rem;
}

.post-callout .btn {
  flex-shrink: 0;
}

.post-tip {
  display: flex;
  gap: var(--s-4);
  margin: var(--s-7) 0 0;
  padding: var(--s-5);
  border-left: 4px solid var(--yellow-500);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  background: var(--yellow-50);
}

.post-tip .icon {
  width: 24px;
  height: 24px;
  color: var(--yellow-800);
  margin-top: 2px;
}

.post-tip strong {
  color: var(--yellow-800);
}

/* Author */
.author-box {
  display: flex;
  gap: var(--s-5);
  margin-top: var(--s-8);
  padding: var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--white);
}

.author-avatar {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: var(--r-full);
  object-fit: cover;
  box-shadow: 0 0 0 4px var(--green-100);
}

.author-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.author-box h2 {
  margin-top: var(--s-1);
  font-size: 1.375rem;
}

.author-box h2 a:hover {
  color: var(--green-600);
}

.author-role {
  font-size: 0.9375rem;
  color: var(--green-600);
  font-weight: 600;
}

.author-box p:not(.author-label):not(.author-role) {
  margin-top: var(--s-3);
  color: var(--ink-muted);
}

.author-box .text-link {
  margin-top: var(--s-4);
}

/* Related */
.related {
  margin-top: var(--s-9);
}

.related h2 {
  margin-bottom: var(--s-5);
  font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-5);
}

.related .article-body {
  padding: var(--s-4) var(--s-5) var(--s-5);
}

.related .article-body h3 {
  font-size: 1.0625rem;
  margin-bottom: 0;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  min-width: 0;
}

.widget {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--white);
}

.widget-title {
  margin-bottom: var(--s-4);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.widget-tool {
  overflow: hidden;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}

.widget-tool:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.tool-card {
  display: block;
}

.tool-media {
  position: relative;
  display: block;
  aspect-ratio: 17 / 11;
  overflow: hidden;
  background: var(--green-100);
}

.tool-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease);
}

.widget-tool:hover .tool-media img {
  transform: scale(1.04);
}

.tool-badge {
  position: absolute;
  top: var(--s-3);
  left: var(--s-3);
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--yellow-300);
  color: var(--green-900);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tool-body {
  display: block;
  padding: var(--s-5);
}

.tool-title {
  display: block;
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--green-800);
}

.widget-tool:hover .tool-title {
  color: var(--green-600);
}

.widget-subscribe {
  position: relative;
  padding: var(--s-6) var(--s-5);
  border-color: var(--green-800);
  background: var(--green-800);
  color: var(--green-200);
  overflow: hidden;
  isolation: isolate;
}

.widget-subscribe::before {
  content: "";
  position: absolute;
  right: -48px;
  top: -48px;
  width: 160px;
  height: 160px;
  border-radius: var(--r-full);
  background: rgba(246, 214, 123, 0.12);
  z-index: -1;
}

.subscribe-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--s-4);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.1);
  color: var(--yellow-300);
}

.subscribe-icon .icon {
  width: 24px;
  height: 24px;
}

.subscribe-title {
  font-size: 1.375rem;
  color: var(--white);
}

.widget-subscribe > p:not(.subscribe-note) {
  margin-top: var(--s-2);
  font-size: 0.9375rem;
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-top: var(--s-5);
}

.subscribe-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--s-4);
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  background: var(--white);
  font: inherit;
  color: var(--ink);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.subscribe-form input::placeholder {
  color: var(--ink-muted);
}

.subscribe-form input:focus {
  outline: none;
  border-color: var(--yellow-300);
  box-shadow: 0 0 0 3px rgba(246, 214, 123, 0.4);
}

.subscribe-form input[aria-invalid="true"] {
  border-color: var(--error-600);
}

.subscribe-status:empty {
  display: none;
}

.subscribe-status {
  padding: var(--s-3);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 600;
  animation: status-in var(--t-med) var(--ease);
}

.subscribe-status[data-type="error"] {
  background: var(--error-100);
  color: var(--error-600);
}

.subscribe-status[data-type="success"] {
  background: var(--success-100);
  color: var(--success-600);
}

.subscribe-form.is-done input,
.subscribe-form.is-done button {
  display: none;
}

.subscribe-note {
  font-size: 0.8125rem;
  color: var(--green-300);
}

.widget-subscribe > .subscribe-note {
  margin-top: var(--s-3);
}

@keyframes status-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.widget-latest {
  padding: var(--s-5);
}

.latest-list li + li {
  border-top: 1px solid var(--line);
}

.latest-list a {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0;
}

.latest-list li:first-child a {
  padding-top: 0;
}

.latest-list li:last-child a {
  padding-bottom: 0;
}

.latest-list img {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  object-fit: cover;
  transition: transform var(--t-med) var(--ease);
}

.latest-list a:hover img {
  transform: scale(1.05);
}

.latest-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  transition: color var(--t-fast) var(--ease);
}

.latest-list a:hover .latest-title {
  color: var(--green-600);
}

.latest-list time {
  display: block;
  margin-top: var(--s-1);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* Static page */
.page-layout {
  max-width: 760px;
  padding-top: var(--s-8);
  padding-bottom: var(--s-11);
}

.page-header {
  margin-bottom: var(--s-7);
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.875rem);
}

.page-lede {
  margin-top: var(--s-4);
  font-size: 1.1875rem;
  color: var(--ink-muted);
}

.page-updated {
  margin-top: var(--s-3);
  font-size: 0.875rem;
  color: var(--ink-muted);
}

/* Responsive */
@media (max-width: 1099px) {
  .post-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--s-7);
  }
}

@media (max-width: 959px) {
  .post-layout {
    grid-template-columns: 1fr;
    gap: var(--s-9);
  }

  .entry-content {
    max-width: none;
  }

  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-5);
  }

  .widget-latest {
    grid-column: 1 / -1;
  }

  .latest-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--s-5);
  }

  .latest-list li + li {
    border-top: 0;
  }

  .latest-list li {
    border-bottom: 1px solid var(--line);
  }

  .latest-list li a,
  .latest-list li:first-child a,
  .latest-list li:last-child a {
    padding: var(--s-3) 0;
  }
}

@media (max-width: 767px) {
  .post-layout {
    padding-top: var(--s-6);
    padding-bottom: var(--s-9);
  }

  .post-featured {
    margin-left: calc(-1 * var(--s-5));
    margin-right: calc(-1 * var(--s-5));
    border-radius: 0;
  }

  .post-callout {
    flex-direction: column;
    align-items: stretch;
    padding: var(--s-5);
  }

  .author-box {
    flex-direction: column;
    padding: var(--s-5);
  }

  .author-avatar {
    width: 72px;
    height: 72px;
  }

  .sidebar,
  .latest-list {
    grid-template-columns: 1fr;
  }

  .latest-list li:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 359px) {
  .post-callout .btn {
    white-space: normal;
    padding: var(--s-3) var(--s-4);
  }
}
