/* d:\한의원\홈페이지 보수\new-site\css\main.css */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');
@import 'reset.css';
@import 'variables.css?v=20260830-spacing1';

/* Base Styles */
body {
  font-family: var(--font-primary);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-base);
  word-break: keep-all;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

a {
  transition: color var(--transition-fast);
}

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

.text-center { text-align: center; }
.text-accent { color: var(--color-accent); }
.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-text-muted); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition-normal);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

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

/* Official clinic brand */
.site-logo {
  position: relative;
  display: block;
  width: 190px;
  height: 52px;
  overflow: hidden;
  flex: 0 0 auto;
}

.site-logo img {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
}

.footer-brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  .site-logo {
    width: 150px;
    height: 46px;
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .site-logo {
    width: 132px;
    height: 46px;
  }

  .nav-desktop {
    gap: var(--space-2) !important;
  }

  .nav-desktop a,
  .mega-nav-trigger {
    font-size: 0.82rem;
  }
}

/* Site-wide click-to-open mega navigation */
.mega-nav-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  padding: var(--space-3) var(--space-1);
  position: relative;
  white-space: nowrap;
}

.mega-nav-trigger::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transform: translateX(-50%);
  transition: width var(--transition-fast);
}

.mega-nav-trigger:hover,
.mega-nav-trigger:focus-visible,
.mega-nav-trigger.is-active {
  color: var(--color-primary);
}

.mega-nav-trigger:hover::after,
.mega-nav-trigger:focus-visible::after,
.mega-nav-trigger.is-active::after {
  width: 100%;
}

.site-mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  background: #172a24;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  color: var(--color-white);
  transition: max-height 0.34s ease, opacity 0.22s ease, visibility 0.34s;
}

.site-mega-menu.is-open {
  max-height: 560px;
  visibility: visible;
  opacity: 1;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.mega-menu-column {
  min-width: 0;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.mega-menu-column.is-targeted {
  background: rgba(255, 255, 255, 0.08);
}

.mega-menu-column h2 {
  margin: 0 0 var(--space-4);
  font-size: var(--text-base);
}

.mega-menu-column h2 a {
  color: #f5d8ac;
  text-decoration: none;
}

.mega-menu-column ul {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.mega-menu-column li {
  margin: 0;
}

.mega-menu-column li a {
  display: block;
  color: rgba(255, 255, 255, 0.86);
  font-size: var(--text-sm);
  line-height: 1.45;
  text-decoration: none;
}

.mega-menu-column li a:hover,
.mega-menu-column li a:focus-visible {
  color: var(--color-white);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

@media (min-width: 769px) and (max-width: 1100px) {
  .site-mega-menu.is-open {
    max-height: 720px;
  }

  .mega-menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .site-mega-menu {
    display: none;
  }

  .mobile-nav-links {
    overflow-y: auto;
    padding-bottom: var(--space-8);
  }

  .mobile-nav-group {
    border-bottom: 1px solid var(--color-border);
  }

  .mobile-nav-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    color: var(--color-text);
    cursor: pointer;
    font-size: var(--text-lg);
    font-weight: 700;
    list-style: none;
  }

  .mobile-nav-group summary::-webkit-details-marker {
    display: none;
  }

  .mobile-nav-group summary::after {
    content: '+';
    color: var(--color-primary);
    font-size: 1.3rem;
    font-weight: 400;
  }

  .mobile-nav-group[open] summary::after {
    content: '−';
  }

  .mobile-nav-submenu {
    display: grid;
    gap: 0;
    padding: 0 var(--space-6) var(--space-3);
  }

  .mobile-nav-submenu a {
    padding: var(--space-3) var(--space-2);
    border-top: 1px solid rgba(224, 216, 204, 0.65);
    color: var(--color-text-light);
    font-size: var(--text-sm);
    text-decoration: none;
  }

  body.mobile-menu-open .floating-cta {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(150%) !important;
  }
}

/* Mobile Nav */
.mobile-menu-btn {
  display: block;
  padding: var(--space-2);
  z-index: 1001;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  position: relative;
  transition: background-color var(--transition-fast);
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: var(--color-text);
  transition: transform var(--transition-normal);
}

.hamburger::before { top: -6px; }
.hamburger::after { bottom: -6px; }

.main-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background-color: var(--color-white);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  padding-top: calc(var(--header-height) + var(--space-6));
  transition: right var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.main-nav.active {
  right: 0;
}

.nav-list {
  display: flex;
  flex-direction: column;
}

.nav-link {
  display: block;
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.nav-link:hover, .nav-link:active {
  color: var(--color-primary);
  background-color: var(--color-bg-section);
}

.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-color: var(--color-primary-dark);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to right, rgba(27, 94, 32, 0.8), rgba(0, 0, 0, 0.4));
}

.hero-content {
  position: relative;
  z-index: 10;
  color: var(--color-white);
  padding: var(--space-12) 0;
}

.hero-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
  color: var(--color-white);
}

.hero-subtitle {
  font-size: var(--text-lg);
  font-weight: 300;
  margin-bottom: var(--space-8);
  color: var(--color-white);
  opacity: 0.9;
}

/* Sections */
.section {
  padding: var(--space-16) 0;
}

.section-bg {
  background-color: var(--color-bg-section);
}

.section-title {
  font-size: var(--text-2xl);
  text-align: center;
  margin-bottom: var(--space-8);
  color: var(--color-primary);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background-color: var(--color-accent);
  margin: var(--space-4) auto 0;
}

/* Cards & Info Grids */
.grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

.card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  border: 1px solid var(--color-border);
}

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

.card-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
  color: var(--color-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition-fast);
  text-align: center;
}

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

.btn-primary:hover {
  background-color: var(--color-primary-dark);
}

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

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

.btn-outline {
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* Schedule Table */
.schedule-table-wrapper {
  overflow-x: auto;
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.schedule-table {
  width: 100%;
  min-width: 600px;
  text-align: center;
}

.schedule-table th, .schedule-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.schedule-table th {
  background-color: var(--color-bg-section);
  font-weight: 600;
  color: var(--color-primary);
}

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

/* Map Container */
.map-container {
  width: 100%;
  height: 300px;
  background-color: var(--color-border); /* Placeholder for map */
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-6);
}

/* Footer */
.site-footer {
  background-color: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--space-12) 0;
  margin-bottom: var(--cta-height); /* Space for mobile CTA */
}

.footer-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

.footer-info p {
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}

.footer-info a {
  color: var(--color-accent-light);
}

/* Floating Mobile CTA Bar */
.mobile-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--cta-height);
  background-color: var(--color-white);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  z-index: 999;
}

.cta-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-white);
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-btn:last-child {
  border-right: none;
}

.cta-phone { background-color: var(--color-phone); }
.cta-booking { background-color: var(--color-booking); }
.cta-directions { background-color: var(--color-directions); }
.cta-naver-talk { background-color: #03C75A; }
.cta-kakao { 
  background-color: var(--color-kakao);
  color: var(--color-kakao-text);
}

.cta-btn span {
  margin-top: 2px;
}

/* Scroll Animation */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Scheduled Closure Notice Popup */
body.notice-popup-open {
  overflow: hidden;
}

.notice-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(12, 35, 23, 0.68);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.notice-popup-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.notice-popup {
  position: relative;
  width: min(100%, 560px);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  border: 1px solid rgba(13, 82, 46, 0.14);
  border-radius: var(--radius-xl);
  background: var(--color-white);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.2s ease;
}

.notice-popup-overlay.is-open .notice-popup {
  transform: translateY(0) scale(1);
}

.notice-popup-close-icon {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--color-bg-section);
  color: var(--color-text);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.notice-popup-close-icon:focus-visible,
.notice-popup-close-button:focus-visible,
.notice-popup-link:focus-visible,
.notice-popup-hide-today input:focus-visible {
  outline: 3px solid rgba(13, 82, 46, 0.3);
  outline-offset: 2px;
}

.notice-popup-content {
  padding: var(--space-8) var(--space-8) var(--space-6);
}

.notice-popup-brand {
  position: relative;
  width: min(230px, 60vw);
  height: 52px;
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.notice-popup-logo {
  display: block;
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  max-width: none;
  height: auto;
  transform: translateY(-50%);
}

.notice-popup-eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.notice-popup-title {
  margin: 0;
  padding-right: var(--space-8);
  color: var(--color-primary-dark);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.25;
}

.notice-popup-message {
  margin: var(--space-3) 0 0;
  color: var(--color-text-muted);
  line-height: 1.75;
}

.notice-popup-schedule {
  margin: var(--space-5) 0 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-section);
}

.notice-popup-schedule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.notice-popup-schedule-row:last-child {
  border-bottom: 0;
}

.notice-popup-schedule dt,
.notice-popup-schedule dd {
  margin: 0;
}

.notice-popup-schedule dt {
  font-weight: 600;
}

.notice-popup-schedule dd {
  color: var(--color-primary);
  font-weight: 700;
}

.notice-popup-schedule dd.is-closed {
  color: #B3412D;
}

.notice-popup-note {
  margin: var(--space-4) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.65;
}

.notice-popup-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  text-decoration: none;
}

.notice-popup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-border);
  background: #F7F5EF;
}

.notice-popup-hide-today {
  display: inline-flex;
  align-items: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  cursor: pointer;
}

.notice-popup-hide-today input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-primary);
}

.notice-popup-close-button {
  min-height: 40px;
  padding: var(--space-2) var(--space-4);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-primary-dark);
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 600px) {
  .notice-popup-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .notice-popup {
    width: 100%;
    max-height: 90vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .notice-popup-content {
    padding: var(--space-6) var(--space-5) var(--space-5);
  }

  .notice-popup-footer {
    padding-right: var(--space-4);
    padding-left: var(--space-4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notice-popup-overlay,
  .notice-popup {
    transition: none;
  }
}
