/* The village layout guide (tools/layout-guide.mjs writes the pages; guide.css gives the banner,
   the "back to top" link and the language list). */

.layouts-banner { background-image: url('/app/art/backdrops/camp_wide.webp'); background-position: center 55%; }
/* Sharp screens get the full-size original (client/public/art/site/camp_wide_2752.webp). */
.layouts-banner { background-image: url('/app/art/backdrops/camp_wide.webp'); background-image: image-set(url('/app/art/backdrops/camp_wide.webp') 1x, url('/app/art/site/camp_wide_2752.webp') 2x); }

/* How to use a code, beside the key to the drawings. */
.layouts-how { padding: 48px 16px; background: var(--night); }
.layouts-how-wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; }
.layouts-how .eyebrow { margin-bottom: 16px; }
.layouts-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.layouts-steps li {
  position: relative; padding: 16px 18px 16px 64px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line); counter-increment: step;
  font-size: 17px; line-height: 1.5; color: var(--soft);
}
.layouts-steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 14px;
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: #2a1a05;
  font-family: 'Cinzel', Georgia, serif; font-weight: 900; font-size: 17px;
  box-shadow: 0 3px 0 #8a5a12, 0 6px 14px rgba(0, 0, 0, 0.35);
}
.layouts-note { margin: 16px 0 0; font-size: 15px; line-height: 1.5; color: var(--lilac); }
.layouts-key { padding: 20px 22px; border-radius: 18px; background: var(--deep); border: 1px solid var(--line); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3); }
.layouts-key ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; padding: 0; list-style: none; }
.layouts-key li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--soft); min-width: 0; overflow-wrap: anywhere; }
.swatch { flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--fill); border: 2px solid var(--edge); box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.28); }
.swatch.hall { --fill: #f2b134; --edge: #8a5a12; }
.swatch.defence { --fill: #e0605a; --edge: #7d2421; }
.swatch.storehouse { --fill: #4fc3b5; --edge: #1d6158; }
.swatch.economy { --fill: #e7c36a; --edge: #7d6120; }
.swatch.army { --fill: #6f9df0; --edge: #25427f; }
.swatch.other { --fill: #b9a6ff; --edge: #4d3c8c; }
.swatch.wall { --fill: #6b7486; --edge: #363c48; border-radius: 3px; width: 16px; height: 16px; margin: 3px; }
.swatch.goo { background: radial-gradient(circle at 35% 35%, #7a58a6 0 3px, transparent 4px), #5b3f80; border-color: #3a2670; }

/* The Town Hall picker. */
.layouts-halls { padding: 40px 16px 48px; background: var(--deep); }
.layouts-halls .eyebrow { margin-bottom: 20px; text-align: center; }
.layouts-hall-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.layouts-hall-list a {
  display: grid; place-items: center; height: 52px; border-radius: 14px;
  background: var(--panel); border: 2px solid var(--line); color: #fff; text-decoration: none;
  font-family: 'Cinzel', Georgia, serif; font-weight: 900; font-size: 18px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
/* The Town Hall shown (layouts.js shows one at a time). */
.layouts-hall-list a[aria-current="true"] {
  background: linear-gradient(180deg, var(--gold-light), var(--gold)); border-color: var(--gold); color: #2a1a05;
  box-shadow: 0 3px 0 #8a5a12, 0 8px 18px rgba(0, 0, 0, 0.35);
}
.layouts-filtered .layout-hall { background: var(--night); }
.layouts-hall-list a:hover, .layouts-hall-list a:focus-visible { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(242, 177, 52, 0.2); }

/* A Town Hall's plans. */
.layout-hall { padding: 48px 16px; background: var(--night); scroll-margin-top: 80px; }
.layout-hall:nth-of-type(even) { background: var(--deep); }
.layout-hall h2 { margin-bottom: 20px; font-size: 32px; line-height: 1.15; overflow-wrap: break-word; }
.layout-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin: 0 0 8px; padding: 0; list-style: none; }
.layout-card {
  display: flex; flex-direction: column; overflow: hidden; border-radius: 22px;
  background: var(--panel); border: 2px solid var(--line);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.layout-card:hover { transform: translateY(-3px); box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45); }
.layout-card.own { border-color: rgba(242, 177, 52, 0.7); }
.layout-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; padding: 14px; background: radial-gradient(circle at 50% 40%, #2f6a8f, #173a55 75%); }
.layout-card-words { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 18px; min-width: 0; }
.layout-card h3 { margin: 0; font-family: 'Cinzel', Georgia, serif; font-weight: 900; font-size: 20px; color: #fff; overflow-wrap: break-word; }
.layout-code { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.layout-code span { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--lilac); }
.layout-code strong {
  padding: 4px 12px; border-radius: 10px; background: var(--night); border: 1px solid var(--gold);
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 22px; letter-spacing: 1px;
  color: var(--gold-light); user-select: all;
}
.layout-count { margin: 0; font-size: 15px; color: var(--soft); }

@media (max-width: 900px) {
  .layouts-how-wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .layouts-steps li { padding-left: 58px; font-size: 16px; }
  .layout-hall { padding: 36px 16px; scroll-margin-top: 150px; }
  .layout-hall h2 { font-size: 26px; }
  .layout-cards { grid-template-columns: minmax(0, 1fr); }
  .layouts-key ul { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .layouts-hall-list a, .layout-card { transition: none; }
  .layouts-hall-list a:hover, .layout-card:hover { transform: none; }
}
