/* Single CPT Template Styles
 * Shared styles for all custom post type single templates
 * (Success Stories, Press Releases, Articles, Guides, Courses, Videos, Data Sheets, Glossary, Open Positions)
 */

/* Hero Section */
.cpt-hero {
  padding-top: clamp(8rem, 7vw, 11.2rem);
  padding-bottom: clamp(8rem, 7vw, 11.2rem);
  background-color: #000000;
}

.cpt-hero .cpt-hero-grid {
  display: grid;
  grid-template-columns: 1fr 506px;
  gap: 4.8rem;
  align-items: center;
}

@media (max-width: 900px) {
  .cpt-hero .cpt-hero-grid {
    grid-template-columns: 1fr;
    gap: 3.2rem;
  }

  .cpt-hero .cpt-hero-image {
    order: -1;
  }
}

@media (max-width: 700px) {
  .cpt-hero {
    padding-top: clamp(12rem, 15vw, 16rem);
  }
}

.cpt-hero .cpt-hero-image {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
}

@media (max-width: 700px) {
  .cpt-hero .cpt-hero-image {
    aspect-ratio: 16 / 9;
  }
}

.cpt-hero .cpt-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cpt-hero .breadcrumbs {
  color: var(--text-primary, #fff);
  margin-bottom: 1.6rem;
}

.cpt-hero .breadcrumbs a {
  color: var(--text-brand-green, #8FFF3E);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.cpt-hero .breadcrumbs a:hover {
  opacity: 0.8;
}

.cpt-hero .breadcrumbs .separator {
  margin: 0 0.8rem;
  color: var(--text-primary, #fff);
}

.cpt-hero .cpt-title {
  color: var(--text-primary, #fff);
  margin-bottom: 1.6rem;
}

.cpt-hero .cpt-excerpt {
  color: var(--text-secondary, #e7e4df);
  margin-bottom: 2.4rem;
}

.cpt-hero .cpt-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.6rem;
  color: var(--text-secondary, #e7e4df);
}

.cpt-hero .cpt-meta .separator {
  background: url('data:image/svg+xml;utf8,<svg width="6" height="6" viewBox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"><path fill="%237fff00" d="M2 0 H6 V4 C6 5.1 5.1 6 4 6 H0 V2 C0 0.9 0.9 0 2 0 Z"/></svg>') no-repeat center/contain;
  width: 6px;
  height: 6px;
}

.cpt-hero .cpt-meta .cpt-date,
.cpt-hero .cpt-meta .cpt-type {
  color: var(--text-brand-green, #8FFF3E);
}

.cpt-hero .cpt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2.4rem;
}

.cpt-hero .cpt-tags .tag {
  background-color: #3a352e;
  color: var(--text-brand-green, #8FFF3E);
  padding: 0.8rem 1.6rem;
  border-radius: 4px;
  border: 1px solid #3a352e;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cpt-hero .cpt-tags .tag:hover {
  background-color: #8FFF3E;
  color: #000000;
}

/* Content Section - Full Width (No TOC) */
.cpt-content-section {
  padding-top: clamp(8rem, 7vw, 11.2rem);
  padding-bottom: clamp(8rem, 7vw, 11.2rem);
  background-color: var(--background-neutral-50, #f6f6f6);
}

.cpt-main-content {
  max-width: 800px;
  margin: 0 auto;
}

/* Post Content */
.cpt-content {
  color: var(--text-primary, #000000);
  font-size: clamp(1.6rem, 1.125vw, 1.8rem);
  line-height: 1.6;
}

.cpt-content h1,
.cpt-content h2,
.cpt-content h3,
.cpt-content h4,
.cpt-content h5,
.cpt-content h6 {
  font-family: "ballinger-mono", sans-serif;
  color: var(--text-primary, #000000);
  margin-top: 3.2rem;
  margin-bottom: 1.6rem;
}

.cpt-content h1:first-child,
.cpt-content h2:first-child,
.cpt-content h3:first-child,
.cpt-content h4:first-child,
.cpt-content h5:first-child,
.cpt-content h6:first-child {
  margin-top: 0;
}

.cpt-content h2 {
  font-size: clamp(2.8rem, 2.25vw, 3.6rem);
  font-weight: 600;
}

.cpt-content h3 {
  font-size: clamp(2.4rem, 1.75vw, 2.8rem);
  font-weight: 600;
}

.cpt-content h4 {
  font-size: clamp(2rem, 1.5vw, 2.4rem);
  font-weight: 600;
}

.cpt-content p {
  margin-bottom: 1.6rem;
}

.cpt-content p:last-child {
  margin-bottom: 0;
}

/* Remove gaps from empty paragraphs */
.cpt-content p:empty,
.cpt-content p br:only-child {
  display: none;
}

.cpt-content br + br {
  display: none;
}

/* Tighten spacing between Gutenberg blocks */
.cpt-content > *:first-child {
  margin-top: 0;
}

.cpt-content .wp-block-heading + * {
  margin-top: 0;
}

.cpt-content a {
  color: var(--text-brand-blue, #013DA5);
  text-decoration: underline;
  transition: opacity 0.3s ease;
}

.cpt-content a:hover {
  opacity: 0.8;
}

/* List Styling */
.cpt-content ul,
.cpt-content ol,
.cpt-content .wp-block-list {
  margin-bottom: 1.6rem;
  padding-left: 2.4rem;
  list-style-position: outside;
}

.cpt-content ul,
.cpt-content ul.wp-block-list {
  list-style-type: disc !important;
}

.cpt-content ul ul {
  list-style-type: circle !important;
}

.cpt-content ul ul ul {
  list-style-type: square !important;
}

.cpt-content ol,
.cpt-content ol.wp-block-list {
  list-style-type: decimal !important;
}

.cpt-content ol ol {
  list-style-type: lower-alpha !important;
}

.cpt-content ul li,
.cpt-content ol li,
.cpt-content .wp-block-list li {
  margin-bottom: 0.8rem;
  line-height: 1.6;
  display: list-item;
}

.cpt-content li > ul,
.cpt-content li > ol {
  margin-top: 0.8rem;
  margin-bottom: 0;
}

/* Blockquote */
.cpt-content blockquote {
  border-left: 4px solid var(--border-brand-green, #8FFF3E);
  padding: 2.4rem;
  background-color: var(--background-neutral-100, #e7e4df);
  margin: 3.2rem 0;
  font-style: italic;
}

.cpt-content blockquote p {
  margin-bottom: 0;
}

/* Images */
.cpt-content img {
  max-width: 100%;
  height: auto;
  margin: 3.2rem 0;
  display: block;
}

.cpt-content figure {
  margin: 3.2rem 0;
}

.cpt-content figure img {
  margin: 0;
}

.cpt-content figure figcaption {
  text-align: center;
  font-size: 1.4rem;
  color: var(--text-neutral-500, #776e60);
  margin-top: 0.8rem;
  font-style: italic;
}

/* Code */
.cpt-content code {
  background-color: var(--background-neutral-100, #e7e4df);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

.cpt-content pre {
  background-color: var(--background-neutral-100, #e7e4df);
  padding: 1.6rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 2.4rem 0;
}

.cpt-content pre code {
  background: none;
  padding: 0;
}

/* Tables */
.cpt-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2.4rem 0;
}

.cpt-content th,
.cpt-content td {
  padding: 1.2rem;
  text-align: left;
  border: 1px solid var(--border-neutral-200, #c7bfb3);
}

.cpt-content th {
  background-color: var(--background-neutral-100, #e7e4df);
  font-weight: 600;
}

.cpt-content tr:nth-child(even) {
  background-color: var(--background-neutral-50, #f6f6f6);
}

/* Author Bio */
.cpt-author-bio {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.6rem;
  padding: 1.6rem;
  background-color: var(--background-neutral-100, #e7e4df);
  border-radius: 0px;
  margin-top: 4.8rem;
}

.cpt-author-bio .author-avatar img {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  display: block;
}

.cpt-author-bio .author-info .author-name {
  font-size: var(--Typography-Body-B1-Size, 18px);
  font-style: normal;
  font-weight: 400;
  line-height: var(--Typography-Body-B1-Line-Height, 24px);
  letter-spacing: var(--Typography-Body-B1-Tracking, 0);
}

.cpt-author-bio .author-info .author-social {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0;
}

.cpt-author-bio .author-info .author-social .social-icon {
  color: #000000;
  transition: color 0.3s ease;
  background: #fff;
  padding: 5px;
  border-radius: 15px;
}

.cpt-author-bio .author-info .author-social .social-icon:hover {
  color: #8FFF3E;
}

.cpt-author-bio .author-info .author-social .social-icon svg {
  display: block;
}

.cpt-author-bio .author-description {
  grid-column: 1 / -1;
  color: var(--text-neutral-600, #5d564b);
  margin: 0;
}

/* Share Section */
.cpt-share-section {
  margin-top: 4.8rem;
  padding-top: 3.2rem;
  border-top: 1px solid var(--border-neutral-200, #c7bfb3);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3.2rem;
}

@media (max-width: 900px) {
  .cpt-share-section {
    flex-direction: column;
  }
}

.cpt-share-section .share-left .share-title {
  font-size: var(--Typography-Body-B1-Size, 18px);
  font-style: normal;
  font-weight: 400;
  line-height: var(--Typography-Body-B1-Line-Height, 24px);
  letter-spacing: var(--Typography-Body-B1-Tracking, 0);
}

.cpt-share-section .share-left .share-buttons {
  display: flex;
  gap: 1.2rem;
}

.cpt-share-section .share-left .share-buttons .share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #000;
  transition: all 0.3s ease;
  text-decoration: none;
  background: var(--background-secondary, #E7E4DF);
}

.cpt-share-section .share-left .share-buttons .share-btn svg {
  width: 20px;
  height: 20px;
}

.cpt-share-section .share-left .share-buttons .share-btn:hover {
  background-color: var(--background-brand-green, #8FFF3E);
  color: #000000;
  transform: translateY(-2px);
}

.cpt-share-section .bottom-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-start;
}

.cpt-share-section .bottom-tags .tag-link {
  background-color: #000000;
  color: var(--text-brand-green, #8FFF3E);
  padding: 0.8rem 1.6rem;
  border-radius: 4px;
  display: inline-block;
  text-decoration: none;
}

.cpt-share-section .bottom-tags .tag-link:hover {
  background-color: var(--background-brand-green, #8FFF3E);
  color: #000000;
}

/* Gutenberg Block Fixes */
.cpt-content .wp-block-list {
  padding-left: 2.4rem;
  margin-bottom: 1.6rem;
  margin-top: 0;
}

.cpt-content .wp-block-list li {
  margin-bottom: 0.8rem;
}

/* Fix spacing between blocks */
.cpt-content .wp-block-group,
.cpt-content .wp-block-columns {
  margin-top: 1.6rem;
  margin-bottom: 1.6rem;
}

.cpt-content .wp-block-spacer {
  height: 1.6rem !important;
}

/* Remove any default WordPress block margins that cause gaps */
.cpt-content [class*="wp-block-"]:not(.wp-block-list):not(.wp-block-heading) {
  margin-top: 1.6rem;
  margin-bottom: 1.6rem;
}

.cpt-content .wp-block-heading {
  margin-top: 2.4rem;
  margin-bottom: 1.2rem;
}

.cpt-content > .wp-block-heading:first-child {
  margin-top: 0;
}

/* Video embed responsive */
.cpt-content .wp-block-embed,
.cpt-content .wp-block-video {
  margin: 3.2rem 0;
}

.cpt-content .wp-block-embed iframe,
.cpt-content .wp-block-video video {
  max-width: 100%;
  width: 100%;
}

/* Button blocks */
.cpt-content .wp-block-button__link {
  background-color: var(--background-brand-green, #8FFF3E);
  color: #000;
  padding: 1.2rem 2.4rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  transition: opacity 0.3s ease;
}

.cpt-content .wp-block-button__link:hover {
  opacity: 0.9;
}

/* Separator */
.cpt-content hr,
.cpt-content .wp-block-separator {
  border: none;
  border-top: 1px solid var(--border-neutral-200, #c7bfb3);
  margin: 3.2rem 0;
}
