/* ============================================================================
   Misamis Oriental Health Directory — design system & components
   Tailwind (CDN) provides utilities; this file defines tokens, custom
   components, the SVG icon language, animations, and accessibility polish.
   ========================================================================== */

:root {
  --brand: #1E40AF;
  --brand-deep: #0369A1;
  --wellness: #10B981;
  --wellness-deep: #059669;
  --ink: #1F2937;
  --ink-soft: #6B7280;
  --mist: #F3F4F6;
  --line: #E5E7EB;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(30, 64, 175, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

.container { max-width: 1160px; }

/* Screen-reader only + skip link ------------------------------------------ */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 50%; transform: translateX(-50%) translateY(-140%);
  top: 8px; z-index: 100; background: var(--brand); color: #fff;
  padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14px;
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateX(-50%) translateY(0); }

/* Focus visibility (a11y) -------------------------------------------------- */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(30, 64, 175, 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Header ------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo-mark { display: inline-flex; box-shadow: var(--shadow-sm); border-radius: 12px; }
.logo-mark--sm { box-shadow: none; }
.nav-link { color: var(--ink-soft); transition: color .15s ease; }
.nav-link:hover { color: var(--brand); }
.mobile-nav-link { padding: 10px 8px; border-radius: 8px; color: var(--ink); }
.mobile-nav-link:hover { background: var(--brand-50, #EFF4FF); color: var(--brand); }

/* Buttons ------------------------------------------------------------------ */
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--brand); border: 1.5px solid var(--brand);
  padding: 11px 20px; border-radius: 11px; font-weight: 600; font-size: 14px;
  transition: background .15s ease, transform .15s ease;
}
.btn-secondary:hover { background: var(--brand-50, #EFF4FF); }
.btn-ghost {
  background: #fff; color: var(--ink-soft); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 13px;
  transition: border-color .15s ease, color .15s ease;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-white {
  display: inline-flex; align-items: center; background: #fff; color: var(--brand);
  padding: 12px 22px; border-radius: 11px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-sm); transition: transform .15s ease;
}
.btn-white:hover { transform: translateY(-1px); }
.btn-outline-white {
  display: inline-flex; align-items: center; background: transparent; color: #fff;
  border: 1.5px solid rgba(255,255,255,0.7); padding: 12px 22px; border-radius: 11px;
  font-weight: 600; font-size: 14px; transition: background .15s ease;
}
.btn-outline-white:hover { background: rgba(255,255,255,0.12); }

/* Hero --------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(1000px 460px at 18% -10%, rgba(30,64,175,0.12), transparent 60%),
    radial-gradient(760px 420px at 92% 0%, rgba(16,185,129,0.12), transparent 60%),
    linear-gradient(180deg, #F7FAFF 0%, #FFFFFF 70%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(30,64,175,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,64,175,0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 70%);
}
.hero-eyebrow {
  display: inline-block; background: var(--wellness-50, #ECFDF5); color: var(--wellness-deep);
  border: 1px solid rgba(16,185,129,0.25); font-weight: 600; font-size: 12.5px;
  padding: 6px 14px; border-radius: 999px;
}
.hero-search {
  display: flex; align-items: center; gap: 8px; position: relative;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 8px 8px 8px 14px;
  max-width: 680px; margin-left: auto; margin-right: auto;
}
.hero-search-icon { color: var(--ink-soft); display: inline-flex; flex: none; }
.hero-search-input {
  flex: 1; border: none; outline: none; font-size: 15px; color: var(--ink);
  padding: 12px 6px; background: transparent; min-width: 0;
}
.hero-search-input::placeholder { color: #9CA3AF; }
.hero-search-btn {
  flex: none; background: var(--brand); color: #fff; border: none;
  padding: 12px 20px; border-radius: 11px; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s ease;
}
.hero-search-btn:hover { background: #1b3a9e; }
.quick-term {
  color: var(--brand); font-weight: 600; text-decoration: underline;
  text-underline-offset: 2px; background: none; border: none; cursor: pointer;
  font-size: inherit; padding: 0;
}

/* Section headings --------------------------------------------------------- */
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.section-title {
  font-family: '"Plus Jakarta Sans"', 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; font-size: clamp(1.5rem, 3vw, 2rem); color: var(--ink);
}
.section-sub { color: var(--ink-soft); margin-top: .6rem; font-size: 1rem; }

/* Filters ------------------------------------------------------------------ */
.filters {
  display: grid; gap: 14px; grid-template-columns: 1fr;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
@media (min-width: 640px) { .filters { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .filters { grid-template-columns: repeat(5, 1fr); } }
.filter-field { display: flex; flex-direction: column; gap: 6px; }
.filter-field label {
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .03em;
}
.filter-field select {
  appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round'><path d='M3 5l4 4 4-4'/></svg>") no-repeat right 12px center;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 34px 10px 12px;
  font-size: 14px; color: var(--ink); cursor: pointer; width: 100%;
}

/* Result tabs -------------------------------------------------------------- */
.result-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.result-tab {
  background: #fff; border: 1px solid var(--line); color: var(--ink-soft);
  padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 13px;
  cursor: pointer; transition: all .15s ease;
}
.result-tab:hover { border-color: var(--brand); color: var(--brand); }
.result-tab.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.result-count { color: var(--ink-soft); font-size: 13px; margin-bottom: 14px; }

/* Results grid & cards ----------------------------------------------------- */
.results-grid, .featured-grid {
  display: grid; gap: 18px; grid-template-columns: 1fr;
}
@media (min-width: 640px) { .results-grid, .featured-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .results-grid, .featured-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex; flex-direction: column; height: 100%;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #D6DEEE; }

.card-tag {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.tag-professional { background: #EFF4FF; color: var(--brand); }
.tag-facility { background: #ECFEFF; color: #0E7490; }
.tag-program { background: #ECFDF5; color: var(--wellness-deep); }

.card-title { font-family: '"Plus Jakarta Sans"', 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 1.05rem; color: var(--ink); line-height: 1.3; }
.card-sub { color: var(--brand); font-weight: 600; font-size: .9rem; margin-top: 2px; }
.card-meta { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.meta-row { display: flex; align-items: flex-start; gap: 8px; font-size: .875rem; color: var(--ink-soft); }
.meta-row svg { flex: none; margin-top: 2px; color: #9CA3AF; }
.card-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.detail-link {
  display: inline-flex; align-items: center; gap: 5px; color: var(--brand);
  font-weight: 600; font-size: .875rem; background: none; border: none; cursor: pointer;
}
.detail-link:hover { text-decoration: underline; }

/* Avatar (professional) ---------------------------------------------------- */
.avatar {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.card-head-row { display: flex; align-items: center; gap: 12px; }
.spec-icon { display: inline-flex; }

/* Accreditation badge ------------------------------------------------------ */
.badge-ph {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
  font-weight: 600; padding: 3px 9px; border-radius: 999px;
}
.badge-ph.yes { background: #ECFDF5; color: var(--wellness-deep); }
.badge-ph.no { background: var(--mist); color: var(--ink-soft); }

/* Service chips ------------------------------------------------------------ */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { background: var(--mist); color: var(--ink); font-size: 12px; padding: 4px 10px; border-radius: 8px; }

/* Program extras ----------------------------------------------------------- */
.prog-block { margin-top: 12px; }
.prog-block h4 { font-size: 12px; font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.prog-block ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.prog-block li { position: relative; padding-left: 18px; font-size: .85rem; color: var(--ink-soft); }
.prog-block li::before { content: ""; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--wellness); }

/* No results --------------------------------------------------------------- */
.no-results { text-align: center; padding: 48px 16px; color: var(--ink-soft);
  background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }

/* Government cards ---------------------------------------------------------- */
.gov-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow-sm); }
.gov-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.gov-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.gov-icon--blue { background: #EFF4FF; color: var(--brand); }
.gov-icon--green { background: #ECFDF5; color: var(--wellness-deep); }
.gov-title { font-family: '"Plus Jakarta Sans"', 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.gov-provider { font-size: .85rem; color: var(--ink-soft); }
.gov-intro { color: var(--ink-soft); font-size: .95rem; margin-bottom: 14px; }
.gov-list { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 10px; }
.gov-list li { position: relative; padding-left: 26px; font-size: .92rem; color: var(--ink); line-height: 1.5; }
.gov-list li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--wellness-50, #ECFDF5);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23059669' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M2 6l3 3 5-6'/></svg>");
  background-repeat: no-repeat; background-position: center;
}
.gov-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 600; font-size: .92rem; }
.gov-link:hover { text-decoration: underline; }

/* How it works ------------------------------------------------------------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .steps { grid-template-columns: repeat(5, 1fr); } }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; font-weight: 800; font-size: 17px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; margin-bottom: 12px;
}
.step h3 { font-family: '"Plus Jakarta Sans"', 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.step p { color: var(--ink-soft); font-size: .9rem; margin-top: 6px; }

/* CTA band ----------------------------------------------------------------- */
.cta-band { padding: 4rem 0; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%); color: #fff; }
.cta-inner { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .cta-inner { grid-template-columns: 1.2fr 1fr; } }
.cta-copy p { color: rgba(255,255,255,0.85); margin-top: 10px; max-width: 46ch; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.hotlines { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.hotlines li { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); border-radius: 12px; padding: 14px 16px; }
.hotline-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,0.75); margin-bottom: 4px; }
.hotlines a { color: #fff; font-weight: 700; font-size: 1.05rem; }
.hotlines a:hover { text-decoration: underline; }

/* FAQ ---------------------------------------------------------------------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; font-weight: 600; font-size: 1rem; color: var(--ink);
}
.faq-q:hover { background: #FAFBFF; }
.faq-icon { flex: none; color: var(--brand); transition: transform .2s ease; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .28s ease; }
.faq-a-inner { padding: 0 20px 18px; color: var(--ink-soft); font-size: .95rem; line-height: 1.6; }

/* Footer ------------------------------------------------------------------- */
.site-footer { background: #0F1B3D; color: #fff; padding: 3.5rem 0 2rem; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-text { color: rgba(255,255,255,0.7); font-size: .9rem; line-height: 1.6; }
.footer-title { font-weight: 700; font-size: .95rem; margin-bottom: 12px; color: #fff; }
.footer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-list li, .footer-list a { color: rgba(255,255,255,0.7); font-size: .875rem; line-height: 1.5; }
.footer-list a:hover { color: #fff; text-decoration: underline; }
.footer-disclaimer { margin-top: 34px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,0.12); }
.footer-disclaimer p { color: rgba(255,255,255,0.7); font-size: .82rem; line-height: 1.6; max-width: 80ch; }

/* Animations --------------------------------------------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeUp .45s ease both; }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .animate-in, .reveal { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
}
