:root {
    color: #202020;
    background: #f4f1ea;
}

* { box-sizing: border-box; }

html {
    font-family: Inter, Arial, Helvetica, sans-serif;
    color: #202020;
    background: #f4f1ea;
}

body { min-height: 100vh; margin: 0; }
a { color: #7a3528; }

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    color: #fff;
    background: #231f1c;
}

header .brand {
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 700;
    text-decoration: none;
}

header nav { display: flex; align-items: center; }
header nav a { margin-left: 20px; color: #f8f5ef; text-decoration: none; }
header nav a:hover { text-decoration: underline; }

main {
    width: calc(100% - 40px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 42px 0 70px;
}

h1, h2 { font-family: Georgia, "Times New Roman", serif; }

.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 38px;
    margin-bottom: 28px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(120deg, rgba(35, 31, 28, 0.96), rgba(122, 53, 40, 0.88));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.hero small {
    display: block;
    margin-bottom: 10px;
    color: #ead9cd;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.hero h1 {
    max-width: 720px;
    margin: 0;
    font-size: 4rem;
    line-height: 1.05;
}

.primary, .hero .primary {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin-left: 30px;
    padding: 0 20px;
    border-radius: 8px;
    color: #fff;
    background: #7a3528;
    font-weight: 700;
    text-decoration: none;
}

.primary:hover, .hero .primary:hover { background: #59261d; }

.search { display: flex; margin: 0 0 30px; }
.search input { flex: 1; min-width: 0; margin-right: 10px; }
input, textarea, button { font: inherit; }

input, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d8d3c8;
    border-radius: 8px;
    color: #202020;
    background: #fff;
}

input:focus, textarea:focus {
    border-color: #7a3528;
    outline: 3px solid rgba(122, 53, 40, 0.14);
}

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

button {
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: #7a3528;
    font-weight: 700;
    cursor: pointer;
}

button:hover { background: #59261d; }

/* Flexbox replaces Grid for compatibility with older CSS validators. */
.grid { display: flex; flex-direction: column; }

.grid article {
    display: flex;
    min-height: 153px;
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid #d8d3c8;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.grid .photo {
    display: flex;
    flex: 0 0 320px;
    align-items: center;
    justify-content: center;
    width: 320px;
    min-height: 213px;
    overflow: hidden;
    color: #6d6a64;
    background: #e8e4dc;
}

.grid .photo a, .grid .photo img { display: block; width: 100%; height: 100%; }
.grid .photo img { object-fit: cover; transition: transform 180ms ease; }
.grid .photo a:hover img { transform: scale(1.025); }

.grid .body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    padding: 19px 22px;
}

.grid .body small {
    order: 0;
    color: #6d6a64;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.grid .body h2 { order: 2; margin: 4px 0; font-size: 22px; line-height: 1.2; }
.grid .body b { order: 1; color: #7a3528; font-size: 1.1rem; }
.grid .body p { order: 3; margin: 10px 0; color: #4e4b46; line-height: 1.45; }

.grid .actions {
    order: 4;
    display: flex;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #d8d3c8;
}

.grid .actions a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin-right: 10px;
    padding: 8px 14px;
    border-radius: 7px;
    color: #fff;
    background: #3e5263;
    font-weight: 700;
    text-decoration: none;
}

.grid .actions form { margin: 0; }
.grid .actions button { min-height: 40px; padding: 8px 11px; background: #a12828; }
.grid .actions button:hover { background: #7f1f1f; }

.editor {
    display: flex;
    flex-wrap: wrap;
    max-width: 900px;
    padding: 28px;
    border: 1px solid #d8d3c8;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.editor label {
    display: flex;
    flex: 0 0 calc(50% - 10px);
    flex-direction: column;
    margin: 0 20px 20px 0;
    font-weight: 700;
}

.editor label:nth-of-type(even) { margin-right: 0; }
.editor .wide { flex-basis: 100%; margin-right: 0; }
.editor button { align-self: flex-start; }
.editor small { margin-top: 8px; color: #6d6a64; font-weight: 400; }

.notice, .empty {
    padding: 18px;
    border: 1px solid #d8d3c8;
    border-radius: 10px;
    background: #fff;
}

@media (max-width: 650px) {
    header { align-items: flex-start; flex-direction: column; }
    header nav { margin-top: 24px; }
    header nav a:first-child { margin-left: 0; }
    main { width: calc(100% - 24px); padding-top: 20px; }
    .hero { align-items: flex-start; flex-direction: column; padding: 26px 20px; }
    .hero h1 { font-size: 2rem; }
    .hero .primary { margin: 30px 0 0; }
    .search { flex-direction: column; }
    .search input { margin: 0 0 10px; }
    .grid article { flex-direction: column; min-height: 0; }
    .grid .photo {
        flex: none;
        width: 100%;
        min-height: 0;
        aspect-ratio: 3 / 2;
    }
    .grid .body { padding: 14px; }
    .grid .body h2 { font-size: 20px; }
    .editor { padding: 20px; }
    .editor label { flex-basis: 100%; margin-right: 0; }
}
