/* ============================================================
   APSCI — Asia Pacific Society for Ceramic Implantology
   Brand palette: #004b46 (deep teal) / #008e80 (teal) / #def3f6 (aqua mist)
   Local Roboto fonts.
   ============================================================ */

/* ---------- Local Roboto ---------- */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/roboto-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/roboto-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/roboto-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/roboto-700.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
  --teal-900: #004b46;
  --teal-600: #008e80;
  --aqua-100: #def3f6;
  --charcoal: #1f2a2a;
  --muted: #566363;
  --line: #e2ecec;
  --white: #ffffff;
  --bg-soft: #f6fbfb;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 75, 70, 0.08);
  --shadow-lg: 0 20px 50px rgba(0, 75, 70, 0.14);
  --maxw: 1180px;
  --font: 'Roboto', -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(0, 142, 128, 0.15);
}

/* Lock scroll when the mobile nav is open */
body.nav-open { overflow: hidden; }

/* Media never forces horizontal scroll */
img, svg, video, iframe { max-width: 100%; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; color: var(--teal-900); margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.1em; }
a { color: var(--teal-600); text-decoration: none; transition: color .15s; }
a:hover { color: var(--teal-900); }
img { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.section { padding: 72px 0; }
.section--soft { background: var(--bg-soft); }
.section--mist { background: var(--aqua-100); }
.text-center { text-align: center; }
.lead { font-size: 1.2rem; color: var(--muted); font-weight: 300; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--teal-600); margin-bottom: .6rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 500;
  font-size: .98rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .18s ease;
}
.btn--primary { background: var(--teal-600); color: #fff; }
.btn--primary:hover { background: var(--teal-900); color: #fff; transform: translateY(-2px); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.65); }
.btn--ghost:hover { background: #fff; color: var(--teal-900); }
.btn--dark { background: var(--teal-900); color: #fff; }
.btn--dark:hover { background: var(--teal-600); color: #fff; transform: translateY(-2px); }
.btn--outline { background: transparent; color: var(--teal-900); border-color: var(--teal-600); }
.btn--outline:hover { background: var(--teal-600); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.navbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; max-width: 300px; }
.brand img { height: 46px; width: auto; }
.brand .brand-text { font-weight: 700; color: var(--teal-900); line-height: 1.1; font-size: 1.05rem; }
.brand .brand-text small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; letter-spacing: .02em; }
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links li { display: flex; align-items: center; }
.nav-links a { display: inline-flex; align-items: center; color: var(--charcoal); font-weight: 500; font-size: .92rem; line-height: 1; white-space: nowrap; padding: 10px 11px; border-radius: 8px; }
.nav-links a:hover, .nav-links a.active { color: var(--teal-900); background: var(--aqua-100); }
.nav-cta { margin-left: 8px; }
.nav-cta a.btn { padding: 10px 18px; }
@media (max-width: 1150px) {
  .brand .brand-text small { display: none; }
  .nav-links a { padding: 10px 9px; font-size: .88rem; }
}
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 10px; margin: -10px -6px -10px 0; border-radius: 10px;
  min-width: 44px; min-height: 44px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px; background: var(--teal-900);
  margin: 5px auto; border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: #fff;
  background:
    linear-gradient(130deg, rgba(0,75,70,.96), rgba(0,142,128,.88)),
    url('/assets/hero.svg') center/cover no-repeat;
  padding: 88px 0 80px;
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero-copy { min-width: 0; }
.hero h1 { color: #fff; max-width: 16ch; }
.hero .pillars { color: var(--aqua-100); font-weight: 500; letter-spacing: .02em; margin-bottom: 1.2rem; }
.hero p { color: rgba(255,255,255,.92); max-width: 56ch; font-size: 1.12rem; }
.hero .hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.hero-figure { display: flex; justify-content: center; }
.hero-figure img { width: 100%; max-width: 480px; height: auto; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-figure { order: -1; }
  .hero-figure img { max-width: 320px; }
}

/* ---------- Pillars ---------- */
.pillar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.pillar {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pillar .icon {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  background: var(--aqua-100); color: var(--teal-900); margin-bottom: 14px;
}
.pillar h3 { margin-bottom: .3em; }
.pillar p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- Generic grids ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 42px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }

/* ---------- Cards ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .card-media { aspect-ratio: 16/10; background: var(--aqua-100); overflow: hidden; }
.card .card-media img { width: 100%; height: 100%; object-fit: cover; }
.card .card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.card .card-body h3 { margin-bottom: .4em; }
.card .meta { font-size: .82rem; color: var(--muted); margin-bottom: .6rem; }
.card .card-body p { color: var(--muted); font-size: .95rem; }
.card .card-body .btn { margin-top: auto; align-self: flex-start; }

/* ---------- Team ---------- */
.team-card { text-align: center; }
.team-card .card-media { aspect-ratio: 1/1; border-radius: 50%; width: 170px; height: 170px; margin: 26px auto 0; }
.team-card .card-media img { border-radius: 50%; }
.team-card .qualifications { color: var(--teal-600); font-weight: 500; font-size: .9rem; }

/* ---------- Content / prose ---------- */
.prose { max-width: 820px; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }
.prose img { border-radius: var(--radius); margin: 1.4em 0; }

/* ---------- Page hero (inner) ---------- */
.page-hero {
  background: linear-gradient(130deg, var(--teal-900), var(--teal-600));
  color: #fff; padding: 70px 0 60px;
}
.page-hero h1 { color: #fff; margin-bottom: .2em; }
.page-hero p { color: var(--aqua-100); margin: 0; }
.breadcrumbs { font-size: .85rem; color: rgba(255,255,255,.75); margin-bottom: 1rem; }
.breadcrumbs a { color: rgba(255,255,255,.9); }

/* ---------- Event detail ---------- */
.event-meta { display: flex; flex-wrap: wrap; gap: 26px; margin: 20px 0; }
.event-meta .item { background: var(--aqua-100); border-radius: 10px; padding: 12px 18px; }
.event-meta .item strong { display: block; color: var(--teal-900); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; font-size: .92rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 1rem; background: #fff; color: var(--charcoal);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--teal-600); box-shadow: 0 0 0 3px rgba(0,142,128,.15);
}
.field textarea { min-height: 130px; resize: vertical; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }

.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 18px; }
.alert--success { background: #e3f6ef; color: #0b5e46; border: 1px solid #b9e6d4; }
.alert--error { background: #fdecec; color: #8a2020; border: 1px solid #f3c2c2; }
.error-text { color: #b02121; font-size: .85rem; margin-top: 4px; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; }
.faq details { border: 1px solid var(--line); border-radius: 10px; padding: 4px 18px; margin-bottom: 12px; background: #fff; }
.faq summary { cursor: pointer; font-weight: 500; padding: 14px 0; color: var(--teal-900); }
.faq details[open] summary { color: var(--teal-600); }
.faq p { color: var(--muted); padding-bottom: 14px; margin: 0; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(120deg, var(--teal-900), var(--teal-600)); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--aqua-100); max-width: 60ch; margin: 0 auto 24px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--teal-900); color: #cfe6e3; padding: 56px 0 24px; }
.site-footer a { color: #cfe6e3; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 36px; margin-bottom: 36px; }
.footer-grid h4 { color: #fff; font-size: 1rem; margin-bottom: 1em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.site-footer .brand img { height: 40px; width: auto; display: block; background: #fff; padding: 7px 10px; border-radius: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .85rem; }
.footer-bottom a { margin-left: 16px; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 40px; list-style: none; padding: 0; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; }
.pagination .active span { background: var(--teal-600); color: #fff; border-color: var(--teal-600); }

/* ---------- Responsive ---------- */

/* Tablet / small laptop */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* Mobile nav + stacking */
@media (max-width: 900px) {
  .pillar-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  .nav-links {
    position: fixed; top: 76px; left: 0; right: 0; bottom: 0;
    background: #fff;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 2px; padding: 14px 22px calc(28px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    box-shadow: var(--shadow); display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links.open { display: flex; }
  .nav-links li { display: block; }
  .nav-links a {
    display: block; width: 100%;
    padding: 14px 14px; font-size: 1.02rem;
    border-radius: 10px; min-height: 48px;
  }
  .nav-cta { margin: 10px 0 0; }
  .nav-cta a.btn { display: block; text-align: center; padding: 14px 18px; }
  .nav-toggle { display: block; }

  .form .row { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .event-meta { gap: 14px; }
}

/* Phones */
@media (max-width: 600px) {
  .container { padding: 0 18px; }
  .pillar-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .brand .brand-text small { display: none; }
  .brand .brand-text { font-size: .98rem; }

  .section { padding: 44px 0; }
  h1 { font-size: clamp(1.8rem, 7vw, 2.3rem); }
  h2 { font-size: clamp(1.35rem, 5.5vw, 1.8rem); }
  .lead { font-size: 1.08rem; }

  .hero { padding: 56px 0 52px; }
  .hero p { font-size: 1.02rem; }
  .hero .hero-actions { gap: 10px; }
  .hero .hero-actions .btn { flex: 1 1 auto; text-align: center; }

  .page-hero { padding: 48px 0 40px; }

  .card .card-body { padding: 18px; }
  .form-card { padding: 22px; }

  /* Comfortable tap targets */
  .btn { padding: 14px 24px; min-height: 48px; }
  .faq summary { padding: 16px 0; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-bottom a { margin-left: 0; margin-right: 16px; }

  .team-card .card-media { width: 140px; height: 140px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .brand img, .brand .brand-text { } /* keep brand compact */
  .brand .brand-text { font-size: .9rem; }
  .hero h1 { max-width: none; }
}

/* Short landscape phones: let the open menu scroll */
@media (max-height: 480px) and (max-width: 900px) {
  .nav-links { padding-top: 10px; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
