/*
Theme Name: TechXtorm
Theme URI: https://www.techxtorm.com/blog/
Author: TechXtorm
Description: Blog theme matching the TechXtorm website. Install WordPress in the /blog folder of techxtorm.com: the theme loads the main site's styles, fonts and scripts from the site root, so the blog looks and behaves exactly like the rest of the site.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: Proprietary
Text Domain: techxtorm
*/

/* The shared design system (tokens, header, footer, buttons, animations) comes from
   /css/style.css on the main site. This file only adds blog-specific layouts. */

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* WordPress admin bar sits above the fixed site header */
.admin-bar .nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .nav { top: 46px; } }

/* ---------- Blog hero ---------- */
.blog-hero__bar { display: flex; justify-content: space-between; align-items: center; gap: 20px 40px; flex-wrap: wrap; margin: 36px 0 110px; padding-top: 22px; border-top: 1px solid var(--line-dark); }
.blog-hero__spacer { height: 90px; }
.blog-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-cats a { display: block; padding: 8px 14px; border: 1px solid #30353b; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: #b4b8be; transition: background-color .3s, color .3s, border-color .3s; }
.blog-cats a:hover { border-color: #5d636b; color: var(--white); }
.blog-cats a[aria-current] { background: var(--blue); border-color: var(--blue); color: var(--ink); }
.blog-search { display: flex; align-items: center; border-bottom: 1px solid #30353b; min-width: 240px; }
.blog-search input { flex: 1; background: none; border: 0; padding: 10px 0; color: var(--white); font: 400 1rem var(--display); }
.blog-search input::placeholder { color: #6b7178; }
.blog-search input:focus { outline: none; }
.blog-search:focus-within { border-color: var(--blue); }
.blog-search button { background: none; border: 0; padding: 14px; margin-right: -14px; cursor: pointer; }
.blog-search svg { width: 16px; height: 16px; fill: none; stroke: var(--white); stroke-width: 1.8; }

/* ---------- Post cards ---------- */
.blog-list .px-edge, .post .px-edge { color: var(--paper); }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px 24px; }
.post-card__link { display: grid; gap: 20px; color: var(--ink); }
.post-card__img { aspect-ratio: 16 / 10; background: var(--ink); overflow: hidden; }
.post-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.post-card__link:hover .post-card__img img { transform: scale(1.04); }
.post-card__ph { position: relative; display: block; width: 100%; height: 100%; background: var(--ink) radial-gradient(#20a2dc 1.2px, transparent 1.3px) 0 0 / 22px 22px; }
.post-card__ph i { position: absolute; width: 9%; aspect-ratio: 1; background: var(--blue); }
.post-card__ph i:nth-child(1) { left: 58%; top: 30%; }
.post-card__ph i:nth-child(2) { left: 67%; top: 30%; }
.post-card__ph i:nth-child(3) { left: 67%; top: 16%; background: var(--orange); }
.post-card__ph i:nth-child(4) { left: 76%; top: 16%; }
.post-card__ph i:nth-child(5) { left: 76%; top: 2%; background: var(--orange); }
.post-card__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.post-card__meta span:first-child { color: var(--blue-text); }
.post-card__title { font-weight: 600; font-stretch: 108%; font-size: 1.4rem; line-height: 1.2; letter-spacing: -.02em; margin-top: 10px; transition: color .3s; }
.post-card__link:hover .post-card__title { color: var(--blue-text); }
.post-card__excerpt { color: var(--muted); margin-top: 12px; max-width: 560px; }
.post-card__more { display: inline-flex; gap: 8px; margin-top: 14px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid currentColor; padding-bottom: 3px; }
.post-card__more span { transition: transform .5s var(--ease); }
.post-card__link:hover .post-card__more span { transform: translateX(5px); }
.post-card--large { grid-column: 1 / -1; }
.post-card--large .post-card__link { grid-template-columns: 7fr 5fr; gap: 40px; align-items: center; }
.post-card--large .post-card__title { font-size: clamp(1.8rem, 3vw, 2.8rem); line-height: 1.08; }
.blog-empty { padding: 20px 0 40px; display: grid; gap: 22px; justify-items: start; }

.pager { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager a, .pager span { display: inline-flex; align-items: center; gap: 8px; min-width: 42px; height: 42px; padding: 0 14px; justify-content: center; border: 1px solid var(--line); font-family: var(--mono); font-size: 13px; color: var(--ink); }
.pager a:hover { border-color: var(--ink); }
.pager .current { background: var(--ink); border-color: var(--ink); color: var(--white); }
.pager .next { margin-left: auto; }

/* ---------- Single post ---------- */
.post-hero__title { font-size: clamp(2.3rem, 4.8vw, 4.6rem); max-width: 22ch; }
.post-hero__meta { margin: 40px 0 110px; }
.post__cover { margin: 0 0 72px; aspect-ratio: 16 / 8; background: var(--ink); }
.post__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post__grid { display: grid; grid-template-columns: 3fr 9fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.post__aside { position: sticky; top: 110px; }
.post__share { margin-top: 16px; border-top: 1px solid var(--line); }
.post__share li { border-bottom: 1px solid var(--line); }
.post__share a, .post__share button { display: block; width: 100%; text-align: left; padding: 10px 0; background: none; border: 0; cursor: pointer; font: 500 .95rem var(--display); color: var(--muted); transition: color .3s; }
.post__share a:hover, .post__share button:hover { color: var(--ink); }
.post__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.post__tags a { display: block; padding: 6px 12px; border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.post__tags a:hover { border-color: var(--ink); color: var(--ink); }
.prose .post__tags { display: flex; }
.prose .post__tags li { padding-left: 0; }
.prose .post__tags li::before { display: none; }
.prose .post__tags a { text-decoration: none; }
.post__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 88px; border-top: 1px solid var(--line); }
.post__nav-link { display: grid; gap: 8px; padding: 26px 0; font-weight: 600; font-stretch: 106%; font-size: 1.15rem; color: var(--ink); }
.post__nav-link span { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-text); }
.post__nav-link--next { text-align: right; }
.post__nav-link:hover { color: var(--blue-text); }
.blog-related { padding-top: 40px; }

/* ---------- Article typography ---------- */
.prose { max-width: 720px; color: #33363b; font-size: 1.08rem; line-height: 1.75; }
.prose--page { margin: 0 auto; }
.prose > * + * { margin-top: 1.3em; }
.prose h2 { font-weight: 650; font-stretch: 110%; font-size: clamp(1.6rem, 2.6vw, 2.15rem); line-height: 1.15; letter-spacing: -.025em; color: var(--ink); margin-top: 2em; }
.prose h3 { font-weight: 600; font-stretch: 108%; font-size: 1.35rem; line-height: 1.25; color: var(--ink); margin-top: 1.8em; }
.prose h4 { font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 1.8em; }
.prose a { color: var(--blue-text); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 0; display: grid; gap: .5em; }
.prose ul { list-style: none; }
.prose ul li { position: relative; padding-left: 24px; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: .72em; width: 7px; height: 7px; background: var(--orange); }
.prose ol { list-style: none; counter-reset: li; }
.prose ol li { counter-increment: li; position: relative; padding-left: 36px; }
.prose ol li::before { content: counter(li, decimal-leading-zero); position: absolute; left: 0; top: .15em; font-family: var(--mono); font-size: .8em; color: var(--blue-text); }
.prose blockquote { position: relative; margin-left: 0; padding: 4px 0 4px 28px; font-weight: 500; font-stretch: 104%; font-size: 1.3rem; line-height: 1.45; color: var(--ink); }
.prose blockquote::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); }
.prose blockquote cite { display: block; margin-top: 12px; font-family: var(--mono); font-size: .75rem; font-style: normal; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.prose img, .prose video, .prose iframe { max-width: 100%; height: auto; display: block; }
.prose figure { margin: 2em 0; }
.prose figcaption, .prose .wp-element-caption { margin-top: 10px; font-family: var(--mono); font-size: .75rem; letter-spacing: .04em; color: var(--muted); }
.prose code { font-family: var(--mono); font-size: .88em; background: #e8e6e0; padding: .15em .4em; }
.prose pre { background: var(--ink); color: #cfd3d8; padding: 20px 22px; overflow-x: auto; font-family: var(--mono); font-size: .85rem; line-height: 1.7; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.5em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.prose .alignwide { margin-left: -8%; margin-right: -8%; max-width: none; }
.prose .wp-block-button__link { display: inline-block; background: var(--blue); color: var(--ink); text-decoration: none; padding: 14px 22px; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; border-radius: 0; }

/* ---------- CTA ---------- */
.blog-cta { padding: clamp(90px, 10vw, 140px) 0; }
.blog-cta__inner { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.blog-cta .cta__title { margin: 22px 0 0; font-size: clamp(2.8rem, 7vw, 6rem); max-width: 12ch; }

@media (max-width: 1024px) {
  .post-grid { grid-template-columns: 1fr 1fr; }
  .post-card--large .post-card__link { grid-template-columns: 1fr; gap: 20px; }
  .post__grid { grid-template-columns: minmax(0, 1fr); }
  .post__aside { position: static; order: 2; }
  .prose .alignwide { margin-left: 0; margin-right: 0; }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .post__nav { grid-template-columns: 1fr; }
  .post__nav-link--next { text-align: left; }
  .blog-search { width: 100%; }
  .blog-hero__bar, .post-hero__meta { margin-bottom: 90px; }
}
