/*
Theme Name: IT Knowledge Hub
Theme URI: https://example.com/it-knowledge-hub
Author: Codex
Description: A professional WordPress theme for IT articles, tutorials, and multi-technology publishing.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: it-knowledge-hub
*/

:root {
  --ink: #162033;
  --muted: #5c667a;
  --line: #dfe4ec;
  --panel: #ffffff;
  --soft: #f5f7fb;
  --brand: #0b6bcb;
  --brand-dark: #084d91;
  --accent: #13a06f;
  --warning: #e58a1f;
  --danger: #c83e51;
  --max: 1180px;
  --radius: 8px;
  --shadow: 0 14px 35px rgba(22, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--brand-dark);
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

.site-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 1000;
  padding: 10px 14px;
  color: #fff;
  background: var(--brand);
}

.skip-link:focus {
  left: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar {
  background: #162033;
  color: #d9e4f2;
  font-size: 13px;
}

.topbar .container {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar a {
  color: #ffffff;
}

.site-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}

.site-branding {
  min-width: 190px;
}

.custom-logo-link img {
  max-height: 48px;
  width: auto;
}

.site-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.site-title:hover {
  text-decoration: none;
}

.site-title-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--brand);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
}

.main-navigation {
  flex: 1;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

.primary-menu,
.primary-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-menu {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.primary-menu li {
  position: relative;
}

.primary-menu a {
  display: block;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
}

.primary-menu a:hover,
.primary-menu a:focus {
  color: var(--brand);
  background: #eef5fd;
  text-decoration: none;
}

.primary-menu ul {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 220px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  visibility: hidden;
}

.primary-menu li:hover > ul,
.primary-menu li:focus-within > ul {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.header-search {
  width: min(270px, 30vw);
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-field {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-submit,
.button,
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.search-submit:hover,
.button:hover,
.wp-block-button__link:hover {
  color: #fff;
  background: var(--brand-dark);
  text-decoration: none;
}

.site-main {
  flex: 1;
}

.hero {
  color: #fff;
  background:
    linear-gradient(110deg, rgba(12, 24, 41, 0.94), rgba(12, 24, 41, 0.72)),
    radial-gradient(circle at 82% 24%, rgba(19, 160, 111, 0.36), transparent 28%),
    #162033;
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 40px;
  align-items: center;
  min-height: 500px;
  padding: 56px 0;
}

.hero-kicker,
.section-kicker,
.post-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 650px;
  margin: 20px 0 0;
  color: #dce8f7;
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button.secondary {
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
}

.button.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hero-panel {
  align-self: stretch;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.hero-panel img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.hero-panel-content {
  padding: 20px;
}

.hero-panel-content h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 22px;
  line-height: 1.25;
}

.hero-panel-content p {
  margin: 0;
  font-size: 15px;
}

.section {
  padding: 54px 0;
}

.section.compact {
  padding-top: 22px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.18;
}

.section-description {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.category-card,
.article-card,
.sidebar-widget,
.author-box,
.comment-respond,
.comment-body {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.category-card {
  min-height: 158px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(22, 32, 51, 0.04);
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.category-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  color: #fff;
  background: var(--category-color, var(--brand));
  border-radius: 8px;
  font-size: 18px;
  font-weight: 900;
}

.category-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-card h3 {
  margin: 14px 0 4px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.category-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.article-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
}

.article-card-image {
  aspect-ratio: 16 / 9;
  background: #dce4ef;
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

.article-card h2,
.article-card h3 {
  margin: 0 0 10px;
  font-size: 21px;
  line-height: 1.26;
}

.article-card h2 a,
.article-card h3 a {
  color: var(--ink);
}

.article-card h2 a:hover,
.article-card h3 a:hover {
  color: var(--brand);
}

.entry-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.article-card .excerpt {
  margin: 0 0 16px;
  color: var(--muted);
}

.read-more {
  margin-top: auto;
  font-weight: 800;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.archive-header,
.single-header {
  padding: 42px 0 28px;
}

.archive-title,
.single-title {
  max-width: 860px;
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
}

.archive-description,
.single-excerpt {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.single-shell {
  max-width: 860px;
  margin: 0 auto;
  padding-bottom: 60px;
}

.single-featured {
  overflow: hidden;
  margin: 0 0 30px;
  border-radius: 8px;
}

.single-featured img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.entry-content {
  color: #243047;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: min(7vw, 54px);
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content > *:last-child {
  margin-bottom: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--ink);
  line-height: 1.2;
}

.entry-content h2 {
  margin-top: 1.6em;
  font-size: 30px;
}

.entry-content h3 {
  margin-top: 1.35em;
  font-size: 24px;
}

.entry-content pre,
.entry-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.entry-content pre {
  overflow-x: auto;
  padding: 16px;
  color: #ecf2ff;
  background: #111827;
  border-radius: 8px;
}

.entry-content blockquote {
  margin-left: 0;
  padding-left: 18px;
  color: var(--muted);
  border-left: 4px solid var(--brand);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.post-tags a,
.cat-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  color: var(--brand-dark);
  background: #eef5fd;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.sidebar {
  position: sticky;
  top: 112px;
}

.sidebar-widget {
  padding: 18px;
  margin-bottom: 18px;
}

.sidebar-widget h2,
.sidebar-widget h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.sidebar-widget ul {
  margin: 0;
  padding-left: 18px;
}

.pagination,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.page-numbers.current {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.comments-area {
  margin-top: 34px;
}

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

.comment-body,
.comment-respond {
  padding: 18px;
  margin-bottom: 14px;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.site-footer {
  margin-top: auto;
  color: #d9e4f2;
  background: #162033;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 28px;
  padding: 44px 0;
}

.site-footer h2,
.site-footer h3 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 18px;
}

.site-footer p,
.site-footer li {
  color: #d9e4f2;
}

.site-footer a {
  color: #fff;
}

.footer-bottom {
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #bcc9d9;
  font-size: 14px;
}

.footer-menu,
.footer-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.not-found {
  padding: 70px 0;
  text-align: center;
}

@media (max-width: 980px) {
  .site-header-main {
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: inline-block;
  }

  .main-navigation {
    order: 3;
    flex-basis: 100%;
  }

  .primary-menu {
    display: none;
    align-items: stretch;
    flex-direction: column;
    padding: 8px 0;
  }

  .primary-menu.is-open {
    display: flex;
  }

  .primary-menu ul {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    padding-left: 14px;
  }

  .header-search {
    width: min(100%, 320px);
    margin-left: auto;
  }

  .hero .container,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .topbar .container,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header-main {
    gap: 12px;
  }

  .header-search {
    order: 4;
    width: 100%;
    margin-left: 0;
  }

  .hero .container {
    min-height: 0;
    padding: 42px 0;
  }

  .hero p {
    font-size: 17px;
  }

  .category-grid,
  .article-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .entry-content {
    padding: 22px;
  }
}
