:root {
    --theme-bg: #f6f7f3;
    --theme-text: #27323a;
    --theme-link: #245c80;
    --theme-border: #d6dde5;
    --theme-surface: #ffffff;
    --theme-danger: #8b1e1e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--theme-text);
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.55;
    background: var(--theme-bg);
}

a {
    color: var(--theme-link);
}

.theme-page-root {
    min-height: 100vh;
}

.theme-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: var(--theme-surface);
    border-bottom: 1px solid var(--theme-border);
}

.theme-nav__link {
    color: var(--theme-link);
    text-decoration: none;
}

.theme-nav__link[aria-current='page'] {
    font-weight: 700;
}

.theme-page {
    width: min(900px, calc(100% - 2rem));
    margin: 1.5rem auto;
}

.theme-page--narrow {
    max-width: 44rem;
}

.theme-page-title {
    margin: 0 0 .75rem;
    font-size: clamp(1.85rem, 4.2vw, 2.6rem);
    line-height: 1.1;
}

.theme-summary,
.theme-lead {
    max-width: 44rem;
    margin: 0 0 1.25rem;
    color: #4b5662;
    font-size: 1.1rem;
}

.theme-hero {
    padding: 2rem 0;
}

.theme-hero .theme-page-title {
    max-width: 14ch;
    font-size: clamp(2.4rem, 8vw, 5rem);
    line-height: 1;
}

.theme-eyebrow {
    margin: 0 0 .5rem;
    color: #58614f;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.theme-section {
    margin-top: 1.5rem;
}

.theme-section-title {
    margin: 0 0 .6rem;
}

.theme-content {
    margin-top: .8rem;
}

.theme-content img,
.theme-preview img,
.theme-section > img {
    max-width: 100%;
    height: auto;
}

.theme-list {
    margin: 0;
    padding-left: 1.2rem;
}

.theme-link {
    color: var(--theme-link);
}

.theme-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.theme-card {
    padding: 1rem;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: .35rem;
}

.theme-card :first-child {
    margin-top: 0;
}

.theme-card :last-child {
    margin-bottom: 0;
}

.theme-meta,
.record-details {
    margin: 0;
    padding: 0 0 0 1rem;
    border-left: 3px solid var(--theme-border);
}

.theme-meta dd,
.record-details dd {
    margin: .2rem 0 .9rem;
}

.record-details div {
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--theme-border);
}

.record-details dt {
    font-weight: 700;
}

.theme-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1rem;
}

.theme-gallery figure {
    margin: 0;
    cursor: pointer;
}

.theme-gallery img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.theme-gallery figcaption {
    padding-top: .4rem;
}

.theme-preview {
    margin: 1rem 0;
}

.theme-price {
    font-size: 1.4rem;
}

.theme-search {
    display: grid;
    gap: .5rem;
    margin: 1.5rem 0;
}

.theme-search label {
    font-weight: 700;
}

.theme-search__fields {
    display: flex;
    gap: .5rem;
}

.theme-search input {
    width: 100%;
    min-height: 2.75rem;
    padding: .65rem .75rem;
    color: var(--theme-text);
    font: inherit;
    background: var(--theme-surface);
    border: 1px solid #b8c1c9;
    border-radius: .25rem;
}

.theme-search button {
    padding: .65rem .95rem;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    background: var(--theme-text);
    border: 1px solid var(--theme-text);
    border-radius: .25rem;
    cursor: pointer;
}

.account-page {
    width: min(44rem, calc(100% - 2rem));
    margin: 1.5rem auto;
}

.account-page form {
    display: grid;
    gap: .85rem;
    margin: 1rem 0;
    padding: 1.15rem;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: .5rem;
    box-shadow: 0 1px 2px rgba(39, 50, 58, .08);
}

.account-page label {
    display: grid;
    gap: .35rem;
    color: #354052;
    font-weight: 700;
}

.account-page input:not([type='hidden']) {
    width: 100%;
    min-height: 2.75rem;
    padding: .65rem .75rem;
    color: var(--theme-text);
    font: inherit;
    background: var(--theme-surface);
    border: 1px solid #b8c1c9;
    border-radius: .25rem;
}

.account-page input:not([type='hidden']):focus-visible,
.account-page button:focus-visible {
    outline: 3px solid #bed8eb;
    outline-offset: 2px;
}

.account-page button {
    width: fit-content;
    min-height: 2.75rem;
    padding: .65rem .95rem;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    background: var(--theme-text);
    border: 1px solid var(--theme-text);
    border-radius: .25rem;
    cursor: pointer;
}

.account-page button:hover {
    background: var(--theme-link);
    border-color: var(--theme-link);
}

.account-page form[action='/account/delete'] button {
    color: var(--theme-danger);
    background: #fff3f2;
    border-color: #e6b8b2;
}

.account-page form[action='/account/delete'] button:hover {
    color: #ffffff;
    background: var(--theme-danger);
    border-color: var(--theme-danger);
}

.account-status,
.account-message,
.account-page .error {
    padding: .75rem 1rem;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: .35rem;
}

.account-page .error {
    color: var(--theme-danger);
    background: #fff3f2;
    border-color: #e6b8b2;
}

.account-page ul {
    display: grid;
    gap: .75rem;
    padding-left: 0;
    list-style: none;
}

.account-page li {
    padding: 1rem;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: .35rem;
}

.account-page li form {
    margin: .75rem 0 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

@media (max-width: 520px) {
    .account-page button {
        width: 100%;
    }
}
