/* ============================================================
   SHARED DESIGN SYSTEM — Medical Home Classes
   Single source of truth for all inner pages.
   Homepage uses style.css + home/extra.css (do not touch).
   ============================================================ */

/* ---- RESET ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  background: #f6f9fc;
  color: #1f1f1f;
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
}

main {
  display: block;
  width: 100%;
}

a,
button,
input,
textarea,
select {
  min-width: 0;
}

/* ---- MEDIA SAFETY ---- */
img, picture, video, canvas, svg, iframe, embed, object {
  display: block;
  max-width: 100%;
}

img { height: auto; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: #b5b5b5; border-radius: 2px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   LAYOUT — Container
   ============================================================ */
.container {
  width: 92%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1rem;
}

.container--narrow {
  width: 92%;
  max-width: 860px;
  margin-inline: auto;
  padding-inline: 1rem;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: #000;
  border-bottom: 2px solid red;
  padding: 1.25rem 1rem;
  text-align: center;
}

.site-header .brand-name {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  color: red;
  text-decoration: none;
  display: inline-block;
  line-height: 1.2;
}

.site-header .brand-tagline {
  color: #f5f5f5;
  margin-top: 0.3rem;
  font-size: clamp(0.75rem, 2.5vw, 0.95rem);
  line-height: 1.4;
}

/* ============================================================
   NAV — Horizontal scroll pill menu (matches homepage)
   ============================================================ */
.site-nav {
  background: #fff;
  border-bottom: 1px solid #ddd;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  text-align: center;
}

.site-nav::-webkit-scrollbar { display: none; }

.site-nav .nav-inner {
  display: inline-flex;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
}

.site-nav a {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: #e8f1ff;
  border-radius: 20px;
  color: #0a3d62;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border: 1px solid #c8dfff;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.site-nav a:hover,
.site-nav a.active {
  background: #0077cc;
  color: #fff;
  border-color: #0077cc;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  color: #777;
  overflow-x: hidden;
}

.breadcrumb .container,
.breadcrumb .container--narrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  align-items: center;
}

.breadcrumb a {
  color: #0077cc;
  text-decoration: none;
  white-space: nowrap;
}

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: #aaa; }

/* ============================================================
   PAGE HERO — Inner page banner
   ============================================================ */
.page-hero {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: clamp(1.5rem, 4vw, 2.5rem) 1rem;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700;
  color: #0a3d62;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.page-hero p {
  color: #555;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  max-width: 640px;
  margin-inline: auto;
  line-height: 1.65;
}

/* ============================================================
   SECTION
   ============================================================ */
.section {
  max-width: 1280px;
  margin: clamp(2rem, 5vw, 3rem) auto;
  padding-inline: 1rem;
}

.section > h2 {
  text-align: center;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  color: #0a3d62;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.section-intro {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 1.5rem;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.7;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.button-row--compact {
  margin-top: 0.9rem;
}

.list-offset-top {
  margin-top: 0.6rem;
}

.mt-half {
  margin-top: 0.5rem;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: clamp(1.1rem, 3vw, 1.5rem);
  overflow-wrap: break-word;
  word-break: break-word;
}

.card h3 {
  color: #0a3d62;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card p {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.7;
}

.card ul {
  padding-left: 1.2rem;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.9;
}

/* ============================================================
   CARD GRID — auto-fit responsive
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

/* ============================================================
   BUTTON
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  background: #0077cc;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  text-decoration: none;
  border: none;
  cursor: pointer;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  transition: background 0.18s;
  overflow-wrap: normal;
  word-break: normal;
}

.btn:hover { background: #005ea3; }
.btn:disabled { background: #7ab8e8; cursor: not-allowed; }

.btn--full {
  display: block;
  width: 100%;
  white-space: normal;
}

.btn--compact {
  font-size: 0.9rem;
}

.btn--green  { background: #138808; }
.btn--green:hover  { background: #0f6606; }
.btn--grey   { background: #4a4a4a; }
.btn--grey:hover   { background: #333; }

.btn--grey:visited {
  color: #fff;
}

/* ============================================================
   FORM — shared form system
   ============================================================ */
.form-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: clamp(1.25rem, 4vw, 2rem);
  width: 100%;
}

.form-card h2 {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 700;
  color: #0a3d62;
  margin-bottom: 1.25rem;
  line-height: 1.3;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0a3d62;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.field input,
.field textarea,
.field select {
  display: block;
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  color: #1f1f1f;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 8px;
  line-height: 1.5;
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: #0077cc;
  box-shadow: 0 0 0 3px rgba(0, 119, 204, 0.12);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-note {
  font-size: 0.82rem;
  color: #777;
  text-align: center;
  margin-top: 0.9rem;
  line-height: 1.5;
}

.form-status {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: center;
}

.form-status--success { color: #0f6606; }
.form-status--error { color: #b02a2a; }

/* Legacy .form-box + .form-group — kept for homepage enroll form */
.form-box {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: clamp(1.25rem, 4vw, 2rem);
  width: 100%;
}

.form-box h2 {
  text-align: center;
  color: #0a3d62;
  margin-bottom: 1.25rem;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-weight: 600;
  color: #0a3d62;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid #bbb;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  color: #1f1f1f;
  font-family: inherit;
  transition: border-color 0.18s;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #0077cc;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* ============================================================
   INFO BOX
   ============================================================ */
.info-box {
  background: #f0f6ff;
  border-left: 4px solid #0077cc;
  padding: 1rem 1.2rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 1rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.info-box ul { padding-left: 1.2rem; }
.info-box li { margin-bottom: 0.4rem; color: #333; line-height: 1.7; }
.info-box p  { color: #333; line-height: 1.7; margin-bottom: 0.4rem; }
.info-box p:last-child { margin-bottom: 0; }

/* ============================================================
   CONTACT INFO BLOCK
   ============================================================ */
.contact-info-block {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: clamp(1.1rem, 3vw, 1.5rem);
  overflow-wrap: break-word;
  word-break: break-word;
}

.contact-info-block h3 {
  color: #0a3d62;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

.contact-info-block p {
  margin-bottom: 0.5rem;
  color: #333;
  font-size: 0.9rem;
  line-height: 1.65;
}

.contact-info-block strong { color: #0a3d62; }

.contact-info-block a { color: #0077cc; }

.contact-info-block--compact {
  max-width: 580px;
  margin: 1.25rem auto 0;
}

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-radius: 8px;
}

.table-wrap::-webkit-scrollbar { display: none; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 380px;
  font-size: 0.9rem;
}

table th,
table td {
  border: 1px solid #ddd;
  padding: 0.7rem 0.9rem;
  text-align: left;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: break-word;
}

table thead { background: #0a3d62; color: #fff; }
table tbody tr:nth-child(even) { background: #f8fbff; }

/* ============================================================
   BLOCKQUOTE
   ============================================================ */
blockquote {
  border-left: 4px solid #0a3d62;
  padding: 0.9rem 1.4rem;
  background: #eef3f7;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #333;
  line-height: 1.7;
}

/* ============================================================
   CODE
   ============================================================ */
pre {
  background: #1e1e1e;
  color: #eaeaea;
  padding: 1rem 1.2rem;
  border-radius: 8px;
  margin: 1rem 0;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}

code { font-family: 'Courier New', Courier, monospace; }

/* ============================================================
   MAP BOX
   ============================================================ */
.map-box {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #ddd;
  margin-top: 1.25rem;
  /* Responsive aspect ratio */
  position: relative;
  width: 100%;
  padding-bottom: 40%;
  min-height: 220px;
}

.map-box iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================================
   RELATED POSTS GRID
   ============================================================ */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.related-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.18s;
  overflow-wrap: break-word;
  word-break: break-word;
}

.related-card h4,
.related-card p,
.related-card .rc-category {
  overflow-wrap: break-word;
  word-break: break-word;
}

.related-card:hover { border-color: #0077cc; }

.related-card .rc-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0077cc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.related-card h4 {
  color: #0a3d62;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.related-card p {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.6;
}

.teacher-cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  margin-top: 1.5rem;
}

.teacher-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #ddd;
  padding: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.teacher-card-media {
  margin-bottom: 0.9rem;
}

.teacher-card img {
  width: 118px;
  height: 118px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto;
  display: block;
  border: 2px solid #d7e6f6;
}

.teacher-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 auto;
}

.teacher-card h4 {
  color: #0a3d62;
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: break-word;
}

.teacher-card-role {
  color: #555;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.55;
}

.teacher-card-summary {
  color: #666;
  font-size: 0.86rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  word-break: break-word;
}

.teacher-card .link a {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.45rem 1rem;
  background: #0077cc;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.18s;
}

.teacher-card .link a:hover { background: #005ea3; }

.profile-link-disabled {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.45rem 1rem;
  background: #eef3f7;
  color: #5b6770;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

/* ============================================================
   BLOG LISTING CARDS
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.blog-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s;
}

.blog-card:hover { border-color: #0077cc; }

.blog-card-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.blog-card-body {
  padding: 1.1rem 1.25rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0077cc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.blog-card h3 {
  color: #0a3d62;
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 0.4rem;
  overflow-wrap: break-word;
}

.blog-card p {
  color: #555;
  font-size: 0.875rem;
  flex: 1;
  margin-bottom: 0.9rem;
  line-height: 1.65;
}

.card-grid--form-layout {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  align-items: start;
}

.blog-card-meta {
  font-size: 0.78rem;
  color: #888;
}

/* ============================================================
   PROFILE
   ============================================================ */
.profile-wrap {
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(2.5rem, 6vw, 4rem);
}

.profile-header-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: clamp(1.5rem, 4vw, 2rem);
  text-align: center;
  margin-bottom: 1.5rem;
}

.profile-img {
  width: clamp(100px, 20vw, 150px);
  height: clamp(100px, 20vw, 150px);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #0077cc;
  margin-bottom: 1rem;
}

.profile-name {
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: #0a3d62;
  margin-bottom: 0.3rem;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.profile-role {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
}

.section-label {
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: #0a3d62;
  font-weight: 700;
  margin: 1.75rem 0 0.7rem;
  line-height: 1.3;
}

.back-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: #0077cc;
  color: #fff;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  margin-top: 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s;
}

.back-btn:hover { background: #005ea3; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #000;
  padding: clamp(2rem, 5vw, 3rem) 1rem clamp(1.5rem, 4vw, 2rem);
  border-top: 2px solid red;
  margin-top: clamp(2rem, 5vw, 3rem);
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  max-width: 1280px;
  margin: 0 auto clamp(1.5rem, 4vw, 2rem);
}

.footer-col h3 {
  color: #ff9933;
  font-size: 1.05rem;
  margin-bottom: 0.7rem;
  line-height: 1.3;
}

.footer-col h4 {
  color: #e8f1ff;
  font-size: 0.95rem;
  margin-bottom: 0.7rem;
  line-height: 1.3;
}

.footer-col p {
  color: #bbb;
  font-size: 0.875rem;
  line-height: 1.75;
  overflow-wrap: break-word;
  word-break: break-word;
  margin-bottom: 0.5rem;
}

.footer-col p:last-child { margin-bottom: 0; }

.footer-col ul { list-style: none; }

.footer-col ul li {
  margin-bottom: 0.3rem;
}

.footer-col ul li a {
  color: #bbb;
  font-size: 0.875rem;
  text-decoration: none;
  line-height: 1.75;
  transition: color 0.18s;
}

.footer-col ul li a:hover { color: #fff; }

.footer-col a {
  color: #bbb;
  text-decoration: none;
  overflow-wrap: break-word;
  word-break: break-word;
  transition: color 0.18s;
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid #2a2a2a;
  padding-top: 1.25rem;
  color: #777;
  font-size: 0.82rem;
  max-width: 1280px;
  margin: 0 auto;
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem 1.25rem;
}

.footer-bottom a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.18s;
}

.footer-bottom a:hover { color: #fff; }

.footer-credit {
  margin-top: 0;
  font-size: 0.78rem;
  color: #555;
}

.footer-credit a { color: #777; }
.footer-credit a:hover { color: #bbb; }

/* ============================================================
   UTILITY
   ============================================================ */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   Mobile-first — overrides for larger screens where needed
   ============================================================ */

/* ---- Tablet ≥ 600px ---- */
@media (min-width: 600px) {
  .map-box { padding-bottom: 35%; }
}

/* ---- Desktop ≥ 900px ---- */
@media (min-width: 900px) {
  .map-box { padding-bottom: 28%; }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1.5fr;
  }
}

/* ---- Large desktop ≥ 1200px ---- */
@media (min-width: 1200px) {
  .site-nav .nav-inner { gap: 0.75rem; }
}

/* ---- Mobile ≤ 599px ---- */
@media (max-width: 599px) {
  .site-footer { padding: 1.75rem 1rem 1.25rem; }

  .button-row {
    flex-direction: column;
  }

  .button-row .btn {
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .footer-bottom {
    font-size: 0.78rem;
    justify-content: center;
    text-align: center;
  }

  .page-hero { padding: 1.5rem 1rem; }

  .section { margin: 1.75rem auto; }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    padding: 0.7rem 1.3rem;
    font-size: 0.9rem;
  }

  table { font-size: 0.82rem; }

  table th,
  table td { padding: 0.55rem 0.65rem; }
}

/* ---- Very small ≤ 380px ---- */
@media (max-width: 380px) {
  .site-header .brand-tagline { font-size: 0.72rem; }
  .breadcrumb { font-size: 0.78rem; }
  .site-nav a { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
}
