/* =====================================================================
   Tropical Links (BragDeal, 2026-11-12, paid project "Tropical Links Page
   Redesign and Branded Share Links").
   Used by frontend/views/tropicallinks.php (/maui-useful-links) and
   frontend/views/tropical_link_page.php (/maui-useful-links/<slug>).
   Mobile first. Site colours: maroon #701B42, accent #D65C68.
   ===================================================================== */

.tl-page {
  --tl-maroon: #701B42; --tl-maroon-deep: #5A1535;
  --tl-accent: #D65C68; --tl-accent-tint: #FBE9EB;
  --tl-ink: #1F1418; --tl-body: #3A2E32; --tl-muted: #6B6355;
  --tl-line: #E8DCCD; --tl-media: #F6F1EA; --tl-ok: #1E7A46;
  overflow-wrap: anywhere;
  padding-bottom: 8px;
}
.tl-page .page-headings { margin-bottom: 6px; }
.tl-intro { font-size: 17px; line-height: 1.55; color: var(--tl-body); max-width: 760px; margin: 6px 0 20px; }

/* ---------- Category filter: wrapping chips, 44px tap targets ---------- */
.tl-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; }
.tl-chip {
  min-height: 44px; padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--tl-accent); background: #fff; color: var(--tl-ink);
  font: 600 15px/1.2 "Urbanist", sans-serif; display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.tl-chip:hover { background: var(--tl-accent-tint); }
.tl-chip[aria-pressed="true"], .tl-chip[aria-pressed="true"]:hover { background: var(--tl-maroon); border-color: var(--tl-maroon); color: #fff; }
.tl-chip-count {
  font-size: 13px; font-weight: 700; min-width: 24px; padding: 2px 7px; border-radius: 999px; text-align: center;
  background: var(--tl-accent-tint); color: var(--tl-maroon);
}
.tl-chip[aria-pressed="true"] .tl-chip-count { background: rgba(255, 255, 255, .22); color: #fff; }
.tl-page :focus-visible { outline: 3px solid var(--tl-accent); outline-offset: 2px; }
/* Phones: one row that scrolls sideways (wrapping took 7 rows at 375px); the fade shows there is more */
@media (max-width: 575.98px) {
  .tl-filter {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity; scrollbar-width: none;
    margin: 0 -16px 18px; padding: 4px 48px 8px 16px;
    -webkit-mask-image: linear-gradient(to right, #000 82%, transparent);
    mask-image: linear-gradient(to right, #000 82%, transparent);
  }
  .tl-filter::-webkit-scrollbar { display: none; }
  .tl-chip { flex: none; scroll-snap-align: start; scroll-margin-left: 16px; }
}

/* ---------- Card grid: 1 column on phones, 2 on tablets, 3 on desktop ---------- */
.tl-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 768px) { .tl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; } }
@media (min-width: 992px) { .tl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }

.tl-card {
  display: flex; flex-direction: column; min-width: 0;
  background: #fff; border: 1px solid var(--tl-line); border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 20, 40, .08); overflow: hidden;
  transition: box-shadow .2s ease;
}
.tl-card[hidden] { display: none; }
.tl-card:hover { box-shadow: 0 16px 40px rgba(0, 20, 40, .14); }

/* Full image, never cropped: contain inside a fixed 4:3 frame on a neutral background */
.tl-media { display: block; aspect-ratio: 4 / 3; background: var(--tl-media); padding: 10px; }
.tl-media img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
@supports not (aspect-ratio: 4 / 3) { .tl-media { height: 260px; } }

.tl-body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 16px 18px 18px; }
.tl-cat { font: 700 12px/1.3 "Urbanist", sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--tl-maroon); margin: 0 0 6px; }
.tl-name { font: 800 21px/1.25 "Urbanist", sans-serif; color: var(--tl-ink); letter-spacing: -.01em; margin: 0 0 8px; }
.tl-name a { color: inherit; text-decoration: none; }
.tl-name a:hover, .tl-name a:focus-visible { color: var(--tl-maroon); text-decoration: underline; text-underline-offset: 3px; }
.tl-desc {
  font-size: 16px; line-height: 1.55; color: var(--tl-body); margin: 0 0 14px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.tl-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }

/* ---------- Buttons ---------- */
.tl-btn {
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 2px solid var(--tl-maroon);
  font: 700 15px/1.2 "Urbanist", sans-serif; text-decoration: none !important; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.tl-actions .tl-btn { flex: 1 1 auto; } /* side by side when they fit, full width when they wrap */
.tl-btn-primary { background: var(--tl-maroon); color: #fff !important; }
.tl-btn-primary:hover, .tl-btn-primary:focus-visible { background: var(--tl-maroon-deep); border-color: var(--tl-maroon-deep); color: #fff !important; }
.tl-btn-ghost { background: #fff; color: var(--tl-maroon) !important; }
.tl-btn-ghost:hover, .tl-btn-ghost:focus-visible { background: var(--tl-accent-tint); }
.tl-btn.is-copied, .tl-btn.is-copied:hover { background: var(--tl-ok); border-color: var(--tl-ok); color: #fff !important; }
.tl-btn i { font-size: 14px; }

.tl-empty { font-size: 17px; color: var(--tl-body); }

/* ---------- Branded page ---------- */
.tl-breadcrumb { font-size: 14px; margin: 4px 0 12px; }
.tl-breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; }
.tl-breadcrumb li + li::before { content: "\203A"; margin: 0 8px; color: var(--tl-muted); }
.tl-breadcrumb a { color: var(--tl-maroon); text-decoration: underline; text-underline-offset: 2px; }
.tl-breadcrumb [aria-current] { font-weight: 600; color: var(--tl-body); }

.tl-presented {
  display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 12px; padding: 7px 14px;
  border-radius: 999px; background: var(--tl-accent-tint); color: var(--tl-maroon);
  font: 700 14px/1.3 "Urbanist", sans-serif;
}
.tl-presented i { color: var(--tl-accent); }

.tl-detail {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px;
  background: #fff; border: 1px solid var(--tl-line); border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 20, 40, .08); padding: 16px; margin: 8px 0 22px;
}
@media (min-width: 992px) { .tl-detail { grid-template-columns: minmax(0, 11fr) minmax(0, 10fr); gap: 32px; padding: 24px; } }
.tl-detail .tl-media { border-radius: 14px; padding: 12px; aspect-ratio: auto; height: auto; display: flex; align-items: center; justify-content: center; }
.tl-detail .tl-media img { width: auto; max-width: 100%; height: auto; max-height: min(70vh, 560px); }
.tl-detail-body p.tl-cat { font-size: 12px; line-height: 1.3; color: var(--tl-maroon); margin: 0 0 8px; }
.tl-detail-body { display: flex; flex-direction: column; min-width: 0; }
.tl-detail-body p { font-size: 17px; line-height: 1.6; color: var(--tl-body); margin: 0 0 12px; }
.tl-detail-body .tl-actions { margin-top: 10px; }

.tl-box {
  background: #fff; border: 1px solid var(--tl-line); border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 20, 40, .08); padding: 20px 18px; margin: 0 0 22px;
}
@media (min-width: 768px) { .tl-box { padding: 26px 28px; } }
.tl-box h2 { font: 800 24px/1.25 "Urbanist", sans-serif; color: var(--tl-ink); letter-spacing: -.01em; margin: 0 0 10px; }
.tl-box p { font-size: 17px; line-height: 1.6; color: var(--tl-body); margin: 0 0 14px; }
.tl-host { border-top: 5px solid var(--tl-maroon); }
.tl-contact { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.tl-contact a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--tl-maroon); font-weight: 700; text-decoration: none; }
.tl-contact a:hover, .tl-contact a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.tl-host .tl-actions { margin-top: 0; }
.tl-related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.tl-related a { display: inline-flex; align-items: center; min-height: 44px; color: var(--tl-maroon); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 575.98px) {
  .tl-actions .tl-btn { flex: 1 1 100%; }
  .tl-name { font-size: 20px; }
  .tl-box h2 { font-size: 22px; }
}

.tl-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  .tl-card, .tl-btn, .tl-chip { transition: none; }
}
