
:root {
  --main-font-family: 'Times New Roman', Times, serif;
}

body.accessible-mode, .accessible-mode {
  --main-font-family: 'OpenDyslexic', 'Comic Sans MS', 'Arial', Helvetica, sans-serif;
}

body.accessible-mode p, .accessible-mode p,
body.accessible-mode .justify, .accessible-mode .justify {
  text-align: left !important;
}

/* Header and Nav styling */
header {
  background: linear-gradient(135deg, #1c3d5a, #2a5c85);
  color: white;
  padding: 0; /* top = 0, right = 30, bottom = 0, left = 0 */
  /*position: sticky;*/
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  font-family: var(--main-font-family);
}

.header-grid {
  display: grid;
  grid-template-columns:  460px 1fr;  /* Left image | Title + Nav */
  grid-template-rows: auto auto;     /* Title on top, nav below */
  grid-template-areas:
    "left title"
    "left nav";
  background: linear-gradient(135deg, #1c3d5a, #2a5c85);
  padding: 0;
  gap: 10px;
}

/* LEFT IMAGE (vertical) */
.left-image {
  margin: 0;
  padding: 0;
  grid-area: left;
}

.left-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* TITLE */
.title {
  grid-area: title;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.title h1 {
  font-size: 4rem;
  margin: 0;
  color: white;
  font-family: var(--main-font-family);
  margin-top: 5%;
}

/* NAVIGATION */
.navigation {
  grid-area: nav;
}


/* Layout container */
.nav-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  display: flex;
}

.nav-list .logo {
  margin: 0;
  padding: 0;
}

.nav-list .logo img {   
  display: block;
  margin: 0;
  padding: 0;
}

.nav-list li:not(.logo) a {
  padding: 8px 10px;
}

nav {
  margin-left: 0;
}

.nav-list {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  align-items: flex-end;
  justify-content: flex-end;   /* <-- This pushes the menu to the RIGHT */
}


.nav-list > li {
  position: relative;
  margin: 0;
  padding: 0.5% 1%;
}

.nav-list a {
  text-decoration: none;
  color: white;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.nav-list a:hover,
.nav-list .dropbtn:hover {
  background-color: #3a4e62;
  transform: scale(1.02);
}

.dropdown .dropbtn {
  font-size: 1.05rem; 
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1; 
}

/* Dropdown content */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #1c3d5a;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  border-radius: 6px;
  top: 100%;
  left: 0;
  z-index: 200;
}

.dropdown-content li {
  padding: 0;
  margin: 0;
}

.dropdown-content li a {
  padding: 12px 18px;
  display: block;
  font-weight: 500;
  font-size: 1.05rem;
}

.dropdown-content li a:hover {
  background-color: #3b536a;
  border-radius: 0;
}

/* Show dropdown on hover */
.dropdown:hover .dropdown-content {
  display: block;
}

.site-title {
  font-size: 4rem;
  color: white;
  margin: 0;
  float: right;
  font-family: var(--main-font-family);
}



body {
  font-family: var(--main-font-family);
  background-color: #faf8f5;
  color: #2a3b4c;
  margin: 0;
  padding: 0;
  line-height: 1.8;
  letter-spacing: 0.05em;
  word-spacing: 0.1em;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Ensure boxes are hidden by default */
.container {
     display: flex;
     flex-wrap: nowrap;
     align-items: flex-start;
     width: 100%;
     overflow-x: auto;
     gap: 15px; /* Equal spacing between boxes */
     padding: 0 15px; /* Space before first and after last */
     box-sizing: border-box;
     margin-top: 1.5%;
}

.footer {
  background: linear-gradient(135deg, #152d43, #1c3d5a);
  color: #e0e0e0;
  padding: 40px 20px;
  font-family: var(--main-font-family);
  font-size: 15px;
  margin-top: auto;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

/* Footer grid layout */
.footer-container {
  max-width: 1200px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

/* Column headings */
.footer-col h5 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.1rem;
  border-bottom: 2px solid #57a99a;
  padding-bottom: 8px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Lists inside footer */
.footer-col ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.footer-col ul li {
  margin: 0;
  padding: 5px 0;
  transition: transform 0.2s ease;
  font-size: 15px;
  line-height: 1.5;
}

.footer-col ul li:hover {
  transform: translateX(5px);
}

.footer-col p {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Footer links */
.footer a {
  color: #88c9bb;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: #ffffff;
}

/* Footer logos/images */
/* Footer logos column */
.footer-logos {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}

/* Footer logos */
.footer-logo {
  max-width: 140px;
  height: auto;
  display: block;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px;
  border-radius: 6px;
  transition: transform 0.3s ease;
}

.footer-logo:hover {
  transform: scale(1.05);
}

/* Small text */
.footer small {
  display: block;
  margin-top: 15px;
  font-size: 0.85rem;
  color: #a0aab5;
  line-height: 1.5;
}

.footer small img {
  vertical-align: middle;
  margin-bottom: 4px;
}

/* Stack columns only on small screens */
@media (max-width: 900px) {
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-logos {
    align-items: center;
  }
}

.fixed-bottom-left {
  position: fixed;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: flex-start;
  gap: 10px;         /* spacing between images */
  padding: 10px;     /* optional: small padding from the edges */
  background: none;  /* or transparent */
  z-index: 9999;     /* stay above everything */
}

.fixed-bottom-left img {
  height: 60px;     /* choose your desired size */
  width: auto;      /* preserves aspect ratio */
  object-fit: contain;
  display: block;
}

.fixed-bottom-right {
  position: fixed;
  bottom: 0;
  right: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.95);
  z-index: 9999;
  border-top-left-radius: 10px;
  box-shadow: -2px -2px 10px rgba(0, 0, 0, 0.1);
}

.footer-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.footer-item h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.footer-item small {
  font-size: 12px;
  line-height: 1.3;
  color: #333;
  max-width: 450px;
}

.footer-separator {
  width: 1px;
  height: 24px;
  background-color: #ccc;
  margin: 0 5px;
}

.fixed-bottom-right img {
  vertical-align: middle;
}

h2, h3 {
  text-align: left;
  font-family: "Calibri", sans-serif;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

h1 {
  font-size: 28px;
  text-align: center;
  margin: 0.75em 0;
}

h2 {
  font-size: 24px;
}

.home-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 30px;
  width: 100%;
  box-sizing: border-box;
}

.home-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
  color: #222;
}

.home-hero h2 {
  align-self: flex-end;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  font-variant: small-caps;
  text-align: right;
  color: #555;
  line-height: 1.5;
  font-weight: 500;
  margin-top: 0;
  border-top: 2px solid #57a99a;
  padding-top: 15px;
  max-width: 80%;
}

h3 {
  font-size: 20px;
}

h4{
  font-size:18px;
}

ul li {
    list-style: none;
    position: relative;
    padding-left: 6em;   /* space so text doesn't overlap marker */
}

ul li::before {
    content: attr(data-wit);
    position: absolute;
    left: 0;
    font-weight: bold;
}


p {
  margin: 1em 0;
  text-align: justify;
  font-size: 18px;
  line-height: 1.7;
}

li {
  margin: 1rem 0;
  text-align: justify;
  font-size: 18px;
  line-height: 1.7;
}

.image-text-block {
  margin-bottom: 1.2rem;
  padding: 15px 20px;               
  border-radius: 10px;
  word-spacing: 1px;
  max-width: 1200px;                            /* balanced line length */
  margin-left: auto;
  margin-right: auto;
}

[id] {
  scroll-margin-top: 20px; /* adjusted for non-sticky or smaller header */
}


a {
  color: #005bbb;                               /* accessible blue */
  text-decoration-thickness: 2px;
}

a:hover {
  text-decoration: underline;
}

table, th, td { 
  border: 1px solid black; 
  border-collapse: collapse; 
}
                    
th, td { 
  padding: 5px; 
}

.edition-title-row { 
  background-color: #ddd; 
  font-weight: bold; 
}
                    
.alphabet-nav { 
  display:flex; 
  justify-content:center; 
  flex-wrap:wrap; 
  gap:6px; 
  margin:1rem 0; 
}
                    
.alphabet-nav .alpha-link { 
  padding:4px 8px; 
  background:#1c3d5a; 
  color:#fff; 
  border-radius:4px; 
  text-decoration:none; 
  font-weight:bold;
}
                    
.person-block { 
  margin-bottom: 1.2rem; 
  padding: 10px; 
  background:#fff; 
  border-radius:8px; 
  border:1px solid #e6e6e6; 
}
                
.person-toggle {
    font-size: 1.4rem;        /* slightly smaller */
    margin: 4px 0;            /* WAS 10px */
    padding: 4px 0;           /* WAS 8px */
}

.person-toggle:hover {
    color: #2a5c85;
}

.person-panel {
    display: none;
    padding: 10px 0 20px 0;
}

.person-panel.open {
    display: block;
}

.person-link {
    font-size: 0.9rem;
    margin-left: 6px;
    color: #2179c4;
    text-decoration: none;
}

.person-link:hover {
    text-decoration: underline;
}

.alphabet-nav {
    width: 100vw;               /* full viewport width */
    display: flex;
    justify-content: center;    /* center horizontally */
    flex-wrap: wrap;            /* wrap letters if needed */
    margin: 1rem 0;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    left: 50%;
    transform: translateX(-50%); /* truly center relative to viewport */
}

.alphabet-nav .alpha-link {
    margin: 2px;
    padding: 6px 10px;
    background-color: #1c3d5a;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    display: inline-block;
}

.alphabet-nav .alpha-link:hover {
    background-color: #3a4e62;
}

.wrap-image-left {
  float: left;       
  width: 40%;      
  margin: 10px 30px 10px 0;  /* increased right margin for text spacing */
}

.wrap-image-right {
  float: right;       
  width: 40%;    
  margin: 10px 0 10px 30px;  /* increased left margin for text spacing */
}

.contact-section {
  width: 100%;
  max-width: 80rem; /* increased horizontal width (~1280px) */
  margin-left: auto;
  margin-right: auto;
  padding: 3rem 1rem; /* keep vertical padding the same */
}

.contact-intro > * + * {
  margin-top: 1rem;
}

.contact-description {
  color: rgb(107 114 128);
}

.form-group-container {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  margin-bottom: 0.5rem;
}

.form-input,
.form-textarea {
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  display: flex;
  height: 2.5rem;
  width: 800px;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.form-input::placeholder,
.form-textarea:focus-visible {
  color: #6b7280;
}

.form-input:focus-visible,
.form-textarea:focus-visible {
  outline: 2px solid #1c3d5a;
  outline-offset: 2px;
}

.form-textarea {
  min-height: 120px;
}

.form-submit {
  width: 100%;
  margin-top: 1.2rem;
  background-color: #3b536a;
  color: #fff;
  padding: 13px 5px;
  border-radius: 0.375rem;
}

/* Responsive Layout */
@media (max-width: 768px) {
  .header-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "title"
      "nav";
  }
  .title h1 {
    font-size: 2.5rem;
    margin-top: 2%;
  }
  .nav-list {
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-list > li {
    padding: 2%;
  }
  .container {
    flex-direction: column;
  }
}

.collapsible {
  background-color: #eee;
  color: #444;
  cursor: pointer;
  padding: 18px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 15px;
}

/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
.active, .collapsible:hover {
  background-color: #ccc;
}

/* Style the collapsible content. Note: hidden by default */
.content {
  padding: 0 18px;
  display: none;
  overflow: hidden;
  background-color: #f1f1f1;
}.archivio-container {
    width: 100%;
    max-width: 100%;
    margin: 20px auto;
    padding: 0 20px;
    box-sizing: border-box;
    min-height: 80vh;
}
.archivio-header {
    text-align: center;
    margin-bottom: 30px;
    color: #4a4a4a;
}
.archivio-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    background: #fdfdfd;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}
.archivio-controls label {
    font-weight: bold;
    color: #333;
}
.archivio-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    flex-grow: 1;
    max-width: 400px;
}
.archivio-btn {
    padding: 10px 20px;
    background-color: #f07b1d; /* using the orange from the site */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}
.archivio-btn:hover {
    background-color: #d16b18;
}
.archivio-btn-secondary {
    background-color: #6c757d;
}
.archivio-btn-secondary:hover {
    background-color: #5a6268;
}
.manifest-list {
    width: 100%;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}
.manifest-list h3 {
    margin-top: 0;
    font-size: 16px;
    color: #555;
}
.manifest-list-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.manifest-badge {
    background-color: #e9ecef;
    color: #495057;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#mirador-viewer {
    width: 100%;
    height: 90vh;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}