/* ============================================================
   PoolSpa.Pro – Mobile-first stylesheet
   Brand palette: #334356 navy | #7aa8c1 pool blue | #fdfdfd light
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent:       #7aa8c1;
  --accent-dark:  #5c8faa;
  --accent-glow:  rgba(122, 168, 193, 0.18);

  --bg:           #1b2838;
  --surface:      #243040;
  --surface-2:    #2e3d50;

  --text:         #e8f0f5;
  --text-muted:   #7a9aad;
  --border:       #334356;

  --radius:       12px;
  --nav-height:   46px;
  --header-height: 70px;

  /* iOS-style nav icon colors */
  --nav-home:    #5ba3c9;
  --nav-about:   #d4813a;
  --nav-contact: #3eaa6a;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: Lora, Georgia, 'Times New Roman', serif;
  letter-spacing: 0.025em;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  padding-top: var(--header-height);
  padding-bottom: var(--nav-height);
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 11px;
}

.site-logo-img {
  height: 38px;
  width: auto;
}

.site-logo {
  font-family: Lora, Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
}

.site-logo .accent {
  color: var(--accent);
}

/* ── Bottom Nav ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2px 0 0px;
  gap: 1px;
  color: var(--text-muted);
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  -webkit-tap-highlight-color: transparent;
}

.nav-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, transform 0.12s;
}

.nav-item span {
  line-height: 1;
  padding-bottom: 0;
  margin-bottom: -6px;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  transition: color 0.18s;
}

.nav-logo-icon {
  height: 24px;
  width: auto;
}

.nav-item:active .nav-icon-wrap {
  transform: scale(0.9);
}

/* Active state – iOS-style colored icon backgrounds */
.nav-item:nth-child(1).active .nav-icon-wrap { background: var(--nav-home); }
.nav-item:nth-child(2).active .nav-icon-wrap { background: var(--nav-about); }
.nav-item:nth-child(3).active .nav-icon-wrap { background: var(--nav-contact); }

.nav-item.active { color: var(--text); }
.nav-item.active svg { color: #fff; }

/* Subtle hover for non-active items */
.nav-item:not(.active):hover .nav-icon-wrap {
  background: var(--border);
}

/* ── Feed (Home) ────────────────────────────────────────── */
.feed {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.28);
}

.post-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.875rem 1rem 0;
  color: var(--text);
}

.media-pair {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 0.75rem;
}

.media-pair figure {
  position: relative;
  margin: 0;
}

.media-pair figcaption {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(27, 40, 56, 0.72);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(122, 168, 193, 0.25);
}

.media-pair img,
.media-pair video {
  width: 100%;
  display: block;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--surface-2);
}

/* ── Video play button overlay ──────────────────────────── */
.video-wrap {
  position: relative;
  display: block;
}

.video-wrap video {
  display: block;
}

.play-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.play-btn-inner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7aa8c1 0%, #5c8faa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(92, 143, 170, 0.55);
}

.play-btn:hover .play-btn-inner {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(92, 143, 170, 0.75);
}

.play-btn:active .play-btn-inner {
  transform: scale(0.95);
}

.play-btn svg {
  width: 22px;
  height: 22px;
  color: #fff;
  margin-left: 3px;
}

.play-btn .icon-pause { display: none; margin-left: 0; }
.play-btn.playing .icon-play  { display: none; }
.play-btn.playing .icon-pause { display: block; }

.play-btn.playing {
  opacity: 0;
}

.play-btn.playing:hover {
  opacity: 1;
}

.post-description {
  padding: 0.75rem 1rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Page Content (About / Contact) ─────────────────────── */
.page-content {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.page-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.page-content h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

/* ── About ──────────────────────────────────────────────── */
.about-description p {
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.services-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.services-list li {
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  font-size: 0.95rem;
  color: var(--text);
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
}

/* ── Contact Form ───────────────────────────────────────── */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.required {
  color: #e06060;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: Lora, Georgia, serif;
  letter-spacing: 0.02em;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.btn-primary {
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: Lora, Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(92, 143, 170, 0.35);
  transition: opacity 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-status {
  text-align: center;
  padding: 0.65rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.form-status.success {
  background: rgba(87, 170, 132, 0.15);
  color: #7dcca8;
  border: 1px solid rgba(87, 170, 132, 0.3);
}

.form-status.error {
  background: rgba(196, 122, 91, 0.15);
  color: #e89878;
  border: 1px solid rgba(196, 122, 91, 0.3);
}

.business-phone {
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  padding-top: 1.25rem;
  letter-spacing: 0.05em;
}

.business-phone a {
  color: var(--accent);
  text-decoration: none;
}

.business-phone a:hover {
  text-decoration: underline;
}

.business-address {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 0.35rem;
}

.business-address a {
  color: var(--text-muted);
  text-decoration: none;
}

.business-address a:hover {
  color: var(--text);
}

/* ── Utility ────────────────────────────────────────────── */
.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  font-size: 0.95rem;
}

/* ── License footer ─────────────────────────────────────── */
.license-footer {
  padding: 1rem 1.5rem 6rem;
  text-align: center;
}

.license-statement {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.license-statement a {
  color: var(--text-muted);
  text-decoration: underline;
}

.dev-credit {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.dev-credit a {
  color: inherit;
  text-decoration: none;
}

.dev-credit a:hover {
  text-decoration: underline;
}

/* ── Mobile Swipe Feed ──────────────────────────────────── */
@media (max-width: 599px) {
  /* Feed becomes a fixed snap container between header and nav */
  .feed {
    position: fixed;
    top: var(--header-height);
    bottom: var(--nav-height);
    left: 0;
    right: 0;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
  }

  .feed::-webkit-scrollbar {
    display: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 0;
    gap: 0;
    max-width: none;
  }

  /* Hide license footer — overlaps with fixed feed */
  .feed ~ .license-footer {
    display: none;
  }

  /* Each card = one full view */
  .feed .post-card {
    height: calc(100dvh - var(--header-height) - var(--nav-height));
    scroll-snap-align: start;
    flex-shrink: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .feed .post-title {
    padding: 0.6rem 1rem 0;
    font-size: 0.9rem;
    flex-shrink: 0;
  }

  /* Media pair fills all remaining height */
  .feed .media-pair {
    flex: 1;
    margin-top: 0.4rem;
    gap: 2px;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .feed .media-pair figure {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .feed .video-wrap {
    height: 100%;
  }

  .feed .media-pair img,
  .feed .media-pair video {
    width: 100%;
    height: 100%;
    aspect-ratio: unset;
    object-fit: cover;
  }

  .feed .post-description {
    padding: 0.5rem 1rem 0.75rem;
    font-size: 0.82rem;
    flex-shrink: 0;
    color: var(--text-muted);
  }

  /* Swipe-up hint on all but last card */
  .feed .post-card:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background: rgba(122, 168, 193, 0.45);
    pointer-events: none;
  }

  /* Slide counter badge */
  .swipe-counter {
    display: block;
    position: fixed;
    bottom: calc(var(--nav-height) + 10px);
    right: 12px;
    background: rgba(27, 40, 56, 0.78);
    color: var(--text-muted);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.7rem;
    padding: 3px 9px;
    border-radius: 20px;
    z-index: 50;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    letter-spacing: 0.06em;
    pointer-events: none;
    border: 1px solid rgba(122, 168, 193, 0.18);
  }
}

.swipe-counter { display: none; }

/* ── Desktop centering ──────────────────────────────────── */
@media (min-width: 600px) {
  .bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .site-header {
    border-left: none;
    border-right: none;
  }
}
