/*
Theme Name: CVZilla Blog
Theme URI: https://cvzilla.io/blog/
Author: CVZilla
Author URI: https://cvzilla.io/
Description: Native block theme for the CVZilla blog, aligned with the public application UI.
Requires at least: 6.7
Tested up to: 7.0
Requires PHP: 8.1
Version: 1.1.3
Text Domain: cvzilla-blog
*/

:root {
  --cvz-blue: #2563eb;
  --cvz-blue-dark: #1d4ed8;
  --cvz-slate-950: #020617;
  --cvz-slate-900: #0f172a;
  --cvz-slate-600: #475569;
  --cvz-slate-200: #e2e8f0;
  --cvz-canvas: #f8fafc;
  --cvz-gradient: linear-gradient(90deg, #ffffff 0%, #eff6ff 52%, #faf5ff 100%);
  --cvz-shadow: 0 18px 55px rgba(15, 23, 42, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--cvz-canvas);
  color: var(--cvz-slate-900);
  -webkit-font-smoothing: antialiased;
}

a {
  text-underline-offset: 0.18em;
}

:where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.site-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
  backdrop-filter: blur(14px);
}

/* WordPress applies the global block gap to every top-level site block. */
.wp-site-blocks > .wp-block-template-part + .site-shell {
  margin-block-start: 0;
}

.site-header__inner {
  box-sizing: border-box;
  min-height: 64px;
}

.site-header__brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.site-header__brand img {
  display: block;
  width: 102px;
  height: auto;
}

.site-header .wp-block-navigation-item__content {
  border-radius: 0.5rem;
  padding: 0.58rem 0.75rem;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.site-header .wp-block-navigation-item__content:hover,
.site-header .current-menu-item > .wp-block-navigation-item__content {
  background: #eff6ff;
  color: var(--cvz-blue-dark);
}

.site-header .wp-block-navigation__responsive-container-open,
.site-header .wp-block-navigation__responsive-container-close {
  border-radius: 0.65rem;
  padding: 0.5rem;
}

.site-header__actions {
  flex: 0 0 auto;
}

.site-header__actions .wp-block-button__link,
.cvz-button .wp-block-button__link {
  min-height: 40px;
  box-sizing: border-box;
  padding: 0.65rem 1rem;
  border: 1px solid var(--cvz-blue);
  border-radius: 0.55rem;
  background: var(--cvz-blue);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.site-header__actions .is-style-outline .wp-block-button__link {
  border-color: #d1d5db;
  background: #fff;
  color: #374151;
}

.site-header__actions .wp-block-button__link:hover,
.cvz-button .wp-block-button__link:hover {
  border-color: var(--cvz-blue-dark);
  background: var(--cvz-blue-dark);
  transform: translateY(-1px);
}

.site-header__actions .is-style-outline .wp-block-button__link:hover {
  border-color: #9ca3af;
  background: #f9fafb;
  color: #111827;
}

.blog-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--cvz-slate-200);
  background:
    radial-gradient(circle at 12% 12%, rgba(14, 165, 233, 0.14), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(139, 92, 246, 0.12), transparent 30%),
    #fff;
}

.blog-hero::after {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(14, 116, 144, 0.13) 0.8px, transparent 0.8px);
  background-size: 13px 13px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
  pointer-events: none;
}

.blog-hero > * {
  position: relative;
  z-index: 1;
}

.brand-gradient {
  background: linear-gradient(90deg, #0284c7 0%, #6366f1 55%, #a855f7 100%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
}

.category-explorer {
  position: relative;
  padding-block: clamp(1.75rem, 4vw, 3rem);
  overflow: hidden;
  border-bottom: 1px solid var(--cvz-slate-200);
  background: var(--cvz-canvas);
}

.category-explorer::before {
  position: absolute;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.16);
  content: "";
  filter: blur(12px);
  inset: -12rem -8rem auto auto;
  pointer-events: none;
}

.category-explorer__inner {
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid rgba(147, 197, 253, 0.2);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 92% 10%, rgba(59, 130, 246, 0.24), transparent 32%),
    linear-gradient(135deg, #0f172a 0%, #172554 58%, #1e3a8a 100%);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
  color: #fff;
}

.category-explorer__inner::after {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 0.7px, transparent 0.7px);
  background-size: 14px 14px;
  content: "";
  mask-image: linear-gradient(120deg, transparent 25%, #000 100%);
  pointer-events: none;
}

.category-explorer__inner > * {
  position: relative;
  z-index: 1;
}

.category-explorer__header {
  gap: 1rem 2rem;
  margin-bottom: 1.25rem;
}

.category-explorer__intro {
  max-width: 38rem;
}

.category-explorer__title {
  margin: 0;
  color: #fff;
}

.category-explorer__description {
  max-width: 36rem;
  margin-top: 0.35rem;
  color: #cbd5e1;
  line-height: 1.55;
}

.category-explorer__all {
  margin: 0;
}

.category-explorer__all a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 0.4rem;
  box-sizing: border-box;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(191, 219, 254, 0.35);
  border-radius: 999px;
  color: #dbeafe;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.category-explorer__all a:hover {
  border-color: rgba(219, 234, 254, 0.7);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.category-explorer .wp-block-categories-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  list-style: none;
}

.category-explorer .wp-block-categories-list > li {
  min-width: 0;
  margin: 0;
}

.category-explorer .wp-block-categories-list > li > a {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(191, 219, 254, 0.2);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.075);
  color: #f8fafc;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.category-explorer .wp-block-categories-list > li > a::after {
  flex: 0 0 auto;
  color: #bfdbfe;
  content: "\2192";
  font-size: 1rem;
  transition: color 160ms ease, transform 160ms ease;
}

.category-explorer .wp-block-categories-list > li > a:hover {
  border-color: rgba(147, 197, 253, 0.65);
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.category-explorer .wp-block-categories-list > li > a:hover::after {
  color: #fff;
  transform: translateX(2px);
}

.blog-card {
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--cvz-slate-200);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 7px 28px rgba(15, 23, 42, 0.045);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.blog-card:hover {
  border-color: #bfdbfe;
  box-shadow: var(--cvz-shadow);
  transform: translateY(-3px);
}

.blog-card .wp-block-post-featured-image {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #e0f2fe;
}

.blog-card .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.blog-card:hover .wp-block-post-featured-image img {
  transform: scale(1.025);
}

.blog-card__content {
  padding: 1.35rem;
}

.blog-card .wp-block-post-title a {
  color: var(--cvz-slate-950);
  text-decoration: none;
}

.blog-card .wp-block-post-title a:hover {
  color: var(--cvz-blue-dark);
}

.post-meta,
.post-meta a {
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.post-meta a:hover {
  color: var(--cvz-blue-dark);
}

.blog-card .wp-block-post-excerpt__more-link,
.cvz-text-link {
  color: var(--cvz-blue-dark);
  font-weight: 700;
  text-decoration: none;
}

.blog-card .wp-block-post-excerpt__more-link:hover,
.cvz-text-link:hover {
  text-decoration: underline;
}

.article-shell,
.content-panel {
  box-sizing: border-box;
  border: 1px solid var(--cvz-slate-200);
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: var(--cvz-shadow);
}

.article-shell .wp-block-post-content > :where(h2, h3, h4) {
  scroll-margin-top: 92px;
}

.article-shell .wp-block-post-content :where(p, li) {
  color: #334155;
}

.article-shell .wp-block-post-content a:not(.wp-element-button) {
  color: var(--cvz-blue-dark);
  font-weight: 600;
}

.article-shell .wp-block-post-content blockquote {
  margin-inline: 0;
  padding: 0.3rem 0 0.3rem 1.25rem;
  border-left: 4px solid var(--cvz-blue);
  color: #334155;
}

.article-shell .wp-block-post-content :where(.wp-block-image, figure) {
  max-width: 100%;
}

.article-shell .wp-block-post-content :where(img, .wp-block-image img) {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0.9rem;
}

.site-shell.is-layout-flow > * {
  margin-block-start: 0;
}

.site-shell.is-layout-flow > * + * {
  padding-block-start: 4rem;
  padding-block-end: 4rem;
}

.archive-title strong,
.article-kicker {
  color: var(--cvz-blue-dark);
}

.wp-block-query-pagination {
  gap: 0.5rem;
}

.blog-pagination {
  margin-block-start: 0;
  padding-block-start: 2rem;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .current {
  display: inline-flex;
  min-width: 2.5rem;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid var(--cvz-slate-200);
  border-radius: 0.55rem;
  background: #fff;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.wp-block-query-pagination a:hover,
.wp-block-query-pagination .current {
  border-color: var(--cvz-blue);
  background: var(--cvz-blue);
  color: #fff;
}

.site-footer {
  min-height: 16rem;
  border-top: 1px solid var(--cvz-slate-200);
  background: var(--cvz-gradient);
  color: #1e293b;
}

.site-footer a {
  color: #475569;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--cvz-blue-dark);
  text-decoration: underline;
}

.site-footer .is-style-none {
  list-style: none;
}

.site-footer__legal {
  border-top: 1px solid rgba(203, 213, 225, 0.8);
}

/* Contact Form 7 inherits the same control system as the public application. */
.wpcf7 {
  font-family: "Manrope", "Avenir Next", "Noto Sans", sans-serif;
}

.wpcf7 label {
  color: #334155;
  font-size: 0.9375rem;
  font-weight: 700;
}

.wpcf7-form > p {
  margin: 0 0 1rem;
}

.wpcf7 :where(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), textarea, select) {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
  margin-top: 0.4rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #cbd5e1 !important;
  border-radius: 0.7rem !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

.wpcf7 textarea {
  min-height: 9rem;
  resize: vertical;
}

.wpcf7 :where(input, textarea, select):focus {
  border-color: var(--cvz-blue) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16) !important;
  outline: 0 !important;
}

.wpcf7 input[type="submit"] {
  min-height: 46px;
  padding: 0.7rem 1.15rem;
  border: 0 !important;
  border-radius: 0.7rem !important;
  background: var(--cvz-blue) !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24);
}

.wpcf7 input[type="submit"]:hover {
  background: var(--cvz-blue-dark) !important;
}

.wpcf7 .wpcf7-not-valid-tip {
  margin-top: 0.35rem;
  color: #be123c;
  font-size: 0.8125rem;
  font-weight: 600;
}

.wpcf7 form .wpcf7-response-output {
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  border-width: 1px;
  border-radius: 0.7rem;
  font-size: 0.9rem;
}

.wp-block-breadcrumbs {
  margin-bottom: 1rem;
}

@media (max-width: 960px) {
  .site-header__nav {
    order: 3;
  }

  .site-header .wp-block-navigation__responsive-container.is-menu-open {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
    background: #fff;
  }

  .site-header .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__responsive-dialog {
    width: 100%;
    min-height: 100%;
  }
}

@media (max-width: 680px) {
  .site-header__inner {
    gap: 0.6rem;
  }

  .site-header__brand img {
    width: 88px;
  }

  .site-header__actions .wp-block-button__link {
    min-height: 38px;
    padding-inline: 0.75rem;
  }

  .site-header__actions {
    gap: 0.35rem !important;
  }

  .site-header__nav {
    margin-left: -0.2rem;
  }

  .blog-card__content {
    padding: 1.1rem;
  }

  .category-explorer {
    padding-block: 1.5rem;
  }

  .category-explorer__inner {
    padding: 1.15rem !important;
    border-radius: 0.85rem;
  }

  .category-explorer__header {
    display: block;
  }

  .category-explorer__all {
    margin-top: 0.75rem;
  }

  .category-explorer .wp-block-categories-list {
    grid-template-columns: 1fr;
  }

  .category-explorer .wp-block-categories-list > li > a {
    min-height: 50px;
  }

  .article-shell,
  .content-panel {
    border-inline: 0;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
