/* Taviwash — blog archive and single post (Elementor Theme Builder: Archive + Single Post). */

/* Post card (Loop Item template) */
.post-card { display: grid; align-content: start; gap: 18px; }
.post-card-media { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; border-radius: var(--r); background: var(--surface); }
.post-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.post-card:hover .post-card-media img { transform: scale(1.03); }
.card-planned { position: absolute; top: 12px; left: 12px; padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, .92); color: var(--muted); font-size: var(--t-micro); font-weight: 600; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--accent); font-size: var(--t-small); font-weight: 600; }
.post-meta a { color: inherit; text-decoration: none; }
.post-card h2, .post-card h3 { margin-top: 8px; line-height: 1.25; }
.post-card h3 { font-size: var(--t-xl); }
.post-card h2 a, .post-card h3 a { color: var(--ink); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .4s var(--ease); }
.post-card:hover h2 a, .post-card:hover h3 a, .post-card h2 a:focus-visible, .post-card h3 a:focus-visible { background-size: 100% 1px; }
.post-excerpt { margin-top: 10px; color: var(--muted); line-height: 1.6; }
.post-date { margin-top: 12px; color: var(--faint); font-size: var(--t-small); }

/* Archive */
.blog-hero h1 { max-width: 16ch; }
.blog-featured { padding-block: clamp(40px, 5vw, 72px); }
.post-card.is-featured { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.post-card.is-featured .post-card-media { aspect-ratio: 16 / 11; }
.post-card.is-featured h2 { font-size: clamp(1.75rem, 2.2vw + 1rem, 2.75rem); letter-spacing: -.02em; }
.post-card.is-featured .post-excerpt { font-size: var(--t-large); }

.blog-list { padding-block: clamp(40px, 5vw, 72px) clamp(64px, 8vw, 112px); border-top: 1px solid var(--line); }
.blog-list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.blog-list-head h2, .related > h2 { font-size: clamp(1.5rem, 1.6vw + .9rem, 2.25rem); }
.blog-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.blog-filter button { min-height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 99px; background: #fff; color: var(--ink); font: 500 var(--t-small) var(--font); cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.blog-filter button:hover { border-color: var(--accent); }
.blog-filter button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }
.blog-sample-note { margin-top: 20px; padding: 10px 14px; border-radius: var(--r); background: #fff3cd; color: #6b4e00; font-size: var(--t-small); }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(36px, 4vw, 56px) clamp(20px, 2.4vw, 32px); margin-top: clamp(28px, 4vw, 44px); }
.post-card[hidden] { display: none; }
.blog-empty { margin-top: 32px; color: var(--muted); }

.blog-cta { padding-block: clamp(56px, 7vw, 104px); background: var(--accent); color: #fff; }
.blog-cta-row { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.blog-cta-media { overflow: hidden; border-radius: var(--r); aspect-ratio: 1 / 1; }
.blog-cta-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.blog-cta h2 { color: #fff; font-size: clamp(1.75rem, 2.2vw + 1rem, 2.75rem); line-height: 1.1; }
.blog-cta p { max-width: 48ch; margin: 16px 0 28px; color: rgba(255, 255, 255, .82); font-size: var(--t-large); line-height: 1.6; }
.blog-cta .btn-primary { background: #fff; color: var(--accent); border-color: #fff; }
.blog-cta .btn-primary:hover { background: var(--accent-tint); }

/* Single post */
.read-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
.post-head { padding-block: clamp(40px, 5vw, 72px) clamp(28px, 3vw, 40px); }
.post-head h1 { max-width: 22ch; margin-top: 12px; font-size: var(--t-h2); line-height: 1.06; }
.post-head .page-lead { max-width: 60ch; }
.post-byline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; color: var(--muted); font-size: var(--t-small); }
.post-cover { margin-block: 0; }
.post-cover img { display: block; width: 100%; height: auto; aspect-ratio: 21 / 9; border-radius: var(--r); object-fit: cover; object-position: 50% 60%; }

.post-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 260px; gap: clamp(32px, 4vw, 64px); padding-block: clamp(40px, 5vw, 72px); }
.post-side .toc { position: static; }
.post-side, .post-product { position: sticky; top: calc(var(--header) + 24px); align-self: start; }
.post-content { max-width: 68ch; }
.post-content .post-intro { color: var(--ink); font-size: var(--t-large); line-height: 1.65; }
.post-content h2 { margin-top: 48px; scroll-margin-top: calc(var(--header) + 24px); }
.post-content h3 { margin-top: 28px; }
.post-content > h2 + p, .post-content > h3 + p { margin-top: 12px; }
.post-content em { font-style: italic; }
.post-callout { margin: 32px 0; padding: 20px 22px; border-radius: var(--r); background: var(--accent-tint); }
.post-callout p { color: var(--ink); }
.post-content .faq-list { margin-top: 16px; }
.post-content .faq-list summary { font-size: var(--t-body); min-height: 56px; }
.post-content .faq-list p { font-size: var(--t-body); }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.share > span:first-child { width: 100%; margin-bottom: 4px; font-size: var(--t-small); font-weight: 600; }
.share a, .share button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; transition: border-color .2s, color .2s; }
.share a:hover, .share button:hover { border-color: var(--accent); color: var(--accent); }
.share svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.share-status { width: 100%; color: var(--accent); font-size: var(--t-small); }
.share-status:empty { display: none; }

.post-product-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.post-product-card img { display: block; width: 100%; height: auto; border-radius: calc(var(--r) - 2px); background: #fff; }
.post-product-card h2 { margin-top: 16px; font-size: var(--t-large); }
.post-product-card p { margin-top: 6px; color: var(--muted); font-size: var(--t-small); line-height: 1.5; }
.post-product-card .pp-price { color: var(--ink); font-weight: 600; }
.post-product-card .btn { margin-top: 16px; }

.post-foot { display: grid; grid-template-columns: 220px minmax(0, 68ch); gap: 24px clamp(32px, 4vw, 64px); padding-bottom: clamp(56px, 7vw, 96px); }
.post-foot > * { grid-column: 2; }
.author-box { display: flex; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r); }
.author-mark { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; font-size: var(--t-xl); font-weight: 700; }
.author-box p { margin-top: 4px; color: var(--muted); font-size: var(--t-small); line-height: 1.6; }
.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.post-nav a { display: grid; gap: 4px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r); color: inherit; text-decoration: none; transition: border-color .2s, transform .25s var(--ease); }
.post-nav a:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.post-nav a:last-child { text-align: right; }
.post-nav span { color: var(--muted); font-size: var(--t-small); }
.post-nav b { line-height: 1.35; }

@media (max-width: 1199px) {
  .post-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .post-foot { grid-template-columns: 200px minmax(0, 68ch); }
  .post-product { grid-column: 2; position: static; }
  .post-product-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0 20px; align-items: center; max-width: 68ch; }
  .post-product-card img { grid-row: span 4; }
  .post-product-card h2 { margin-top: 0; }
}
@media (max-width: 1023px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-card.is-featured { grid-template-columns: minmax(0, 1fr); }
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .post-foot { grid-template-columns: minmax(0, 1fr); }
  .post-foot > * { grid-column: 1; }
  .post-side { position: static; }
  .post-product { grid-column: auto; }
  .blog-cta-row { grid-template-columns: minmax(0, 1fr); }
  .blog-cta-media { max-width: 320px; }
}
@media (max-width: 599px) {
  .post-grid, .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav a:last-child { text-align: left; }
  .post-cover img { aspect-ratio: 4 / 3; }
  .post-product-card { grid-template-columns: 88px minmax(0, 1fr); }
  .post-product-card .btn { grid-column: 1 / -1; }
  .blog-cta .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .read-progress { display: none; } }
