* {
    box-sizing: border-box;
}

:root {
    --ink: #171717;
    --muted: #777;
    --line: #e8e4de;
    --cream: #f7f3ed;
    --white: #fff;
    --accent: #d8893a;
    --accent-dark: #b96e28;
    --green: #2d8a57;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: #fff;
    font-family: "DM Sans", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

.container {
    width: min(1040px, calc(100% - 48px));
    margin: 0 auto;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
}

.header-inner {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border: 1px solid #222;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: "Playfair Display", serif;
    font-size: 14px;
}

.brand strong {
    display: block;
    font-size: 13px;
    letter-spacing: .16em;
}

.brand small {
    display: block;
    margin-top: 4px;
    color: #858585;
    font-size: 10px;
}

.contact-button {
    padding: 11px 22px;
    border: 1px solid #222;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    transition: .2s ease;
}

.contact-button:hover {
    color: white;
    background: #171717;
}

/* Intro */
.intro {
    padding: 72px 0 38px;
    text-align: center;
}

.eyebrow {
    color: var(--accent-dark);
    font-size: 10px;
    letter-spacing: .28em;
    font-weight: 700;
    margin-bottom: 16px;
}

h1 {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(38px, 6vw, 62px);
    line-height: 1.05;
    font-weight: 500;
    letter-spacing: -.025em;
}

h1 em,
.footer-brand h2 em {
    color: var(--accent-dark);
    font-style: italic;
}

.intro > p {
    max-width: 520px;
    margin: 18px auto 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

.rule {
    height: 1px;
    background: var(--line);
    margin-top: 48px;
}

/* Editor */
.editor-section {
    padding: 5px 0 90px;
}

.message {
    min-height: 0;
    margin-bottom: 15px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

.message.success {
    color: var(--green);
}

.message.error,
.error-box {
    color: #b63b35;
}

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

.image-row {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: center;
    gap: 46px;
    padding: 30px 0;
    border-bottom: 1px solid var(--line);
}

.image-row:first-child {
    padding-top: 10px;
}

.photo-wrap {
    position: relative;
    width: 180px;
}

.photo-number {
    position: absolute;
    z-index: 3;
    left: -10px;
    top: -10px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: white;
    font-family: "Playfair Display", serif;
    font-size: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,.12);
}

.image-box {
    width: 180px;
    height: 180px;
    padding: 6px;
    background: #f0ece6;
    border-radius: 8px;
    overflow: hidden;
}

.image-box img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    transition: transform .35s ease;
}

.image-box:hover img {
    transform: scale(1.025);
}

.form-area {
    min-width: 0;
}

.field-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 10px;
}

.field-heading label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
}

.image-file {
    color: #aaa;
    font-size: 10px;
}

.input-group {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.input-group input {
    width: 100%;
    min-width: 0;
    height: 50px;
    padding: 0 18px;
    border: 1px solid #d7d2ca;
    border-radius: 4px;
    outline: none;
    background: white;
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
    transition: border .2s, box-shadow .2s;
}

.input-group input::placeholder {
    color: #aaa;
}

.input-group input:focus {
    border-color: #777;
    box-shadow: 0 0 0 4px rgba(216, 137, 58, .08);
}

.save-btn {
    flex: 0 0 112px;
    height: 50px;
    border: 0;
    border-radius: 4px;
    background: var(--ink);
    color: white;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.save-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.save-btn:disabled {
    opacity: .65;
    cursor: wait;
    transform: none;
}

.button-loading {
    display: none;
}

.save-btn.loading .button-text {
    display: none;
}

.save-btn.loading .button-loading {
    display: inline;
}

.saved-state {
    min-height: 18px;
    margin-top: 8px;
    color: var(--green);
    font-size: 11px;
    font-weight: 600;
    opacity: 0;
    transition: opacity .2s;
}

.saved-state.visible {
    opacity: 1;
}

.loading {
    text-align: center;
    color: var(--muted);
    padding: 60px 0;
}

.error-box {
    padding: 22px;
    border: 1px solid #f0d6d3;
    background: #fff8f7;
    text-align: center;
}

/* Footer */
.site-footer {
    background: #171717;
    color: white;
    padding-top: 68px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr .9fr;
    gap: 80px;
    padding-bottom: 58px;
}

.footer-title {
    font-size: 12px;
    letter-spacing: .17em;
    font-weight: 700;
}

.footer-title span {
    margin-right: 8px;
}

.footer-brand h2 {
    margin: 22px 0 12px;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 42px;
    line-height: 1.02;
    font-weight: 500;
}

.footer-brand p {
    margin: 0 0 22px;
    color: #aaa;
    font-size: 13px;
    line-height: 1.7;
}

.website-link {
    color: #ddd;
    font-size: 12px;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
}

.footer-label {
    color: #9d9d9d;
    font-size: 10px;
    letter-spacing: .2em;
    margin-bottom: 18px;
}

.contact-details {
    padding-top: 6px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid #333;
}

.contact-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid #555;
    border-radius: 50%;
    font-size: 12px;
}

.contact-item small {
    display: block;
    color: #888;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: 3px;
}

.contact-item strong {
    display: block;
    color: #eee;
    font-size: 12px;
    font-weight: 500;
}

.contact-item:hover strong {
    color: #e6a35e;
}

.footer-bottom {
    min-height: 66px;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: #777;
    font-size: 10px;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-links a {
    color: #aaa;
}

.social-links a:hover {
    color: white;
}

/* Mobile */
@media (max-width: 700px) {
    .container {
        width: min(100% - 32px, 1040px);
    }

    .header-inner {
        min-height: 72px;
    }

    .brand small {
        font-size: 9px;
    }

    .contact-button {
        padding: 9px 16px;
    }

    .intro {
        padding: 52px 0 30px;
    }

    .intro > p {
        font-size: 13px;
    }

    .rule {
        margin-top: 35px;
    }

    .editor-section {
        padding-bottom: 60px;
    }

    .image-row {
        grid-template-columns: 90px minmax(0, 1fr);
        gap: 18px;
        padding: 22px 0;
    }

    .photo-wrap,
    .image-box {
        width: 90px;
    }

    .image-box {
        height: 90px;
        padding: 4px;
        border-radius: 6px;
    }

    .image-box img {
        border-radius: 3px;
    }

    .photo-number {
        width: 28px;
        height: 28px;
        left: -7px;
        top: -7px;
        font-size: 9px;
    }

    .field-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 8px;
    }

    .input-group {
        flex-direction: column;
        gap: 8px;
    }

    .input-group input,
    .save-btn {
        height: 44px;
    }

    .save-btn {
        width: 100%;
        flex-basis: auto;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 42px;
        padding-bottom: 45px;
    }

    .footer-brand h2 {
        font-size: 35px;
    }

    .footer-bottom {
        min-height: 85px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
    }
}
