/*
  Red Trilobite shared stylesheet
  Revised September 2026

  Designed for:
  - index.html
  - Templates/Group.dwt
  - Templates/item.dwt
  - gradual migration of older Dreamweaver pages
*/

:root {
  --rt-background: #f5f5f2;
  --rt-surface: #ffffff;
  --rt-text: #252525;
  --rt-heading: #1f1f1f;
  --rt-border: #d7d7d2;
  --rt-border-dark: #aaaaaa;
  --rt-burgundy: #9f2d2d;
  --rt-burgundy-dark: #7b2020;
  --rt-teal: #2d9e9f;
  --rt-teal-dark: #2d7778;
  --rt-teal-pale: #f2f8f8;
  --rt-selection-blue: #1565c0;
  --rt-nav-background: #eeeeee;
  --rt-muted-background: #f3f3f0;
  --rt-content-width: 820px;
  --rt-site-width: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--rt-background);
  color: var(--rt-text);
  font-family: Calibri, Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--rt-burgundy-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover,
a:focus-visible {
  color: var(--rt-teal-dark);
}

a:focus-visible {
  outline: 3px solid var(--rt-teal);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -5rem;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: var(--rt-surface);
  color: #000000;
}

.skip-link:focus {
  top: 1rem;
}

#container {
  width: min(var(--rt-site-width), 100%);
  margin: 0 auto;
  background: var(--rt-surface);
}

/* Header and primary navigation */

#header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rt-border);
  background: var(--rt-surface);
  color: var(--rt-text);
}

#header > p {
  margin: 0;
}

.site-logo,
#Insert_logo {
  display: block;
  width: min(250px, 70vw);
  height: auto;
  border: 0;
}

#csstabs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#csstabs ul li {
  float: none;
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
}

#csstabs li a {
  display: block;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--rt-burgundy);
  background: var(--rt-nav-background);
  color: #111111;
  font-size: 0.9rem;
  line-height: 1;
  text-decoration: none;
}

#csstabs li a:hover,
#csstabs li a:focus-visible {
  background: #f6eaea;
  color: #111111;
}

#csstabs li a[aria-current="page"] {
  background: var(--rt-burgundy);
  color: #ffffff;
}

/* Main two-column layout */

.page-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 2rem;
  padding: 2rem 1.25rem 3rem;
}

.page-layout #content {
  float: none;
  grid-column: 2;
  width: auto;
  max-width: var(--rt-content-width);
  min-width: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.page-layout #sidecol {
  float: none;
  grid-column: 1;
  grid-row: 1;
  width: auto;
  color: inherit;
  background: transparent;
}

#contproper,
#sideproper {
  padding: 0;
}

/* Compatibility for older pages without .page-layout. */

#container > #content {
  float: right;
  width: 85%;
  color: var(--rt-text);
  background: var(--rt-surface);
  text-align: left;
}

#container > #sidecol {
  float: right;
  width: 15%;
  color: var(--rt-text);
  background: var(--rt-surface);
}

#container > #content #contproper,
#container > #sidecol #sideproper {
  padding-right: 0.5rem;
  padding-left: 0.5rem;
}

/* Typography */

h1,
h2,
h3 {
  color: var(--rt-heading);
  font-family: Calibri, Arial, Helvetica, sans-serif;
  font-style: normal;
}

h1 {
  margin: 0 0 1.25rem;
  padding: 0;
  font-size: clamp(2rem, 5vw, 2.65rem);
  line-height: 1.15;
}

h2 {
  margin: 2rem 0 1rem;
  padding: 0;
  font-size: 1.6rem;
  line-height: 1.25;
}

h3 {
  margin: 0 0 0.4rem;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

p {
  margin: 0 0 1.15rem;
}

/* Category navigation */

#sidecol h2 {
  margin: 0 0 0.75rem;
  padding: 0;
  font-size: 1rem;
}

#cssbuttons {
  width: 100%;
  max-width: 180px;
  text-align: center;
}

#cssbuttons ul {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#cssbuttons li {
  margin: 0;
  padding: 0;
  list-style: none;
}

#cssbuttons li a {
  display: block;
  border: 1px solid var(--rt-border-dark);
  background: var(--rt-surface);
  color: #111111;
  text-decoration: none;
}

#cssbuttons li a:hover,
#cssbuttons li a:focus-visible {
  border-color: var(--rt-selection-blue);
  background: var(--rt-teal-pale);
}

#cssbuttons img {
  display: block;
  width: 100%;
  max-width: 110px;
  height: auto;
  margin: 0 auto;
  border: 0;
}

/* Homepage */

.shop-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
}

.shop-link img {
  width: 50px;
  height: 50px;
  border: 0;
}

.site-note {
  padding: 0.8rem 1rem;
  border-left: 4px solid var(--rt-teal);
  background: var(--rt-teal-pale);
}

.collection-list {
  display: grid;
  gap: 1.25rem;
}

.collection-category {
  padding: 1.25rem;
  border: 1px solid var(--rt-border);
}

.collection-category p {
  margin-bottom: 1rem;
}

.thumbnail-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.thumbnail-list a {
  position: relative;
  display: block;
  padding: 0.25rem;
  border: 1px solid #bbbbbb;
  background: var(--rt-surface);
}

.thumbnail-list a:hover,
.thumbnail-list a:focus-visible {
  border-color: var(--rt-selection-blue);
  background: var(--rt-teal-pale);
}

.thumbnail-list img {
  display: block;
  max-width: 150px;
  height: auto;
  border: 0;
}

/* Clear selection frame for linked photographs and objects */

#content a:hover img,
#content a:focus-visible img,
#sidecol a:hover img,
#sidecol a:focus-visible img {
  outline: 3px solid var(--rt-selection-blue);
  outline-offset: 0;
}

.new-marker {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  padding: 0.1rem 0.35rem;
  background: var(--rt-burgundy);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Dreamweaver group and item templates */

.template-content {
  min-width: 0;
  overflow-x: auto;
}

.template-content table {
  width: 100% !important;
  max-width: 100%;
}

.template-content img {
  max-width: 100%;
  height: auto;
}

.template-content td:hover {
  background: inherit;
  text-align: inherit;
}

.group-introduction {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rt-border);
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 1rem;
}

.collection-item {
  padding: 1rem;
  border: 1px solid var(--rt-border);
}

.collection-item:has(a:hover),
.collection-item:has(a:focus-visible),
.gallery-grid figure:has(a:hover),
.gallery-grid figure:has(a:focus-visible) {
  border-color: var(--rt-selection-blue);
  box-shadow: inset 0 0 0 2px var(--rt-selection-blue);
}

.collection-item h3,
.collection-item p {
  margin-bottom: 0.5rem;
}

.item-facts {
  display: grid;
  gap: 0;
  margin: 0 0 2rem;
  border: 1px solid var(--rt-border);
}

.item-facts div {
  display: grid;
  grid-template-columns: minmax(110px, 0.25fr) 1fr;
  border-bottom: 1px solid var(--rt-border);
}

.item-facts div:last-child {
  border-bottom: 0;
}

.item-facts dt,
.item-facts dd {
  margin: 0;
  padding: 0.75rem 1rem;
}

.item-facts dt {
  background: var(--rt-muted-background);
  font-weight: 700;
  text-transform: uppercase;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.gallery-grid figure {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--rt-border);
}

.gallery-grid img {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
}

.gallery-grid figcaption {
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

/* Legacy table-based content */

#contproper {
  min-width: 0;
  overflow-x: auto;
}

#contproper table {
  max-width: 100%;
  border-collapse: collapse;
  border-color: var(--rt-burgundy);
}

#contproper th,
#contproper td {
  padding: 0.75rem;
  text-align: left;
  vertical-align: bottom;
}

#contproper td:hover {
  background: inherit;
  text-align: left;
}

#contproper td:has(a:hover),
#contproper td:has(a:focus-visible) {
  box-shadow: inset 0 0 0 3px var(--rt-selection-blue);
}

#contproper td img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
}

#contproper td a img {
  border: 1px solid #111111;
}

#contproper .collection-category a img,
#contproper .thumbnail-list a img,
#contproper .gallery-grid a img {
  border: 0;
}

input,
select,
button,
textarea,
meter,
progress,
output {
  max-width: 100%;
}

/* Footer */

#footer {
  clear: both;
  padding: 1.25rem;
  background: var(--rt-teal);
  color: #071c1c;
  text-align: center;
}

#footer p {
  margin: 0.2rem 0;
}

@media (max-width: 700px) {
  #header {
    align-items: center;
    flex-direction: column;
  }

  .page-layout {
    display: block;
    padding-top: 1.5rem;
  }

  .page-layout #content {
    max-width: none;
  }

  .page-layout #sidecol {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rt-border);
  }

  #container > #content,
  #container > #sidecol {
    float: none;
    width: 100%;
  }

  #cssbuttons {
    max-width: none;
  }

  #cssbuttons ul {
    grid-template-columns: repeat(5, minmax(70px, 1fr));
  }
}

@media (max-width: 500px) {
  body {
    font-size: 17px;
  }

  #cssbuttons ul {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }

  .thumbnail-list img {
    max-width: 120px;
  }

  .item-facts div {
    display: block;
  }
}

@media print {
  body,
  #container {
    background: #ffffff;
  }

  #header,
  #sidecol,
  #footer,
  .skip-link {
    display: none;
  }

  .page-layout,
  .page-layout #content,
  #container > #content {
    display: block;
    float: none;
    width: 100%;
    max-width: none;
    padding: 0;
  }
}
