/* =========================================================
   RedGif Homepage Blocks — Frontend + Editor Shared Styles
   All classes prefixed .redgif- to avoid theme conflicts.
   ========================================================= */

/* Design tokens (defaults — every block can override via inline styles from attributes) */
.redgif-section,
.redgif-section * {
  box-sizing: border-box;
}

.redgif-section {
  --rg-primary:       #E63946;
  --rg-primary-dark:  #C1121F;
  --rg-primary-soft:  #FDECEE;
  --rg-white:         #FFFFFF;
  --rg-cream:         #FAF8F5;
  --rg-ink:           #1A1A2E;
  --rg-text:          #2B2D42;
  --rg-muted:         #6B7280;
  --rg-border:        #E9ECEF;

  --rg-font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --rg-font-body:    'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --rg-radius-sm: 8px;
  --rg-radius-md: 14px;
  --rg-radius-lg: 20px;
  --rg-shadow-sm: 0 1px 2px rgba(26, 26, 46, 0.04);
  --rg-shadow-md: 0 6px 24px rgba(26, 26, 46, 0.06);
  --rg-shadow-lg: 0 20px 50px rgba(26, 26, 46, 0.08);

  font-family: var(--rg-font-body);
  color: var(--rg-text);
  line-height: 1.65;
  font-size: 17px;
  padding: 90px 0;
  position: relative;
  scroll-margin-top: 80px; /* Gives breathing room when scrolled to via anchor jump links (e.g. sticky header). */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.redgif-section img { max-width: 100%; display: block; }

.redgif-section a {
  color: var(--rg-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.redgif-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography */
.redgif-section h1,
.redgif-section h2,
.redgif-section h3,
.redgif-section h4 {
  font-family: var(--rg-font-display);
  color: var(--rg-ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0;
}
.redgif-h1 { font-size: clamp(2.4rem, 5vw + 1rem, 4.2rem); font-weight: 700; }
.redgif-h2 { font-size: clamp(1.9rem, 3vw + 0.5rem, 2.8rem); }
.redgif-h3 { font-size: clamp(1.25rem, 1.2vw + 0.8rem, 1.5rem); }

.redgif-section p { margin: 0 0 1em; }

.redgif-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--rg-font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rg-primary);
  margin-bottom: 16px;
}
.redgif-eyebrow::before {
  content: '';
  width: 24px;
  height: 2px;
  background: currentColor;
  display: inline-block;
  flex-shrink: 0;
}

/* Buttons */
.redgif-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--rg-font-body);
  transition: all 0.25s ease;
  border: 2px solid transparent;
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
}
.redgif-btn-primary { background: var(--rg-primary); color: var(--rg-white); }
.redgif-btn-primary:hover {
  background: var(--rg-primary-dark);
  color: var(--rg-white);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(230, 57, 70, 0.3);
}
.redgif-btn-secondary {
  background: var(--rg-white);
  color: var(--rg-ink);
  border-color: var(--rg-border);
}
.redgif-btn-secondary:hover {
  border-color: var(--rg-ink);
  color: var(--rg-ink);
  transform: translateY(-2px);
}
.redgif-arrow { transition: transform 0.25s ease; }
.redgif-btn:hover .redgif-arrow { transform: translateX(4px); }

/* Section heads */
.redgif-section-head {
  max-width: 720px;
  margin: 0 auto 60px;
  text-align: center;
}
.redgif-section-head .redgif-h2 { margin-bottom: 18px; }
.redgif-section-head p { font-size: 1.08rem; }

.redgif-section-cta { text-align: center; margin-top: 60px; }

/* =========================================================
   HERO
   ========================================================= */
.redgif-hero { padding: 90px 0 110px; overflow: hidden; }
.redgif-hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.redgif-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 80px;
  align-items: center;
}
.redgif-hero h1 { margin-bottom: 24px; }
.redgif-hero h1 em {
  font-style: italic;
  font-weight: 500;
}
.redgif-hero-description {
  font-size: 1.18rem;
  margin-bottom: 36px;
  line-height: 1.7;
  max-width: 540px;
}
.redgif-hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

/* Hero visual — 4 category cards */
.redgif-hero-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-width: 520px;
  margin-left: auto;
}
.redgif-hero-card {
  aspect-ratio: 1 / 1;
  border-radius: var(--rg-radius-lg);
  padding: 24px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--rg-shadow-md);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}
.redgif-hero-card::after {
  content: '';
  position: absolute;
  top: -40%; right: -40%;
  width: 100%; height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  pointer-events: none;
}
.redgif-hero-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--rg-shadow-lg);
  color: white;
}
.redgif-hero-card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative; z-index: 2;
}
.redgif-hero-card-icon svg { width: 22px; height: 22px; color: white; }
.redgif-hero-card-content {
  display: flex; flex-direction: column; gap: 6px;
  position: relative; z-index: 2;
}
.redgif-hero-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.85;
}
.redgif-hero-card-title {
  font-family: var(--rg-font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  color: white;
}

/* Hero stats */
.redgif-hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 60px;
  padding-top: 36px;
  border-top: 1px solid var(--rg-border);
  grid-column: 1 / -1;
  flex-wrap: wrap;
}
.redgif-hero-stat-num {
  font-family: var(--rg-font-display);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  display: block;
}
.redgif-hero-stat-label {
  font-size: 0.88rem;
  margin-top: 6px;
  letter-spacing: 0.04em;
}

/* =========================================================
   INTRO
   ========================================================= */
.redgif-intro-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: start;
}
.redgif-intro-content p {
  margin-bottom: 18px;
  font-size: 1.05rem;
  line-height: 1.8;
}
.redgif-intro-content p:first-of-type::first-letter {
  font-family: var(--rg-font-display);
  font-size: 4.2rem;
  font-weight: 700;
  float: left;
  line-height: 0.9;
  padding: 6px 14px 0 0;
  color: var(--rg-primary);
}

/* =========================================================
   CATEGORIES
   ========================================================= */
.redgif-category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.redgif-category-card {
  background: var(--rg-white);
  border: 1px solid var(--rg-border);
  border-radius: var(--rg-radius-lg);
  padding: 36px 28px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}
.redgif-category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--rg-shadow-lg);
  border-color: transparent;
}
.redgif-category-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 4px;
  background: var(--cat-color, var(--rg-primary));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.redgif-category-card:hover::before { opacity: 1; }
.redgif-category-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--cat-color, #E63946) 12%, white);
  color: var(--cat-color, #E63946);
  flex-shrink: 0;
}
.redgif-category-icon svg { width: 28px; height: 28px; }
.redgif-category-card h3 { font-size: 1.4rem; }
.redgif-category-card p { font-size: 0.97rem; line-height: 1.6; flex-grow: 1; }
.redgif-category-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cat-color, var(--rg-primary));
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: auto;
}
.redgif-category-link svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.redgif-category-card:hover .redgif-category-link svg { transform: translateX(4px); }

/* =========================================================
   LATEST POSTS
   ========================================================= */
.redgif-post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.redgif-post-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}
.redgif-post-card:hover { transform: translateY(-4px); }
.redgif-post-thumb {
  aspect-ratio: 16 / 10;
  border-radius: var(--rg-radius-md);
  overflow: hidden;
  margin-bottom: 18px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  background: linear-gradient(135deg, #E63946 0%, #6A4C93 100%);
  text-decoration: none;
}
.redgif-post-cat {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--rg-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.redgif-post-meta {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.redgif-post-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
  line-height: 1.3;
}
.redgif-post-title a {
  background-image: linear-gradient(var(--rg-primary), var(--rg-primary));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.3s ease;
  padding-bottom: 2px;
}
.redgif-post-title a:hover { background-size: 100% 2px; }

/* =========================================================
   FEATURED / EDITOR'S PICKS
   ========================================================= */
.redgif-featured-block {
  background: var(--rg-ink);
  color: white;
  border-radius: var(--rg-radius-lg);
  padding: 70px 60px;
  position: relative;
  overflow: hidden;
}
.redgif-featured-block::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.25) 0%, transparent 60%);
  pointer-events: none;
}
.redgif-featured-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.redgif-featured-grid h2 { margin-bottom: 22px; }
.redgif-featured-grid p { font-size: 1.05rem; margin-bottom: 28px; line-height: 1.7; }
.redgif-featured-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0;
  margin: 0;
}
.redgif-featured-list li {
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--rg-radius-md);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 20px;
}
.redgif-featured-list li:hover {
  background: rgba(230, 57, 70, 0.12);
  border-color: var(--rg-primary);
  transform: translateX(6px);
}
.redgif-featured-num {
  font-family: var(--rg-font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--rg-primary);
  min-width: 36px;
}
.redgif-featured-list a { font-weight: 600; font-size: 1.05rem; flex-grow: 1; }

/* =========================================================
   WHY US
   ========================================================= */
.redgif-why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}
.redgif-why-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--rg-primary-soft);
  color: var(--rg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}
.redgif-why-icon svg { width: 26px; height: 26px; }
.redgif-why-card h4 {
  font-family: var(--rg-font-display);
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--rg-ink);
  letter-spacing: -0.02em;
  font-weight: 600;
}
.redgif-why-card p { font-size: 0.96rem; line-height: 1.6; }

/* =========================================================
   FAQ
   ========================================================= */
.redgif-faq-list { max-width: 820px; margin: 0 auto; }
.redgif-faq-item {
  border-bottom: 1px solid var(--rg-border);
  padding: 28px 0;
}
.redgif-faq-item:first-child { border-top: 1px solid var(--rg-border); }
.redgif-faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  list-style: none;
  font-family: var(--rg-font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--rg-ink);
  padding-right: 16px;
}
.redgif-faq-question::-webkit-details-marker { display: none; }
.redgif-faq-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--rg-primary-soft);
  color: var(--rg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  flex-shrink: 0;
  transition: transform 0.3s ease, background 0.3s ease;
  font-family: var(--rg-font-body);
}
details[open] .redgif-faq-icon {
  transform: rotate(45deg);
  background: var(--rg-primary);
  color: white;
}
.redgif-faq-answer {
  margin-top: 16px;
  font-size: 1.02rem;
  line-height: 1.75;
}

/* =========================================================
   NEWSLETTER
   ========================================================= */
.redgif-newsletter {
  background: linear-gradient(135deg, var(--rg-primary) 0%, var(--rg-primary-dark) 100%);
  border-radius: var(--rg-radius-lg);
  padding: 70px 60px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}
.redgif-newsletter::before, .redgif-newsletter::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.redgif-newsletter::before {
  top: -80px; left: -80px;
  width: 280px; height: 280px;
}
.redgif-newsletter::after {
  bottom: -100px; right: -100px;
  width: 340px; height: 340px;
}
.redgif-newsletter > * { position: relative; z-index: 2; }
.redgif-newsletter h2 { margin-bottom: 16px; }
.redgif-newsletter > p {
  font-size: 1.1rem;
  max-width: 540px;
  margin: 0 auto 32px;
}
.redgif-newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.redgif-newsletter-form input {
  flex: 1;
  min-width: 220px;
  padding: 14px 22px;
  border-radius: 999px;
  border: none;
  font-family: var(--rg-font-body);
  font-size: 1rem;
  outline: none;
}
.redgif-newsletter-form button {
  padding: 14px 30px;
  border-radius: 999px;
  border: none;
  background: var(--rg-ink);
  color: white;
  font-family: var(--rg-font-body);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s ease;
}
.redgif-newsletter-form button:hover { transform: translateY(-2px); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .redgif-section { padding: 70px 0; }
  .redgif-hero { padding: 60px 0 80px; }
  .redgif-hero-grid { grid-template-columns: 1fr; gap: 50px; }
  .redgif-hero-visual { margin: 0 auto; }
  .redgif-hero-stats { gap: 28px; }
  .redgif-intro-grid { grid-template-columns: 1fr; gap: 30px; }
  .redgif-category-grid { grid-template-columns: repeat(2, 1fr); }
  .redgif-post-grid { grid-template-columns: repeat(2, 1fr); }
  .redgif-featured-block { padding: 50px 32px; }
  .redgif-featured-grid { grid-template-columns: 1fr; gap: 40px; }
  .redgif-why-grid { grid-template-columns: repeat(2, 1fr); }
  .redgif-newsletter { padding: 50px 28px; }
}
@media (max-width: 560px) {
  .redgif-section { font-size: 16px; }
  .redgif-category-grid,
  .redgif-post-grid,
  .redgif-why-grid { grid-template-columns: 1fr; }
  .redgif-hero-stats { flex-wrap: wrap; gap: 22px; }
  .redgif-featured-block,
  .redgif-newsletter { padding: 40px 22px; }
  .redgif-intro-content p:first-of-type::first-letter { font-size: 3.4rem; }
}
