/**
 * WordPress Runtime Overrides
 *
 * Styles for WordPress-generated markup that differs from the static HTML
 * templates. Covers: default widgets, block widgets, admin bar offset,
 * breadcrumb separator, author box, share links, App Store badge, and
 * navbar button fix.
 *
 * Loaded after all other stylesheets to ensure specificity.
 *
 * @package Vidzy
 * @since   1.0.0
 */

/* ==========================================================================
   1. HEADER / NAVBAR FIX
   ========================================================================== */

/* Header logo icon */
.header-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Fix keycap button in header overflowing — constrain the 3D depth effect */
.site-header .header-actions .keycap {
  --keycap-depth: 2px;
  height: 36px;
  font-size: 13px;
  vertical-align: middle;
}

/* Ensure header-actions stays vertically centered */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ==========================================================================
   2. BREADCRUMBS
   ========================================================================== */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-size: var(--text-body-small);
  line-height: var(--text-body-small-lh);
  padding: var(--space-md) 0;
}

.breadcrumbs a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.breadcrumb-separator {
  display: inline-flex;
  align-items: center;
  margin: 0 var(--space-xs);
  color: var(--color-text-tertiary);
  font-size: 11px;
}

.breadcrumb-current {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

/* ==========================================================================
   3. SIDEBAR WIDGETS (WordPress Block Widgets)
   ========================================================================== */

/* Base widget styling — open/borderless */
.sidebar-widget {
  background: transparent;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--color-border);
  padding: 0 0 var(--space-lg);
  margin-bottom: var(--space-lg);
}

/* Widget headings */
.sidebar-widget .wp-block-heading,
.sidebar-widget h2,
.sidebar-widget h3 {
  font-size: var(--text-heading-small);
  line-height: 1.3;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-md) 0;
}

/* --- Search widget --- */
.sidebar-widget .wp-block-search {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.sidebar-widget .wp-block-search__label {
  font-size: var(--text-body-medium);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: 0;
}

.sidebar-widget .wp-block-search__inside-wrapper {
  display: flex;
  gap: var(--space-xs);
}

.sidebar-widget .wp-block-search__input {
  flex: 1;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--corner-radius-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  font-size: var(--text-body-medium);
  outline: none;
  transition: border-color 0.2s ease;
}

.sidebar-widget .wp-block-search__input::placeholder {
  color: var(--color-text-tertiary);
}

.sidebar-widget .wp-block-search__input:focus {
  border-color: var(--color-accent);
}

.sidebar-widget .wp-block-search__button {
  background: var(--color-surface-elevated);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--corner-radius-sm);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-family);
  font-size: var(--text-body-small);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.sidebar-widget .wp-block-search__button:hover {
  background: var(--color-border);
  border-color: var(--color-text-tertiary);
}

/* --- Recent Posts widget --- */
.sidebar-widget .wp-block-latest-posts {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-widget .wp-block-latest-posts li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-widget .wp-block-latest-posts li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-widget .wp-block-latest-posts li:first-child {
  padding-top: 0;
}

.sidebar-widget .wp-block-latest-posts__post-title {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--text-body-small);
  line-height: 1.5;
  transition: color 0.2s ease;
  display: block;
}

.sidebar-widget .wp-block-latest-posts__post-title:hover {
  color: var(--color-accent);
}

/* --- Recent Comments widget --- */
.sidebar-widget .wp-block-latest-comments {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-widget .wp-block-latest-comments__comment {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-body-small);
  line-height: 1.5;
}

.sidebar-widget .wp-block-latest-comments__comment:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-widget .wp-block-latest-comments__comment:first-child {
  padding-top: 0;
}

.sidebar-widget .wp-block-latest-comments__comment-author,
.sidebar-widget .wp-block-latest-comments__comment-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar-widget .wp-block-latest-comments__comment-author:hover,
.sidebar-widget .wp-block-latest-comments__comment-link:hover {
  color: var(--color-accent);
}

.sidebar-widget .wp-block-latest-comments__comment-meta {
  color: var(--color-text-tertiary);
  font-size: var(--text-body-small);
}

/* --- Categories widget --- */
.sidebar-widget .wp-block-categories-list,
.sidebar-widget .widget_categories ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-widget .wp-block-categories-list li,
.sidebar-widget .widget_categories li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-widget .wp-block-categories-list li:last-child,
.sidebar-widget .widget_categories li:last-child {
  border-bottom: none;
}

.sidebar-widget .wp-block-categories-list a,
.sidebar-widget .widget_categories a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--text-body-small);
  transition: color 0.2s ease;
}

.sidebar-widget .wp-block-categories-list a:hover,
.sidebar-widget .widget_categories a:hover {
  color: var(--color-accent);
}

/* --- Tag Cloud widget --- */
.sidebar-widget .wp-block-tag-cloud,
.sidebar-widget .tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.sidebar-widget .wp-block-tag-cloud a,
.sidebar-widget .tagcloud a {
  display: inline-block;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--corner-radius-sm);
  padding: 4px 12px;
  color: var(--color-text-secondary) !important;
  font-size: var(--text-caption) !important;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sidebar-widget .wp-block-tag-cloud a:hover,
.sidebar-widget .tagcloud a:hover {
  background: var(--color-border);
  border-color: var(--color-text-tertiary);
  color: var(--color-text-primary) !important;
}

/* --- Generic block group reset inside widgets --- */
.sidebar-widget .wp-block-group__inner-container > *:first-child {
  margin-top: 0;
}

.sidebar-widget .wp-block-group__inner-container > *:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   4. AUTHOR BOX (single post)
   ========================================================================== */

.post-author-box {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: transparent;
  border: none;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
  padding: var(--space-lg) 0;
  margin: var(--space-xl) 0 0;
}

.post-author-avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
}

.post-author-info {
  flex: 1;
  min-width: 0;
}

.post-author-name {
  font-size: var(--text-body-large);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 4px;
}

.post-author-name a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.post-author-bio {
  font-size: var(--text-body-small);
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin: 0;
}

/* ==========================================================================
   5. SHARE LINKS (single post)
   ========================================================================== */

.share-links {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border);
  margin-bottom: var(--space-xl);
}

.share-links-label {
  font-size: var(--text-body-small);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  margin-right: var(--space-xs);
}

.share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--corner-radius-sm);
  padding: 6px 14px;
  color: var(--color-text-secondary);
  font-size: var(--text-body-small);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.share-link:hover {
  background: var(--color-border);
  border-color: var(--color-text-tertiary);
  color: var(--color-text-primary);
}

.share-link span {
  line-height: 1;
}

/* ==========================================================================
   6. POST TAGS (single post)
   ========================================================================== */

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border);
}

/* ==========================================================================
   7. RELATED POSTS (single post — de-boxed cards)
   ========================================================================== */

.related-posts {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-lg);
}

.related-posts h2 {
  font-size: var(--text-heading-small);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--space-lg);
}

/* Remove card box: no border-radius, no overflow clip, no hover lift */
.related-posts .post-card {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.related-posts .post-card:hover {
  transform: none;
}

/* Image keeps its own rounded corners */
.related-posts .post-card .card-image {
  border-radius: var(--corner-radius-md);
  overflow: hidden;
}

/* Remove body padding — no box to pad inside */
.related-posts .post-card .card-body {
  padding: var(--space-md) 0 0;
}

/* Smaller title for related cards */
.related-posts .post-card .card-body h3 {
  font-size: var(--text-body-large);
  line-height: 1.35;
}

/* ==========================================================================
   8. APP STORE BADGE (replaces keycap text CTAs)
   ========================================================================== */

.app-store-badge {
  display: inline-block;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-store-badge:hover {
  opacity: 0.85;
  transform: scale(1.03);
}

.app-store-badge img {
  display: block;
  height: 40px;
  width: auto;
}

/* Larger badge variant for hero/CTA sections */
.app-store-badge--lg img {
  height: 54px;
}

/* Header badge — smaller */
.site-header .app-store-badge img {
  height: 32px;
}

/* CTA banner badge */
.cta-banner .app-store-badge img {
  height: 48px;
}

/* Footer badge */
.site-footer .app-store-badge img {
  height: 36px;
}

/* ==========================================================================
   9. ADMIN BAR OFFSET
   ========================================================================== */

body.admin-bar .site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

/* ==========================================================================
   10. RESPONSIVE ADJUSTMENTS
   ========================================================================== */

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

  .share-links {
    justify-content: center;
  }
}
