:root {
  --green: #4f7a5e;
  --green-dark: #355741;
  --cream: #f7f4ee;
  --text: #2f3a33;
  --accent: #f2b632;
  --accent-dark: #dc9f1c;
  --muted: #66746b;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 60px; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  line-height: 1.55;
  background: #fff;
}

h1, h2, h3, .logo { font-family: Georgia, "Times New Roman", serif; }

img { max-width: 100%; display: block; }

.container { width: min(1100px, 92%); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #e5e9e6;
}
.nav-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 0;
}
.logo { font-size: 1.3rem; color: var(--green-dark); text-decoration: none; font-weight: bold; }
.logo span { color: var(--green); font-weight: normal; }
nav { display: flex; align-items: center; gap: 1.5rem; }
nav a { color: var(--text); text-decoration: none; }
nav a:hover { color: var(--green); }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--green);
  color: #fff !important;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn:hover { background: var(--green-dark); }
.btn-small { padding: 0.4rem 1rem; }

/* Hero */
.hero { background-size: cover; background-position: center; }
.hero-overlay {
  background: linear-gradient(rgba(30, 50, 38, 0.55), rgba(30, 50, 38, 0.55));
  color: #fff;
  padding: 4.5rem 0;
  text-align: center;
}
.hero h1 { font-size: clamp(1.8rem, 4.5vw, 3rem); margin-bottom: 0.6rem; }
.hero p { font-size: 1.15rem; margin-bottom: 1.5rem; opacity: 0.95; }

/* Sections */
.section { padding: 3rem 0; }
.section.alt { background: var(--cream); }
.section h2 { text-align: center; font-size: 1.9rem; color: var(--green-dark); }
.section-intro { text-align: center; color: var(--muted); margin: 0.3rem auto 1.75rem; max-width: 650px; }

/* Doctor: name and bio, centered block */
.doctor { max-width: 760px; margin: 0 auto; }
.doctor h3 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.doctor .role { color: var(--green); font-weight: 600; margin-bottom: 0.5rem; }
.doctor .bio p { color: var(--muted); }
.doctor .bio p + p { margin-top: 0.6rem; }

/* What Is 8-Constitution Medicine: short centered text block */
.prose { max-width: 760px; }
.prose h2 { margin-bottom: 0.9rem; }
.prose p { color: var(--muted); }
.prose p + p { margin-top: 0.7rem; }

/* Tags (Constitutions, Conditions): compact wrapping row. Cream on white
   sections, white on cream (.alt) sections, so they always stand out. */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tags li {
  display: flex; align-items: center;
  background: var(--cream); color: var(--green-dark);
  border: 1px solid #e6e0d4; border-radius: 999px;
  padding: 0.45rem 1rem; font-weight: 600; font-size: 0.95rem;
}
.section.alt .tags li { background: #fff; }
/* Balanced rows: equal-width tags, 4 per row (2 on phones), and a shorter
   last row is centered, e.g. 8 items → 4 + 4, 7 items → 4 + 3. */
.tags-4col { justify-content: center; }
.tags-4col li {
  flex: 0 0 calc((100% - 3 * 0.6rem) / 4);
  justify-content: center; text-align: center;
}

/* Visit & Contact: map/info left, form right */
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
.contact-left { display: flex; flex-direction: column; gap: 1rem; }
.map { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.map iframe { width: 100%; height: 230px; border: 0; display: block; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.info-block { background: #fff; border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); font-size: 0.92rem; }
.info-block h3 { color: var(--green-dark); font-size: 1.05rem; margin-bottom: 0.3rem; }
.info-block h3.mt { margin-top: 0.8rem; }
.info-block address { font-style: normal; margin-bottom: 0.3rem; }
.info-block a { color: var(--green); text-decoration: none; word-break: break-word; }
.info-block a:hover { text-decoration: underline; }
.directions { font-weight: 600; }
.hours { width: 100%; border-collapse: collapse; }
.hours th, .hours td { padding: 0.25rem 0; border-bottom: 1px solid #ebe8e1; }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: 0; }
.hours th { text-align: left; font-weight: 600; }
.hours td { text-align: right; color: var(--muted); }

/* Contact form */
.contact-form {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 0.8rem;
}
.contact-form h3 { color: var(--green-dark); font-size: 1.3rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.contact-form label { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 600; font-size: 0.9rem; }
.optional { font-weight: normal; color: var(--muted); }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit;
  font-weight: normal;
  padding: 0.55rem 0.75rem;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  background: #fff;
  width: 100%; min-width: 0; /* fill the column instead of using the default input width, which depends on the font and is much wider for Korean */
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
  border-color: var(--green);
}
.contact-form textarea { resize: vertical; }
.contact-form button { align-self: flex-start; border: 0; cursor: pointer; font: inherit; }
.contact-form button:disabled { opacity: 0.6; cursor: wait; }
.hp { position: absolute; left: -9999px; }
.form-status:empty { display: none; }
.form-status.success { color: var(--green-dark); font-weight: 600; }
.form-status.error { color: #b23b3b; font-weight: 600; }
.form-note { font-size: 0.8rem; color: var(--muted); }

/* Language toggle */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font: inherit; font-size: 0.9rem; font-weight: 700;
  background: var(--accent); color: var(--text);
  border: none; border-radius: 999px;
  padding: 0.35rem 0.9rem 0.35rem 0.6rem; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: background 0.2s, transform 0.1s;
}
.lang-toggle:hover { background: var(--accent-dark); }
.lang-toggle:active { transform: translateY(1px); }
.lang-toggle:focus-visible { outline: 3px solid var(--green-dark); outline-offset: 2px; }
.lang-toggle .flag {
  height: 16px; width: auto; display: block;
  border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

/* Korean: break lines between words, not mid-word */
html[lang="ko"] body { word-break: keep-all; }

/* Footer */
.site-footer { background: var(--green-dark); color: #dfe8e1; text-align: center; padding: 1rem 0; font-size: 0.85rem; }

/* Responsive */
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  nav a:not(.btn) { display: none; }
  .hero-overlay { padding: 3.5rem 0; }
  .info-grid, .form-row { grid-template-columns: 1fr; }
  .tags-4col li { flex: 1 1 calc((100% - 0.6rem) / 2); } /* 2 per row; a tag too long to share a row fills it */
}
