/*
Theme Name: TrafficManager Blog
Theme URI: https://www.trafficmanager.com/blog/
Author: TrafficManager
Author URI: https://www.trafficmanager.com/
Description: A lightweight blog-only WordPress theme for TrafficManager news, updates, and educational articles.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: trafficmanager-blog
Tags: blog, custom-logo, featured-images, footer-widgets, responsive-layout, threaded-comments
*/

:root {
  --tm-primary: #d6459b;
  --tm-primary-dark: #b93482;
  --tm-orange: #ff7a3d;
  --tm-orange-dark: #f05c2e;
  --tm-text: #48486a;
  --tm-heading: #25233f;
  --tm-muted: #73738d;
  --tm-border: #ececf4;
  --tm-surface: #ffffff;
  --tm-soft: #faf8fc;
  --tm-soft-alt: #fff5ef;
  --tm-shadow: 0 14px 40px rgba(37, 35, 63, 0.08);
  --tm-radius: 8px;
  --tm-container: 1170px;
  --tm-content: 780px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--tm-text);
  font-family: "Public Sans", "Roboto", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--tm-primary);
  text-decoration: none;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

a:hover,
a:focus {
  color: var(--tm-orange-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(214, 69, 155, 0.28);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.65em;
  color: var(--tm-heading);
  font-weight: 800;
  line-height: 1.16;
}

p {
  margin: 0 0 1.25em;
}

ul,
ol {
  margin: 0 0 1.4em 1.25em;
  padding: 0;
}

blockquote {
  margin: 2rem 0;
  padding: 1.2rem 1.4rem;
  border-left: 5px solid var(--tm-primary);
  background: var(--tm-soft);
  color: var(--tm-heading);
  border-radius: 0 var(--tm-radius) var(--tm-radius) 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th,
td {
  padding: 0.85rem;
  border: 1px solid var(--tm-border);
  text-align: left;
}

th {
  color: var(--tm-heading);
  background: var(--tm-soft);
}

.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;
}

.screen-reader-text:focus {
  top: 1rem;
  left: 1rem;
  z-index: 100000;
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  clip: auto;
  background: #fff;
  color: var(--tm-heading);
  border-radius: var(--tm-radius);
  box-shadow: var(--tm-shadow);
}

.tm-container {
  width: min(100% - 2rem, var(--tm-container));
  margin: 0 auto;
}

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

.site-header.is-scrolled {
  box-shadow: 0 10px 28px rgba(37, 35, 63, 0.08);
}

.header-inner {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-branding {
  display: flex;
  align-items: center;
  min-width: 0;
}

.custom-logo-link,
.site-logo-text {
  display: inline-flex;
  align-items: center;
}

.custom-logo {
  width: auto;
  max-height: 52px;
}

.site-logo-text {
  color: var(--tm-heading);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0;
}

.site-logo-text span {
  color: var(--tm-primary);
}

.site-description {
  margin: 0.15rem 0 0;
  color: var(--tm-muted);
  font-size: 0.86rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.primary-navigation {
  display: flex;
  align-items: center;
}

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

.primary-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.primary-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  color: var(--tm-text);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--tm-radius);
}

.primary-menu a:hover,
.primary-menu a:focus,
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a,
.primary-menu .tm-blog-link > a {
  color: var(--tm-primary);
  background: rgba(214, 69, 155, 0.08);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  background: #fff;
  color: var(--tm-heading);
  cursor: pointer;
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 19px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  content: "";
}

.menu-toggle span {
  position: relative;
}

.menu-toggle span::before,
.menu-toggle span::after {
  position: absolute;
  left: 0;
}

.menu-toggle span::before {
  top: -6px;
}

.menu-toggle span::after {
  top: 6px;
}

.blog-hero {
  background:
    radial-gradient(circle at 12% 24%, rgba(214, 69, 155, 0.14), transparent 28%),
    linear-gradient(135deg, #fff 0%, var(--tm-soft) 55%, var(--tm-soft-alt) 100%);
  border-bottom: 1px solid var(--tm-border);
}

.blog-hero-inner {
  display: grid;
  min-height: 290px;
  align-items: end;
  padding: 4.5rem 0 3.5rem;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 1rem;
  padding: 0.35rem 0.7rem;
  color: var(--tm-primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(214, 69, 155, 0.1);
  border-radius: 999px;
}

.page-title {
  max-width: 820px;
  margin-bottom: 0.55rem;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.page-intro {
  max-width: 720px;
  margin: 0;
  color: var(--tm-muted);
  font-size: 1.08rem;
}

.site-main {
  padding: 4rem 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
}

.post-card {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  background: var(--tm-surface);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  box-shadow: 0 10px 28px rgba(37, 35, 63, 0.05);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(214, 69, 155, 0.28);
  box-shadow: var(--tm-shadow);
}

.post-card-media {
  position: relative;
  display: block;
  aspect-ratio: 1.9 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(214, 69, 155, 0.15), rgba(255, 122, 61, 0.12));
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}

.post-card:hover .post-card-media img {
  transform: scale(1.04);
}

.post-card-placeholder {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: rgba(214, 69, 155, 0.55);
  font-size: 3rem;
  font-weight: 900;
}

.post-date-badge {
  position: absolute;
  right: 1rem;
  bottom: -1.45rem;
  display: grid;
  width: 60px;
  min-height: 60px;
  place-items: center;
  padding: 0.35rem;
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, var(--tm-primary), var(--tm-orange));
  border-radius: var(--tm-radius);
  box-shadow: 0 10px 24px rgba(214, 69, 155, 0.28);
}

.post-date-badge .day {
  display: block;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.post-date-badge .month {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.post-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 2.4rem 1.35rem 1.35rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--tm-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.post-meta a {
  color: var(--tm-primary);
}

.post-card-title {
  margin-bottom: 0.7rem;
  font-size: 1.15rem;
  line-height: 1.28;
}

.post-card-title a {
  color: var(--tm-heading);
}

.post-card-title a:hover,
.post-card-title a:focus {
  color: var(--tm-primary);
}

.post-excerpt {
  color: var(--tm-muted);
  font-size: 0.95rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  color: var(--tm-orange-dark);
  font-weight: 900;
}

.read-more::after {
  content: ">";
  transition: transform 180ms ease;
}

.read-more:hover::after,
.read-more:focus::after {
  transform: translateX(3px);
}

.pagination-wrap,
.posts-navigation,
.post-navigation {
  margin-top: 3rem;
}

.pagination,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
}

.page-numbers,
.nav-links a {
  display: inline-flex;
  min-width: 42px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.8rem;
  color: var(--tm-heading);
  font-weight: 800;
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  background: #fff;
}

.page-numbers.current,
.page-numbers:hover,
.page-numbers:focus,
.nav-links a:hover,
.nav-links a:focus {
  color: #fff;
  background: var(--tm-primary);
  border-color: var(--tm-primary);
}

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

.content-layout.no-sidebar {
  display: block;
}

.single-article {
  max-width: var(--tm-content);
  margin: 0 auto;
}

.single-header {
  padding: 4rem 0 2rem;
  background: linear-gradient(135deg, #fff 0%, var(--tm-soft) 100%);
  border-bottom: 1px solid var(--tm-border);
}

.single-header-inner {
  max-width: var(--tm-content);
  margin: 0 auto;
}

.single-title {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3.35rem);
}

.single-featured-image {
  margin: 2rem 0 0;
  overflow: hidden;
  border-radius: var(--tm-radius);
  box-shadow: var(--tm-shadow);
}

.single-featured-image img {
  display: block;
  width: 100%;
}

.entry-content {
  color: var(--tm-text);
  font-size: 1.05rem;
}

.entry-content > * {
  margin-bottom: 1.35rem;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 2.2rem;
}

.entry-content a {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.entry-content .alignwide {
  width: min(100vw - 2rem, 980px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.entry-content .alignfull {
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.wp-block-image img,
.entry-content img {
  border-radius: var(--tm-radius);
}

.entry-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--tm-border);
}

.tag-list,
.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.tag-list a,
.category-list a {
  display: inline-flex;
  padding: 0.35rem 0.65rem;
  color: var(--tm-primary-dark);
  font-size: 0.83rem;
  font-weight: 800;
  background: rgba(214, 69, 155, 0.08);
  border-radius: 999px;
}

.related-posts {
  margin-top: 3rem;
}

.related-posts h2 {
  font-size: 1.45rem;
}

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

.related-card {
  padding: 1rem;
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  background: #fff;
}

.related-card a {
  color: var(--tm-heading);
  font-weight: 900;
}

.sidebar {
  padding: 1.35rem;
  background: var(--tm-soft);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
}

.widget {
  margin-bottom: 2rem;
}

.widget:last-child {
  margin-bottom: 0;
}

.widget-title,
.widget h2,
.widget h3 {
  margin-bottom: 0.9rem;
  font-size: 1rem;
}

.widget ul {
  margin-left: 0;
  list-style: none;
}

.widget li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(72, 72, 106, 0.09);
}

input,
textarea,
select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  color: var(--tm-heading);
  font: inherit;
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  background: #fff;
}

button,
input[type="submit"],
.button,
.wp-block-button__link {
  display: inline-flex;
  width: auto;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.05rem;
  color: #fff;
  font: inherit;
  font-weight: 900;
  border: 0;
  border-radius: var(--tm-radius);
  background: linear-gradient(135deg, var(--tm-orange), var(--tm-orange-dark));
  box-shadow: 0 8px 22px rgba(255, 122, 61, 0.25);
  cursor: pointer;
}

button:hover,
input[type="submit"]:hover,
.button:hover,
.wp-block-button__link:hover {
  color: #fff;
  transform: translateY(-1px);
}

.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-form label {
  flex: 1;
}

.not-found,
.no-results {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  background: var(--tm-soft);
}

.site-footer {
  color: rgba(255, 255, 255, 0.78);
  background: #25233f;
}

.footer-main {
  padding: 3.5rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-widget-title,
.site-footer .widget-title,
.site-footer h2,
.site-footer h3 {
  color: #fff;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.84);
}

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

.footer-logo img {
  max-height: 52px;
  width: auto;
}

.footer-menu li {
  margin-bottom: 0.4rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.social-links a {
  display: inline-flex;
  min-width: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.65rem;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--tm-radius);
}

.footer-bottom {
  padding: 1.1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
}

.comments-area {
  max-width: var(--tm-content);
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--tm-border);
}

@media (max-width: 980px) {
  .header-inner {
    min-height: 72px;
  }

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

  .primary-navigation {
    position: absolute;
    top: 100%;
    right: 1rem;
    left: 1rem;
    display: none;
    padding: 0.8rem;
    background: #fff;
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius);
    box-shadow: var(--tm-shadow);
  }

  .primary-navigation.is-open {
    display: block;
  }

  .primary-menu {
    display: grid;
    gap: 0.2rem;
  }

  .primary-menu a {
    width: 100%;
  }

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

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

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

@media (max-width: 640px) {
  .tm-container {
    width: min(100% - 1.25rem, var(--tm-container));
  }

  .blog-hero-inner,
  .single-header {
    padding: 3rem 0 2.2rem;
  }

  .site-main {
    padding: 2.5rem 0;
  }

  .post-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .post-card-body {
    padding: 2.25rem 1.1rem 1.15rem;
  }

  .search-form {
    display: grid;
  }

  .footer-bottom-inner {
    display: block;
  }
}
