/* ============================================
   はまだ歯科・矯正クリニック
   Modern Responsive Stylesheet
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --color-primary: #1a4d8f;
  --color-primary-dark: #0f3460;
  --color-primary-light: #e8f0fe;
  --color-accent: #0d9488;
  --color-accent-light: #ccfbf1;
  --color-surface: #ffffff;
  --color-bg: #f8fafc;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-highlight: #dc2676;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  --max-width: 960px;
  --header-height: 72px;
  --nav-height: 48px;
  --transition: 0.25s ease;
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent);
}

ul, ol {
  padding-left: 1.5em;
}

h1, h2, h3, h4 {
  line-height: 1.4;
  color: var(--color-text);
}

strong {
  color: var(--color-highlight);
  font-weight: 600;
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* --- Site Header --- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-logo img {
  height: 48px;
  width: auto;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.header-tel {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.header-tel::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 4px;
  vertical-align: -3px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z'/%3E%3C/svg%3E") no-repeat center / contain;
}

.header-hours {
  font-size: 12px;
  white-space: nowrap;
}

/* Hamburger Menu Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  padding: 6px;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle span + span {
  margin-top: 6px;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* --- Navigation --- */
.site-nav {
  background: var(--color-primary-dark);
  position: sticky;
  top: var(--header-height);
  z-index: 99;
}

.site-nav ul {
  list-style: none;
  padding: 0;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
}

.site-nav li {
  flex: none;
}

.site-nav a {
  display: block;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.site-nav a.active {
  background: var(--color-accent);
  color: #ffffff;
}

/* --- Page Content --- */
.page-content {
  flex: 1;
  padding: 40px 0 60px;
}

/* --- Section Title --- */
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-surface);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  margin: 36px 0 20px;
  letter-spacing: 0.03em;
}

.section-title:first-child {
  margin-top: 0;
}

/* --- Card --- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 32px;
  margin-bottom: 24px;
}

/* --- Info Box --- */
.info-box {
  background: var(--color-primary-light);
  border-left: 4px solid var(--color-primary);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
  font-weight: 500;
  color: var(--color-primary-dark);
}

/* --- Label --- */
.label {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  margin: 20px 0 10px;
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.table-pricing {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-pricing th,
.table-pricing td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.table-pricing th {
  background: var(--color-primary-light);
  font-weight: 600;
  color: var(--color-primary-dark);
  font-size: 14px;
}

.table-pricing td:last-child {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-primary);
}

.table-pricing tr:last-child td {
  border-bottom: none;
}

.table-pricing tr:hover td {
  background: var(--color-bg);
}

/* Schedule Table */
.table-schedule {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.table-schedule th,
.table-schedule td {
  padding: 10px 14px;
  border: 1px solid var(--color-border-light);
}

.table-schedule th {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
}

.table-schedule td:first-child {
  text-align: left;
  background: var(--color-primary-light);
  font-weight: 500;
  white-space: nowrap;
}

.table-schedule .open {
  color: var(--color-accent);
  font-weight: 700;
}

.table-schedule .closed {
  color: #cbd5e1;
}

/* Description Table (for appliance/treatment descriptions) */
.table-desc {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-desc th {
  background: var(--color-primary-light);
  font-weight: 600;
  color: var(--color-primary-dark);
  padding: 12px 16px;
  text-align: left;
}

.table-desc td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
}

.table-desc td:first-child {
  font-weight: 600;
  white-space: nowrap;
  width: 180px;
  color: var(--color-primary-dark);
}

.table-desc tr:last-child td {
  border-bottom: none;
}

/* --- FAQ Section --- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-question {
  font-weight: 700;
  font-size: 15px;
  padding: 16px 20px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.faq-answer {
  padding: 16px 20px;
  line-height: 1.9;
}

/* --- Staff Card --- */
.staff-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 24px;
}

.staff-card-body {
  display: flex;
  gap: 24px;
  padding: 24px;
}

.staff-photo {
  flex-shrink: 0;
}

.staff-photo img {
  width: 160px;
  border-radius: var(--radius-sm);
}

.staff-info {
  flex: 1;
  min-width: 0;
}

.staff-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.staff-name-en {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.credential-label {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  margin: 12px 0 6px;
}

.credential-content {
  font-size: 14px;
  color: var(--color-text-secondary);
  padding-left: 4px;
}

.career-table {
  width: 100%;
  font-size: 14px;
}

.career-table td {
  padding: 4px 8px 4px 0;
  vertical-align: top;
  border: none;
}

.career-table td:first-child {
  white-space: nowrap;
  font-weight: 600;
  color: var(--color-primary);
  width: 100px;
}

/* --- Image Gallery / Carousel --- */
.carousel {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin: 20px 0;
}

.carousel-inner {
  position: relative;
}

.carousel-item {
  display: none;
  text-align: center;
  padding: 16px;
}

.carousel-item.active {
  display: block;
}

.carousel-item img {
  max-height: 340px;
  margin: 0 auto;
}

.carousel-caption {
  background: var(--color-primary-light);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-primary-dark);
}

.carousel-controls {
  display: flex;
  justify-content: space-between;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  pointer-events: none;
  padding: 0 8px;
}

.carousel-btn {
  pointer-events: all;
  background: rgba(26, 77, 143, 0.85);
  color: #ffffff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
  box-shadow: var(--shadow-md);
}

.carousel-btn:hover {
  background: var(--color-primary-dark);
  transform: scale(1.1);
}

/* --- Before/After --- */
.before-after {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.before-after figure {
  text-align: center;
}

.before-after figcaption {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--color-primary-dark);
}

.before-after .arrow {
  font-size: 32px;
  color: var(--color-accent);
  font-weight: 700;
}

/* --- Risk List --- */
.risk-list {
  counter-reset: risk;
  list-style: none;
  padding: 0;
}

.risk-list li {
  counter-increment: risk;
  padding: 10px 12px 10px 40px;
  position: relative;
  font-size: 14px;
  line-height: 1.7;
  border-bottom: 1px solid var(--color-border-light);
}

.risk-list li:last-child {
  border-bottom: none;
}

.risk-list li::before {
  content: counter(risk);
  position: absolute;
  left: 8px;
  top: 10px;
  width: 22px;
  height: 22px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Case Details --- */
.case-details {
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 14px;
}

.case-details dt {
  font-weight: 600;
  color: var(--color-primary-dark);
  display: inline;
}

.case-details dt::after {
  content: "：";
}

.case-details dd {
  display: inline;
  margin: 0;
}

.case-details dd::after {
  content: "";
  display: block;
  margin-bottom: 4px;
}

/* --- Notice --- */
.notice {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 12px 0;
}

.notice::before {
  content: "※";
  margin-right: 2px;
}

/* --- News / Info Section --- */
.news-section {
  margin: 24px 0;
}

.news-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 4px solid var(--color-accent);
}

#info {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  min-height: 60px;
}

#info p {
  margin: 0;
}

#info .ql-editor {
  padding: 0;
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, #0f3460 0%, #1a4d8f 40%, #1b6b93 100%);
  color: #ffffff;
  padding: 56px 20px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(13, 148, 136, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-sub {
  font-size: 13px;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.hero-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  color: #ffffff;
}

.hero-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 36px;
  letter-spacing: 0.08em;
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-feature {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  min-width: 200px;
  flex: 1;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: background var(--transition);
}

.hero-feature:hover {
  background: rgba(255, 255, 255, 0.16);
}

.hero-feature-icon {
  font-size: 24px;
  margin-bottom: 2px;
}

.hero-feature-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.65);
}

.hero-feature-text {
  font-size: 16px;
  font-weight: 700;
}

.hero-feature-text a {
  color: #ffffff;
  text-decoration: none;
}

.hero-feature-text a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .hero {
    padding: 40px 20px 36px;
  }

  .hero-title {
    font-size: 24px;
  }

  .hero-desc {
    margin-bottom: 28px;
  }

  .hero-features {
    flex-direction: column;
    align-items: center;
  }

  .hero-feature {
    max-width: 100%;
    width: 100%;
    flex-direction: row;
    padding: 14px 20px;
    gap: 12px;
    min-width: 0;
  }

  .hero-feature-icon {
    font-size: 22px;
    margin-bottom: 0;
  }

  .hero-feature-label {
    font-size: 10px;
  }

  .hero-feature-text {
    font-size: 15px;
  }
}

/* --- Image Grid --- */
.image-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.image-grid img {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* --- Map --- */
.map-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: 20px 0;
}

.map-container iframe {
  width: 100%;
  height: 400px;
  border: 0;
  display: block;
}

/* --- Contact Info Box --- */
.contact-box {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  font-size: 14px;
  line-height: 2;
  display: inline-block;
}

/* --- Site Footer --- */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.75);
  padding: 40px 0 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-heading {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
}

.footer-info p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.9;
}

.footer-schedule table {
  font-size: 13px;
  width: auto;
}

.footer-schedule th,
.footer-schedule td {
  padding: 4px 10px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-schedule th {
  background: rgba(255, 255, 255, 0.1);
  font-weight: 600;
  color: #ffffff;
}

.footer-copyright {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

/* --- Quill override --- */
.ql-container.ql-snow {
  border: none !important;
}

.ql-snow .ql-editor {
  padding: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.8;
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-small { font-size: 13px; }
.text-muted { color: var(--color-text-secondary); }
.mt-0 { margin-top: 0; }
.mt-sm { margin-top: 12px; }
.mt-md { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 12px; }
.mb-md { margin-bottom: 24px; }

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .header-info {
    display: none;
  }

  .header-tel-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--color-primary);
    flex-shrink: 0;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-primary-dark);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 99;
  }

  .site-nav.open {
    transform: translateX(0);
  }

  .site-nav ul {
    flex-direction: column;
    padding: 16px 0;
  }

  .site-nav a {
    padding: 14px 24px;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .page-content {
    padding: 24px 0 40px;
  }

  .card {
    padding: 20px;
  }

  .section-title {
    font-size: 17px;
    padding: 9px 16px;
    margin: 28px 0 16px;
  }

  .staff-card-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .staff-info {
    text-align: left;
  }

  .before-after {
    flex-direction: column;
  }

  .before-after .arrow {
    transform: rotate(90deg);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .table-schedule th,
  .table-schedule td {
    padding: 8px 6px;
    font-size: 13px;
  }

  .carousel-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .table-desc td:first-child {
    white-space: normal;
    width: auto;
  }
}

@media (min-width: 769px) {
  .header-tel-mobile {
    display: none;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 0 16px;
  }

  .card {
    padding: 16px;
    border-radius: var(--radius-sm);
  }

  .section-title {
    font-size: 16px;
    border-radius: var(--radius-sm);
  }

  .map-container iframe {
    height: 280px;
  }
}
