/* ============================================================================
   GRÃNFORSYNING SINGLE POST â MOBILE-FIRST, CONVERSION-OPTIMIZED
   ============================================================================ */

/* ============================================================================
   READING PROGRESS BAR
   ============================================================================ */

.gf-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--gf-green-500), var(--gf-accent));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ============================================================================
   POST HERO â mobile-first
   ============================================================================ */

.gf-post-hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--gf-gutter) 40px;
  overflow: hidden;
}

/* Hero with featured image */
.gf-post-hero--has-image {
  background-color: var(--gf-green-900);
}

.gf-post-hero__image {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.gf-post-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gf-post-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(11, 31, 21, 0.1) 0%,
    rgba(11, 31, 21, 0.5) 50%,
    rgba(11, 31, 21, 0.85) 100%
  );
}

/* Hero without featured image */
.gf-post-hero--no-image {
  background: linear-gradient(135deg, var(--gf-green-900) 0%, var(--gf-green-800) 100%);
}

.gf-post-hero__gradient {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.gf-post-hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.25;
}

.gf-post-hero__orb--1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(61, 163, 99, 0.5) 0%, transparent 70%);
  top: -80px;
  right: -80px;
  animation: gf-float 6s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

.gf-post-hero__orb--2 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(45, 122, 74, 0.4) 0%, transparent 70%);
  bottom: -60px;
  left: -60px;
  animation: gf-float 8s cubic-bezier(0.34, 1.56, 0.64, 1) infinite reverse;
}

@keyframes gf-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(20px); }
}

.gf-post-hero__grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(248, 250, 247, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(248, 250, 247, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.5;
}

.gf-post-hero__content {
  position: relative;
  z-index: 2;
  max-width: 860px;
}

.gf-post-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.gf-post-hero__category {
  display: inline-block;
  background-color: var(--gf-green-500);
  color: var(--gf-white);
  font-family: var(--gf-font-body);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.8rem;
  border-radius: 2rem;
  text-decoration: none;
}

.gf-post-hero__reading-time {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 13px;
  color: var(--gf-stone-300);
  font-family: var(--gf-font-body);
  font-weight: 500;
}

.gf-post-hero__title {
  font-family: var(--gf-font-display);
  font-size: clamp(1.6rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--gf-white);
  margin: 12px 0 0;
}

.gf-post-hero__author-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 13px;
}

.gf-post-hero__author-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gf-post-hero__author-name {
  font-family: var(--gf-font-body);
  font-weight: 500;
  color: var(--gf-white);
}

.gf-post-hero__date {
  font-family: var(--gf-font-body);
  color: var(--gf-stone-300);
  font-size: 13px;
}

.gf-post-hero__date::before {
  content: 'Â·';
  margin-right: 8px;
  color: var(--gf-stone-400);
}

/* ============================================================================
   TABLE OF CONTENTS (auto-generated via JS)
   ============================================================================ */

.gf-toc {
  background: var(--gf-cream);
  border-radius: 12px;
  padding: 24px;
  margin: 0 auto 2.5rem;
  max-width: var(--gf-container-narrow);
}

.gf-toc__title {
  font-family: var(--gf-font-body);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gf-stone-500);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.gf-toc__title svg {
  transition: transform 0.3s ease;
}

.gf-toc--collapsed .gf-toc__title svg {
  transform: rotate(-90deg);
}

.gf-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.gf-toc--collapsed .gf-toc__list {
  max-height: 0 !important;
}

.gf-toc__link {
  display: block;
  font-family: var(--gf-font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--gf-green-900);
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.gf-toc__link:last-child {
  border-bottom: none;
}

.gf-toc__link:hover,
.gf-toc__link--active {
  color: var(--gf-green-500);
  padding-left: 8px;
}

/* ============================================================================
   POST BODY â mobile-first
   ============================================================================ */

.gf-post-body {
  max-width: var(--gf-container-narrow);
  margin: 0 auto;
  padding: 40px var(--gf-gutter) 40px;
}

.gf-post-body__content {
  font-family: var(--gf-font-body);
  color: var(--gf-green-900);
}

.gf-post-body__content p {
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.gf-post-body__content h2 {
  font-family: var(--gf-font-display);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--gf-green-900);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  scroll-margin-top: 80px;
}

.gf-post-body__content h3 {
  font-family: var(--gf-font-display);
  font-size: clamp(1.2rem, 3vw, 1.625rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--gf-green-900);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 80px;
}

.gf-post-body__content h4 {
  font-family: var(--gf-font-body);
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gf-green-900);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.gf-post-body__content a {
  color: var(--gf-green-500);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.gf-post-body__content a:hover {
  color: var(--gf-accent);
}

.gf-post-body__content blockquote {
  border-left: 3px solid var(--gf-accent);
  padding-left: 1.25rem;
  margin: 2rem 0;
  font-family: var(--gf-font-display);
  font-size: clamp(18px, 2.5vw, 22px);
  font-style: italic;
  line-height: 1.6;
  color: var(--gf-stone-500);
}

.gf-post-body__content ul {
  list-style: none;
  margin: 1.5rem 0;
  padding-left: 1.25rem;
}

.gf-post-body__content ul li {
  position: relative;
  margin-bottom: 0.75rem;
  line-height: 1.75;
  font-size: clamp(15px, 1.8vw, 18px);
}

.gf-post-body__content ul li::before {
  content: 'âª';
  position: absolute;
  left: -1.25rem;
  color: var(--gf-green-500);
  font-weight: 600;
}

.gf-post-body__content ol {
  list-style: none;
  counter-reset: item;
  margin: 1.5rem 0;
  padding-left: 1.25rem;
}

.gf-post-body__content ol li {
  counter-increment: item;
  position: relative;
  margin-bottom: 0.75rem;
  line-height: 1.75;
  font-size: clamp(15px, 1.8vw, 18px);
}

.gf-post-body__content ol li::before {
  content: counter(item) '.';
  position: absolute;
  left: -1.25rem;
  color: var(--gf-green-500);
  font-weight: 600;
}

/* Images â contained on mobile, no overflow */
.gf-post-body__content img {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: 8px;
  display: block;
}

.gf-post-body__content figure {
  margin: 2rem 0;
  text-align: center;
}

.gf-post-body__content figcaption {
  font-size: 13px;
  color: var(--gf-stone-500);
  font-style: italic;
  margin-top: 0.75rem;
  line-height: 1.5;
}

.gf-post-body__content pre {
  background-color: var(--gf-green-900);
  color: var(--gf-white);
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 13px;
  line-height: 1.6;
  font-family: 'Monaco', 'Courier New', monospace;
  -webkit-overflow-scrolling: touch;
}

.gf-post-body__content code {
  background-color: var(--gf-cream);
  color: var(--gf-green-900);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 13px;
}

.gf-post-body__content pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

.gf-post-body__content hr {
  border: none;
  border-top: 1px solid var(--gf-stone-200);
  margin: 2.5rem 0;
}

/* Tables â horizontal scroll on mobile */
.gf-post-body__content .wp-block-table,
.gf-post-body__content table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  width: 100%;
}

.gf-post-body__content table {
  min-width: 500px;
  border-collapse: collapse;
}

.gf-post-body__content table th {
  background-color: var(--gf-cream);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid var(--gf-stone-200);
  white-space: nowrap;
}

.gf-post-body__content table td {
  padding: 0.75rem;
  font-size: 14px;
  border-bottom: 1px solid var(--gf-stone-200);
}

.gf-post-body__content table tr:nth-child(even) {
  background-color: var(--gf-white);
}

/* ============================================================================
   INLINE CTA (mid-article conversion block)
   ============================================================================ */

.gf-inline-cta {
  background: linear-gradient(135deg, var(--gf-green-900), var(--gf-green-800));
  border-radius: 12px;
  padding: 28px 24px;
  margin: 2.5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gf-inline-cta::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(61, 163, 99, 0.3) 0%, transparent 70%);
  top: -60px;
  right: -60px;
  border-radius: 50%;
  filter: blur(40px);
}

.gf-inline-cta__text {
  font-family: var(--gf-font-display);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: var(--gf-white);
  margin-bottom: 16px;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.gf-inline-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gf-white);
  color: var(--gf-green-900);
  font-family: var(--gf-font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 1;
}

.gf-inline-cta__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ============================================================================
   POST TAGS
   ============================================================================ */

.gf-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--gf-stone-200);
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.gf-post-tag {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--gf-stone-300);
  border-radius: 2rem;
  font-family: var(--gf-font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--gf-stone-500);
  text-decoration: none;
  transition: all 0.2s ease;
  background-color: transparent;
}

.gf-post-tag:hover {
  border-color: var(--gf-green-500);
  color: var(--gf-green-500);
  background-color: var(--gf-cream);
}

/* ============================================================================
   POST SHARE
   ============================================================================ */

.gf-post-share {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--gf-stone-200);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.gf-post-share__label {
  font-family: var(--gf-font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gf-stone-500);
}

.gf-post-share__links {
  display: flex;
  gap: 8px;
}

.gf-post-share__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--gf-stone-300);
  border-radius: 50%;
  background-color: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--gf-green-500);
}

.gf-post-share__link:hover {
  border-color: var(--gf-green-500);
  background-color: var(--gf-cream);
  transform: translateY(-2px);
}

/* ============================================================================
   RELATED POSTS SECTION
   ============================================================================ */

.gf-related {
  background-color: var(--gf-cream);
  padding: 60px var(--gf-gutter);
}

.gf-related__header {
  text-align: center;
  margin-bottom: 2rem;
}

.gf-related__title {
  font-family: var(--gf-font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--gf-green-900);
}

.gf-related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: var(--gf-container-max);
  margin: 0 auto;
}

/* ============================================================================
   STICKY MOBILE CTA
   ============================================================================ */

.gf-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--gf-green-900);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
}

.gf-sticky-cta--visible {
  transform: translateY(0);
}

.gf-sticky-cta__text {
  font-family: var(--gf-font-body);
  font-size: 13px;
  color: var(--gf-stone-300);
  font-weight: 400;
  line-height: 1.3;
  flex: 1;
}

.gf-sticky-cta__text strong {
  display: block;
  color: var(--gf-white);
  font-weight: 600;
  font-size: 14px;
}

.gf-sticky-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gf-green-500);
  color: var(--gf-white);
  font-family: var(--gf-font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.gf-sticky-cta__btn:hover {
  background: var(--gf-accent);
}

/* ============================================================================
   RESPONSIVE â TABLET (min-width: 640px)
   ============================================================================ */

@media (min-width: 640px) {
  .gf-post-hero {
    min-height: 50vh;
    padding-bottom: 50px;
  }

  .gf-post-hero__category {
    font-size: 11px;
    padding: 0.5rem 1rem;
  }

  .gf-toc {
    padding: 28px 32px;
  }

  .gf-post-body {
    padding: 50px var(--gf-gutter) 50px;
  }

  .gf-related__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .gf-post-body__content img {
    border-radius: 10px;
    margin: 2.5rem 0;
  }

  .gf-inline-cta {
    padding: 32px 28px;
    margin: 3rem 0;
  }
}

/* ============================================================================
   RESPONSIVE â DESKTOP (min-width: 1024px)
   ============================================================================ */

@media (min-width: 1024px) {
  .gf-post-hero {
    min-height: 65vh;
    padding-bottom: 80px;
  }

  .gf-post-hero__meta {
    gap: 16px;
    margin-bottom: 1.5rem;
  }

  .gf-post-hero__orb--1 {
    width: 500px;
    height: 500px;
    top: -150px;
    right: -150px;
  }

  .gf-post-hero__orb--2 {
    width: 450px;
    height: 450px;
    bottom: -120px;
    left: -120px;
  }

  .gf-post-body {
    padding: 80px var(--gf-gutter) 60px;
  }

  .gf-post-body__content p {
    line-height: 1.85;
    margin-bottom: 2rem;
  }

  .gf-post-body__content h2 {
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
  }

  .gf-post-body__content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
  }

  .gf-post-body__content blockquote {
    padding-left: 2rem;
    margin: 2.5rem 0;
  }

  .gf-post-body__content img {
    border-radius: 12px;
    margin: 3rem 0;
  }

  .gf-toc {
    padding: 32px 40px;
  }

  .gf-related {
    padding: 100px var(--gf-gutter);
  }

  .gf-related__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
  }

  .gf-related__header {
    margin-bottom: 3rem;
  }

  .gf-inline-cta {
    padding: 40px 36px;
    margin: 3.5rem 0;
    border-radius: 16px;
  }

  /* Hide sticky CTA on desktop â the bottom CTA is visible enough */
  .gf-sticky-cta {
    display: none !important;
  }
}

/* ============================================================================
   STRONG in paragraphs (used for step labels like "Trin 1:")
   ============================================================================ */

.gf-post-body__content p strong {
  font-weight: 600;
  color: var(--gf-green-900);
}
