:root {
    --paper: #fcfcfa;
    --paper-soft: #f3f0ea;
    --ink: #171717;
    --muted: #6f716c;
    --line: #e6dfd2;
    --primary: #435548;
    --primary-strong: #26382f;
    --accent: #c59a37;
    --accent-soft: #efe1b8;
    --danger: #b54848;
    --success: #3d7a57;
    --white: #ffffff;
    --shadow: 0 18px 50px rgba(24, 27, 25, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
    line-height: 1.65;
}

body.modal-open {
    overflow: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.site-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.topbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    color: var(--white);
    transition: background-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.topbar.is-scrolled,
.topbar.is-open {
    background: rgba(252, 252, 250, 0.96);
    box-shadow: 0 8px 24px rgba(23, 23, 23, 0.08);
    color: var(--ink);
    backdrop-filter: blur(10px);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 900;
    white-space: nowrap;
}

.brand img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--white);
    object-fit: contain;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 34px;
    font-size: 15px;
    font-weight: 700;
}

.desktop-nav a {
    opacity: 0.86;
    transition: color 160ms ease, opacity 160ms ease;
}

.desktop-nav a:hover {
    color: var(--accent);
    opacity: 1;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.phone-button,
.search-button,
.primary-button,
.secondary-button,
.plain-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    min-height: 42px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 800;
    transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.phone-button,
.search-button,
.primary-button {
    background: var(--primary);
    color: var(--white);
}

.phone-button:hover,
.search-button:hover,
.primary-button:hover,
.secondary-button:hover,
.plain-button:hover,
.danger-button:hover {
    transform: translateY(-1px);
}

.secondary-button {
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
}

.plain-button {
    background: var(--paper-soft);
    color: var(--ink);
}

.danger-button {
    background: #fff0f0;
    color: var(--danger);
}

.admin-link {
    font-size: 13px;
    font-weight: 800;
    opacity: 0.72;
}

.search-button {
    background: var(--accent);
    color: #171717;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: transparent;
    color: currentColor;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: currentColor;
}

.mobile-panel {
    display: none;
    border-top: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    padding: 10px 20px 22px;
}

.mobile-panel a {
    display: block;
    padding: 13px 0;
    font-weight: 800;
}

.hero {
    position: relative;
    display: grid;
    align-items: center;
    height: 92svh;
    max-height: 820px;
    min-height: 560px;
    overflow: hidden;
    color: var(--white);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.46);
}

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: slow-zoom 28s ease-in-out infinite alternate;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding-top: 90px;
}

.hero h1 {
    margin: 0;
    font-size: 76px;
    line-height: 1.04;
    letter-spacing: 0;
}

.hero-lead {
    margin: 22px 0 0;
    max-width: 760px;
    color: var(--accent-soft);
    font-size: 26px;
    font-weight: 700;
}

.hero-copy {
    max-width: 680px;
    margin: 16px 0 0;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.86);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.section {
    padding: 96px 0;
}

.section-muted {
    background: var(--paper-soft);
}

.section-dark {
    background: var(--primary-strong);
    color: var(--white);
}

.split-section {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 80px;
    align-items: start;
}

h2 {
    margin: 0;
    font-size: 42px;
    line-height: 1.18;
    letter-spacing: 0;
}

h3,
p {
    letter-spacing: 0;
}

.intro-copy p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 18px;
}

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

.feature-card,
.notice-item,
.admin-panel,
.data-item,
.popup-admin-card,
.login-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.feature-card {
    padding: 30px;
}

.feature-card span {
    color: var(--accent);
    font-size: 13px;
    font-weight: 900;
}

.feature-card h3 {
    margin: 16px 0 8px;
    font-size: 22px;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
}

.section-heading {
    margin-bottom: 32px;
}

.section-heading p:last-child {
    max-width: 640px;
    margin: 14px 0 0;
    color: var(--muted);
}

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

.gallery-groups {
    display: grid;
    gap: 34px;
}

.gallery-group {
    display: grid;
    gap: 12px;
}

.gallery-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.gallery-group-title h3 {
    margin: 0;
    font-size: 22px;
}

.gallery-group-title span {
    color: var(--accent);
    font-size: 13px;
    font-weight: 900;
}

.gallery-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.gallery-filter button {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: var(--muted);
    min-height: 38px;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 900;
}

.gallery-filter button.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
}

.gallery-item {
    position: relative;
    display: block;
    height: 260px;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: var(--line);
    padding: 0;
}

.gallery-item span {
    position: absolute;
    left: 12px;
    bottom: 12px;
    border-radius: 999px;
    background: rgba(17, 20, 18, 0.76);
    color: var(--white);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 900;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 240ms ease;
}

.gallery-item:hover img {
    transform: scale(1.04);
}

.gallery-more-row,
.gallery-group-more {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.gallery-group-more {
    justify-content: flex-end;
    margin-top: 4px;
}

.notice-list {
    display: grid;
    gap: 12px;
}

.notice-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 26px;
    padding: 26px;
}

.notice-item time {
    color: var(--accent);
    font-weight: 900;
}

.notice-item h3 {
    margin: 0 0 8px;
    font-size: 22px;
}

.notice-item p {
    margin: 0;
    color: var(--muted);
}

.section-letter {
    background: linear-gradient(180deg, #fff 0%, #f7f4ee 100%);
}

.letter-page {
    background: #f7f4ee;
}

.page-hero {
    padding: 138px 0 58px;
    background: var(--primary-strong);
    color: var(--white);
}

.page-hero h1 {
    margin: 0;
    font-size: 52px;
    line-height: 1.12;
}

.page-hero p:last-child {
    max-width: 680px;
    margin: 16px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 18px;
}

.letter-teaser {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr);
    gap: 28px;
    align-items: start;
}

.letter-teaser > div:first-child {
    display: grid;
    gap: 18px;
}

.letter-teaser p {
    color: var(--muted);
    margin: 0;
}

.letter-board {
    display: grid;
    grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.14fr);
    gap: 20px;
    align-items: start;
}

.letter-list {
    display: grid;
    gap: 12px;
}

.letter-card,
.letter-detail,
.letter-write-box,
.letter-edit-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.letter-card a {
    display: grid;
    gap: 6px;
    padding: 18px;
}

.letter-card.is-active {
    border-color: var(--primary);
    box-shadow: 0 14px 34px rgba(67, 85, 72, 0.12);
}

.letter-card time,
.letter-detail time {
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
}

.letter-card h3,
.letter-detail h3,
.letter-write-box h3,
.letter-edit-box h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.28;
}

.letter-card p,
.letter-detail p {
    margin: 0;
    color: var(--muted);
}

.letter-panel {
    display: grid;
    gap: 14px;
}

.letter-detail {
    overflow: hidden;
    padding: 24px;
}

.letter-detail-head {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.letter-image {
    width: 100%;
    max-height: 380px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 20px;
}

.letter-content {
    color: #2e2f2d;
    font-size: 17px;
}

.letter-content p {
    margin: 0 0 12px;
}

.letter-placeholder {
    background: rgba(255, 255, 255, 0.72);
}

.letter-write-box,
.letter-edit-box {
    padding: 22px;
}

.letter-edit-box summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 900;
}

.letter-form {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.letter-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 900;
}

.letter-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    padding: 12px 14px;
    outline: 0;
}

.form-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.editor-wrap {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid var(--line);
    padding: 8px;
    background: var(--white);
}

.editor-toolbar button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    min-width: 38px;
    min-height: 34px;
    padding: 0 10px;
    color: var(--ink);
    font-weight: 900;
}

.rich-editor {
    min-height: 180px;
    padding: 14px;
    outline: 0;
}

.rich-editor:empty::before {
    content: "마음을 담아 글을 남겨주세요.";
    color: #a2a09a;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    align-items: start;
}

.directions-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
}

.directions-copy p {
    max-width: 620px;
}

.map-card {
    margin: 28px 0 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.map-card img {
    width: 100%;
    height: auto;
}

.section-dark .eyebrow {
    color: var(--accent-soft);
}

.section-dark p {
    color: rgba(255, 255, 255, 0.78);
}

.contact-list {
    display: grid;
    gap: 14px;
}

.contact-list div {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 18px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.contact-list span {
    color: var(--accent-soft);
    font-weight: 900;
}

.contact-list a,
.contact-list strong {
    color: var(--white);
    font-size: 20px;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.site-footer {
    background: #111412;
    color: rgba(255, 255, 255, 0.66);
    padding: 34px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-inner div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-inner img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--white);
    object-fit: contain;
}

.footer-inner p {
    margin: 0;
    font-size: 13px;
}

.popup-layer {
    position: fixed;
    z-index: 200;
    inset: 90px auto auto 24px;
    display: grid;
    gap: 14px;
    max-width: calc(100vw - 40px);
    pointer-events: none;
}

.popup-card {
    overflow: hidden;
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
    pointer-events: auto;
    width: min(var(--popup-width, 360px), calc(100vw - 40px));
}

.popup-media {
    max-height: 420px;
    overflow: hidden;
    background: var(--paper-soft);
}

.popup-media img {
    width: 100%;
    height: auto;
}

.popup-actions {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: #151715;
    color: var(--white);
    font-size: 13px;
}

.popup-button-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.popup-actions button,
.text-link {
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: 800;
}

.gallery-modal {
    position: fixed;
    z-index: 300;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(0, 0, 0, 0.84);
}

.gallery-modal[hidden] {
    display: none;
}

.gallery-modal img {
    max-width: 94vw;
    max-height: 88vh;
    border-radius: 8px;
    object-fit: contain;
}

.modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    color: var(--white);
    font-size: 30px;
    line-height: 1;
}

.admin-body {
    min-height: 100vh;
    background: var(--paper-soft);
}

.admin-layout {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
    padding: 48px 0 80px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 26px;
}

.admin-header h1,
.login-panel h1 {
    margin: 0;
    font-size: 36px;
    line-height: 1.2;
}

.admin-header-actions,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin: 20px 0;
}

.admin-tabs a {
    border-radius: 999px;
    padding: 10px 18px;
    background: var(--white);
    color: var(--muted);
    font-weight: 900;
}

.admin-tabs a.is-active {
    background: var(--primary);
    color: var(--white);
}

.stack-form select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    padding: 12px 14px;
    outline: 0;
}

.admin-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    align-items: start;
}

.admin-panel,
.login-panel {
    padding: 26px;
}

.admin-panel h2 {
    margin: 0 0 18px;
    font-size: 24px;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel-title-row span {
    color: var(--accent);
    font-weight: 900;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.stack-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.stack-form input,
.stack-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    padding: 12px 14px;
    outline: 0;
}

.stack-form input:focus,
.stack-form textarea:focus {
    border-color: var(--primary);
}

.check-row {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px !important;
}

.check-row input {
    width: auto;
}

.full-button {
    width: 100%;
}

.small-button {
    min-height: 34px;
    padding: 0 14px;
    font-size: 13px;
}

.data-list,
.popup-admin-list {
    display: grid;
    gap: 12px;
}

.data-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    padding: 18px;
}

.data-item time {
    color: var(--accent);
    font-weight: 900;
    font-size: 13px;
}

.data-item h3 {
    margin: 6px 0;
}

.data-item p {
    margin: 0;
    color: var(--muted);
}

.popup-admin-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 18px;
    padding: 14px;
}

.popup-admin-card img {
    width: 160px;
    height: 118px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--paper-soft);
}

.popup-admin-card h3 {
    margin: 8px 0 2px;
}

.popup-admin-card p {
    margin: 0 0 12px;
    color: var(--muted);
    word-break: break-all;
}

.inline-size-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 8px;
    margin: 10px 0 12px;
}

.inline-size-form label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.inline-size-form input {
    width: 100px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    color: var(--white);
    font-size: 12px;
    font-weight: 900;
}

.status-pill.is-on {
    background: var(--success);
}

.status-pill.is-off {
    background: var(--muted);
}

.alert {
    border-radius: 8px;
    padding: 14px 16px;
    margin: 14px 0;
    font-weight: 800;
}

.alert-error {
    background: #fff0f0;
    color: var(--danger);
}

.alert-success {
    background: #edf8f1;
    color: var(--success);
}

.alert-warning {
    background: #fff7da;
    color: #7b5b12;
}

.empty-text {
    margin: 0;
    padding: 34px 0;
    color: var(--muted);
    text-align: center;
}

.login-panel {
    width: min(440px, 100%);
    margin: 80px auto;
}

.login-brand {
    margin-bottom: 24px;
}

.login-panel p {
    color: var(--muted);
}

@keyframes slow-zoom {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.07);
    }
}

@media (max-width: 900px) {
    .desktop-nav,
    .phone-button,
    .search-button,
    .admin-link {
        display: none;
    }

    .menu-toggle {
        display: inline-block;
    }

    .topbar.is-open .mobile-panel {
        display: block;
    }

    .hero h1 {
        font-size: 52px;
    }

    .hero-lead {
        font-size: 22px;
    }

    .split-section,
    .feature-grid,
    .gallery-grid,
    .contact-grid,
    .letter-teaser,
    .letter-board,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .split-section {
        gap: 28px;
    }

    .gallery-item {
        height: 220px;
    }
}

@media (max-width: 640px) {
    .site-shell,
    .admin-layout {
        width: min(100% - 28px, 1180px);
    }

    .nav-inner {
        min-height: 66px;
    }

    .brand span {
        font-size: 17px;
    }

    .hero {
        min-height: 520px;
    }

    .hero h1 {
        font-size: 40px;
    }

    .hero-copy {
        font-size: 16px;
    }

    .hero-actions {
        display: grid;
    }

    .section {
        padding: 68px 0;
    }

    h2 {
        font-size: 32px;
    }

    .notice-item,
    .data-item,
    .popup-admin-card {
        grid-template-columns: 1fr;
    }

    .form-pair {
        grid-template-columns: 1fr;
    }

    .popup-admin-card img {
        width: 100%;
        height: 180px;
    }

    .contact-list div {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .footer-inner,
    .admin-header {
        align-items: start;
        flex-direction: column;
    }

    .popup-layer {
        inset: 78px 14px auto 14px;
        max-width: none;
    }
}
