/* Blog: index, category archives, single article and the Home "Media & Insights" cards. */

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

/* ---------- Hero ---------- */
.tg-blog-hero .section-title,
.tg-article-title {
  color: var(--text-white);
}

.tg-blog-hero .section-title {
  margin-top: 1rem;
}

.tg-blog-hero .page-hero-lead {
  max-width: 620px;
}

/* ---------- Category links ---------- */
.tg-blog-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.25rem;
}

.tg-blog-cats .jobs-pill {
  text-decoration: none;
}

/* ---------- Layout: articles + sidebar ---------- */
.tg-blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 3rem;
  align-items: start;
}

/* ---------- Cards ---------- */
.tg-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3rem 2rem;
}

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

.tg-post-card {
  display: flex;
  flex-direction: column;
}

.tg-post-card-media {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--border-radius-md);
  background-color: var(--primary-navy);
}

.tg-post-card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Placeholder when an article has no featured image: brand navy with copper rings. */
.tg-post-ph {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background-color: var(--primary-navy);
  background-image:
    url("data:image/svg+xml,%3Csvg width='220' height='220' viewBox='0 0 220 220' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='110' cy='110' r='108' stroke='%23C87941' stroke-opacity='.35' stroke-width='2'/%3E%3Ccircle cx='110' cy='110' r='80' stroke='%23C87941' stroke-opacity='.55' stroke-width='2'/%3E%3Ccircle cx='110' cy='110' r='52' stroke='%23C87941' stroke-opacity='.75' stroke-width='2.5'/%3E%3Ccircle cx='110' cy='110' r='24' stroke='%23C87941' stroke-width='3'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='1' fill='%23C87941' fill-opacity='0.22'/%3E%3C/svg%3E");
  background-repeat: no-repeat, repeat;
  background-position: right -40px bottom -40px, 0 0;
}

.tg-post-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.9rem;
  padding: 1.5rem 0 0;
}

.tg-post-card-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.3px;
  color: var(--text-heading);
  margin: 0;
}

.tg-post-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tg-post-card:hover .tg-post-card-title a,
.tg-post-card-title a:hover {
  color: var(--accent-copper-dark);
}

.tg-post-card-excerpt {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-dark);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tg-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
}

.tg-post-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tg-post-meta-item svg {
  flex-shrink: 0;
  color: var(--accent-copper);
}

.tg-read-more {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-copper-dark);
  text-decoration: none;
}

.tg-read-more svg {
  transition: transform 0.2s ease;
}

.tg-read-more:hover {
  color: var(--accent-copper);
}

.tg-read-more:hover svg {
  transform: translateX(4px);
}

.tg-post-cat {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent-copper-dark);
  background-color: var(--accent-copper-light);
  border-radius: 4px;
  padding: 0.22rem 0.55rem;
  text-decoration: none;
}

a.tg-post-cat:hover {
  color: var(--accent-copper);
}

/* ---------- Sidebar ---------- */
.tg-blog-sidebar {
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  padding: 2.25rem 2rem;
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
}

.tg-widget-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-heading);
  margin: 0 0 1.1rem;
}

.tg-search-form {
  position: relative;
  display: flex;
}

.tg-search-input {
  width: 100%;
  padding: 0.95rem 3.25rem 0.95rem 1.15rem;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--primary-navy);
  background-color: var(--bg-white);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.tg-search-input::placeholder {
  color: var(--text-light);
}

.tg-search-input:focus {
  border-color: var(--accent-copper);
  box-shadow: 0 0 0 4px var(--accent-copper-light);
}

.tg-search-btn {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--border-radius-sm);
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.tg-search-btn:hover,
.tg-search-btn:focus-visible {
  color: var(--text-white);
  background-color: var(--accent-copper);
}

.tg-recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tg-recent-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border-color);
}

.tg-recent-item:first-child {
  padding-top: 0;
  border-top: none;
}

.tg-recent-item:last-child {
  padding-bottom: 0;
}

.tg-recent-thumb {
  display: block;
  width: 84px;
  height: 84px;
  overflow: hidden;
  border-radius: var(--border-radius-sm);
  background-color: var(--primary-navy);
}

.tg-recent-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tg-recent-thumb .tg-post-ph {
  background-size: 90px, auto;
  background-position: right -20px bottom -20px, 0 0;
}

.tg-recent-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.tg-recent-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
}

.tg-recent-date svg {
  color: var(--accent-copper);
}

.tg-recent-title {
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-dark);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tg-recent-title:hover {
  color: var(--accent-copper-dark);
}

/* ---------- Pagination ---------- */
.tg-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.tg-pagination .page-numbers {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.9rem;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary-navy);
  background-color: var(--bg-white);
  border: 1.5px solid var(--border-color);
  border-radius: 50px;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.tg-pagination a.page-numbers:hover {
  border-color: var(--accent-copper);
  color: var(--accent-copper);
}

.tg-pagination .page-numbers.current {
  background-color: var(--accent-copper);
  border-color: var(--accent-copper);
  color: var(--text-white);
}

.tg-pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
}

/* ---------- Empty state ---------- */
.tg-blog-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  max-width: 860px;
  padding: 2.5rem;
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
}

.tg-blog-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-copper);
  background-color: var(--accent-copper-light);
}

.tg-blog-empty h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-heading);
  margin: 0 0 0.6rem;
}

.tg-blog-empty p {
  max-width: 60ch;
  margin: 0;
  line-height: 1.65;
  color: var(--text-light);
}

/* ---------- Single article ---------- */
.tg-article-hero .header-text-content {
  max-width: 880px;
}

.tg-article-hero.has-cover {
  padding-bottom: 7rem;
}

.tg-article-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.8px;
  margin: 1rem 0 1.25rem;
}

.tg-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
}

.tg-article-meta .tg-post-cat {
  color: var(--accent-copper-hover);
  background-color: rgba(200, 121, 65, 0.18);
}

.tg-article {
  background-color: var(--bg-white);
  padding-bottom: 4.5rem;
}

.tg-article-cover {
  position: relative;
  z-index: 3;
  max-width: 1140px;
  margin: -4.5rem auto 0;
}

.tg-article-cover-frame {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background-color: var(--primary-navy);
}

.tg-article-cover-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 620px;
  object-fit: cover;
}

.tg-article-cover figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
}

.tg-article-content {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 3.5rem;
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text-dark);
}

.tg-article-content > * {
  margin: 0 0 1.4rem;
}

.tg-article-content h2,
.tg-article-content h3,
.tg-article-content h4 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  font-weight: 700;
}

.tg-article-content h2 {
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin: 2.75rem 0 1rem;
}

.tg-article-content h3 {
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 2.25rem 0 0.75rem;
}

.tg-article-content h4 {
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 1.75rem 0 0.6rem;
}

.tg-article-content a {
  color: var(--accent-copper-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tg-article-content a:hover {
  color: var(--accent-copper);
}

.tg-article-content ul,
.tg-article-content ol {
  padding-left: 1.4rem;
}

.tg-article-content ul {
  list-style: disc;
}

.tg-article-content ol {
  list-style: decimal;
}

.tg-article-content li {
  margin-bottom: 0.5rem;
}

.tg-article-content li::marker {
  color: var(--accent-copper);
}

.tg-article-content strong {
  color: var(--text-heading);
}

.tg-article-content blockquote,
.tg-article-content .wp-block-quote {
  border-left: 3px solid var(--accent-copper);
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin: 2.25rem 0;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--primary-navy);
}

.tg-article-content blockquote p {
  margin: 0 0 0.5rem;
}

.tg-article-content blockquote cite {
  display: block;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-style: normal;
  color: var(--text-light);
}

.tg-article-content .wp-block-pullquote {
  border-top: 2px solid var(--accent-copper);
  border-bottom: 2px solid var(--accent-copper);
  padding: 2rem 0;
  text-align: center;
}

.tg-article-content .wp-block-pullquote blockquote {
  border: 0;
  padding: 0;
  margin: 0;
}

.tg-article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius-md);
}

.tg-article-content figure {
  margin: 2.25rem 0;
}

.tg-article-content figcaption,
.tg-article-content .wp-element-caption {
  margin-top: 0.65rem;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-light);
}

.tg-article-content .alignwide {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(1040px, calc(100vw - 2.5rem));
  max-width: none;
}

.tg-article-content .alignfull {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: none;
}

.tg-article-content .alignfull img {
  border-radius: 0;
  width: 100%;
}

.tg-article-content .alignleft {
  float: left;
  max-width: 50%;
  margin: 0.4rem 1.75rem 1rem 0;
}

.tg-article-content .alignright {
  float: right;
  max-width: 50%;
  margin: 0.4rem 0 1rem 1.75rem;
}

.tg-article-content .aligncenter {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.tg-article-content .wp-block-image img {
  display: block;
}

.tg-article-content .wp-block-image.aligncenter img {
  margin: 0 auto;
}

.tg-article-content .wp-block-gallery img {
  border-radius: var(--border-radius-sm);
}

.tg-article-content .wp-block-table {
  overflow-x: auto;
}

.tg-article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.55;
}

.tg-article-content th,
.tg-article-content td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
}

.tg-article-content th {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary-navy);
  background-color: var(--bg-light);
}

.tg-article-content hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 3rem 0;
}

.tg-article-content code,
.tg-article-content pre {
  font-size: 0.9em;
  background-color: var(--bg-light);
  border-radius: var(--border-radius-sm);
}

.tg-article-content code {
  padding: 0.1rem 0.35rem;
}

.tg-article-content pre {
  padding: 1.25rem;
  overflow-x: auto;
}

.tg-article-content .wp-block-button__link {
  display: inline-flex;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-white);
  background-color: var(--accent-copper);
  border-radius: var(--border-radius-sm);
  padding: 0.85rem 1.85rem;
  text-decoration: none;
}

.tg-article-content .wp-block-button__link:hover {
  color: var(--text-white);
  background-color: var(--accent-copper-hover);
}

.tg-article-content .wp-block-embed iframe {
  width: 100%;
  border-radius: var(--border-radius-md);
}

.tg-article-content .wp-embed-aspect-16-9 .wp-block-embed__wrapper {
  aspect-ratio: 16 / 9;
}

.tg-article-content .wp-embed-aspect-16-9 .wp-block-embed__wrapper iframe {
  height: 100%;
}

.tg-article-content::after {
  content: '';
  display: table;
  clear: both;
}

.tg-article-footer {
  max-width: 720px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tg-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tg-article-tags a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 0.3rem 0.85rem;
  text-decoration: none;
}

.tg-article-tags a:hover {
  border-color: var(--accent-copper);
  color: var(--accent-copper-dark);
}

.tg-related .section-title {
  margin-bottom: 2rem;
}

/* ---------- Home: Media & Insights ---------- */
.tg-home-blog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.tg-home-blog-head .section-title {
  margin-bottom: 0;
}

/* ---------- Article page with sidebar ---------- */
.tg-article-layout {
  max-width: 1140px;
  margin: 3.5rem auto 0;
}

.tg-article-main .tg-article-content {
  max-width: 760px;
  margin: 0;
  padding-top: 0;
}

.tg-article-main .tg-article-footer {
  max-width: 760px;
  margin: 3rem 0 0;
}

/* Wide/full-width blocks stay inside the article column next to the sidebar. */
.tg-article-main .tg-article-content .alignwide,
.tg-article-main .tg-article-content .alignfull {
  left: auto;
  transform: none;
  width: 100%;
}

.tg-article-main .tg-article-content .alignfull img {
  border-radius: var(--border-radius-md);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .tg-blog-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 2.25rem;
  }

  .tg-post-grid--2 {
    grid-template-columns: 1fr;
  }

  .tg-blog-sidebar {
    padding: 1.75rem 1.5rem;
  }
}

@media (max-width: 1024px) {
  .tg-post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tablet: sidebar moves below the articles, articles back to two columns. */
@media (max-width: 900px) {
  .tg-blog-layout {
    grid-template-columns: 1fr;
  }

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

  .tg-blog-sidebar {
    position: static;
  }

  .tg-post-card-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 640px) {
  .tg-post-grid,
  .tg-post-grid--2 {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .tg-post-card-title {
    font-size: 1.25rem;
  }

  .tg-blog-sidebar {
    padding: 1.5rem 1.25rem;
  }

  .tg-widget-title {
    font-size: 1.3rem;
  }

  .tg-article-hero.has-cover {
    padding-bottom: 4.5rem;
  }

  .tg-article-cover {
    margin-top: -2.75rem;
  }

  .tg-article-cover-frame {
    border-radius: var(--border-radius-md);
  }

  .tg-article-layout {
    margin-top: 2.25rem;
  }

  .tg-article-content {
    padding-top: 2.25rem;
    font-size: 1.02rem;
  }

  .tg-article-content h2 {
    font-size: 1.45rem;
  }

  .tg-article-content .alignleft,
  .tg-article-content .alignright {
    float: none;
    max-width: 100%;
    margin: 1.5rem 0;
  }

  .tg-blog-empty {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.75rem 1.25rem;
  }

  .tg-home-blog-head {
    align-items: flex-start;
  }
}

/* Phones and tablets: search at the top of the article list, no duplicate "Recent Posts" list. */
@media (max-width: 900px) {
  .tg-widget--recent {
    display: none;
  }

  .tg-blog .tg-blog-sidebar {
    order: -1;
    padding: 0;
    gap: 0;
    background: none;
    border: none;
  }

  .tg-blog .tg-widget--search .tg-widget-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .tg-blog .tg-blog-layout {
    gap: 1.5rem;
  }

  .tg-article-layout .tg-blog-sidebar {
    margin-top: 1rem;
    padding: 1.35rem;
  }
}

@media (max-width: 640px) {
  .tg-post-card-excerpt {
    -webkit-line-clamp: 3;
    font-size: 0.95rem;
  }

  .tg-post-card-body {
    padding-top: 1.1rem;
    gap: 0.7rem;
  }

  .tg-post-meta {
    font-size: 0.85rem;
    gap: 0.35rem 1.1rem;
  }

  .tg-read-more {
    font-size: 1rem;
  }

  .tg-blog-cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    padding-bottom: 0.35rem;
    scrollbar-width: none;
  }

  .tg-blog-cats::-webkit-scrollbar {
    display: none;
  }

  .tg-blog-cats .jobs-pill {
    flex: 0 0 auto;
  }

  .tg-article-meta {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tg-post-card-img,
  .tg-read-more svg {
    transition: none;
  }

  .tg-post-card:hover .tg-post-card-img,
  .tg-read-more:hover svg {
    transform: none;
  }
}
