/* Artefacts of Excavation - Archive Site CSS */
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700');

* { box-sizing: border-box; }
body { background-color: #faf5f2; font-family: 'Open Sans', sans-serif; font-size: 14px; line-height: 1.42857143; color: #333; margin: 0; padding: 0; }
a { color: #337ab7; text-decoration: none; }
a:hover { color: #23527c; text-decoration: underline; }
h1,h2,h3,h4,h5,h6 { font-family: inherit; font-weight: 500; line-height: 1.1; }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.row { margin: 0 -15px; }
.row::after { content: ''; display: table; clear: both; }
[class*="col-"] { float: left; padding: 0 15px; }
.col-md-3 { width: 25%; }
.col-md-4 { width: 33.333%; }
.col-md-6 { width: 50%; }
.col-md-8 { width: 66.666%; }
.col-md-9 { width: 75%; }
.col-md-12 { width: 100%; }

/* Header */
#headerwide { width: 100%; background-color: #559CBE; }
#headercentre { margin: 0 auto; max-width: 1200px; padding: 15px; display: flex; align-items: center; justify-content: space-between; }
.header { display: flex; align-items: center; width: 100%; }
.header__logo { margin-right: 20px; flex-shrink: 0; }
.header__logo-image { height: 80px; width: auto; }
.header__name-and-slogan { flex: 1; color: #fff; }
.header__site-name { margin: 0; font-size: 2em; }
.header__site-name a { color: #fff; text-decoration: none; }
.header__site-slogan { font-size: 1em; opacity: 0.9; }
.header-search { flex-shrink: 0; margin-top: 10px; }
.header-search input[type="text"] { padding: 5px 10px; font-size: 1em; border: none; border-radius: 3px 0 0 3px; }
.header-search input[type="submit"] { padding: 5px 12px; background: #e89719; color: #fff; border: none; border-radius: 0 3px 3px 0; cursor: pointer; }

/* Navigation */
#navigationbackground { background-color: #333; width: 100%; }
#navigation { background-color: #333; margin: 0 auto; max-width: 1200px; }
#main-menu { padding: 0; }
.sf-menu { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; }
.sf-menu > li { position: relative; }
.sf-menu > li > a { display: block; padding: 10px 15px; color: #e89719; text-decoration: none; white-space: nowrap; border-right: 1px solid #555; }
.sf-menu > li > a:hover { background-color: #A1C4D0; color: #fff; }
.sf-menu > li > ul { display: none; position: absolute; top: 100%; left: 0; background: #333; min-width: 200px; z-index: 1000; list-style: none; padding: 0; margin: 0; border: 1px solid #555; }
.sf-menu > li:hover > ul { display: block; }
.sf-menu > li > ul > li > a { display: block; padding: 8px 15px; color: #ccc; text-decoration: none; border-bottom: 1px solid #444; }
.sf-menu > li > ul > li > a:hover { background: #559CBE; color: #fff; }

/* Main content */
#page { background: #fff; }
#main { background-color: #fff; padding: 1em 0; }
#content { padding: 20px 15px; }
h2.page__title { margin-top: 0; font-size: 1.8em; color: #333; border-bottom: 2px solid #559CBE; padding-bottom: 10px; margin-bottom: 20px; }

/* Breadcrumb */
.breadcrumb { padding: 8px 0; margin-bottom: 20px; list-style: none; background: transparent; border-radius: 4px; font-size: 0.9em; }
ol.breadcrumb { display: flex; flex-wrap: wrap; padding: 8px 0; margin-bottom: 20px; list-style: none; background: #f5f5f5; border-radius: 4px; padding: 8px 15px; }
ol.breadcrumb li { display: flex; align-items: center; }
ol.breadcrumb li + li::before { content: "»"; padding: 0 8px; color: #999; }
ol.breadcrumb li.active { color: #777; }

/* Cards / Grids */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin: 20px 0; }
.card { background: #fff; border: 1px solid #e0e0e0; border-radius: 4px; overflow: hidden; transition: box-shadow 0.2s; }
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.card a { text-decoration: none; color: inherit; display: block; }
.card-img { width: 100%; height: 160px; object-fit: cover; background: #ead5c7; }
.card-img-placeholder { width: 100%; height: 160px; background: #ead5c7; display: flex; align-items: center; justify-content: center; color: #999; font-size: 2em; }
.card-body { padding: 12px; }
.card-title { font-size: 1em; font-weight: 600; margin: 0 0 5px; }
.card-meta { font-size: 0.85em; color: #777; }

/* Table */
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #e0e0e0; }
th { background: #f5f5f5; font-weight: 600; }
tr:hover { background: #fafafa; }

/* Alphabetical index */
.alpha-index { margin: 20px 0; }
.alpha-index a { display: inline-block; padding: 4px 10px; margin: 2px; background: #559CBE; color: #fff; border-radius: 3px; text-decoration: none; font-size: 0.9em; }
.alpha-index a:hover { background: #337ab7; }
.alpha-section { margin: 20px 0; }
.alpha-section h3 { background: #559CBE; color: #fff; padding: 8px 15px; margin: 0 0 10px; border-radius: 3px; font-size: 1.1em; }
.alpha-list { columns: 3; column-gap: 30px; padding: 0; list-style: none; margin: 0 0 20px; }
.alpha-list li { margin-bottom: 5px; break-inside: avoid; }
.alpha-list a { color: #337ab7; }
.alpha-list a:hover { color: #23527c; text-decoration: underline; }

/* Map */
#excavation-map, #site-map { height: 500px; margin: 20px 0; border: 1px solid #ccc; border-radius: 4px; }
.leaflet-popup-content { max-width: 200px; }
.leaflet-popup-content a { color: #337ab7; }

/* Field labels */
.field-label { font-weight: bold; margin-bottom: 5px; color: #555; }
.field-item { margin-bottom: 0.3em; }
.field-group { margin-bottom: 20px; }

/* People layout */
.person-layout { display: flex; gap: 30px; margin-bottom: 30px; }
.person-image { flex-shrink: 0; }
.person-image img { max-width: 200px; border: 3px solid #ead5c7; }
.person-content { flex: 1; }

/* Tag/pill badges */
.badge { display: inline-block; padding: 3px 8px; margin: 2px; background: #e0eef5; color: #337ab7; border-radius: 3px; font-size: 0.85em; }

/* Document images grid */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; margin: 20px 0; }
.doc-item { text-align: center; }
.doc-item a { display: block; color: #333; text-decoration: none; }
.doc-item img { width: 100%; height: 150px; object-fit: cover; border: 2px solid #ead5c7; }
.doc-item .doc-title { font-size: 0.8em; margin-top: 5px; line-height: 1.3; }
.doc-placeholder { width: 100%; height: 150px; background: #ead5c7; display: flex; align-items: center; justify-content: center; color: #999; }

/* Search */
.search-box { margin: 20px 0; display: flex; gap: 10px; }
.search-box input[type="text"] { flex: 1; padding: 10px; font-size: 1em; border: 1px solid #ccc; border-radius: 3px; }
.search-box input[type="submit"] { padding: 10px 20px; background: #559CBE; color: #fff; border: none; border-radius: 3px; cursor: pointer; }
.search-results { margin-top: 20px; }
.search-result { margin-bottom: 20px; padding: 15px; border: 1px solid #e0e0e0; border-radius: 4px; }
.search-result h3 { margin: 0 0 8px; }
.search-result h3 a { color: #337ab7; }
.search-snippet { color: #666; font-size: 0.95em; }
.search-type { font-size: 0.8em; color: #999; font-style: italic; }
#search-loading { display: none; color: #777; font-style: italic; }

/* Pager */
.pager { display: flex; list-style: none; padding: 20px 0; margin: 0; gap: 5px; flex-wrap: wrap; }
.pager li a { display: block; padding: 6px 14px; border: 1px solid #ccc; border-radius: 3px; color: #555; text-decoration: none; }
.pager li a:hover { background: #559CBE; color: #fff; border-color: #559CBE; }
.pager li.active a, .pager li a.current { background: #559CBE; color: #fff; border-color: #559CBE; }

/* Image lightbox */
.gallery-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.gallery-item { flex: 0 0 auto; }
.gallery-item img { max-width: 150px; max-height: 150px; object-fit: cover; border: 2px solid #ead5c7; cursor: zoom-in; }

/* Sidebar */
.sidebar { background: rgba(160,200,220,0.12); padding: 15px; border-radius: 4px; }
.sidebar h3 { font-size: 1.1em; border-bottom: 1px solid #559CBE; padding-bottom: 8px; margin-bottom: 12px; }
.sidebar ul { padding: 0 0 0 20px; margin: 0; }
.sidebar li { margin-bottom: 5px; }

/* Footer */
#footer-area { background-color: #559CBE; }
#footer-container { max-width: 1200px; margin: 0 auto; padding: 20px 15px; }
#bottom { background-color: #555; padding: 8px; text-align: center; font-size: 0.8em; color: #aaa; }

/* Utility */
.clearfix::after { content: ''; display: table; clear: both; }
.text-muted { color: #777; }
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }

/* Filter controls */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 15px 0; padding: 12px; background: #f5f5f5; border-radius: 4px; }
.filter-bar label { font-weight: 600; font-size: 0.9em; }
.filter-bar input, .filter-bar select { padding: 6px 10px; border: 1px solid #ccc; border-radius: 3px; font-size: 0.9em; }
.filter-bar .filter-count { font-size: 0.85em; color: #777; }

/* Responsive */
@media (max-width: 768px) {
  .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9 { width: 100%; }
  .alpha-list { columns: 1; }
  .header { flex-wrap: wrap; }
  .header__site-name { font-size: 1.4em; }
  .sf-menu { flex-direction: column; }
  .person-layout { flex-direction: column; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* Object marks */
.object-mark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.object-mark-item { text-align: center; padding: 10px; border: 1px solid #e0e0e0; border-radius: 4px; }
.object-mark-item img { max-width: 180px; max-height: 180px; object-fit: contain; }
.object-mark-item .caption { font-size: 0.85em; margin-top: 8px; }

/* Excavations roles table */
.roles-table { width: 100%; border-collapse: collapse; }
.roles-table th { background: #559CBE; color: #fff; padding: 10px; }
.roles-table td { padding: 8px 12px; border-bottom: 1px solid #eee; vertical-align: top; }

/* notice banner */
.archive-notice { background: #f8f4e4; border: 1px solid #e8d870; border-radius: 4px; padding: 12px 15px; margin-bottom: 20px; font-size: 0.95em; color: #666; }
.archive-notice strong { color: #444; }
