/* FLC Publishing House - Consolidated Styles
   Merged from site-theme.css and sermon-page.css
   Eliminates duplicates, consolidates shadows, optimized for performance
*/

:root {
  --flc-navy: #1A3A52;
  --flc-navy-dark: #0F2838;
  --flc-navy-light: #2A4A62;
  --flc-gold: #9A7B4F;
  --flc-gold-light: #B8956A;
  --flc-charcoal: #2C2C2C;
  --flc-cream: #F5F1E8;
  --flc-offwhite: #FAFAF8;
  --flc-border: #E8E6E1;
  --ease-editorial: cubic-bezier(.16, 1, .3, 1);
  --flc-shadow-editorial: 0 1px 2px rgba(15, 40, 56, 0.04), 0 4px 12px rgba(15, 40, 56, 0.06);
  --flc-shadow-soft: 0 2px 8px rgba(15, 40, 56, 0.05), 0 12px 32px rgba(15, 40, 56, 0.07);
  --flc-shadow-elevated: 0 4px 16px rgba(15, 40, 56, 0.06), 0 24px 56px rgba(15, 40, 56, 0.09);
  --flc-shadow-medium: 0 10px 28px rgba(15, 40, 56, 0.10);
  --flc-shadow-lift: 0 4px 16px rgba(15, 40, 56, 0.06), 0 24px 56px rgba(15, 40, 56, 0.09);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(1200px 420px at 84% -12%, rgba(184, 149, 106, 0.18), transparent 65%),
    radial-gradient(900px 360px at -4% 8%, rgba(42, 74, 98, 0.10), transparent 72%),
    linear-gradient(180deg, rgba(250, 250, 248, 0.9), rgba(245, 241, 232, 0.3) 45%, rgba(250, 250, 248, 0.96) 100%);
  color: var(--flc-charcoal);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  max-width: 100vw;
}

* {
  box-sizing: border-box;
}

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

iframe {
  max-width: 100%;
}

table {
  width: 100%;
}

pre, code {
  white-space: pre-wrap;
  word-break: break-word;
}

a, button {
  touch-action: manipulation;
}

a {
  text-underline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(154, 123, 79, 0.55);
  outline-offset: 2px;
}

main {
  position: relative;
  z-index: 1;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 120;
  background: var(--flc-gold);
  color: #fff;
  padding: 0.55rem 0.85rem;
  border-radius: 0.55rem;
  font-weight: 600;
}

.section-kicker {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.link-underline {
  position: relative;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--flc-gold);
  transition: width 0.3s ease;
}

.link-underline:hover::after {
  width: 100%;
}

h1, h2, h3, h4 {
  line-height: 1.16;
  letter-spacing: -0.01em;
}

.hero-surface,
.page-hero,
.hero-background,
.hero-header,
.sermon-header {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(184, 149, 106, 0.24), transparent 65%),
    radial-gradient(900px 450px at 10% 0%, rgba(42, 74, 98, 0.30), transparent 70%),
    linear-gradient(145deg, var(--flc-navy-dark) 0%, var(--flc-navy) 55%, #163247 100%);
}

article,
section,
.shell,
.resource-card,
.week-card,
.searchable-card,
.book-panel,
.content-section,
.scripture-section,
.reflection-section,
.prayer-section,
.devotional-card,
.study-card {
  border-color: var(--flc-border);
}

.resource-card,
.week-card,
.searchable-card,
.book-panel,
.content-section,
.scripture-section,
.reflection-section,
.prayer-section,
.shell,
.devotional-card,
.study-card,
.modal-content {
  box-shadow: var(--flc-shadow-soft);
}

.card-link,
.resource-card,
.week-card,
.searchable-card,
.book-panel,
.devotional-card,
.study-card {
  transition: transform 300ms var(--ease-editorial, cubic-bezier(.16,1,.3,1)),
              box-shadow 300ms var(--ease-editorial, cubic-bezier(.16,1,.3,1)),
              border-color 300ms var(--ease-editorial, cubic-bezier(.16,1,.3,1));
}

.card-link:hover,
.card-link:focus-visible,
.resource-card:hover,
.week-card:hover,
.searchable-card:hover,
.book-panel:hover,
.devotional-card:hover,
.study-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--flc-shadow-elevated);
  border-color: rgba(154, 123, 79, 0.32);
}

/* ── Editorial Shadow Utilities ───────────────────────────────────────── */
.shadow-editorial { box-shadow: var(--flc-shadow-editorial); }
.shadow-soft { box-shadow: var(--flc-shadow-soft); }
.shadow-elevated { box-shadow: var(--flc-shadow-elevated); }

button,
.btn-primary,
.btn-premium,
.btn-ghost,
.download-btn,
a[class*="btn"] {
  border-radius: 0.85rem;
  transition: transform 280ms var(--ease-editorial, cubic-bezier(.16,1,.3,1)),
              box-shadow 280ms var(--ease-editorial, cubic-bezier(.16,1,.3,1)),
              background-color 280ms var(--ease-editorial, cubic-bezier(.16,1,.3,1)),
              border-color 280ms var(--ease-editorial, cubic-bezier(.16,1,.3,1)),
              color 280ms var(--ease-editorial, cubic-bezier(.16,1,.3,1));
}

button:hover,
.btn-primary:hover,
.btn-premium:hover,
.btn-ghost:hover,
.download-btn:hover,
a[class*="btn"]:hover {
  transform: translateY(-1px);
}

input,
textarea,
select,
.form-input {
  border-radius: 0.85rem;
  border: 1px solid var(--flc-border);
  background: rgba(255, 255, 255, 0.92);
}

.modal-overlay {
  background: rgba(10, 22, 33, 0.55);
  backdrop-filter: blur(6px);
}

.modal-content {
  border: 1px solid rgba(154, 123, 79, 0.22);
  border-radius: 1rem;
}

#headerContainer,
#footerContainer {
  position: relative;
  z-index: 30;
}

#mainNav {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(251, 250, 247, 0.98) 100%) !important;
  border-bottom: 1px solid rgba(154, 123, 79, 0.14) !important;
  box-shadow: 0 2px 14px rgba(15, 40, 56, 0.06) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: visible !important;
  opacity: 1 !important;
}

#mainNav a,
#mainNav button,
#mainNav input {
  opacity: 1 !important;
}

@media (min-width: 1024px) {
  #mainNav .nav-links {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  #mainNav .search-bar input {
    background: rgba(255, 255, 255, 0.92) !important;
  }
}

#footerContainer {
  margin-top: 2.75rem;
}

#footerContainer::before {
  content: "";
  display: block;
  height: 1px;
  margin: 0 0 1.8rem 0;
  background: linear-gradient(90deg, transparent, rgba(154, 123, 79, 0.42), transparent);
}

.scroll-top-btn,
#scrollTop,
#scrollTopBtn,
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--flc-navy), var(--flc-navy-light));
  color: #fff;
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 6px 18px rgba(15, 40, 56, 0.25);
  z-index: 80;
}

.scroll-top-btn.visible,
#scrollTop.visible,
#scrollTopBtn.visible,
.back-to-top.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* Animations - Consolidated (removes duplicates) */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lineExpand {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 100%;
    opacity: 1;
  }
}

@keyframes fadeScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes parallaxFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Section glow - subtle gold radial behind headings */
.section-glow {
  position: absolute;
  top: -2rem;
  left: -4rem;
  width: 28rem;
  height: 14rem;
  background: radial-gradient(ellipse at center, rgba(154, 123, 79, 0.10) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.section-glow--right {
  left: auto;
  right: -4rem;
}
.section-glow--bottom-right {
  top: auto;
  bottom: -2rem;
  left: auto;
  right: -4rem;
}

/* Pattern utilities */
.pattern-dots {
  background-image: radial-gradient(circle, #E8E6E1 1px, transparent 1px);
  background-size: 24px 24px;
}

.pattern-lines {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(232, 230, 225, 0.3) 10px,
    rgba(232, 230, 225, 0.3) 11px
  );
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

/* Post Content Typography - Editorial Reading Experience */
.post-content {
  max-width: 110ch;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: #2C2C2C;
}

/* Drop cap for first paragraph */
.post-content > p:first-child::first-letter {
  float: left;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 4.5rem;
  line-height: 0.85;
  font-weight: 700;
  color: #1A3A52;
  padding-right: 0.5rem;
  margin-top: 0.25rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
  color: #1A3A52;
}

.post-content h1 { font-size: 2.25rem; line-height: 1.2; }
.post-content h2 { font-size: 1.875rem; line-height: 1.25; }
.post-content h3 { font-size: 1.5rem; line-height: 1.3; }
.post-content h4 { font-size: 1.25rem; line-height: 1.35; }

.post-content p {
  margin-bottom: 1.75rem;
}

.post-content strong {
  font-weight: 700;
  color: #1A3A52;
}

.post-content a {
  color: #9A7B4F;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(154, 123, 79, 0.3);
  transition: all 0.2s ease;
}

.post-content a:hover {
  color: #1A3A52;
  text-decoration-color: #1A3A52;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.75rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.75rem;
  line-height: 1.8;
}

.post-content blockquote {
  position: relative;
  background: linear-gradient(135deg, rgba(245, 241, 232, 0.8) 0%, rgba(250, 250, 248, 0.9) 100%);
  border-left: 4px solid #9A7B4F;
  padding: 2rem 2.5rem;
  margin: 3rem 0;
  font-style: italic;
  color: #1A3A52;
  font-size: 1.15rem;
  line-height: 1.8;
  border-radius: 0 12px 12px 0;
  box-shadow: 0 4px 20px rgba(26, 58, 82, 0.06);
}

.post-content blockquote::before {
  content: '"';
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  font-family: Georgia, serif;
  font-size: 5rem;
  color: #9A7B4F;
  opacity: 0.2;
  line-height: 1;
}

.post-content blockquote p {
  margin: 0;
  position: relative;
  z-index: 1;
}

/* YouTube/Video Container */
.youtube-video-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 2.5rem auto;
  padding-bottom: 56.25%;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: var(--flc-shadow-lift);
  background: #000;
}

.youtube-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

#youtubeVideoContainer iframe {
  border-radius: 20px;
  box-shadow: 0 32px 96px rgba(26, 58, 82, 0.12);
  transition: transform 0.7s ease, box-shadow 0.7s ease;
}

#youtubeVideoContainer iframe:hover {
  transform: scale(1.02);
  box-shadow: 0 40px 120px rgba(26, 58, 82, 0.15);
}

/* Responsive Images */
.responsive-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 1rem;
  box-shadow: var(--flc-shadow-medium);
}

.responsive-image-container {
  margin: 2.5rem 0;
}

img[loading="lazy"] {
  background-color: #F5F1E8;
  transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #9A7B4F, #B8956A);
  transition: width 0.1s linear;
  z-index: 9999;
}

/* Aspect Ratios */
.aspect-video {
  aspect-ratio: 16 / 9;
}

.aspect-square {
  aspect-ratio: 1 / 1;
}

/* Hero Enhancement Styles */
.hero-letter {
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: inline-block;
}

.hero-word {
  display: inline-block;
  white-space: nowrap;
}

.magnetic-element {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#postTitle {
  color: #1A3A52;
  text-shadow: 0 2px 4px rgba(26, 58, 82, 0.05);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.divider-line {
  animation: lineExpand 1s ease-out 0.5s both;
}

.section-number {
  animation: fadeScale 0.8s ease-out 0.3s both;
}

.video-section-heading {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(154, 123, 79, 0.8);
  font-size: 0.75rem;
  margin-bottom: 1rem;
}

.hero-parallax {
  will-change: transform;
}

.hero-parallax:hover {
  animation: parallaxFloat 6s ease-in-out infinite;
}

/* Scripture/Callout Styling */
.scripture-callout {
  background: linear-gradient(135deg, #F5F1E8 0%, #FAFAF8 100%);
  border-left: 4px solid #9A7B4F;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0.5rem;
  font-style: italic;
  position: relative;
}

.scripture-callout::before {
  content: '"';
  position: absolute;
  top: 0.5rem;
  left: 0.75rem;
  font-size: 3rem;
  color: #9A7B4F;
  opacity: 0.3;
  font-family: Georgia, serif;
  line-height: 1;
}

.scripture-callout p {
  margin: 0;
  color: #1A3A52;
}

/* ── Atmospheric Depth & Texture ──────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(154, 123, 79, 0.18), transparent);
  border: none;
  margin: 0;
}

/* Responsive & Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 768px) {
  body {
    background-size: 140% auto, 120% auto, auto;
  }

  .resource-card:hover,
  .week-card:hover,
  .searchable-card:hover,
  .book-panel:hover,
  .devotional-card:hover,
  .study-card:hover {
    transform: none;
  }
}

@media (max-width: 640px) {
  .hero-v2-title {
    font-size: 2.1rem;
    line-height: 1.1;
  }

  .hero-v2-lede {
    font-size: 1rem;
    line-height: 1.55;
  }

  .mobile-tight-section {
    padding-top: 2.75rem;
    padding-bottom: 2.75rem;
  }

  #aboutFeaturedTitle {
    line-height: 1.3;
    margin-bottom: 2.5rem;
  }

  #aboutFeaturedSummary {
    line-height: 1.6;
    margin-bottom: 3rem;
  }

  /* Phase 7: Mobile typography safety */
  h1 {
    font-size: clamp(1.75rem, 8vw, 2.75rem);
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Phase 7: Tighter card padding on mobile */
  .card-link,
  .resource-card,
  .week-card,
  .searchable-card,
  .book-panel,
  .devotional-card,
  .study-card {
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-full {
    width: 100% !important;
  }
}

/* Phase 7: Touch target minimum */
@media (pointer: coarse) {
  a, button, [role="button"], input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
  }

  .filter-btn {
    min-height: 44px;
    padding: 0.625rem 1rem;
  }
}
