/*
 * Dotlancing Airports — section styles.
 * Loads AFTER ../css/base.css and ../css/site.css, so it inherits the main
 * Dotlancing tokens (colors, fonts, glass, gradient). Light theme is the
 * default here; the dark theme is the main site's own dark palette.
 * All classes are prefixed "ap-" so nothing leaks into the main site.
 */

html {
  scroll-padding-top: 6rem;
}

.ap-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.ap-main {
  position: relative;
  flex: 1;
  padding-top: 6.5rem;
}

/* soft grid + glow behind the top of every page */
.ap-backdrop {
  position: absolute;
  inset: 0 0 auto 0;
  height: 760px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.ap-backdrop .grid-lines {
  position: absolute;
  inset: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
}
.ap-backdrop .glow-top {
  position: absolute;
  inset: 0;
}
.ap-main > *:not(.ap-backdrop) {
  position: relative;
  z-index: 1;
}

.ap-wrap {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
@media (min-width: 768px) {
  .ap-wrap {
    padding-inline: 2.5rem;
  }
}

/* header + footer line up with the content column */
.ap-header .container {
  max-width: 1280px;
}
.ap-footer .footer-inner {
  max-width: 1280px;
}

/* ============================================================
   Header (left logo, right links)
   ============================================================ */
.ap-header .brand-mark img {
  width: 38px;
  height: 34px;
}
.ap-brand-sub {
  color: var(--muted-foreground);
  font-weight: 700;
}
.ap-header .nav-right {
  gap: 0.5rem;
}
.ap-header .nav-links {
  gap: 0.25rem;
  margin-right: 0.5rem;
}
.ap-header .nav-links a {
  position: relative;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
}
.ap-header .nav-links a[aria-current="page"] {
  color: var(--foreground);
}
.ap-header .nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 2px;
  background-image: var(--gradient-brand);
}
@media (min-width: 720px) {
  .ap-header .nav-links {
    display: flex;
  }
  .ap-header .menu-toggle {
    display: none;
  }
}
.ap-header .mobile-menu nav a[aria-current="page"] {
  color: var(--primary);
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================
   Shared bits
   ============================================================ */
.ap-icao {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  border-radius: 9999px;
  background: var(--accent);
  color: var(--accent-foreground);
  border: 1px solid var(--border);
}

.ap-lead {
  max-width: 34rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--muted-foreground);
}

.ap-section {
  padding-block: 3.5rem;
}
@media (min-width: 768px) {
  .ap-section {
    padding-block: 5rem;
  }
}
.ap-section.is-tinted {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.ap-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 2rem;
}
.ap-section-head h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  text-transform: uppercase;
  line-height: 0.95;
}
.ap-section-head p {
  margin-top: 0.75rem;
  max-width: 30rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.ap-pagehead {
  padding-block: 2.5rem 1rem;
}
.ap-pagehead h1 {
  font-size: clamp(2.6rem, 6vw, 4.75rem);
}
.ap-pagehead .ap-lead {
  margin-top: 1.25rem;
}

/* ============================================================
   Banner (photo or typographic fallback)
   ============================================================ */
.ap-banner {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 6;
  overflow: hidden;
  background: var(--surface-2);
}
.ap-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ap-banner.is-fallback {
  display: grid;
  place-items: center;
  background:
    linear-gradient(
      120deg,
      color-mix(in oklch, var(--primary) 16%, var(--surface)) 0%,
      color-mix(in oklch, var(--primary-soft) 22%, var(--surface)) 100%
    );
}
.ap-banner-code {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: max(1.5rem, 17cqw);
  letter-spacing: 0.12em;
  margin-right: -0.12em; /* optically re-centre tracked text */
  line-height: 1;
  color: var(--foreground);
  opacity: 0.82;
}

/* ============================================================
   Hero
   ============================================================ */
.ap-hero {
  padding-block: 2.5rem 4rem;
}
.ap-hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 960px) {
  .ap-hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 4rem;
    min-height: 30rem;
  }
}
.ap-hero-copy .eyebrow {
  margin-bottom: 1.5rem;
}
.ap-hero-title {
  font-size: clamp(2.7rem, 6.4vw, 5.6rem);
}
.ap-hero-title span {
  display: block;
}
.ap-hero-copy .ap-lead {
  margin-top: 1.75rem;
}
.ap-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

/* stack of featured airports, stepped like boarding passes */
.ap-stack {
  display: grid;
  gap: 0.875rem;
}
.ap-stack-card {
  display: block;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lift);
  transition: border-color 0.3s;
}
.ap-stack-card:hover {
  border-color: var(--primary);
}
.ap-stack-card .ap-banner {
  aspect-ratio: 16 / 4.6;
}
.ap-stack-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}
.ap-stack-row .ap-icao {
  align-self: center;
}
.ap-stack-name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-stack-loc {
  font-size: 0.78rem;
  color: var(--muted-foreground);
  white-space: nowrap;
}
@media (max-width: 520px) {
  .ap-stack-loc {
    display: none;
  }
}
@media (min-width: 960px) {
  .ap-stack-card:nth-child(2) {
    margin-left: 2.5rem;
  }
  .ap-stack-card:nth-child(3) {
    margin-left: 5rem;
  }
}

/* the one orchestrated moment: the stack slides in once on load */
@media (prefers-reduced-motion: no-preference) {
  .ap-stack-card {
    animation: ap-slide-in 0.9s var(--ease-cine) both;
    animation-delay: calc(var(--i, 0) * 120ms + 150ms);
  }
}
@keyframes ap-slide-in {
  from {
    opacity: 0;
    transform: translateX(36px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Cards
   ============================================================ */
.ap-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 600px) {
  .ap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 960px) {
  .ap-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ap-card {
  display: flex;
  flex-direction: column;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color 0.3s;
}
.ap-card:hover {
  border-color: var(--primary);
}
.ap-card .ap-banner {
  border-bottom: 1px solid var(--border);
}
.ap-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1rem 1.125rem 1.25rem;
}
.ap-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.ap-card-sub {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* news cards */
.ap-news-card .ap-banner {
  aspect-ratio: 16 / 9;
}
.ap-date {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.ap-news-excerpt {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted-foreground);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ap-more {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

/* loading / empty / error */
.ap-skeleton {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 16 / 10;
}
.ap-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  border-radius: 1rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted-foreground);
}
.ap-state strong {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--foreground);
}
.ap-state .btn-glass {
  margin-top: 1rem;
}

/* ============================================================
   Airport detail
   ============================================================ */
.ap-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}
.ap-crumbs a:hover {
  color: var(--primary);
}
.ap-crumbs [aria-current] {
  color: var(--foreground);
  font-weight: 600;
}
.ap-detail-head {
  padding-block: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.875rem;
}
.ap-detail-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  line-height: 0.95;
}
.ap-detail-head p {
  color: var(--muted-foreground);
}
.ap-detail-banner {
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lift);
}
.ap-detail-banner .ap-banner {
  aspect-ratio: 16 / 6;
}
.ap-detail-grid {
  display: grid;
  gap: 2.5rem;
  padding-block: 2.5rem 5rem;
}
@media (min-width: 960px) {
  .ap-detail-grid {
    grid-template-columns: minmax(0, 1fr) 21rem;
    gap: 3.5rem;
    align-items: start;
  }
}
.ap-article > section + section {
  margin-top: 3rem;
}
.ap-article h2 {
  font-size: 1.5rem;
  line-height: 1.1;
  margin-bottom: 1.1rem;
}
.ap-prose p {
  max-width: 68ch;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--muted-foreground);
}
.ap-prose p + p {
  margin-top: 1rem;
}
.ap-features {
  display: grid;
  gap: 0.9rem;
  max-width: 68ch;
}
.ap-features li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.6rem;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}
.ap-features svg {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.2rem;
  color: var(--primary);
}
.ap-features strong {
  color: var(--foreground);
  font-weight: 600;
}

.ap-trailer {
  aspect-ratio: 16 / 9;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.ap-trailer iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.ap-gallery {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 600px) {
  .ap-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.ap-thumb {
  display: block;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
}
.ap-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ap-aside {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1.5rem;
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 960px) {
  .ap-aside {
    position: sticky;
    top: 6.5rem;
  }
}
.ap-aside-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}
.ap-aside .btn-primary,
.ap-aside .btn-glass {
  justify-content: center;
  width: 100%;
}
.ap-aside .is-disabled {
  opacity: 0.55;
  pointer-events: none;
  background-image: none;
  background: var(--muted);
  color: var(--muted-foreground);
}
.ap-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.ap-facts dt {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.ap-facts dd {
  margin: 0.2rem 0 0;
  font-weight: 600;
  font-size: 0.9rem;
}

/* lightbox */
.ap-lightbox {
  width: min(96vw, 1200px);
  max-height: 94vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  color: var(--foreground);
  overflow: hidden;
}
.ap-lightbox::backdrop {
  background: oklch(0.1 0.02 305 / 0.8);
  backdrop-filter: blur(4px);
}
.ap-lightbox img {
  width: 100%;
  max-height: 86vh;
  object-fit: contain;
  background: var(--surface-2);
}
.ap-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted-foreground);
}
.ap-lightbox-bar div {
  display: flex;
  gap: 0.5rem;
}

/* sample-data notice (only shown while AP_CONFIG.useDemoData is serving demo content) */
.ap-demo-badge {
  position: fixed;
  left: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  padding: 0.5rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--foreground);
  color: var(--background);
}

/* footer extras */
.ap-footer .footer-brand img {
  width: 44px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}
.ap-footer .footer-brand {
  gap: 0.875rem;
}

/* ============================================================
   News article
   ============================================================ */
.ap-post {
  max-width: 820px;
  padding-bottom: 4rem;
}
.ap-post-head {
  padding-block: 1.25rem 1.75rem;
  display: grid;
  gap: 1rem;
}
.ap-post-head h1 {
  font-size: clamp(2.1rem, 5vw, 3.5rem);
  line-height: 0.98;
}
.ap-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}
.ap-post-figure {
  margin: 0 0 2.25rem;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lift);
}
.ap-post-figure img {
  width: 100%;
  height: auto;
}
.ap-post-foot {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* article body (HTML written in the admin blog editor) */
.ap-richtext {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--foreground);
  overflow-wrap: anywhere;
}
.ap-richtext > * + * {
  margin-top: 1.15em;
}
.ap-richtext h2,
.ap-richtext h3,
.ap-richtext h4 {
  margin-top: 2em;
  line-height: 1.1;
}
.ap-richtext h2 {
  font-size: 1.7rem;
}
.ap-richtext h3 {
  font-size: 1.3rem;
}
.ap-richtext p,
.ap-richtext li {
  color: var(--muted-foreground);
}
.ap-richtext strong {
  color: var(--foreground);
}
.ap-richtext a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ap-richtext ul,
.ap-richtext ol {
  padding-left: 1.4rem;
}
.ap-richtext ul {
  list-style: disc;
}
.ap-richtext ol {
  list-style: decimal;
}
.ap-richtext li + li {
  margin-top: 0.4em;
}
.ap-richtext img,
.ap-richtext video {
  height: auto;
  border-radius: 0.75rem;
}
.ap-richtext figure {
  margin: 0;
}
.ap-richtext figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}
.ap-richtext blockquote {
  margin-inline: 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--primary);
}
.ap-richtext iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 0.75rem;
}
.ap-richtext pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.ap-richtext table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}
.ap-richtext th,
.ap-richtext td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}
