---
import SectionHeading from './SectionHeading.astro';

const facebookUrl = 'https://www.facebook.com/swanseaairportofficial';
---

<section class="facebook-section">
  <SectionHeading eyebrow="Social" title="Follow Swansea Airport" />
  <a class="facebook-card" href={facebookUrl} target="_blank" rel="noopener noreferrer">
    <span class="facebook-mark" aria-hidden="true">f</span>
    <span class="facebook-copy">
      <strong>Facebook updates</strong>
      <span>Follow the official page for day-to-day airport news, photos, events, and community updates.</span>
    </span>
    <span class="facebook-action">Open Facebook</span>
  </a>
</section>

<style>
  .facebook-section {
    display: grid;
    gap: 1rem;
  }

  .facebook-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1.1rem;
    border: 1px solid rgba(11, 79, 122, 0.16);
    border-radius: var(--radius);
    background:
      linear-gradient(90deg, rgba(24, 119, 242, 0.12), transparent 42%),
      rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
    color: inherit;
    text-decoration: none;
    transition:
      border-color 180ms ease,
      box-shadow 180ms ease,
      transform 180ms ease;
  }

  .facebook-card:hover {
    border-color: rgba(24, 119, 242, 0.32);
    color: inherit;
    box-shadow: 0 22px 48px rgba(16, 34, 51, 0.14);
    transform: translateY(-2px);
  }

  .facebook-mark {
    display: grid;
    place-items: center;
    width: 3.25rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #1877f2;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
  }

  .facebook-copy {
    display: grid;
    gap: 0.25rem;
  }

  .facebook-copy strong {
    font-size: 1.1rem;
    color: var(--text);
  }

  .facebook-copy span {
    color: var(--muted);
  }

  .facebook-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.6rem;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    background: var(--brand);
    color: white;
    font-weight: 800;
    white-space: nowrap;
  }

  @media (max-width: 640px) {
    .facebook-card {
      grid-template-columns: auto minmax(0, 1fr);
    }

    .facebook-action {
      grid-column: 1 / -1;
      width: fit-content;
    }
  }
</style>
