:root {
    --bg: #f5f7f2;
    --panel: #ffffff;
    --ink: #20231f;
    --muted: #62695f;
    --line: #d9dfd4;
    --brand: #2f5f4d;
    --brand-dark: #1f3f34;
    --accent: #c2574b;
    --gold: #d79b32;
    --soft: #eef4f0;
    --danger: #a33131;
    --success: #276243;
    --shadow: 0 16px 42px rgba(26, 34, 27, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

a {
    color: var(--brand);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.wrap {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: linear-gradient(135deg, #203b33 0%, #315847 58%, #7d493f 100%);
    color: #fff;
    padding: 36px 0 30px;
}

.header-grid,
.admin-header-grid,
.admin-title-row,
.button-row,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.site-header h1,
.admin-main h1 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: 0;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.tagline {
    margin: 10px 0 0;
    max-width: 560px;
    color: rgba(255, 255, 255, 0.86);
}

.instagram-link,
.button-primary,
.button-secondary {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 9px 15px;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.instagram-link {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
}

.button-primary {
    color: #fff;
    background: var(--brand);
}

.button-primary:hover,
.button-primary:focus-visible {
    background: var(--brand-dark);
}

.button-secondary {
    color: var(--brand-dark);
    background: var(--soft);
    border-color: var(--line);
}

.page-main {
    padding: 28px 0 42px;
}

.archive-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.archive-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
}

.archive-chip span {
    color: var(--muted);
}

.archive-chip.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.archive-chip.is-active span {
    color: rgba(255, 255, 255, 0.8);
}

.post-feed {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.post-card,
.admin-panel,
.empty-state,
.notice {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.post-card {
    overflow: hidden;
}

.post-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #1f2622;
}

.media-track,
.media-frame {
    width: 100%;
    height: 100%;
}

.media-frame {
    display: none;
    position: relative;
    margin: 0;
    align-items: center;
    justify-content: center;
}

.media-frame.is-active {
    display: flex;
}

.media-frame img,
.media-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-frame.is-missing img,
.media-frame.is-missing video {
    display: none;
}

.media-missing {
    display: none;
    margin: 0;
    padding: 18px;
    color: #fff;
    text-align: center;
}

.media-frame.is-missing .media-missing {
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 42px;
    height: 42px;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.48);
    color: #fff;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.carousel-btn-prev {
    left: 12px;
}

.carousel-btn-next {
    right: 12px;
}

.carousel-status {
    position: absolute;
    right: 12px;
    bottom: 12px;
    margin: 0;
    border-radius: 999px;
    padding: 5px 9px;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    font-size: 0.86rem;
}

.post-body {
    padding: 18px;
}

.post-body time {
    display: block;
    margin-bottom: 10px;
    color: var(--accent);
    font-weight: 800;
}

.caption {
    margin: 0 0 14px;
    white-space: normal;
}

.is-muted,
.small {
    color: var(--muted);
}

.small {
    font-size: 0.9rem;
}

.post-link {
    font-weight: 800;
}

.empty-state,
.notice {
    padding: 18px;
}

.notice {
    margin: 0 0 18px;
    box-shadow: none;
}

.notice h2,
.empty-state h2 {
    margin-top: 0;
}

.notice-error {
    border-color: #e8b7b7;
    background: #fff3f3;
    color: #651f1f;
}

.notice-success {
    border-color: #b7dec5;
    background: #effaf3;
    color: #1d5338;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 24px 0;
    color: var(--muted);
}

.site-footer .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-footer p {
    margin: 0;
}

.admin-body {
    background: #f2f5f6;
}

.admin-header {
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.admin-header-grid {
    min-height: 62px;
}

.admin-brand {
    color: var(--ink);
    font-weight: 850;
    text-decoration: none;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-main {
    padding: 28px 0 44px;
}

.admin-title-row {
    margin-bottom: 18px;
}

.admin-panel {
    padding: 18px;
    margin-bottom: 20px;
}

.auth-panel {
    max-width: 460px;
}

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

.stacked-form label,
.manual-media-row label,
.media-admin-row label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd4c6;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 11px;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(215, 155, 50, 0.38);
    outline-offset: 2px;
}

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

.form-section {
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.section-heading {
    align-items: flex-start;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.05rem;
}

.section-heading p {
    margin: 4px 0 0;
    color: var(--muted);
}

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

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

.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--line);
    padding: 11px 8px;
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

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

.actions form {
    margin: 0;
}

.link-danger {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--danger);
    text-decoration: underline;
    cursor: pointer;
}

.status-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.82rem;
    font-weight: 800;
}

.status-published {
    background: #e6f5ec;
    color: var(--success);
}

.status-draft {
    background: #fff0dc;
    color: #80510e;
}

.media-admin-list {
    display: grid;
    gap: 10px;
}

.media-admin-row,
.manual-media-row {
    display: grid;
    grid-template-columns: 28px 110px minmax(220px, 1fr) minmax(170px, 0.7fr) minmax(190px, 0.8fr) 92px;
    gap: 10px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fbfcfa;
}

.manual-media-row {
    grid-template-columns: 110px minmax(220px, 1fr) minmax(170px, 0.7fr) minmax(190px, 0.8fr) 84px;
}

.media-admin-row.is-dragging {
    opacity: 0.55;
}

.drag-handle {
    align-self: center;
    color: var(--muted);
    cursor: grab;
    font-weight: 900;
}

.remove-check {
    align-self: center;
}

.remove-check input {
    width: auto;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.report-grid div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fbfcfa;
}

.report-grid dt {
    color: var(--muted);
    font-weight: 800;
}

.report-grid dd {
    margin: 4px 0 0;
    font-size: 1.6rem;
    font-weight: 850;
}

.code-block {
    overflow-x: auto;
    border-radius: 8px;
    background: #17211d;
    color: #edf7f0;
    padding: 16px;
}

code {
    border-radius: 5px;
    background: rgba(32, 35, 31, 0.08);
    padding: 0.1em 0.3em;
}

@media (max-width: 860px) {
    .post-feed,
    .form-grid,
    .report-grid {
        grid-template-columns: 1fr;
    }

    .media-admin-row,
    .manual-media-row {
        grid-template-columns: 1fr;
    }

    .drag-handle {
        display: none;
    }

    .header-grid,
    .admin-title-row,
    .section-heading,
    .site-footer .wrap {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .wrap {
        width: min(100% - 24px, 1120px);
    }

    .site-header {
        padding: 28px 0 24px;
    }

    .site-header h1,
    .admin-main h1 {
        font-size: 1.65rem;
    }

    .post-body,
    .admin-panel {
        padding: 15px;
    }

    .admin-header-grid {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 0;
    }
}
