/* Caddy Connect holding site — mobile-first styles.
   Brand tokens come from the approved Concept A brand pack. */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #0B2D8F;
  --blue-dark: #082370;
  --green: #009B6A;
  --green-text: #00674A;   /* darker tint of brand green for small text (AA contrast) */
  --green-tint: #E6F5F0;
  --red: #E33935;
  --line-green: #06C755;
  --text: #1F2937;
  --muted: #6B7280;
  --muted-text: #4B5563;   /* darker muted for small text (AA contrast) */
  --border: #E5E7EB;
  --bg: #F8FAFC;
  --white: #fff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(31, 41, 55, .06), 0 4px 16px rgba(31, 41, 55, .06);
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--blue); }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; color: var(--text); }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 var(--gutter); }
main { flex: 1 0 auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--blue); color: #fff; padding: 12px 16px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

/* Header */
.site-header { padding-top: max(10px, env(safe-area-inset-top)); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 12px; }
.logo-link { display: inline-flex; align-items: center; min-height: 44px; }
.logo-link img { height: 34px; width: auto; display: block; }

/* Language selector (no JS) */
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; gap: 6px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: 999px; background: var(--white);
  font-weight: 600; font-size: .95rem; color: var(--text);
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); }
.lang[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.lang ul {
  list-style: none; margin: 6px 0 0; padding: 6px; position: absolute; right: 0; z-index: 5;
  min-width: 210px; background: var(--white); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.lang li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 0 12px; border-radius: 10px; font-size: .98rem; }
.lang li[aria-current="true"] { background: var(--green-tint); font-weight: 600; }
.lang li.is-soon { color: var(--muted-text); }
.lang .soon { font-size: .75rem; font-weight: 600; background: var(--border); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 58px; padding: 14px 22px; border-radius: 14px; border: 2px solid var(--blue);
  background: var(--blue); color: #fff; font: inherit; font-size: 1.15rem; font-weight: 700; text-decoration: none; text-align: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn:active { background: var(--blue-dark); }
.btn-secondary { background: var(--white); color: var(--blue); }
.btn-secondary:active { background: var(--green-tint); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--border); border-color: var(--border); color: var(--muted-text); cursor: not-allowed; }
.btn svg { width: 24px; height: 24px; flex: none; fill: currentColor; }
.btn-stack { display: grid; gap: 14px; }

/* Landing */
.landing .hero { text-align: center; padding-top: 8px; padding-bottom: 24px; }
.landing .logo-big { display: block; width: min(76vw, 300px); margin: 4px auto 18px; }
.art { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 1024 / 572; background: var(--green-tint); }
.landing h1 { margin: 22px 0 18px; font-size: 1.7rem; }

/* Root landing: two-choice audience selector */
.landing .logo-big { margin-bottom: 14px; }
.landing h1 { margin: 18px 0 6px; }
.landing .th-line { font-weight: 700; }
.landing .intro { margin: 0 0 16px; color: var(--muted-text); font-size: 1rem; line-height: 1.5; }
.landing .intro.statement { margin-bottom: 12px; }
.landing .choices { gap: 12px; }
.btn-choice { flex-direction: column; gap: 2px; min-height: 76px; padding: 12px 22px; }
.btn-choice .btn-main { font-size: 1.4rem; line-height: 1.25; }
.btn-choice .btn-sub { font-size: 1rem; font-weight: 600; opacity: .95; }
.btn-green { background: var(--green-text); border-color: var(--green-text); }
.btn-green:active { background: #00553D; border-color: #00553D; }
.btn-choice:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
:lang(th) { font-family: "Inter", "Noto Sans Thai", "Leelawadee UI", "Thonburi", "Sarabun", Tahoma, system-ui, sans-serif; line-height: 1.6; }

/* Content pages */
.hero-page { padding-top: 12px; padding-bottom: 8px; }
.eyebrow { display: inline-block; background: var(--green-tint); color: var(--green-text); font-weight: 700; font-size: .95rem; padding: 6px 14px; border-radius: 999px; margin-bottom: 14px; }
.lead { font-size: 1.1rem; color: var(--muted-text); }
.section { padding-top: 28px; padding-bottom: 4px; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.note { font-size: .93rem; color: var(--muted-text); }
.hint { font-size: .95rem; color: var(--muted-text); margin: 10px 2px 0; text-align: center; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding-left: 52px; min-height: 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; display: grid; place-items: center; }
.steps strong { color: var(--text); }
.callout { background: #FFF7E6; border: 1px solid #F3D9A4; border-radius: 12px; padding: 12px 14px; font-size: .97rem; margin-top: 16px; }

/* Preview labelling */
.preview-wrap { position: relative; border: 2px dashed #9CA3AF; border-radius: 20px; padding: 18px 14px 16px; background: repeating-linear-gradient(135deg, #fff, #fff 12px, #F8FAFC 12px, #F8FAFC 24px); }
.preview-wrap > h2 { margin: 0 2px 10px; }
.badge-preview { display: inline-block; background: var(--text); color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; margin: 0 2px; }
.preview-caption { font-size: .92rem; color: var(--muted-text); margin: 10px 2px 12px; }
.preview-explain { margin-top: 14px; padding: 16px 2px 0; border-top: 1px solid var(--border); }
.preview-explain h3 { margin: 0 0 8px; font-size: 1.1rem; color: var(--blue); }
.preview-explain p { font-size: .95rem; color: var(--muted-text); margin: 0 0 .75em; }
.preview-explain p:last-child { margin-bottom: 0; }
.hero-page > .lead-end { margin-bottom: 0; }

/* Profile card */
.profile { background: var(--white); border: 1px solid var(--border); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.profile-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.avatar { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid var(--green); flex: none; background: var(--green-tint); }
.profile h3 { margin: 0; font-size: 1.25rem; color: var(--blue); }
.profile .club { margin: 0; color: var(--muted-text); font-size: .95rem; }
.facts { margin: 0; display: grid; gap: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); font-size: .95rem; }
.facts dt { color: var(--muted-text); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.opt-title { margin: 14px 0 0; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--green-text); }
.tip-row dd { color: var(--green-text); }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { position: relative; padding-left: 30px; }
.checklist li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 14px; border-right: 3px solid var(--green); border-bottom: 3px solid var(--green); transform: rotate(40deg); }

/* Carousel: one complete profile at a time, looping in both directions (see carousel.js) */
.carousel { display: grid; max-width: 340px; margin: 0 auto; padding: 4px 8px 14px; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.carousel.is-dragging { cursor: grabbing; }
.carousel > .profile { grid-area: 1 / 1; align-self: stretch; transition: transform .35s ease, opacity .35s ease; will-change: transform; }
.carousel > .profile.no-anim { transition: none; }
.carousel.is-dragging > .profile { transition: none; }
.carousel .facts div { font-size: .9rem; }
.carousel img { -webkit-user-drag: none; pointer-events: none; }
.swipe-hint { text-align: center; font-size: .88rem; color: var(--muted-text); margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Form (inactive state) */
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; min-height: 56px; border: 2px solid var(--border); border-radius: 12px; padding: 0 16px; font: inherit; font-size: 1rem; /* >=16px stops iOS zoom */ background: #F3F4F6; color: var(--muted-text); }
.field input:not(:disabled) { background: var(--white); color: var(--text); }
.form-status[hidden] { display: none; }
.form-status { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #FFF7E6; border: 1px solid #F3D9A4; font-size: .97rem; }

/* Social: authentic platform artwork (from POC1), shown in a round frame */
.follow-label { font-weight: 700; margin: 0 0 6px; color: var(--text); }
.social { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.social a { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 76px; padding: 6px 0; text-decoration: none; color: var(--text); font-size: .8rem; font-weight: 600; border-radius: 12px; }
.social .ico { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: var(--white); border: 1px solid var(--border); display: grid; place-items: center; }
.social .ico img { width: 100%; height: 100%; display: block; object-fit: contain; }
.social .ico.pad img { width: 58%; height: 58%; }
.social a:active .ico { opacity: .8; }

/* Back to Home, language links, ID and timeline */
.back-home { padding-top: 32px; }
.lang li a { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; margin: 0 -12px; padding: 0 12px; color: inherit; text-decoration: none; border-radius: 10px; }
.lang li:has(> a) { padding: 0; }
.lang li:has(> a) a { margin: 0; }
.id-label { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--green-text); }
.profile h3.cc-id { font-size: 1.5rem; line-height: 1.15; }
.illus { display: inline-block; margin-left: 4px; font-size: .68rem; font-weight: 600; color: var(--muted-text); background: var(--border); border-radius: 999px; padding: 1px 7px; vertical-align: middle; white-space: nowrap; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-rows: 1fr; gap: 12px; }
.timeline li { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; text-align: left; overflow-wrap: anywhere; }
.timeline li > span:last-child { flex: 1 1 auto; min-width: 0; }
.checklist .check-sub { display: block; margin-top: 2px; color: var(--muted-text); font-size: .95rem; }
.when-tag { flex: none; width: 104px; box-sizing: border-box; white-space: nowrap; text-align: center; background: var(--green); color: #fff; font-weight: 700; font-size: .9rem; padding: 6px 12px; border-radius: 999px; }
.when-tag.when-later { background: var(--blue); }

/* Carousel navigation (shown on mobile and desktop) */
.carousel-nav { display: flex; justify-content: center; gap: 16px; margin-bottom: 8px; }
.car-btn { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--blue); background: var(--white); color: var(--blue); font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 0 0 4px; -webkit-tap-highlight-color: transparent; }
.car-btn:hover { background: var(--green-tint); }
.car-btn:active { background: var(--blue); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .swipe-hint { display: none; }
}

/* Sharing buttons: platform brand colours */
.btn-share, .btn-line { color: #fff; }
/* One LINE green for every LINE-specific button */
.btn.btn-share-line, .btn.btn-line { background: var(--line-green); border-color: var(--line-green); color: #fff; }
.btn.btn-share-line:hover, .btn.btn-line:hover { background: #05B34C; border-color: #05B34C; }
.btn.btn-share-line:active, .btn.btn-line:active { background: #049E43; border-color: #049E43; }
.btn-share-wa { background: #15803D; border-color: #15803D; }
.btn-share-wa:hover { background: #116B33; border-color: #116B33; }
.btn-share-wa:active { background: #0E5A2B; border-color: #0E5A2B; }
.btn-share:focus-visible, .btn-line:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }

/* Back to Home at top of audience pages */
.back-home-top { padding-top: 6px; padding-bottom: 6px; }
/* Understated Back to Home link (legal/contact pages) */
.back-link-row { padding-top: 4px; padding-bottom: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding-right: 12px; color: var(--blue); font-size: .95rem; font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
/* Prose pages */
.prose h1 { margin-top: 8px; }
.prose h2 { margin-top: 1.6em; font-size: 1.2rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.draft-banner { background: #FFF7E6; border: 1px solid #F3D9A4; border-radius: 12px; padding: 12px 14px; font-size: .93rem; margin: 8px 0 16px; }
.tbc { background: #FEF3C7; padding: 0 4px; border-radius: 4px; font-weight: 600; }
.email-big { word-break: break-word; }
/* Contact button: keep the full address on one line on phones (long address, 430px down to 320px) */
.btn:has(> .email-big) { padding-left: 6px; padding-right: 6px; }
.btn > .email-big { white-space: nowrap; word-break: normal; font-size: clamp(.78rem, 3.9vw, 1.15rem); }
@media (min-width: 640px) { .btn > .email-big { font-size: 1.15rem; } }

/* Footer */
.site-footer { margin-top: 36px; padding: 22px 0 max(22px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--white); text-align: center; font-size: .93rem; color: var(--muted-text); }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 6px; margin-bottom: 6px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--blue); font-weight: 600; text-decoration: none; }
.site-footer p { margin: 0; }
/* Thai mobile: two links on the first row, the third centred beneath (desktop unchanged) */
@media (max-width: 639px) {
  :lang(th) .site-footer nav { max-width: 300px; margin-left: auto; margin-right: auto; }
}
.landing .site-footer { margin-top: auto; }

/* Cookie consent (analytics.js): compact bar fixed to the bottom; page gets matching bottom padding while shown */
.site-footer .cc-settings { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border: 0; background: none; font: inherit; font-size: inherit; font-weight: 600; color: var(--blue); cursor: pointer; text-decoration: none; }
.site-footer .cc-settings:hover { text-decoration: underline; }
.cc-consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-height: 70vh; overflow-y: auto; background: var(--white); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(31, 41, 55, .12); padding: 10px 0 max(10px, env(safe-area-inset-bottom)); font-size: .84rem; line-height: 1.4; color: var(--text); }
.cc-consent[hidden], .cc-status[hidden] { display: none; }
.cc-inner { max-width: 640px; margin: 0 auto; padding: 0 var(--gutter); }
.cc-consent p { margin: 0 0 .4em; }
.cc-consent .cc-title { font-weight: 700; color: var(--blue); }
.cc-consent .cc-text + .cc-text { margin-top: 4px; }
.cc-consent .cc-status { color: var(--muted-text); font-size: .85rem; }
.cc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
/* Accept and Reject share identical styling so neither is visually favoured */
.cc-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 46px; padding: 4px 6px; border: 2px solid var(--blue); border-radius: 12px; background: var(--white); color: var(--blue); font: inherit; font-size: .88rem; font-weight: 700; line-height: 1.3; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cc-btn:active { background: var(--green-tint); }
.cc-btn:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.cc-consent:focus { outline: none; }

@media (min-width: 640px) {
  body { font-size: 18px; }
  h1 { font-size: 2.1rem; }
  .wrap { max-width: 640px; }
  .btn-stack.row { grid-template-columns: 1fr 1fr; }
  .social a { font-size: .85rem; }
}
@media (max-width: 359px) {
  .social .ico { width: 46px; height: 46px; }
  h1 { font-size: 1.55rem; }
}
@media (prefers-reduced-motion: reduce) {
  .carousel > .profile { transition: none; }
}
