﻿:root {
  --page-blue: #4f819f;
  --header-blue: #234a73;
  --paper: #fffaf0;
  --panel: #f3efe6;
  --ink: #243b4a;
  --brown: #3a2f28;
  --border: #d8cdbb;
  --danger: #9f3c35;
  --shadow: 0 12px 30px rgba(21, 45, 61, 0.18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 0; background: var(--page-blue); }
body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background: var(--page-blue);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.art-site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  padding: 0;
  background-color: var(--header-blue);
  background-image: url(assets/gallery-header-brushes.png);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 2px 10px rgba(17, 38, 53, 0.26);
}
.art-site-header-inner {
  width: min(920px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.art-home, .header-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid var(--brown);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
  color: var(--brown);
  font-weight: 700;
  text-decoration: none;
}
.art-home { min-width: 42px; padding: 0; }
.home-icon { width: 22px; height: 22px; }
.header-action { margin-left: auto; }
.art-home:hover, .header-action:hover,
.art-home:focus-visible, .header-action:focus-visible { background: rgba(255, 250, 240, 0.92); color: #2f2721; }
.art-site-name { min-width: 0; color: var(--paper); font-size: 1.08rem; font-weight: 700; }
.art-nameplate { position: relative; display: flex; height: 38px; align-items: center; padding: 5px 20px; overflow: hidden; border: 1px solid var(--brown); border-radius: 3px; background: #dbd6a8; color: var(--brown); line-height: 1.2; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.art-nameplate::before, .art-nameplate::after { content: ""; position: absolute; top: 50%; width: 4px; height: 4px; border-radius: 50%; background: var(--brown); transform: translateY(-50%); }
.art-nameplate::before { left: 6px; }
.art-nameplate::after { right: 6px; }
.art-section-nav { gap: 8px; }
.art-section-nav a { color: inherit; text-underline-offset: 3px; }

.art-page {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(24px, 5vw, 54px) 0 64px;
}
.art-detail-page { width: min(1040px, calc(100% - 28px)); }
body[data-page=upload] .art-card { max-width: 760px; margin-inline: auto; }
.art-list-page { padding-top: 22px; }

.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.list-heading h1 { margin: 0; font-size: 1.7rem; }
.list-heading-actions, .view-controls { display: flex; align-items: center; gap: 8px; }
.view-button { min-height: 42px; padding: 8px 12px; border: 1px solid var(--brown); border-radius: 8px; background: rgba(255, 250, 240, 0.72); color: var(--brown); cursor: pointer; font-weight: 700; }
.view-button:hover, .view-button:focus-visible, .view-button[aria-pressed=true] { background: var(--paper); }
.uploaded-art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 18px; }
.uploaded-art-item { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.uploaded-art-grid[data-view="large"] .uploaded-art-item { display: grid; grid-template-rows: 210px auto; }
.uploaded-art-item:hover, .uploaded-art-item:focus-visible { border-color: #3f819f; outline: 2px solid rgba(63, 129, 159, 0.24); }
.uploaded-art-thumbnail { display: grid; height: 210px; place-items: center; padding: 10px; overflow: hidden; background: #e7e1d7; }
.uploaded-art-thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: cnter top; }
/*.uploaded-art-item-copy { display: grid; gap: 4px; padding: 13px 14px 15px; }*/
.uploaded-art-item-copy { display: grid; gap: 2px; padding: 7px 12px 9px; }
.uploaded-art-item-copy strong { overflow-wrap: anywhere; }
.uploaded-art-item-copy span { color: #416d86; font-size: 0.92rem; overflow-wrap: anywhere; }
.uploaded-art-item-details { display: none; }
.uploaded-art-grid[data-view=small] { grid-template-columns: 1fr; gap: 10px; }
.uploaded-art-grid[data-view=small] .uploaded-art-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); }
.uploaded-art-grid[data-view=small] .uploaded-art-thumbnail { height: 82px; padding: 6px; }
.uploaded-art-grid[data-view=small] .uploaded-art-item-copy { align-content: center; padding: 9px 12px; }
.uploaded-art-grid[data-view=small] .uploaded-art-item-details { display: block; }
.empty-list { text-align: center; }

.art-card, .artwork-detail {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.art-card { padding: clamp(20px, 4vw, 34px); }

h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; line-height: 1.12; }
h2 { margin: 0; font-size: 1.25rem; }
.art-heading > p:last-child { margin-bottom: 24px; color: #516674; }
.art-kicker { margin: 0 0 5px; color: #416d86; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }

.art-card > form, .edit-panel > form { display: grid; gap: 18px; }
label { min-width: 0; display: grid; gap: 6px; color: var(--brown); font-weight: 700; }
label small { color: #65727a; font-weight: 400; }
input, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #b9ad9b;
  border-radius: 8px;
  background: #fffefb;
  color: var(--ink);
  padding: 10px 11px;
}
input { min-height: 44px; }
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 3px solid rgba(63, 129, 159, 0.24); border-color: #3f819f; }
.file-field input { padding: 7px; background: var(--panel); }
.file-field > small { display: block; }

.upload-preview {
  min-width: 0;
  max-height: 360px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  text-align: center;
}
.upload-preview img { display: block; max-width: 100%; max-height: 338px; margin: auto; object-fit: contain; }

.primary-button, .secondary-button, .danger-button, .text-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 9px 15px;
  cursor: pointer;
  font-weight: 700;
}
.primary-button { border: 1px solid #234a73; background: #345f73; color: #fff; }
.primary-button:hover, .primary-button:focus-visible { background: #234a73; }
.secondary-button { border: 1px solid var(--brown); background: rgba(255, 250, 240, 0.85); color: var(--brown); }
.secondary-button:hover, .secondary-button:focus-visible { background: var(--panel); color: #2f2721; }
.danger-button { border: 1px solid #7f2f2a; background: #fff7f4; color: var(--danger); }
.danger-button:hover, .danger-button:focus-visible { background: #f7dfda; }
.text-button { min-height: 40px; border: 0; background: transparent; color: #345f73; }
button:disabled { cursor: wait; opacity: 0.62; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.form-message { min-height: 1.5em; margin: -5px 0 0; color: #486070; font-size: 0.92rem; }
.error-message { color: #8f2f2b; }

.page-status { margin: 0; padding: 20px; color: #fff; text-align: center; }
.not-found { text-align: center; }
.not-found p { color: #516674; }
.artwork-detail { overflow: hidden; }
.artwork-image-wrap { display: grid; min-height: 220px; place-items: center; padding: clamp(12px, 3vw, 24px); background: #e7e1d7; }
.artwork-image-wrap img { display: block; max-width: 100%; max-height: min(72vh, 820px); object-fit: contain; }
.artwork-copy { padding: clamp(18px, 4vw, 32px); }
.artwork-title-row, .panel-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.artwork-title-row h1 { min-width: 0; }
.compact-button { flex: 0 0 auto; }
.artwork-artist { margin: 8px 0 0; color: #416d86; font-weight: 700; }
.artwork-description { margin: 18px 0 0; white-space: pre-wrap; }
.artwork-facts { margin: 20px 0 0; color: #65727a; font-size: 0.88rem; }
.edit-panel { margin-top: 20px; }
.edit-panel form { margin-top: 20px; }
.edit-actions { display: flex; flex-wrap: wrap; gap: 10px; }


@media (max-width: 480px) {
  .art-site-header-inner { width: calc(100% - 20px); gap: 8px; }
  .art-site-name { font-size: 0.9rem; }
  .header-action { padding-inline: 10px; }
  .art-page, .art-detail-page { width: calc(100% - 20px); padding-top: 18px; }
  .art-card { padding: 18px; border-radius: 11px; }
  .art-list-page { padding-top: 18px; }
  .list-heading { align-items: center; flex-direction: row; gap: 10px; }
  .list-heading h1 { font-size: 1.35rem; }
  .list-heading-actions { margin-left: auto; flex-wrap: nowrap; justify-content: flex-end; }
  .view-button { min-height: 38px; padding: 6px 10px; }
  .artwork-title-row { align-items: center; }
  .edit-actions > button { flex: 1 1 150px; }
}

.site-footer { margin-top:28px; padding:24px 0; border-top:1px solid rgba(255,255,255,.24); color:#FFFFFF; background:#234A73; }
.footer-inner { width:min(920px,calc(100% - 40px)); margin:0 auto; }
.footer-inner p { margin:0; }
.site-footer a { color:inherit; text-decoration:none; }
.site-footer a:hover { text-decoration:underline; text-underline-offset:4px; }
@media (max-width:480px) {
  .site-footer { margin-top:18px; padding:20px 0; }
  .footer-inner { width:calc(100% - 20px); }
}


