@charset "UTF-8";

/* =========================================================================
   Variables & Reset
   ========================================================================= */
:root {
  /* Colors - using logo color as base */
  --primary: #1c9c8d;        /* Logo teal/green */
  --primary-dark: #157367;
  --primary-light: #e6f5f3;
  --accent: #116157;         /* Deep teal */
  --accent-light: #e0f0ef;
  --text-main: #333333;
  --text-muted: #666666;
  --bg-color: #fafbfc;
  --bg-white: #ffffff;
  --border-color: #e2e8e8;
  
  /* Layout */
  --max-width: 1200px;
  --header-height: 90px;
  
  /* Typography */
  --font-family-base: "Noto Serif JP", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "MS PMincho", serif;
  --font-family-serif: "Noto Serif JP", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "MS PMincho", serif;
  
  /* Shadows & Transitions */
  --shadow-sm: 0 4px 10px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 25px rgba(0,0,0,0.08);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family-base);
  color: var(--text-main);
  background-color: var(--bg-color);
  line-height: 1.9;
  letter-spacing: 0.08em;
  -webkit-font-smoothing: antialiased;
}

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

ul, ol {
  list-style: none;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }
}

/* =========================================================================
   Typography & Utilities
   ========================================================================= */
.section-title {
  text-align: center;
  margin-bottom: 60px;
}

.section-title .en {
  font-family: var(--font-family-serif);
  font-size: 2rem;
  color: var(--accent);
  display: block;
  margin-bottom: 5px;
  letter-spacing: 0.1em;
}

.section-title .ja {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-main);
  letter-spacing: 0.2em;
}

.text-center {
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 40px;
  background-color: var(--primary);
  color: #fff;
  border-radius: 50px;
  font-weight: 500;
  letter-spacing: 0.1em;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-dark);
  border-radius: 50px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s ease;
  z-index: -1;
}

.btn:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.btn-accent {
  background-color: var(--accent);
}

.btn-accent::after {
  background-color: #0b453e;
}

/* =========================================================================
   Header & Navigation
   ========================================================================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 15px rgba(0,0,0,0.05);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.header-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  display: flex;
  align-items: center;
}

.logo img {
  height: 50px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links li a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  position: relative;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-action {
  display: flex;
  gap: 15px;
}

.btn-mutsu {
  background: var(--primary);
  color: #fff;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  box-shadow: 0 4px 15px rgba(28, 156, 141, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-mutsu:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(28, 156, 141, 0.5);
}

.btn-reserve {
  background-color: var(--primary);
  color: #fff;
  padding: 10px 25px;
  border-radius: 30px;
  font-weight: bold;
  font-size: 0.9rem;
}

/* =========================================================================
   Hero Section
   ========================================================================= */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  width: 100%;
  overflow: hidden;
  margin-top: 0;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../img/hero_main.jpg');
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 10%;
  max-width: 800px;
}

.hero-title {
  font-family: var(--font-family-serif);
  font-size: 3.5rem;
  line-height: 1.4;
  color: var(--primary-dark);
  margin-bottom: 20px;
  font-weight: 700;
  text-shadow: 0 0 15px rgba(255, 255, 255, 1), 0 0 30px rgba(255, 255, 255, 1), 0 0 5px rgba(255, 255, 255, 1);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s ease 0.5s forwards;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px rgba(255, 255, 255, 1), 0 0 20px rgba(255, 255, 255, 0.8), 0 0 5px rgba(255, 255, 255, 1);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s ease 0.8s forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================================
   News Section
   ========================================================================= */
.section-news {
  padding: 100px 0;
  background-color: var(--bg-white);
}

.news-list {
  max-width: 900px;
  margin: 0 auto;
}

.news-item {
  display: flex;
  padding: 25px 0;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.news-item:hover {
  padding-left: 10px;
}

.news-item:first-child {
  border-top: 1px solid var(--border-color);
}

.news-date {
  font-size: 1rem;
  color: var(--primary);
  width: 140px;
  flex-shrink: 0;
}

.news-tag {
  font-size: 0.8rem;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  padding: 3px 12px;
  border-radius: 2px;
  margin-right: 20px;
  white-space: nowrap;
}

.news-tag.new {
  background-color: #fff0f0;
  color: #e53935;
}

.news-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
}

.news-content-hidden {
  display: none;
  padding-top: 15px;
  line-height: 1.8;
  color: var(--text-main);
  border-top: 1px solid var(--border-color);
  margin-top: 15px;
}

.news-item {
  display: block; /* Change from flex to block to handle accordion better */
  padding: 25px 0;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: pointer;
}

.news-item.active .news-content-hidden {
  display: block;
}

.news-item:hover {
  background-color: rgba(28, 156, 141, 0.02);
}

.news-item-header {
  display: flex;
  align-items: center;
  width: 100%;
}

.news-item-header::after {
  content: '▼';
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--primary);
  transition: transform 0.3s ease;
}

.news-item.active .news-item-header::after {
  transform: rotate(180deg);
}

/* =========================================================================
   About Clinic Section (当院について)
   ========================================================================= */
.section-about {
  padding: 120px 0;
  background-color: var(--bg-color);
  position: relative;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-image {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.about-image img {
  width: 100%;
  height: 500px;
  object-fit: cover;
}

.about-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  pointer-events: none;
}

.about-text h3 {
  font-family: var(--font-family-serif);
  font-size: 2.2rem;
  color: var(--primary-dark);
  margin-bottom: 30px;
  line-height: 1.5;
}

.about-text p {
  margin-bottom: 25px;
  font-size: 1.05rem;
}

/* =========================================================================
   Departments Section (診療案内)
   ========================================================================= */
.section-departments {
  padding: 120px 0;
  background-color: var(--bg-white);
}

.dept-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
}

.dept-card {
  background: var(--bg-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.dept-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
}

.dept-img {
  height: 220px;
  background-size: cover;
  background-position: center;
}

.dept-content {
  padding: 40px 30px;
}

.dept-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 20px;
}

.dept-title {
  font-family: var(--font-family-serif);
  font-size: 1.6rem;
  color: var(--primary-dark);
  margin-bottom: 15px;
}

.dept-desc {
  color: var(--text-muted);
  margin-bottom: 25px;
}

.dept-link {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  font-weight: 500;
  font-size: 0.95rem;
}

.dept-link i {
  margin-left: 8px;
  transition: transform 0.3s;
}

.dept-card:hover .dept-link i {
  transform: translateX(5px);
}

/* =========================================================================
   Features / Amenities
   ========================================================================= */
.section-features {
  padding: 120px 0;
  background-color: var(--primary-dark);
  color: #fff;
}

.section-features .section-title .en {
  color: var(--accent-light);
}

.section-features .section-title .ja {
  color: #fff;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.feature-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}

.feature-img {
  height: 300px;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}

.feature-item:hover .feature-img {
  transform: scale(1.05);
}

.feature-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px;
}

.feature-title {
  font-family: var(--font-family-serif);
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 10px;
}

.feature-desc {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.feature-item:hover .feature-desc {
  opacity: 1;
  transform: translateY(0);
}


/* =========================================================================
   Floating Action Button (Constant Display)
   ========================================================================= */
.fab-container {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.fab {
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transition: var(--transition);
  text-decoration: none;
}

.fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.fab-mutsu {
  background: #ffffff;
  color: var(--primary-dark);
  border: 2px solid var(--primary);
  border-radius: 40px;
  padding: 18px 30px;
  gap: 12px;
}

.fab-mutsu i {
  font-size: 1.3rem;
  color: var(--primary);
}

.fab-mutsu span {
  font-size: 1.05rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.fab-reserve {
  background-color: var(--primary);
  color: #fff;
  border-radius: 12px;
  padding: 15px;
  width: auto;
  height: auto;
  flex-direction: row;
  gap: 10px;
}

.fab-reserve span {
  font-size: 1rem;
}

/* =========================================================================
   Footer
   ========================================================================= */
footer {
  background-color: #2b3030;
  color: #fff;
  padding: 80px 0 30px;
}

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

.footer-info .logo-text {
  font-family: var(--font-family-serif);
  font-size: 1.8rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.footer-info .logo-text img {
  height: 60px;
}

.footer-details {
  color: #aaa;
  margin-bottom: 25px;
}

.footer-tel {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-links h4 {
  font-size: 1.1rem;
  margin-bottom: 25px;
  color: var(--accent);
  position: relative;
  padding-bottom: 10px;
}

.footer-links h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--accent);
}

.footer-links ul li {
  margin-bottom: 15px;
}

.footer-links ul li a {
  color: #ccc;
  font-size: 0.95rem;
}

.footer-links ul li a:hover {
  color: #fff;
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #888;
  font-size: 0.85rem;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 992px) {
  .hero-title {
    font-size: 2.8rem;
  }
  .about-grid, .footer-inner {
    grid-template-columns: 1fr;
  }
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    margin-left: auto;
    font-size: 1.8rem;
    color: var(--primary-dark);
    background: transparent;
    border: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
  }
  
  .nav-links {
    position: fixed;
    top: var(--header-height, 90px);
    left: 0;
    width: 100%;
    height: calc(100vh - 90px);
    background: rgba(255, 255, 255, 0.98);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 40px;
    gap: 25px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 999;
    border-top: 1px solid #eee;
  }

  .nav-links.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links li a {
    font-size: 1.2rem;
    padding: 15px;
    display: block;
    color: var(--primary-dark);
  }

  .btn-mutsu, .btn-reserve, .header-action {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding: 0 15px;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-content {
    padding: 0 20px;
    text-align: center;
    align-items: center;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .fab-container {
    right: 15px;
    bottom: 15px;
  }
}

/* --- Mobile Optimization (iPhone 16 Pro / Small Mobile) --- */
@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }
  .hero-title {
    font-size: 1.8rem;
    line-height: 1.3;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .section-title .en {
    font-size: 1.5rem;
  }
  .section-title .ja {
    font-size: 1rem;
  }
  .news-item-header {
    flex-wrap: wrap;
  }
  .news-date {
    width: 100%;
    margin-bottom: 5px;
    font-size: 0.9rem;
  }
  .news-tag {
    margin-right: 10px;
    padding: 2px 8px;
    font-size: 0.75rem;
  }
  .news-title {
    font-size: 0.95rem;
    width: 100%;
    margin-top: 5px;
  }
  .about-text h3 {
    font-size: 1.6rem;
  }
  .about-text p {
    font-size: 0.95rem;
  }
  .dept-content {
    padding: 30px 20px;
  }
  .dept-title {
    font-size: 1.4rem;
  }
  .fab-mutsu {
    padding: 12px 20px;
  }
  .fab-mutsu span {
    font-size: 0.9rem;
  }
  .footer-inner {
    gap: 30px;
  }
  .footer-info .logo-text {
    font-size: 1.5rem;
  }
  .footer-tel {
    font-size: 1.6rem;
  }

  /* Subpage general overrides */
  .page-header {
    padding: 100px 0 40px !important;
  }
  .page-title {
    font-size: 1.8rem !important;
  }
  .content-section {
    padding: 40px 0 !important;
  }
  .about-grid {
    gap: 30px !important;
  }
  .about-image img {
    height: 300px !important;
  }
  
  /* Table optimization */
  table {
    font-size: 0.85rem;
  }
  th, td {
    padding: 10px 5px !important;
  }
  
  /* FAQ optimization */
  .faq-q, .faq-a {
    padding: 15px !important;
    gap: 10px !important;
    font-size: 0.95rem !important;
  }

  /* Access/Map */
  .access-info {
    gap: 20px !important;
  }

  /* Specific Banner/Feature stack */
  .mutsu-banner {
    padding: 30px 20px !important;
  }
  .mutsu-banner h2 {
    font-size: 1.5rem !important;
  }

  /* Flex containers that should stack */
  [style*="display:flex"], [style*="display: flex"] {
    flex-direction: column !important;
    gap: 15px !important;
  }
  
  /* Reset some flex items that SHOULD NOT stack if they are icons/small */
  .header-inner, .news-item-header {
    flex-direction: row !important;
  }

  /* Postpartum specific overrides */
  .text-box {
    padding: 25px 15px !important;
  }
  .message-text {
    font-size: 0.95rem !important;
    line-height: 1.8 !important;
  }
  .step-card {
    padding: 20px 15px !important;
  }
  .step-header {
    font-size: 1.1rem !important;
  }
  .btn-apply {
    padding: 15px 30px !important;
    font-size: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .city-banner {
    width: 100% !important;
    margin-right: 0 !important;
    margin-bottom: 10px !important;
    text-align: center !important;
  }

  /* Form specific overrides */
  .form-container {
    margin-top: 100px !important;
    padding: 0 10px !important;
  }
  .inner-box {
    padding: 30px 15px !important;
  }
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .btn-confirm {
    font-size: 1.1rem !important;
    padding: 15px !important;
  }
  .confirm-lbl {
    width: 100% !important;
    margin-bottom: 5px !important;
  }
  .modal-content {
    border-radius: 10px !important;
  }

  /* Edu/Classes specific */
  .class-card {
    padding: 25px 20px !important;
  }
  .class-title {
    font-size: 1.25rem !important;
    gap: 10px !important;
  }

  /* Table Scroll Hint */
  .table-wrapper {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin-bottom: 40px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .swipe-hint {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(28, 156, 141, 0.9), rgba(17, 97, 87, 0.9));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: swipeAnim 2.5s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    opacity: 1;
    transition: opacity 0.4s ease, visibility 0.4s ease;
  }
  .swipe-hint i {
    font-size: 1.5rem;
  }
  .table-wrapper.scrolled .swipe-hint {
    opacity: 0;
    visibility: hidden;
  }
  @media (max-width: 480px) {
    .table-wrapper {
      padding: 20px 10px !important;
    }
  }
}

@keyframes swipeAnim {
  0% { transform: translate(-80%, -50%); opacity: 0.8; }
  50% { transform: translate(-20%, -50%); opacity: 1; }
  100% { transform: translate(-80%, -50%); opacity: 0.8; }
}

.swipe-hint {
  display: none; /* Hide by default on desktop */
}

/* =========================================================================
   Scroll Animations
   ========================================================================= */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}
