/* ============ K Plus Loan — public site ============ */
:root {
  --brand: #0b5cd6;
  --brand-deep: #0a47a3;
  --ink: #1a2233;
  --muted: #5b6472;
  --bg: #ffffff;
  --bg-alt: #f4f7fb;
  --line: #e3e8f0;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans", "Noto Sans KR", "Noto Sans Myanmar", "Noto Sans Khmer",
    "Noto Sans Sinhala", "Noto Sans Thai", "Noto Sans Devanagari",
    "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  /* Keep words intact when wrapping (Korean text breaks mid-word without this) */
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Render manual line breaks: pressing Enter in the admin text editor
   produces a real line break on the page for these text elements. */
h1, h2, h3, p, dd, figcaption,
.doc-list li, .product li {
  white-space: pre-line;
}
img { max-width: 100%; }
a { color: var(--brand); }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.main-nav a {
  text-decoration: none; color: var(--ink); padding: 6px 10px;
  border-radius: 8px; font-size: 0.95rem;
}
.main-nav a:hover { background: var(--bg-alt); }
.main-nav a.active { background: var(--brand); color: #fff; }
.lang-switch select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 0.95rem; background: #fff; color: var(--ink);
}

/* Mobile header: brand + language on top row, nav as one scrollable row below */
@media (max-width: 820px) {
  .header-inner {
    display: grid; grid-template-columns: 1fr auto;
    align-items: center; row-gap: 6px;
    padding-top: 10px; padding-bottom: 8px;
  }
  .brand { grid-column: 1; }
  .lang-switch { grid-column: 2; justify-self: end; }
  .main-nav {
    grid-column: 1 / -1;
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; gap: 2px; margin: 0 -20px; padding: 0 20px 2px;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { white-space: nowrap; flex: 0 0 auto; font-size: 0.92rem; }
}

/* Hero */
.hero {
  /* The background-image (gradient + per-language photo hero-{lang}.jpg)
     is set inline on the section in index.html; hero.jpg is the fallback. */
  background-color: #08285c;
  background-image:
    linear-gradient(100deg, rgba(8,40,92,0.92) 0%, rgba(10,71,163,0.82) 45%, rgba(11,92,214,0.45) 100%),
    url('/img/hero.jpg');
  background-position: center 30%;
  background-size: cover;
  background-repeat: no-repeat;
  color: #fff; padding: 96px 0;
}
/* Shown only on phones — the full photo below the text, person fully visible */
.hero-mobile-img { display: none; }
@media (max-width: 768px) {
  /* On narrow screens the cover-cropped photo cuts the person off, so the
     background keeps only the gradient and the photo becomes a normal
     image under the text, cropped toward its right side (where the person is). */
  .hero {
    background-image: linear-gradient(160deg, #08285c 0%, #0a47a3 55%, #0b5cd6 100%) !important;
    padding: 56px 0;
  }
  .hero-mobile-img {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: cover;
    object-position: right center;
    border-radius: var(--radius);
    margin: 24px 0 4px;
  }
}
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 0 0 12px; line-height: 1.3; }
.hero .lead { font-size: 1.15rem; opacity: 0.92; max-width: 640px; margin: 0 0 28px; }

/* Sections */
.section { padding: 56px 0; }
.section.alt { background: var(--bg-alt); }
.section h2 { font-size: 1.5rem; margin-top: 0; }
.page-head { background: var(--bg-alt); padding: 44px 0 32px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0 0 8px; font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.page-head .lead { color: var(--muted); margin: 0; font-size: 1.08rem; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 800px) { .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.card h2, .card h3 { margin-top: 0; font-size: 1.15rem; }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 24px; border-radius: 10px;
  text-decoration: none; font-weight: 700; font-size: 1rem; border: 2px solid transparent;
}
.btn-primary { background: #fff0; }
.hero .btn-primary { background: #fff; color: var(--brand-deep); }
.section .btn-primary, .cta-band .btn-primary { background: var(--brand); color: #fff; }
.btn-outline { border-color: var(--brand); color: var(--brand); }
.btn:hover { opacity: 0.9; }

.cta-band { background: var(--brand-deep); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band .btn-primary { background: #fff; color: var(--brand-deep); }

/* Loans */
.product {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; margin-bottom: 22px; background: #fff;
}
.product h2 { margin: 0 0 8px; font-size: 1.25rem; color: var(--brand-deep); }
.product ul { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.notice { color: var(--muted); font-size: 0.9rem; border-left: 3px solid var(--line); padding-left: 12px; }

/* Apply steps */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 36px; }
.steps > li {
  position: relative; padding: 18px 18px 18px 24px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.steps h2 { margin: 0 0 6px; font-size: 1.1rem; color: var(--brand-deep); }
.steps p { margin: 0; color: var(--muted); }
.doc-list { padding-left: 20px; color: var(--muted); margin-bottom: 32px; }

/* FAQ */
.faq-list details {
  border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 12px; background: #fff; padding: 0 18px;
}
.faq-list summary {
  cursor: pointer; font-weight: 700; padding: 16px 0; list-style-position: outside;
}
.faq-list p { margin: 0 0 16px; color: var(--muted); }

/* Contact */
.contact-grid {
  /* Wider cards so email addresses fit on one line instead of breaking mid-domain */
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin: 0 0 24px;
}
.contact-grid dt { font-weight: 700; color: var(--brand-deep); margin-bottom: 4px; }
.contact-grid dd { margin: 0; overflow-wrap: anywhere; }
.contact-grid dd a { font-size: 0.95rem; }

/* Facebook card on the contact page */
.facebook-card {
  display: flex; align-items: center; gap: 14px;
  margin: 4px 0 24px; padding: 16px 20px;
  border-radius: var(--radius); text-decoration: none;
  background: #1877f2; color: #fff;
  box-shadow: 0 4px 16px rgba(24, 119, 242, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  max-width: 560px;
}
.facebook-card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(24, 119, 242, 0.45); }
.facebook-card .fb-icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center;
}
.facebook-card .fb-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.facebook-card .fb-text strong { font-size: 1.02rem; }
.facebook-card .fb-text span { font-size: 0.88rem; opacity: 0.9; word-break: keep-all; }
.facebook-card .fb-arrow { margin-left: auto; font-size: 1.2rem; opacity: 0.85; }

/* Events */
.event-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.event-filters a {
  padding: 8px 20px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 0.95rem;
}
.event-filters a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.event-empty { color: var(--muted); }
.event-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.event-card {
  display: block; text-decoration: none; color: inherit;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.event-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(16,25,43,0.12); }
/* Thumbnails keep the image's own aspect ratio — never cropped */
.event-thumb { position: relative; background: var(--bg-alt); }
.event-thumb img { width: 100%; height: auto; display: block; }
.event-thumb-placeholder {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.4rem; color: var(--brand); letter-spacing: 0.04em;
}
.event-grid { align-items: start; }
.event-badge {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; color: #fff;
}
.event-badge.ongoing { background: var(--brand); }
.event-badge.ended { background: #8b96aa; }
.event-meta { padding: 14px 16px 18px; }
.event-date { font-size: 0.85rem; color: var(--muted); }
.event-title { font-size: 1.05rem; margin: 6px 0 0; color: var(--ink); }
.event-detail-date { color: var(--muted); }
/* Content images stack top-to-bottom with no gap so a long poster can be
   split into slices; only the very top and bottom corners are rounded. */
.event-detail .event-content-img { display: block; max-width: 760px; width: 100%; margin: 0 auto; border-radius: 0; }
.event-detail .event-content-img:first-of-type { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.event-detail .event-content-img:last-of-type { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.event-content-html { max-width: 760px; margin: 0 auto; }
.event-content-html img { max-width: 100%; height: auto; border-radius: var(--radius); }
.event-back { margin-top: 32px; text-align: center; }

/* Page images */
.page-img {
  display: block; width: 100%; height: auto; border-radius: var(--radius);
  margin: 0 0 28px; box-shadow: 0 4px 18px rgba(16,25,43,0.10);
}
.photo-band { padding: 0 0 56px; }
.photo-band img {
  display: block; width: 100%; height: auto; border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(16,25,43,0.10);
}

/* App download badges */
.hero-badges { margin-top: 30px; }
.hero-badges .app-title { margin: 0 0 10px; font-size: 0.95rem; opacity: 0.92; }
.app-band { background: #10192b; padding: 34px 0; }
.app-band .app-title { color: #fff; font-weight: 700; margin: 0; font-size: 1.05rem; }
.app-band-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.store-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: #000; color: #fff; text-decoration: none;
  border: 1px solid rgba(255,255,255,0.35); border-radius: 10px;
  padding: 8px 16px; line-height: 1.15; min-width: 168px;
}
.store-badge:hover { background: #1a1a1a; }
.store-badge small { display: block; font-size: 0.62rem; font-weight: 400; opacity: 0.85; letter-spacing: 0.02em; }
.store-badge span { font-size: 1.02rem; font-weight: 700; }

/* 1:1 chat floating button */
.chat-fab {
  /* Pill shape: grows with the label so every language fits (was a fixed 72px circle) */
  position: fixed; right: 22px; bottom: 22px; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; text-decoration: none; color: #fff;
  min-height: 56px; max-width: 250px;
  padding: 10px 18px; border-radius: 999px;
  background: linear-gradient(135deg, #ff2d78 0%, #e0347f 35%, #8f3bff 100%);
  box-shadow: 0 6px 22px rgba(224, 52, 127, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.chat-fab:hover { transform: scale(1.06); box-shadow: 0 8px 28px rgba(143, 59, 255, 0.5); }
.chat-fab svg { flex: 0 0 auto; }
.chat-fab-label {
  font-size: 0.88rem; font-weight: 700; letter-spacing: 0.01em;
  text-align: center; line-height: 1.25; word-break: keep-all;
}
@media (max-width: 600px) {
  .chat-fab { right: 14px; bottom: 14px; min-height: 50px; padding: 8px 14px; max-width: 210px; }
  .chat-fab-label { font-size: 0.8rem; }
}

/* Promo videos (vertical 9:16) */
.video-section { background: var(--bg-alt); }
.video-grid {
  display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; margin-top: 10px;
}
.video-grid figure { margin: 0; max-width: 340px; width: 100%; }
.video-grid video {
  width: 100%; aspect-ratio: 9 / 16; background: #000;
  border-radius: var(--radius); box-shadow: 0 6px 22px rgba(16,25,43,0.16);
}
.video-grid figcaption {
  text-align: center; color: var(--muted); font-size: 0.92rem; margin-top: 10px;
}

/* Footer */
.site-footer {
  background: #10192b; color: #b8c2d4; padding: 40px 0; margin-top: 40px;
  font-size: 0.92rem;
}
.site-footer .footer-brand { color: #fff; font-weight: 800; font-size: 1.05rem; }
.site-footer p { margin: 4px 0; }
.site-footer .disclaimer { margin-top: 14px; font-size: 0.85rem; color: #8b96aa; }
.site-footer .legal-links a { color: #cfd8e6; text-decoration: none; }
.site-footer .legal-links a:hover { text-decoration: underline; }
.site-footer .legal-links span { color: #8b96aa; margin: 0 6px; }

/* Legal pages (terms / privacy) — long text, paragraphs via line breaks */
.legal-body { font-size: 0.95rem; color: var(--ink); }
.site-footer .rights { margin-top: 10px; color: #8b96aa; }
.footer-notice {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-notice .notice-title { font-weight: 700; color: #cfd8e6; margin-bottom: 6px; }
.footer-notice .notice-body { font-size: 0.8rem; color: #8b96aa; line-height: 1.7; }
