/* Top things to do in Cape Town: the place and story cards, shared by the homepage rail, the /top-things-to-do/ hub
   and the place pages. The rail behaviour is the shared one (static/css/rail.css,
   static/js/rail.js); everything here is the top-things look.

   Palette (text pairs checked for WCAG AA):
     deep ocean #06202c with pale #f3f8fa text, coral #ff9f6b pill with #06202c text,
     ink #0a1f29 and body #24424f on paper #eaf2f5 */
.ttd-scope {
  --ttd-ink: #0a1f29;
  --ttd-body: #24424f;
  --ttd-muted: #47606c;
  --ttd-ocean: #0f4a63;
  --ttd-deep: #06202c;
  --ttd-sun: #ff9f6b;
  --ttd-sun-soft: #ffd9c2;
  --ttd-cream: #f3f8fa;
  --ttd-paper: #eaf2f5;
  --ttd-line: #cfdfe6;
  --ttd-green: #1f6f5c;
  --ttd-radius: 20px;
  --ttd-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
  --ttd-shadow: 0 1px 2px rgba(10, 31, 41, .08), 0 18px 36px -18px rgba(10, 31, 41, .55);
}

/* ── The card frame ───────────────────────────────────────────────────── */
.ttd-card { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: var(--ttd-radius); overflow: hidden; background: var(--ttd-deep); box-shadow: var(--ttd-shadow); color: var(--ttd-cream); isolation: isolate; }
.ttd-card__link { position: relative; display: block; color: inherit; text-decoration: none; }
.ttd-card__link:hover, .ttd-card__link:focus-visible { color: inherit; }
.ttd-card__link:focus-visible { outline: 3px solid var(--ttd-sun); outline-offset: -3px; border-radius: var(--ttd-radius); }
.ttd-card__media { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: #0c3447; }
.ttd-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 60%; }

/* The scrim deepens to 94% ocean-black where the text sits, so every line keeps AA over any photo. */
.ttd-card__scrim { position: absolute; left: 0; right: 0; bottom: 0; padding: 5rem 1.1rem 1.05rem; background: linear-gradient(180deg, rgba(4, 20, 28, 0) 0, rgba(4, 20, 28, .74) 4.5rem, rgba(4, 20, 28, .95) 100%); }
.ttd-card__name { margin: .5rem 0 .3rem; font-family: var(--ttd-serif); font-size: 1.6rem; font-weight: 700; line-height: 1.08; letter-spacing: -.01em; color: #fff; }
.ttd-card__summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-size: .86rem; line-height: 1.45; color: rgba(243, 248, 250, .9); }
.ttd-card__more { display: inline-block; margin-top: .55rem; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ttd-sun); }
.ttd-card__link:hover .ttd-card__name, .ttd-card__link:focus-visible .ttd-card__name { color: var(--ttd-sun-soft); }

/* Pills: sun for "Good this month", a quiet glass pill for the category, cream for "Read". */
.ttd-pill { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; padding: .24rem .65rem; border-radius: 999px; font-size: .66rem; font-weight: 800; letter-spacing: .09em; line-height: 1.35; text-transform: uppercase; background: rgba(255, 255, 255, .16); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ttd-pill--now { background: var(--ttd-sun); color: var(--ttd-deep); -webkit-backdrop-filter: none; backdrop-filter: none; }
.ttd-pill--now::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: var(--ttd-green); box-shadow: 0 0 0 2px rgba(31, 111, 92, .25); }
.ttd-pill--read { background: var(--ttd-ocean); color: var(--ttd-cream); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* The photo credit sits under the photo, small, on the card's own ground. */
.ttd-credit { margin: 0 0 .65rem; padding: .5rem 1.1rem 0; font-size: .68rem; line-height: 1.35; color: rgba(243, 248, 250, .74); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ttd-card .ttd-credit a { color: rgba(243, 248, 250, .9); text-decoration: underline; text-decoration-color: rgba(243, 248, 250, .35); text-underline-offset: 2px; }
.ttd-card .ttd-credit a:hover { color: var(--ttd-sun); }

/* ── No free photo: a typographic card on a patterned ground, never an empty box ── */
.ttd-card--plain { --ttd-plain: #0f4a63; --ttd-plain-2: #0a2f40; background: var(--ttd-plain-2); }
.ttd-cat--views { --ttd-plain: #2a6f5a; --ttd-plain-2: #0f3329; }
.ttd-cat--sea { --ttd-plain: #17607f; --ttd-plain-2: #08293a; }
.ttd-cat--wildlife { --ttd-plain: #4a5a2a; --ttd-plain-2: #1d260f; }
.ttd-cat--history { --ttd-plain: #6a3a58; --ttd-plain-2: #2b1424; }
.ttd-cat--wine { --ttd-plain: #7d2a4a; --ttd-plain-2: #3a1224; }
.ttd-cat--adventure { --ttd-plain: #a14a1c; --ttd-plain-2: #4a1e08; }
.ttd-plain { position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 4 / 5; padding: 1.1rem 1.1rem 1.05rem; overflow: hidden;
  background:
    radial-gradient(circle at 1.5px 1.5px, rgba(243, 248, 250, .16) 1.2px, transparent 1.6px) 0 0 / 14px 14px,
    radial-gradient(120% 80% at 85% 0%, var(--ttd-plain) 0%, var(--ttd-plain-2) 72%); }
/* A rising sun over the water, drawn in CSS: two rings and a rim of coral, top right. */
.ttd-plain::before, .ttd-plain::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.ttd-plain::before { width: 68%; aspect-ratio: 1; top: -8%; right: -14%; border: 2px solid rgba(255, 159, 107, .55); box-shadow: inset 0 0 0 14px rgba(243, 248, 250, .06), inset 0 0 0 15px rgba(243, 248, 250, .18); }
.ttd-plain::after { width: 36%; aspect-ratio: 1; top: 8%; right: 2%; border: 1px dashed rgba(243, 248, 250, .3); }
.ttd-plain__kicker { position: relative; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ttd-sun); }
.ttd-plain__name { position: relative; margin: .3rem 0 .45rem; font-family: var(--ttd-serif); font-size: 2.15rem; font-weight: 700; font-style: italic; line-height: 1; letter-spacing: -.015em; color: #fff; overflow-wrap: anywhere; }
.ttd-plain .ttd-card__summary { position: relative; -webkit-line-clamp: 3; }
.ttd-plain .ttd-pill { position: absolute; top: 1rem; left: 1.1rem; }

/* ── Story cards: our own articles, cream paper with a wide photo, so they read as a different kind of card ── */
.ttd-card--article { background: var(--ttd-paper); color: var(--ttd-ink); }
.ttd-card--article .ttd-card__link { display: flex; flex-direction: column; flex: 1 1 auto; }
.ttd-card--article .ttd-card__media { aspect-ratio: 16 / 11; background: #cfdfe6; }
.ttd-article__body { display: flex; flex: 1 1 auto; flex-direction: column; align-items: flex-start; gap: .45rem; padding: .95rem 1.1rem 1.1rem; border-top: 3px solid var(--ttd-sun); }
.ttd-article__title { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-family: var(--ttd-serif); font-size: 1.22rem; font-weight: 700; line-height: 1.2; color: var(--ttd-ink); }
.ttd-article__note { margin-top: auto; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ttd-ocean); }
.ttd-card--article .ttd-card__link:hover .ttd-article__title, .ttd-card--article .ttd-card__link:focus-visible .ttd-article__title { color: var(--ttd-ocean); }
.ttd-card--article .ttd-card__link:focus-visible { outline-color: var(--ttd-ocean); }

/* ── Motion: a small lift and a slow zoom, only for pointers that hover and readers who allow motion ── */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .ttd-card { transition: transform .25s ease, box-shadow .25s ease; }
  .ttd-card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(10, 31, 41, .1), 0 26px 44px -18px rgba(10, 31, 41, .65); }
  .ttd-card__media img { transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
  .ttd-card:hover .ttd-card__media img { transform: scale(1.06); }
}

/* The area label sits between the name and the summary: a place, not a tagline. */
.ttd-card__area { margin: 0 0 .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ttd-sun-soft); }
