:root {
  --color-navy: #1f2a3c;
  --color-navy-dark: #141b28;
  --color-gold: #b08d57;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f4f1;
  --color-text: #2b2b2b;
  --color-text-light: #6b6b6b;
  --color-border: #e3e1db;
}

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

body {
  font-family: "Nanum Myeongjo", "궁서체", "Gungsuh", "Batang", "바탕체", serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
}

/* 국화 문양 (텍스트 없는 여백/모서리 전용, 반복 없음) */
:root {
  --pattern-mum: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-32 -32 64 64'%3E%3Cg fill='none' stroke='%23ddd0b0' stroke-width='1.6' stroke-linecap='round'%3E%3Cellipse cx='0' cy='-15' rx='6' ry='14'/%3E%3Cellipse cx='0' cy='-15' rx='6' ry='14' transform='rotate(45)'/%3E%3Cellipse cx='0' cy='-15' rx='6' ry='14' transform='rotate(90)'/%3E%3Cellipse cx='0' cy='-15' rx='6' ry='14' transform='rotate(135)'/%3E%3Cellipse cx='0' cy='-15' rx='6' ry='14' transform='rotate(180)'/%3E%3Cellipse cx='0' cy='-15' rx='6' ry='14' transform='rotate(225)'/%3E%3Cellipse cx='0' cy='-15' rx='6' ry='14' transform='rotate(270)'/%3E%3Cellipse cx='0' cy='-15' rx='6' ry='14' transform='rotate(315)'/%3E%3C/g%3E%3C/svg%3E");
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

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

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

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-navy);
  letter-spacing: -0.02em;
}

.main-nav ul {
  display: flex;
  gap: 32px;
}

.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  transition: color 0.15s ease;
}

.main-nav a:hover {
  color: var(--color-gold);
}

.main-nav a.active {
  color: var(--color-gold);
}

.main-nav li.has-dropdown {
  position: relative;
  padding: 26px 0;
  margin: -26px 0;
}

.main-nav .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 160px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(20, 27, 40, 0.12);
  padding: 8px 0;
  gap: 0;
  z-index: 200;
}

.main-nav li.has-dropdown:hover .dropdown,
.main-nav li.has-dropdown:focus-within .dropdown {
  display: block;
}

.main-nav .dropdown li {
  width: 100%;
}

.main-nav .dropdown a {
  display: block;
  padding: 10px 20px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.main-nav .dropdown a:hover {
  background: var(--color-bg-alt);
  color: var(--color-gold);
}

.header-call {
  font-weight: 700;
  color: var(--color-navy);
  border: 1px solid var(--color-navy);
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.header-call:hover {
  background: var(--color-navy);
  color: #fff;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--color-navy) 0%, var(--color-navy-dark) 100%);
  color: #fff;
  text-align: center;
  padding: 110px 24px;
}

.hero-bg-deco {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  color: var(--color-gold);
  letter-spacing: 0.15em;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.hero-desc {
  color: #d7dbe3;
  font-size: 1.05rem;
  margin-bottom: 34px;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--color-gold);
  color: #fff;
}

.btn-primary:hover {
  background: #967a4a;
}

/* Page banner (subpages) */
.page-banner {
  background-color: var(--color-bg-alt);
  background-image: var(--pattern-mum), var(--pattern-mum);
  background-repeat: no-repeat, no-repeat;
  background-position: left -50px top -40px, right -50px bottom -40px;
  background-size: 170px 170px, 200px 200px;
  border-bottom: 1px solid var(--color-border);
  padding: 44px 0;
  text-align: center;
}

.page-banner h1 {
  color: var(--color-navy);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.breadcrumb {
  color: var(--color-text-light);
  font-size: 0.85rem;
}

.breadcrumb a {
  color: var(--color-text-light);
}

.breadcrumb a:hover {
  color: var(--color-gold);
}

/* Home highlight (mourning mini widget + CTA cards) */
.home-highlight {
  position: relative;
  padding-top: 56px;
  padding-bottom: 0;
  background-image: var(--pattern-mum), var(--pattern-mum);
  background-repeat: no-repeat, no-repeat;
  background-position: left -60px top 30px, right -60px bottom 40px;
  background-size: 190px 190px, 220px 220px;
}

.home-highlight-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.mini-mourning-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 24px;
}

.mini-mourning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.mini-mourning-header h3 {
  color: var(--color-navy);
  font-size: 1.1rem;
}

.mini-mourning-more {
  font-size: 0.82rem;
  color: var(--color-gold);
  font-weight: 700;
}

.mini-mourning-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.mini-mourning-table th,
.mini-mourning-table td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.mini-mourning-table th {
  color: var(--color-text-light);
  font-weight: 600;
  font-size: 0.78rem;
}

.mini-mourning-table tbody tr:last-child td {
  border-bottom: none;
}

.home-cta-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  border-radius: 8px;
  padding: 26px 24px;
  color: #fff;
}

.home-cta-phone {
  background: linear-gradient(160deg, var(--color-navy) 0%, var(--color-navy-dark) 100%);
}

.home-cta-facility {
  background: linear-gradient(160deg, #8a713f 0%, var(--color-gold) 100%);
}

.home-cta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  margin-bottom: 4px;
}

.home-cta-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.home-cta-desc {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 10px;
}

.home-cta-btn {
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  padding: 8px 16px;
  margin-top: auto;
}

.home-bottom-strip {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.home-contact-banner {
  background: var(--color-navy-dark);
  color: #fff;
  border-radius: 8px;
  padding: 26px 24px;
}

.home-contact-label {
  color: var(--color-gold);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.home-contact-phone {
  display: block;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.home-contact-sub {
  color: #b7bdc8;
  font-size: 0.82rem;
}

.home-icon-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 20px 12px;
  color: var(--color-navy);
  transition: border-color 0.15s ease;
}

.home-icon-link:hover {
  border-color: var(--color-gold);
}

.home-icon-link-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.home-icon-link-desc {
  color: var(--color-text-light);
  font-size: 0.78rem;
}

/* Sections */
.section {
  padding: 80px 0;
}

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

.section-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--color-navy);
  text-align: center;
  margin-bottom: 14px;
}

.section-desc {
  text-align: center;
  color: var(--color-text-light);
  max-width: 640px;
  margin: 0 auto 48px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.about-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 32px 24px;
  text-align: center;
}

.about-card h3 {
  color: var(--color-navy);
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.about-card p {
  color: var(--color-text-light);
  font-size: 0.92rem;
}

/* Facility */
.facility-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.facility-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.facility-thumb {
  height: 140px;
  background: var(--color-navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

.facility-card h3 {
  color: var(--color-navy);
  padding: 18px 20px 4px;
  font-size: 1.02rem;
}

.facility-card p {
  color: var(--color-text-light);
  padding: 0 20px 20px;
  font-size: 0.9rem;
}

/* Procedure */
.procedure-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.procedure-list li {
  background: var(--color-bg-alt);
  border-radius: 8px;
  padding: 28px 16px;
  text-align: center;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--color-navy);
  color: #fff;
  font-weight: 700;
}

.step-text {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
}

.step-text small {
  display: block;
  margin-top: 6px;
  font-weight: 400;
  color: var(--color-text-light);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* Religion tabs (장례정보) */
.religion-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.religion-tab {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-light);
  cursor: pointer;
}

.religion-tab:hover {
  border-color: var(--color-gold);
  color: var(--color-navy);
}

.religion-tab.active {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: #fff;
}

.religion-panel p {
  color: var(--color-text-light);
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}

.religion-steps {
  grid-template-columns: repeat(2, 1fr);
}

.religion-steps li {
  text-align: left;
  padding: 24px;
}

.religion-steps .step-num {
  margin: 0 0 12px;
}

/* Etiquette (조문 예절) */
.etiquette-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.etiquette-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 28px;
}

.etiquette-card h3 {
  color: var(--color-navy);
  margin-bottom: 10px;
  font-size: 1.02rem;
}

.etiquette-card p {
  color: var(--color-text-light);
  font-size: 0.92rem;
}

/* Notice */
.notice-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-light);
}

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

/* Location */
.location-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 32px;
  align-items: stretch;
}

.location-info p {
  margin-bottom: 22px;
  font-size: 0.95rem;
}

.location-info strong {
  display: block;
  color: var(--color-navy);
  margin-bottom: 4px;
}

.location-info a {
  color: var(--color-gold);
  font-weight: 700;
}

.map-links {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn-map {
  padding: 10px 18px;
  font-size: 0.85rem;
  border-radius: 4px;
  font-weight: 700;
}

.btn-kakao {
  background: #fee500;
  color: #3c1e1e;
}

.btn-kakao:hover {
  background: #f4d900;
}

.btn-naver {
  background: #03c75a;
  color: #fff;
}

.btn-naver:hover {
  background: #02a94d;
}

.location-map {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  min-height: 220px;
}

.location-map iframe {
  width: 100%;
  height: 100%;
  min-height: 220px;
  border: 0;
}

/* Mourning table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.mourning-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.mourning-table th,
.mourning-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.mourning-table th {
  background: var(--color-bg-alt);
  color: var(--color-navy);
  font-weight: 700;
}

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

.table-empty {
  text-align: center;
  color: var(--color-text-light);
  white-space: normal;
}

.row-clickable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.row-clickable:hover {
  background-color: var(--color-bg-alt);
}

/* Mourning detail page */
.detail-card {
  max-width: 720px;
  margin: 0 auto 24px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 36px;
}

.detail-meta {
  color: var(--color-text-light);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.detail-info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.detail-info-row {
  display: flex;
  gap: 16px;
  font-size: 0.95rem;
}

.detail-info-row dt {
  flex: 0 0 90px;
  color: var(--color-text-light);
  font-weight: 600;
}

.detail-info-row dd {
  color: var(--color-text);
  font-weight: 600;
}

.detail-divider {
  border-top: 1px solid var(--color-border);
  margin: 24px 0;
}

.detail-family {
  white-space: pre-line;
  color: var(--color-text);
  font-size: 0.95rem;
  line-height: 1.9;
}

.detail-back {
  display: inline-block;
}

/* Admin */
.footer-admin {
  color: #6f7684;
  font-size: 0.8rem;
  margin-left: 8px;
}

.footer-admin:hover {
  color: var(--color-gold);
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-email {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.admin-auth-section {
  padding: 60px 0;
}

.admin-card {
  max-width: 420px;
  margin: 0 auto 48px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 36px;
}

.admin-card-title {
  color: var(--color-navy);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--color-navy);
  font-weight: 600;
}

.admin-form input {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
}

.admin-form input:focus,
.admin-form textarea:focus {
  outline: 2px solid var(--color-gold);
  outline-offset: 1px;
}

.admin-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

.admin-form-full {
  grid-column: 1 / -1;
}

.admin-submit {
  width: 100%;
  border: none;
  cursor: pointer;
  margin-top: 6px;
}

.admin-error {
  color: #c0392b;
  font-size: 0.85rem;
}

.admin-back {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
}

.admin-back a {
  color: var(--color-text-light);
}

.admin-back a:hover {
  color: var(--color-gold);
}

.admin-card-wide {
  max-width: none;
  margin-bottom: 40px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: end;
}

.admin-form-actions {
  display: flex;
  gap: 10px;
}

.admin-list-title {
  margin-bottom: 20px;
}

.admin-row-actions {
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-navy);
  cursor: pointer;
  text-decoration: underline;
}

.btn-link-danger {
  color: #c0392b;
}

/* Footer */
.site-footer {
  background: var(--color-navy-dark);
  color: #b7bdc8;
  padding: 40px 0;
  font-size: 0.88rem;
}

.footer-name {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.site-footer p {
  margin-bottom: 4px;
}

.footer-copy {
  margin-top: 14px;
  color: #6f7684;
}

/* Responsive */
@media (max-width: 860px) {
  .main-nav { display: none; }
  .about-grid, .facility-grid { grid-template-columns: 1fr; }
  .procedure-list { grid-template-columns: repeat(2, 1fr); }
  .location-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-header-right { gap: 8px; }
  .home-highlight-grid { grid-template-columns: 1fr; }
  .home-bottom-strip { grid-template-columns: 1fr 1fr; }
  .religion-steps, .etiquette-grid { grid-template-columns: 1fr; }
  .religion-tabs { flex-wrap: wrap; }
}
