/* ========================================================================
   POST CARD — Reusable Component
   ======================================================================== */

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.post-card__thumb {
  position: relative;
  aspect-ratio: 3/2;
  overflow: hidden;
  flex-shrink: 0;
}

.post-card__thumb img,
.post-card__thumb .technews-thumb-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.post-card:hover .post-card__thumb img {
  transform: scale(1.06);
}

.technews-thumb-placeholder {
  background: linear-gradient(135deg, var(--color-surface), var(--color-border));
}

.post-card__badge {
  position: absolute;
  top: var(--sp-sm);
  left: var(--sp-sm);
  z-index: 2;
}

.post-card__body {
  padding: var(--sp-md);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card__title {
  font-family: var(--font-headline);
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: var(--sp-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__title a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}

.post-card__title a:hover {
  color: var(--color-accent);
}

.post-card__meta {
  margin-top: auto;
}

/* ---- Card Variations ------------------------------------------------- */

/* Horizontal / small card */
.post-card--horizontal {
  flex-direction: row;
}

.post-card--horizontal .post-card__thumb {
  width: 120px;
  min-height: 80px;
  aspect-ratio: auto;
}

.post-card--horizontal .post-card__body {
  padding: var(--sp-sm) var(--sp-md);
}

.post-card--horizontal .post-card__title {
  font-size: 0.9rem;
}

/* No-image variant */
.post-card--no-image .post-card__body {
  padding: var(--sp-md);
}

/* ========================================================================
   SIDEBAR
   ======================================================================== */

.tn-sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-lg));
}

.sidebar-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-lg);
}

.widget-title {
  font-family: var(--font-headline);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-sm);
  border-bottom: 2px solid var(--color-accent);
}

/* Popular posts widget */
.popular-post {
  display: flex;
  gap: var(--sp-sm);
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.popular-post:last-child {
  border-bottom: none;
}

.popular-post__thumb {
  width: 72px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.popular-post__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popular-post__title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-post__title a {
  color: var(--color-text);
}

.popular-post__title a:hover {
  color: var(--color-accent);
}

.popular-post__date {
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  margin-top: var(--sp-xs);
}

/* Sidebar Newsletter */
.sidebar-newsletter__input {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.85rem;
  margin-bottom: var(--sp-sm);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease);
}

.sidebar-newsletter__input:focus {
  border-color: var(--color-accent);
}

.sidebar-newsletter .btn {
  width: 100%;
}

/* Tag cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs);
}

/* Ad placeholder */
.ad-placeholder {
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: var(--sp-2xl) var(--sp-md);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ========================================================================
   FOOTER
   ======================================================================== */

.tn-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--sp-3xl) 0 0;
  margin-top: var(--sp-3xl);
}

.tn-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-2xl);
}

@media (min-width: 768px) {
  .tn-footer__grid {
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
  }
}

.tn-footer__brand p {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  margin-top: var(--sp-sm);
  max-width: 280px;
}

.tn-footer__heading {
  font-family: var(--font-headline);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-md);
  color: var(--color-text);
}

.tn-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.tn-footer__links a {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  transition: color var(--duration-fast) var(--ease);
}

.tn-footer__links a:hover {
  color: var(--color-accent);
}

/* Footer newsletter */
.tn-footer__newsletter-input {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.85rem;
  margin-bottom: var(--sp-sm);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease);
}

.tn-footer__newsletter-input:focus {
  border-color: var(--color-accent);
}

.tn-footer__newsletter .btn {
  width: 100%;
}

/* Footer bottom bar */
.tn-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-md);
  padding: var(--sp-lg) 0;
  margin-top: var(--sp-2xl);
  border-top: 1px solid var(--color-border);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}

.tn-footer__bottom a {
  color: var(--color-text-secondary);
}

.tn-footer__bottom a:hover {
  color: var(--color-accent);
}

.tn-back-to-top {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--sp-xs) var(--sp-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}

.tn-back-to-top:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ========================================================================
   NEWSLETTER CTA BLOCK (full-width)
   ======================================================================== */

.newsletter-cta {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: var(--sp-3xl) 0;
  text-align: center;
}

.newsletter-cta__title {
  font-family: var(--font-headline);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: var(--sp-sm);
}

.newsletter-cta__subtitle {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--sp-lg);
}

.newsletter-cta__form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-sm);
  max-width: 480px;
  margin-inline: auto;
}

.newsletter-cta__input {
  flex: 1;
  min-width: 200px;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease);
}

.newsletter-cta__input:focus {
  border-color: var(--color-accent);
}

/* ========================================================================
   PAGINATION
   ======================================================================== */

.tn-pagination {
  display: flex;
  justify-content: center;
  gap: var(--sp-xs);
  padding: var(--sp-2xl) 0;
}

.tn-pagination a,
.tn-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--sp-sm);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  transition: all var(--duration-fast) var(--ease);
}

.tn-pagination a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.tn-pagination .current {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #0A0A0F;
}

/* ========================================================================
   SEARCH RESULTS
   ======================================================================== */

.search-header {
  padding: var(--sp-2xl) 0 var(--sp-lg);
}

.search-header__title {
  font-family: var(--font-headline);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.search-header__title span {
  color: var(--color-accent);
}

.search-result {
  display: flex;
  gap: var(--sp-md);
  padding: var(--sp-lg) 0;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--duration-fast) var(--ease);
}

.search-result__thumb {
  width: 160px;
  height: 110px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .search-result__thumb {
    width: 100px;
    height: 72px;
  }
}

.search-result__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result__title {
  font-family: var(--font-headline);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: var(--sp-xs);
}

.search-result__title a {
  color: var(--color-text);
}

.search-result__title a:hover {
  color: var(--color-accent);
}

.search-result__excerpt {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--sp-sm);
}

/* No results */
.no-results {
  text-align: center;
  padding: var(--sp-3xl) 0;
}

.no-results__title {
  font-family: var(--font-headline);
  font-size: 1.6rem;
  margin-bottom: var(--sp-md);
}

.no-results__text {
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-xl);
}

.no-results__categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-sm);
}

/* ========================================================================
   ARCHIVE HEADER
   ======================================================================== */

.archive-header {
  padding: var(--sp-2xl) 0 var(--sp-lg);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--sp-xl);
}

.archive-header__title {
  font-family: var(--font-headline);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  margin-bottom: var(--sp-sm);
}

.archive-header__desc {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  max-width: 600px;
}

.archive-header__count {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: var(--sp-sm);
}

.archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-lg);
}

@media (min-width: 640px) {
  .archive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .archive-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================================================
   COMMENTS
   ======================================================================== */

.tn-comments {
  padding-top: var(--sp-2xl);
  border-top: 1px solid var(--color-border);
  margin-top: var(--sp-2xl);
}

.tn-comments .comment-reply-title,
.tn-comments .comments-title {
  font-family: var(--font-headline);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--sp-lg);
}

.tn-comments .comment-list {
  list-style: none;
  padding: 0;
}

.tn-comments .comment {
  padding: var(--sp-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-md);
  background: var(--color-surface);
}

.tn-comments .comment .children {
  list-style: none;
  padding-left: var(--sp-lg);
  margin-top: var(--sp-md);
}

.tn-comments .comment-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-sm);
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

.tn-comments .comment-meta .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.tn-comments .comment-meta .fn {
  font-weight: 600;
  color: var(--color-text);
}

.tn-comments .comment-content p {
  font-size: 0.9rem;
}

.tn-comments .reply a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-accent);
}

.tn-comments .comment-form input[type="text"],
.tn-comments .comment-form input[type="email"],
.tn-comments .comment-form input[type="url"],
.tn-comments .comment-form textarea {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  margin-bottom: var(--sp-sm);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease);
}

.tn-comments .comment-form input:focus,
.tn-comments .comment-form textarea:focus {
  border-color: var(--color-accent);
}

.tn-comments .comment-form .submit {
  background: var(--color-accent);
  color: #0A0A0F;
  font-weight: 600;
  border: none;
  padding: var(--sp-sm) var(--sp-lg);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}

.tn-comments .comment-form .submit:hover {
  background: #33DDFF;
}

/* ========================================================================
   AUTHOR BOX
   ======================================================================== */

.author-box {
  display: flex;
  gap: var(--sp-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--sp-xl);
  margin: var(--sp-2xl) 0;
}

@media (max-width: 600px) {
  .author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

.author-box__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.author-box__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-box__name {
  font-family: var(--font-headline);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--sp-xs);
}

.author-box__name a {
  color: var(--color-text);
}

.author-box__name a:hover {
  color: var(--color-accent);
}

.author-box__bio {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-sm);
}

.author-box__social {
  display: flex;
  gap: var(--sp-sm);
}

.author-box__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  transition: all var(--duration-fast) var(--ease);
}

.author-box__social a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ========================================================================
   THEME TOGGLE
   ======================================================================== */

.theme-toggle__icon--light { display: none; }
.theme-toggle__icon--dark  { display: block; }

[data-theme="light"] .theme-toggle__icon--light { display: block; }
[data-theme="light"] .theme-toggle__icon--dark  { display: none; }
