/* =============================================
   RAMPART — Shared Styles
   Header, splash screen, and shared UI for all pages
   ============================================= */

/* ---------- Splash Screen ---------- */
.shared-splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background, #213e66);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease;
}

.shared-splash.splash-fade-out {
  opacity: 0;
  pointer-events: none;
}

.shared-splash-logo {
  width: 160px;
  max-width: 160px;
  height: auto;
}

/* Hide body overflow during splash */
body.splash-active > *:not(.shared-splash) {
  opacity: 0;
}

/* ---------- Shared Header ---------- */
.shared-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--background, #213e66);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shared-header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.shared-header-logo img {
  width: 90px;
  height: auto;
}

.shared-header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Fallback for Safari versions that don't support flexbox gap */
@supports not (gap: 8px) {
  .shared-header-nav > * + * {
    margin-left: 8px;
  }
}

.shared-header-link {
  font-size: 0.8rem;
  color: var(--foreground, #efebe2);
  opacity: 0.75;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: opacity 0.3s ease, background 0.3s ease;
  white-space: nowrap;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
}

.shared-header-link:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

.shared-header-kit {
  background: var(--primary, #f1efea);
  border-color: var(--primary, #f1efea);
  color: var(--primary-foreground, #213e66);
  opacity: 1;
  min-width: 90px;
  text-align: center;
  font-weight: 700;
}

.shared-header-kit:hover {
  opacity: 0.9;
}

@keyframes kitBlurIn {
  from { opacity: 0; filter: blur(6px); }
  to   { opacity: 1; filter: blur(0); }
}

@keyframes kitBlurOut {
  from { opacity: 1; filter: blur(0); }
  to   { opacity: 0; filter: blur(6px); }
}

.kit-blur-in  { animation: kitBlurIn  0.45s ease forwards; }
.kit-blur-out { animation: kitBlurOut 0.45s ease forwards; }

/* ---------- Shared Footer Social ---------- */
.shared-footer-social {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
}

.shared-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border, rgba(255,255,255,0.2));
  border-radius: 50%;
  color: var(--muted-foreground, #c9b9b0);
  transition: all 0.2s ease;
}

.shared-footer-social a:hover {
  color: var(--primary, #f1efea);
  border-color: var(--primary, #f1efea);
}

.shared-footer-social svg {
  width: 16px;
  height: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .shared-header {
    padding: 12px 16px;
  }

  .shared-header-logo img {
    width: 72px;
  }

  .shared-header-link {
    font-size: 0.7rem;
    padding: 5px 10px;
  }
}

@media (min-width: 768px) {
  .shared-header-logo img {
    width: 110px;
  }

  .shared-header {
    padding: 20px 40px;
  }
}

/* ---------- Featured "Why Blocking" CTA Card ---------- */
.rampart-featured-cta {
  position: relative;
  margin: 2.5rem 0;
  padding: 28px 24px;
  background: var(--card, hsl(215, 45%, 30%));
  border: 1px solid rgba(241, 239, 234, 0.2);
  border-radius: 16px;
  transition: opacity 0.3s ease, transform 0.3s ease;
  animation: ctaSlideIn 0.5s ease forwards;
}

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

.featured-cta-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: var(--card, hsl(215, 45%, 30%));
  border: 1px solid var(--border, rgba(255,255,255,0.2));
  color: var(--foreground, #efebe2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
}

.featured-cta-close:hover {
  background: rgba(241, 239, 234, 0.15);
  border-color: rgba(241, 239, 234, 0.4);
}

/* RTL close button */
[dir="rtl"] .featured-cta-close {
  right: auto;
  left: 14px;
}

.featured-cta-inner {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.featured-cta-logo {
  flex-shrink: 0;
}

.featured-cta-logo img {
  width: 56px;
  height: auto;
  border-radius: 8px;
}

.featured-cta-content {
  flex: 1;
  min-width: 0;
}

.featured-cta-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #f1efea;
  margin-bottom: 6px;
}

.featured-cta-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--foreground, #efebe2);
  margin-bottom: 8px;
  line-height: 1.35;
}

.featured-cta-desc {
  font-size: 0.95rem;
  color: var(--muted-foreground, #c9b9b0);
  margin-bottom: 14px;
  line-height: 1.5;
}

a.featured-cta-btn,
.blog-article a.featured-cta-btn {
  display: inline-block;
  padding: 10px 22px;
  background: #f1efea;
  color: #213e66;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.featured-cta-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .rampart-featured-cta {
    padding: 20px 16px;
  }

  .featured-cta-inner {
    flex-direction: column;
    gap: 12px;
  }

  .featured-cta-title {
    font-size: 1.05rem;
  }

  .featured-cta-desc {
    font-size: 0.9rem;
  }
}

/* ---------- "Read in Your Language" Banner ---------- */
.lang-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(215, 38, 56, 0.1) 0%, rgba(33, 62, 102, 0.15) 100%);
  border: 1px solid rgba(215, 38, 56, 0.3);
  border-radius: 12px;
  transition: opacity 0.3s ease;
  flex-wrap: wrap;
}

.lang-banner-text {
  font-size: 0.9rem;
  color: var(--foreground, #efebe2);
  font-weight: 500;
  flex: 1;
  min-width: 150px;
}

.lang-banner-btn {
  display: inline-block;
  padding: 6px 16px;
  background: var(--primary, #f1efea);
  color: #fff;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lang-banner-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.lang-banner-close {
  background: none;
  border: none;
  color: var(--muted-foreground, #c9b9b0);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s ease;
  line-height: 1;
}

.lang-banner-close:hover {
  color: var(--foreground, #efebe2);
}

@media (max-width: 480px) {
  .lang-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .lang-banner-close {
    position: absolute;
    top: 8px;
    right: 8px;
  }

  .lang-banner {
    position: relative;
    padding-right: 36px;
  }
}

/* ---------- PDF Guide Popup ---------- */
.pdf-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pdf-popup-overlay.pdf-popup-visible {
  opacity: 1;
}

.pdf-popup {
  position: relative;
  background: var(--background, #213e66);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 40px 32px 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
}

.pdf-popup-visible .pdf-popup {
  transform: translateY(0) scale(1);
}

.pdf-popup-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--foreground, #efebe2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
}

.pdf-popup-close:hover {
  background: var(--primary, #f1efea);
  border-color: var(--primary, #f1efea);
}

/* RTL close button */
[dir="rtl"] .pdf-popup-close {
  right: auto;
  left: 16px;
}

.pdf-popup-logo {
  margin-bottom: 20px;
}

.pdf-popup-logo img {
  width: 80px;
  height: auto;
}

.pdf-popup-heading {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--foreground, #efebe2);
  margin: 0 0 12px;
  line-height: 1.4;
}

.pdf-popup-sub {
  font-size: 0.95rem;
  color: var(--muted-foreground, #c9b9b0);
  line-height: 1.6;
  margin: 0 0 24px;
}

.pdf-popup-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pdf-popup-input {
  flex: 1 1 200px;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--foreground, #efebe2);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.pdf-popup-input::placeholder {
  color: rgba(239, 235, 226, 0.4);
}

.pdf-popup-input:focus {
  border-color: var(--primary, #f1efea);
}

.pdf-popup-btn {
  padding: 12px 20px;
  background: #f1efea;
  color: #213e66;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.pdf-popup-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.pdf-popup-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.pdf-popup-trust {
  font-size: 0.8rem;
  color: rgba(239, 235, 226, 0.45);
  font-style: italic;
  margin: 0;
  line-height: 1.5;
}

.pdf-popup-success {
  text-align: center;
  animation: ctaSlideIn 0.4s ease forwards;
}

.pdf-popup-success-text {
  font-size: 1.05rem;
  color: var(--foreground, #efebe2);
  margin: 0 0 16px;
  font-weight: 500;
}

.pdf-popup-download {
  display: inline-block;
  padding: 12px 28px;
  background: #f1efea;
  color: #213e66;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.pdf-popup-download:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

@media (max-width: 540px) {
  .pdf-popup {
    padding: 32px 20px 24px;
    border-radius: 16px;
  }

  .pdf-popup-heading {
    font-size: 1.15rem;
  }

  .pdf-popup-sub {
    font-size: 0.9rem;
  }

  .pdf-popup-form {
    flex-direction: column;
  }

  .pdf-popup-btn {
    width: 100%;
  }
}

/* ---------- Goose Reading Progress Bar ---------- */
.goose-progress {
  position: sticky;
  top: 57px; /* below shared header mobile */
  z-index: 999;
  width: 100%;
  height: 48px;
  background: var(--background, #213e66);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow: visible;
}

@media (min-width: 768px) {
  .goose-progress {
    top: 69px; /* below shared header desktop */
    height: 52px;
  }
}

.goose-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

/* Footprints trail */
.goose-footprints {
  position: absolute;
  left: 0;
  top: 50%;
  height: 3px;
  width: 0%;
  transform: translateY(-50%);
  transition: width 0.15s ease-out;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 10px,
    rgba(215, 38, 56, 0.35) 10px,
    rgba(215, 38, 56, 0.35) 13px,
    transparent 13px,
    transparent 16px,
    rgba(215, 38, 56, 0.25) 16px,
    rgba(215, 38, 56, 0.25) 19px,
    transparent 19px,
    transparent 28px
  );
}

/* The faint track line */
.goose-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1px;
}

/* Goose walker */
.goose-walker {
  position: absolute;
  left: 0%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.15s ease-out;
  line-height: 0;
}

.goose-img {
  width: 50px;
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  user-select: none;
  display: block;
}

@media (min-width: 768px) {
  .goose-img {
    width: 56px;
  }
}

/* Walking waddle animation (disabled - too distracting) */

/* High contrast mode */
@media (prefers-contrast: high) {
  .goose-footprints {
    background: repeating-linear-gradient(
      90deg,
      transparent 0px,
      transparent 10px,
      rgba(215, 38, 56, 0.7) 10px,
      rgba(215, 38, 56, 0.7) 13px,
      transparent 13px,
      transparent 16px,
      rgba(215, 38, 56, 0.55) 16px,
      rgba(215, 38, 56, 0.55) 19px,
      transparent 19px,
      transparent 28px
    );
  }

  .goose-track::before {
    background: rgba(255, 255, 255, 0.15);
  }
}

/* ---------- Homepage Signup CTA ---------- */
.rampart-homepage-cta {
  margin: 2rem 0;
  padding: 24px;
  background: linear-gradient(135deg, rgba(33, 62, 102, 0.15) 0%, rgba(215, 38, 56, 0.08) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  animation: ctaSlideIn 0.5s ease forwards;
}

.homepage-cta-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 200px;
}

.homepage-cta-logo {
  flex-shrink: 0;
  border-radius: 8px;
}

.homepage-cta-text {
  flex: 1;
  min-width: 0;
}

.homepage-cta-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground, #efebe2);
  margin: 0 0 4px;
}

.homepage-cta-desc {
  font-size: 0.88rem;
  color: var(--muted-foreground, #c9b9b0);
  line-height: 1.5;
  margin: 0;
}

.homepage-cta-btn {
  display: inline-block;
  padding: 10px 22px;
  background: #f1efea;
  color: #213e66;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.homepage-cta-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .rampart-homepage-cta {
    flex-direction: column;
    align-items: stretch;
    padding: 20px 16px;
  }

  .homepage-cta-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .homepage-cta-btn {
    text-align: center;
    width: 100%;
  }
}

/* ---------- Sticky Kit Banner ---------- */
.kit-sticky-banner {
  position: fixed;
  bottom: -60px;
  left: 0;
  right: 0;
  z-index: 9998;
  background: var(--background, #213e66);
  border-top: 1px solid rgba(241, 239, 234, 0.15);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: bottom 0.4s ease;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
}

.kit-sticky-banner.kit-banner-visible {
  bottom: 0;
}

.kit-banner-text {
  color: var(--foreground, #efebe2);
  font-size: 0.9rem;
  font-weight: 600;
}

.kit-banner-btn {
  display: inline-block;
  padding: 6px 16px;
  background: #f1efea;
  color: #213e66;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.kit-banner-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .kit-sticky-banner {
    padding: 8px 14px;
    gap: 10px;
  }

  .kit-banner-text {
    font-size: 0.82rem;
  }
}

/* ---------- Inline Signup Section ---------- */
.inline-signup-section {
  padding: 48px 24px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.inline-signup-inner {
  max-width: 480px;
  margin: 0 auto;
}

.inline-signup-heading {
  color: var(--foreground, #efebe2);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.inline-signup-sub {
  color: var(--muted-foreground, #c9b9b0);
  font-size: 0.95rem;
  margin: 0 0 20px;
}

.inline-signup-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.inline-signup-form input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: var(--foreground, #efebe2);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.inline-signup-form input:focus {
  border-color: var(--primary, #f1efea);
}

.inline-signup-form input::placeholder {
  color: rgba(239, 235, 226, 0.4);
}

.inline-signup-form button {
  padding: 12px 20px;
  background: var(--primary, #f1efea);
  color: var(--primary-foreground, #213e66);
  font-weight: 700;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.inline-signup-form button:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.inline-signup-trust {
  color: rgba(239, 235, 226, 0.35);
  font-size: 0.8rem;
  font-style: italic;
  margin: 0;
}

.inline-signup-status {
  font-size: 0.9rem;
  margin: 8px 0 0;
}

.inline-signup-status.success {
  color: #4caf50;
}

.inline-signup-status.error {
  color: #ef5350;
}

@media (max-width: 480px) {
  .inline-signup-form {
    flex-direction: column;
  }

  .inline-signup-section {
    padding: 36px 16px;
  }
}

/* ---------- Social Share Buttons ---------- */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  margin: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.share-label {
  font-size: 0.8rem;
  color: var(--muted-foreground, #c9b9b0);
  font-weight: 500;
  margin-right: 4px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--foreground, #efebe2);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  text-decoration: none;
}

.share-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}
