* {
    box-sizing: border-box;
}

:root {
    --bg-top: #f2f6f3;
    --bg-bottom: #dbe7dd;
    --card: rgba(255, 255, 255, 0.82);
    --card-strong: #ffffff;
    --text: #102117;
    --muted: #577060;
    --accent: #1f7a4c;
    --accent-dark: #185d3a;
    --border: rgba(16, 33, 23, 0.12);
    --danger: #b93d3d;
    --shadow: 0 24px 60px rgba(16, 33, 23, 0.14);
    --radius: 24px;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.8), transparent 35%),
        linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body {
    min-height: 100vh;
}

body.lightbox-open {
    overflow: hidden;
}

a {
    color: inherit;
}

.public-shell,
.admin-shell {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.public-shell {
    display: grid;
    gap: 24px;
    align-content: center;
    min-height: 100vh;
    width: min(100%, 760px);
}

.hero-card,
.links-card,
.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero-card,
.links-card,
.panel {
    padding: 28px;
}

.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
}

h1,
h2 {
    margin: 0;
    line-height: 1.05;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
}

h2 {
    font-size: 1.4rem;
}

.hero-title {
    display: grid;
    gap: 4px;
}

.hero-cap {
    font-size: clamp(1.2rem, 3vw, 1.7rem);
    line-height: 1.1;
}

.hero-name {
    line-height: 0.98;
}

.intro,
.section-heading p,
.notice,
label,
th,
td {
    color: var(--muted);
}

.intro {
    margin: 14px 0 0;
    max-width: 34rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

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

.section-heading p {
    margin: 8px 0 0;
}

.hero-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
    max-width: 760px;
}

.hero-photo {
    margin: 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(31, 122, 76, 0.14);
    box-shadow: 0 18px 40px rgba(16, 33, 23, 0.12);
    background: rgba(255, 255, 255, 0.7);
}

.hero-photo a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.hero-photo img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3.9;
    object-fit: cover;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    cursor: zoom-out;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 18, 13, 0.82);
    backdrop-filter: blur(8px);
}

.lightbox-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 28px;
}

.lightbox-image {
    display: block;
    max-width: min(100%, 1100px);
    max-height: calc(100vh - 56px);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
    background: #fff;
}

.guestbook-form {
    margin-bottom: 28px;
}

.guestbook-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.honeypot-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.turnstile-wrap {
    overflow-x: auto;
}

.message-heading {
    margin-top: 10px;
}

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

.message-card {
    padding: 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
}

.message-card p {
    margin: 10px 0 0;
    color: var(--text);
    line-height: 1.65;
}

.message-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    color: var(--muted);
    font-size: 0.95rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    padding: 12px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
}

.pagination-link:hover {
    background: var(--accent-dark);
}

.pagination-status {
    color: var(--muted);
    font-weight: 600;
}

.rules-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.rules-list li + li {
    margin-top: 6px;
}

.route-map {
    margin: 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 40px rgba(16, 33, 23, 0.1);
}

.route-map img {
    display: block;
    width: 100%;
    height: auto;
}

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

.link-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 18px;
    background: var(--card-strong);
    border: 1px solid rgba(31, 122, 76, 0.16);
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.link-button:hover,
.link-button:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(31, 122, 76, 0.4);
    box-shadow: 0 16px 32px rgba(31, 122, 76, 0.16);
}

.link-copy {
    display: grid;
    gap: 4px;
    flex: 1;
}

.link-title {
    color: var(--text);
}

.link-description {
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 500;
    line-height: 1.5;
}

.link-arrow {
    color: var(--accent);
    font-size: 1.1rem;
}

.link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(31, 122, 76, 0.1);
    color: var(--accent-dark);
    flex-shrink: 0;
    font-size: 1.1rem;
}

.admin-page .admin-shell {
    display: grid;
    gap: 20px;
}

.admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 20px;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.stat-panel {
    padding: 22px 24px;
}

.stat-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.stat-value {
    margin: 10px 0 0;
    color: var(--text);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
    line-height: 1;
}

.auth-panel {
    width: min(100%, 460px);
    margin: 10vh auto 0;
}

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

.field {
    display: grid;
    gap: 8px;
}

label {
    display: block;
    font-weight: 600;
}

.field-help {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.icon-preview {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(31, 122, 76, 0.08);
    color: var(--accent-dark);
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    font: inherit;
    color: var(--text);
    background: rgba(255, 255, 255, 0.94);
}

textarea {
    resize: vertical;
    min-height: 92px;
}

input:focus,
button:focus,
a:focus {
    outline: 3px solid rgba(31, 122, 76, 0.18);
    outline-offset: 2px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-field {
    gap: 0;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
}

button,
.secondary-button,
.mini-button {
    appearance: none;
    border: none;
    border-radius: 999px;
    padding: 13px 18px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.secondary-button:hover,
.mini-button:hover {
    background: var(--accent-dark);
}

.secondary-button {
    background: rgba(16, 33, 23, 0.1);
    color: var(--text);
}

.secondary-button:hover {
    background: rgba(16, 33, 23, 0.16);
}

.mini-button {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.danger {
    background: var(--danger);
}

.danger:hover {
    background: #952f2f;
}

.form-actions,
.actions-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.text-link {
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: 700;
}

.notice {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
}

.notice.error {
    color: #7a1f1f;
    border-color: rgba(185, 61, 61, 0.24);
    background: rgba(255, 243, 243, 0.9);
}

.notice.success {
    color: #185d3a;
    border-color: rgba(31, 122, 76, 0.22);
    background: rgba(240, 255, 246, 0.92);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th {
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.url-cell a {
    color: var(--accent-dark);
    word-break: break-word;
}

.message-admin-cell {
    min-width: 260px;
    white-space: pre-wrap;
}

.icon-cell {
    min-width: 56px;
    color: var(--accent-dark);
    font-size: 1.05rem;
}

.muted-dash {
    color: var(--muted);
}

.inline-form {
    margin: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.status-pill.active {
    background: rgba(31, 122, 76, 0.12);
    color: #185d3a;
}

.status-pill.inactive {
    background: rgba(16, 33, 23, 0.08);
    color: #4a5f52;
}

@media (max-width: 860px) {
    .admin-stats-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 640px) {
    .public-shell,
    .admin-shell {
        padding: 18px 14px 28px;
    }

    .hero-card,
    .links-card,
    .panel {
        padding: 20px;
        border-radius: 20px;
    }

    h1 {
        font-size: 2.3rem;
    }

    .guestbook-two-column,
    .pagination {
        grid-template-columns: 1fr;
        display: grid;
    }

    .hero-gallery {
        grid-template-columns: 1fr;
    }

    .lightbox-dialog {
        padding: 18px;
    }

    .lightbox-image {
        max-height: calc(100vh - 36px);
        border-radius: 18px;
    }

    th,
    td {
        padding-left: 0;
        padding-right: 0;
    }
}
