/* Premo Studio — shared design system
   Colors and type matched to the existing premostudio.my brand. */

:root {
  --bg-page: #FAF8F4;
  --bg-section-alt: #F1EEE6;
  --bg-dark: #3E4C4C;
  --bg-dark-2: #34413F;
  --text-dark: #1F2624;
  --text-muted: #5B6664;
  --text-on-dark: #FFFFFF;
  --text-on-dark-muted: #CBD3D0;
  --text-on-dark-faint: #AAB4B1;
  --accent: #C08A3E;
  --accent-hover: #A8752F;
  --accent-on-dark: #E8B25A;
  --card-border: #E7E2D8;
  --fill-tag: #FBEED9;
  --fill-tag-text: #8A5A1E;
  --max-width: 1200px;

  /* service tint palette — inspired by haimati.cn's colour-blocked service cards,
     re-tuned to sit inside Premo's own warm/slate palette rather than copy theirs */
  --tint-1-bg: #DCE6E1; --tint-1-text: #2C4A40; /* passport — sage */
  --tint-2-bg: #F0DCC8; --tint-2-text: #6B3D1E; /* headshot — terracotta */
  --tint-3-bg: #DCE3EC; --tint-3-text: #2E4460; /* graduation — dusty blue */
  --tint-4-bg: #EDDCE0; --tint-4-text: #6B2F42; /* family portrait — dusty rose */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-dark);
  font-family: "Work Sans", "PingFang SC", "Microsoft YaHei", "Heiti SC", sans-serif;
  line-height: 1.5;
}
h1, h2, h3, .serif {
  font-family: "Source Serif 4", "Songti SC", "PingFang SC", serif;
  margin: 0;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* Nav */
.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px; background: #FFFFFF; border-bottom: 1px solid #ECE7DC;
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%; background: #EDEAE2;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-name { font-family: "Source Serif 4", serif; font-size: 20px; font-weight: 700; letter-spacing: 0.03em; }
.brand-name small { display: block; font-size: 10.5px; font-weight: 500; letter-spacing: 0.16em; color: var(--text-muted); margin-top: -2px; }
.nav-links { display: flex; align-items: center; gap: 24px; font-size: 14.5px; color: var(--text-muted); }
.nav-links a, .nav-links span { white-space: nowrap; }
.nav-links a { color: var(--text-muted); }
.nav-links .current { color: var(--text-dark); border-bottom: 2px solid var(--text-dark); padding-bottom: 4px; font-family: "Source Serif 4", serif; }
.nav-cta {
  background: var(--accent); color: #fff; padding: 9px 18px; border-radius: 2px;
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.nav-toggle-checkbox { display: none; }
.nav-toggle { display: none; }

/* Nav service dropdowns (KL / JB per service) */
.nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-dropdown-toggle {
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  color: var(--text-muted); white-space: nowrap;
}
.nav-dropdown-toggle::after {
  content: ""; width: 0; height: 0; margin-top: 2px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; opacity: 0.55;
}
.nav-dropdown-toggle.current { color: var(--text-dark); border-bottom: 2px solid var(--text-dark); padding-bottom: 4px; font-family: "Source Serif 4", serif; }
.nav-dropdown::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 12px; }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: #fff; border: 1px solid var(--card-border); border-radius: 6px;
  box-shadow: 0 10px 28px rgba(30,30,25,0.12); padding: 6px; min-width: 128px;
  opacity: 0; visibility: hidden; transition: opacity .15s ease, transform .15s ease; z-index: 60;
}
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  display: block; padding: 8px 16px; border-radius: 4px; font-size: 14px;
  white-space: nowrap; color: var(--text-muted);
}
.nav-dropdown-menu a:hover { background: var(--bg-section-alt); color: var(--text-dark); }
.nav-dropdown-menu a.current-loc { color: var(--text-dark); font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 30px; border-radius: 2px; font-weight: 600; font-size: 15px;
  letter-spacing: 0.01em; cursor: pointer; border: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.55); }
.btn-outline:hover { border-color: #fff; color: #fff; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* Hero */
.hero { background: var(--bg-dark); padding: 88px 40px 96px; }
.hero-inner { max-width: var(--max-width); margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25); border-radius: 20px; padding: 6px 16px;
  margin-bottom: 26px; color: #EDEAE2; font-size: 13px; letter-spacing: 0.05em; font-weight: 500;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-on-dark); }
.hero h1 { color: #fff; font-size: 58px; line-height: 1.06; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 20px; }
.hero .subhead { color: var(--accent-on-dark); font-size: 18px; font-weight: 600; margin-bottom: 20px; }
.hero p.lead { color: var(--text-on-dark-muted); font-size: 16px; line-height: 1.75; max-width: 560px; margin-bottom: 32px; }

/* Sections */
section { padding: 80px 40px; }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-alt { background: var(--bg-section-alt); }
.section-dark { background: var(--bg-dark); color: #fff; }
.eyebrow-label { color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: 0.12em; margin-bottom: 12px; }
.section-title { font-size: 38px; font-weight: 700; letter-spacing: -0.005em; margin-bottom: 16px; }
.section-lead { color: var(--text-muted); font-size: 16px; line-height: 1.75; max-width: 640px; }

/* Grids & cards */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 26px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 48px; }
.card { background: #fff; border: 1px solid var(--card-border); padding: 26px 22px; }
.card svg { margin-bottom: 14px; }
.card-title { font-weight: 600; font-size: 15.5px; margin-bottom: 8px; }
.card-body { color: var(--text-muted); font-size: 14px; line-height: 1.6; }

.stat-card { background: var(--fill-tag); color: var(--fill-tag-text); text-align: center; padding: 26px; border: none; }
.stat-num { font-family: "Source Serif 4", serif; font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.stat-label { font-size: 13px; }

.review-card { background: #fff; border: 1px solid var(--card-border); padding: 22px; color: #8A9694; font-size: 14px; line-height: 1.7; font-style: italic; }

.placeholder-photo {
  background: repeating-linear-gradient(135deg, #E4E9E8, #E4E9E8 10px, #DAE0DE 10px, #DAE0DE 20px);
  display: flex; align-items: center; justify-content: center; color: #8A9694;
  font-size: 12.5px; text-align: center; line-height: 1.5;
}

/* Service tint cards */
.tint-card {
  border-radius: 4px; padding: 30px 24px; display: block;
}
.tint-card .card-title, .tint-card .card-body { color: inherit; }
.tint-card .card-body { opacity: 0.82; }
.tint-1 { background: var(--tint-1-bg); color: var(--tint-1-text); }
.tint-2 { background: var(--tint-2-bg); color: var(--tint-2-text); }
.tint-3 { background: var(--tint-3-bg); color: var(--tint-3-text); }
.tint-4 { background: var(--tint-4-bg); color: var(--tint-4-text); }

/* FAQ */
.faq-item { border-bottom: 1px solid rgba(255,255,255,0.15); padding: 20px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { color: #fff; font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.faq-a { color: var(--text-on-dark-faint); font-size: 14px; line-height: 1.7; }
.faq-item.light { border-bottom-color: var(--card-border); }
.faq-item.light .faq-q { color: var(--text-dark); }
.faq-item.light .faq-a { color: var(--text-muted); }

/* Location list */
.info-list { display: flex; flex-direction: column; gap: 16px; font-size: 15px; line-height: 1.7; }
.info-list .k { color: var(--accent-on-dark); margin-right: 10px; }
.info-list.light .k { color: var(--accent); }

/* Bilingual secondary line (English gloss under Chinese body copy) */
.bi-en { display: block; font-size: 0.86em; color: inherit; opacity: 0.62; font-style: italic; margin-top: 4px; }
.card-body .bi-en, .section-lead .bi-en, .faq-a .bi-en, .review-card .bi-en { opacity: 0.75; }

/* Fill-in marker */
.fillin { background: #FCE9C6; padding: 2px 6px; border-radius: 3px; }
.fillin-box { background: #FCE9C6; border-radius: 3px; padding: 16px 18px; font-size: 14px; line-height: 1.7; color: #6B5324; }

/* Footer */
footer { padding: 56px 40px; text-align: center; }
footer .foot-note { margin-top: 18px; color: #8A9694; font-size: 13px; }
footer .foot-social { margin-top: 8px; color: #8A9694; font-size: 12.5px; }
footer .foot-social a { color: #8A9694; text-decoration: underline; text-underline-offset: 2px; }
footer .foot-social a:hover { color: #333; }

/* Portfolio masonry — no-crop gallery, images keep natural aspect ratio */
.portfolio-masonry { columns: 3 280px; column-gap: 18px; margin-bottom: 8px; }
.portfolio-item { break-inside: avoid; margin-bottom: 18px; border-radius: 10px; overflow: hidden; border: 1px solid var(--card-border); background: #fff; }
.portfolio-item img { width: 100%; height: auto; display: block; }

/* Mobile-only compact fallback text under wide illustration images
   (hidden on desktop where the image's baked-in text is legible) */
.mobile-only-caption { display: none; }

/* Responsive */
@media (max-width: 900px) {
  .hero-inner { display: block !important; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }

  /* Hero photo pairs (family portrait / graduation hero images) —
     stack full-width instead of squeezing two side-by-side at ~50% each */
  .hero-photo-pair {
    flex-direction: column !important;
    width: 100% !important;
    gap: 18px !important;
    margin-top: 24px;
  }
  .hero-photo-item {
    width: 100% !important;
    margin-top: 0 !important;
  }
  .hero-photo-item img {
    max-height: none !important;
    width: 100% !important;
    height: auto !important;
  }
  /* Same treatment for pages where the two hero photos are bare <img> tags
     directly inside .hero-photo-pair (no wrapping .hero-photo-item div) */
  .hero-photo-pair > img {
    max-width: 100% !important;
    max-height: none !important;
    width: 100% !important;
    height: auto !important;
  }
  .site-nav { padding: 14px 20px; position: relative; }
  .nav-links { gap: 0; }
  .portfolio-masonry { columns: 2 180px; column-gap: 12px; }
  .portfolio-item { margin-bottom: 12px; }
  section, .hero { padding-left: 20px; padding-right: 20px; }

  /* Hamburger menu (pure CSS, no JS) */
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; font-size: 22px; line-height: 1;
    color: var(--text-dark); cursor: pointer; border-radius: 4px; flex-shrink: 0;
    order: 3;
  }
  .nav-toggle:hover { background: var(--bg-section-alt); }
  .nav-cta { order: 2; margin-right: 8px; }

  /* Collapsed by default: hide everything except the WhatsApp CTA */
  .nav-links > a:not(.nav-cta), .nav-links > span, .nav-links > .nav-dropdown { display: none; }

  /* Expanded panel when the checkbox is checked */
  .nav-toggle-checkbox:checked ~ .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid #ECE7DC;
    box-shadow: 0 12px 24px rgba(30,30,25,0.1);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 20px 18px; z-index: 55;
  }
  .nav-toggle-checkbox:checked ~ .nav-links > a:not(.nav-cta),
  .nav-toggle-checkbox:checked ~ .nav-links > span,
  .nav-toggle-checkbox:checked ~ .nav-links > .nav-dropdown {
    display: block; width: 100%;
  }
  .nav-toggle-checkbox:checked ~ .nav-links > a:not(.nav-cta),
  .nav-toggle-checkbox:checked ~ .nav-links > span {
    padding: 12px 0; border-bottom: 1px solid var(--card-border);
  }
  .nav-toggle-checkbox:checked ~ .nav-links > .nav-cta {
    order: 0; margin: 14px 0 0; text-align: center;
  }

  /* Service dropdowns become static, always-expanded sublists inside the mobile panel */
  .nav-toggle-checkbox:checked ~ .nav-links .nav-dropdown { padding: 12px 0; border-bottom: 1px solid var(--card-border); }
  .nav-toggle-checkbox:checked ~ .nav-links .nav-dropdown-toggle { pointer-events: none; }
  .nav-toggle-checkbox:checked ~ .nav-links .nav-dropdown-menu {
    position: static; transform: none; opacity: 1; visibility: visible;
    box-shadow: none; border: none; padding: 8px 0 0 12px; margin-top: 6px;
    min-width: 0;
  }
  .nav-toggle-checkbox:checked ~ .nav-links .nav-dropdown-menu a { padding: 8px 0; }

  .mobile-only-caption { display: block; }
}
