:root { --ink: #0f2a4a; --blue: #2c5f94; --muted: #5b6b7d; --bg: #f7f9fb; --line: #dde4ec; --sold: #a23b3b; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Josefin Sans", system-ui, sans-serif; font-weight: 300; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--blue); }
img { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .8rem 16px; background: url(background.jpg) center/cover; }
.top.admin-top { background: #4f6478; }
.brand img { height: 44px; width: auto; }
.adminnav { display: flex; gap: 1rem; align-items: center; }
.adminnav a, .adminnav .link { color: #fff; text-decoration: none; font-weight: 400; }
.adminnav form { margin: 0; }

/* gallery grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; padding: 6px; }
.tile { position: relative; aspect-ratio: 1; overflow: hidden; background: #dfe6ee; color: #fff; text-decoration: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.logo-tile { container-type: inline-size; background: url(background.jpg) center/cover; display: grid; place-items: center; }
.logo-inner { width: 78%; text-align: center; }
.tagline { margin: .6rem 0 0; color: #fff; font-size: clamp(.95rem, 4.6cqi, 1.6rem); letter-spacing: .12em; text-shadow: 0 1px 6px rgba(8,24,44,.5); }
.logo-tile img { width: 100%; height: auto; object-fit: contain; transform: none !important; }
.caption { position: absolute; inset: auto 0 0 0; padding: 2.5rem 1rem .9rem; display: flex; flex-direction: column;
  background: linear-gradient(transparent, rgba(8,24,44,.75)); opacity: 0; transition: opacity .3s; }
.caption strong { font-weight: 600; font-size: 1.15rem; letter-spacing: .03em; }
@media (hover: none), (pointer: coarse), (max-width: 700px) { .tile .caption { opacity: 1; } }
.tile.sold img { filter: saturate(.55); }
.badge { position: absolute; top: 12px; right: 12px; background: var(--sold); color: #fff; padding: .2rem .7rem;
  font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.badge.inline { position: static; vertical-align: middle; margin-left: .5rem; }

/* detail */
.detail { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 2.5rem; max-width: 1300px; margin: 2rem auto; padding: 0 16px; }
.detail .zoom img { width: 100%; box-shadow: 0 10px 40px rgba(15,42,74,.18); }
.detail h1 { font-weight: 300; font-size: 2.4rem; margin: 0 0 .2rem; letter-spacing: .04em; }
.meta { color: var(--muted); margin: 0; }
.price { font-size: 1.4rem; font-weight: 400; }
.desc { margin-bottom: 1.5rem; }
@media (max-width: 800px) { .detail { grid-template-columns: 1fr; gap: 1.2rem; margin-top: 1rem; } }

/* forms */
.order { display: flex; flex-direction: column; gap: .9rem; }
.order label { display: flex; flex-direction: column; gap: .25rem; font-weight: 400; }
.order label.radio { flex-direction: row; align-items: center; gap: .5rem; font-weight: 300; }
input, textarea, button { font: inherit; }
input:not([type=radio]):not([type=checkbox]), textarea { padding: .6rem .7rem; border: 1px solid var(--line); background: #fff; color: var(--ink); width: 100%; }
fieldset { border: 1px solid var(--line); padding: .6rem .9rem; display: flex; flex-direction: column; gap: .4rem; }
.hp { position: absolute; left: -9999px; }
.btn { background: var(--ink); color: #fff; border: 0; padding: .75rem 1.4rem; cursor: pointer; text-decoration: none; display: inline-block; letter-spacing: .04em; }
.btn.small { padding: .4rem .8rem; font-size: .9rem; }
.link { background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; text-decoration: underline; }
.danger { color: var(--sold); }
.error { color: var(--sold); background: #fbeaea; padding: .5rem .8rem; margin: .3rem 0; }
.flash { background: #e6f2e9; padding: .5rem .8rem; }

.narrow { max-width: 640px; margin: 2rem auto; padding: 0 16px; }
.bank { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.2rem; background: #fff; padding: 1rem; border: 1px solid var(--line); }
.bank dt { color: var(--muted); } .bank dd { margin: 0; font-weight: 400; }
.addr { background: #fff; padding: 1rem; border: 1px solid var(--line); }

/* admin */
.admin { max-width: 1100px; margin: 1.5rem auto; padding: 0 16px; }
.admin.narrow { max-width: 640px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.list { width: 100%; border-collapse: collapse; background: #fff; }
.list th, .list td { padding: .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.thumb { width: 72px; height: 72px; object-fit: cover; }
.preview { width: 200px; }
.pill { display: inline-block; border: 0; border-radius: 99px; padding: .15rem .7rem; font-size: .85rem; background: #e8eef5; color: var(--ink); text-decoration: none; cursor: pointer; }
button.pill { border: 1px solid currentColor; padding: .05rem .55rem; font-size: .8rem; line-height: 1.5; white-space: nowrap; }
.swap { opacity: .6; margin-left: .2rem; }
.pill.sold { background: #f6dede; color: var(--sold); } .pill.avail { background: #e1f1e5; color: #2c6b3c; }
.actions { white-space: nowrap; } .actions > * { margin-left: .6rem; }
.order-card { background: #fff; border: 1px solid var(--line); padding: .9rem 1rem; margin-bottom: .8rem; }
.order-card p { margin: .3rem 0; }
.order-card.status-cancelled, .order-card.status-done { opacity: .6; }
@media (max-width: 700px) {
  .list thead { display: none; }
  .list, .list tbody { display: block; background: none; }
  .list tr { display: grid; grid-template-columns: 88px 1fr auto; grid-template-areas: "img name name" "img price status" "img . actions";
    gap: .15rem .8rem; align-items: center; background: #fff; border: 1px solid var(--line); padding: .6rem; margin-bottom: .5rem; }
  .list td { display: block; padding: 0; border: 0; min-width: 0; }
  .list td:nth-child(1) { grid-area: img; } .list td:nth-child(2) { grid-area: name; font-weight: 400; }
  .list td:nth-child(3) { display: none; } .list td:nth-child(4) { grid-area: price; white-space: nowrap; }
  .list td:nth-child(5) { display: none; } .list td:nth-child(6) { grid-area: status; justify-self: end; text-align: right; }
  .list td:nth-child(7) { grid-area: actions; justify-self: end; }
  .thumb { width: 88px; height: 88px; }
  .admin { padding: 0 .6rem; }
  .adminnav { gap: .8rem; flex-wrap: wrap; }
}

.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 16px; }

/* hover effects only for real mouse pointers on larger screens */
@media (hover: hover) and (pointer: fine) and (min-width: 701px) {
  .tile:hover img { transform: scale(1.04); }
  .tile:hover .caption, .tile:focus .caption { opacity: 1; }
  .btn:hover { background: var(--blue); }
  button.pill:hover { filter: brightness(.95); }
}

/* phones: two tiles per row */
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; }
  .caption { padding: 1.6rem .55rem .45rem; }
  .caption strong { font-size: .9rem; line-height: 1.2; }
  .caption small { font-size: .72rem; }
  .badge { top: 6px; right: 6px; padding: .1rem .45rem; font-size: .62rem; }
  .logo-inner { width: 86%; }
  .tagline { font-size: clamp(.62rem, 6.2cqi, .9rem); letter-spacing: .06em; margin-top: .35rem; }
}
