/* ==========================================================================
   Crusades Regesta — modern presentation layer for the content pages.
   Loads after the original Drupal-era stylesheets and refines them:
   readable typography, card layouts, hover/reveal effects. The site's
   crimson (#AA1A02) + charcoal identity is kept throughout.
   ========================================================================== */

:root {
  --cr-red: #AA1A02;
  --cr-red-dark: #7A1502;
  --cr-ink: #222;
  --cr-grey: #edefed;
  --cr-line: #ddd;
  --cr-shadow: 0 2px 6px rgba(0,0,0,.07), 0 12px 28px -18px rgba(0,0,0,.35);
  --cr-shadow-lift: 0 4px 10px rgba(0,0,0,.08), 0 22px 40px -20px rgba(0,0,0,.4);
}

/* --------------------------------------------------------------------------
   Shared: article typography on all static pages
   -------------------------------------------------------------------------- */
.node-page .content.clearfix,
.page-node article.node-page {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--cr-ink);
}
.node-page .field-name-body { max-width: 900px; }
.node-page .field-name-body p { margin: 0 0 1.05em; }

/* Page title: bigger, with a two-tone accent bar underneath */
.region-content h1.title {
  font-size: 34px;
  letter-spacing: .5px;
  color: var(--cr-red);
  margin-bottom: .35em;
}
.region-content h1.title::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin-top: .3em;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cr-red) 0 55%, #d9b382 55% 100%);
}

/* Old inline red headings and .redTilte headings: consistent modern look */
.node-page .field-name-body .redTilte,
.node-page .field-name-body span[style*="800000"],
.node-page .field-name-body span[style*="#AA1A02"] {
  color: var(--cr-red) !important;
  font-weight: bold;
}
.node-page .field-name-body .redTilte {
  font-size: 22px;
  margin: 1.4em 0 .6em;
}

/* Links inside article prose */
.node-page .field-name-body a:not(.bib-tag) {
  color: var(--cr-red-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(170,26,2,.35);
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.node-page .field-name-body a:not(.bib-tag):hover {
  color: var(--cr-red);
  border-bottom-color: var(--cr-red);
  background: rgba(170,26,2,.05);
}

/* Lead paragraph: slightly larger on the prose pages */
.page-about .field-name-body .field-item > p:first-child,
.page-founders .field-name-body .field-item > p:first-child,
.page-future-prospects .field-name-body .field-item > p:first-child {
  font-size: 19px;
  line-height: 1.65;
  color: #333;
}

/* In-page TOC lists (About / Founders): pill buttons */
.page-about .field-name-body .field-item > ul:first-of-type,
.page-founders .field-name-body .field-item > ul:first-of-type {
  list-style: none;
  margin: 1em 0 1.6em;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.page-about .field-name-body .field-item > ul:first-of-type li,
.page-founders .field-name-body .field-item > ul:first-of-type li { margin: 0; padding: 0; }
.page-about .field-name-body .field-item > ul:first-of-type a,
.page-founders .field-name-body .field-item > ul:first-of-type a {
  display: inline-block;
  padding: .45em 1.1em;
  border: 1px solid rgba(170,26,2,.4);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: all .18s ease;
}
.page-about .field-name-body .field-item > ul:first-of-type a:hover,
.page-founders .field-name-body .field-item > ul:first-of-type a:hover {
  background: var(--cr-red);
  color: #fff;
  border-color: var(--cr-red);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(170,26,2,.3);
}

/* Prose images (founders portraits etc.): rounded with soft shadow */
.node-page .field-name-body img {
  border-radius: 10px;
  box-shadow: var(--cr-shadow);
  max-width: 100%;
  height: auto;
}

/* Anchor targets clear the sticky elements */
.node-page .field-name-body a[id] { scroll-margin-top: 2.5em; }

/* --------------------------------------------------------------------------
   Participants: responsive profile-card grid (existing .perticipant markup)
   -------------------------------------------------------------------------- */
.page-participants .field-name-body .field-item {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: stretch;
}
.page-participants .field-name-body .field-item > p { flex: 1 1 100%; margin-bottom: .1em; }
.page-participants .field-name-body .light { display: none; }
.page-participants .perticipant {
  flex: 0 1 205px;
  background: #fff;
  border: 1px solid var(--cr-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--cr-shadow);
  transition: transform .22s ease, box-shadow .22s ease;
  text-align: center;
}
.page-participants .perticipant:hover {
  transform: translateY(-5px);
  box-shadow: var(--cr-shadow-lift);
}
.page-participants .perticipant img {
  width: 100% !important;
  height: 200px !important;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: 0;
  box-shadow: none;
  transition: transform .35s ease;
}
.page-participants .perticipant:hover img { transform: scale(1.045); }
.page-participants .perticipant .right {
  padding: .8em .6em .9em;
  font-weight: bold;
  color: var(--cr-ink);
  font-size: 15px;
  line-height: 1.35;
  border-top: 3px solid var(--cr-red);
}

/* --------------------------------------------------------------------------
   Contact page: modern form card
   -------------------------------------------------------------------------- */
.page-contact-us .webform-client-form {
  max-width: 620px;
  background: #fff;
  border: 1px solid var(--cr-line);
  border-top: 4px solid var(--cr-red);
  border-radius: 12px;
  box-shadow: var(--cr-shadow);
  padding: 1.6em 1.8em 1.4em;
  margin: 1.2em 0 1.6em;
}
.page-contact-us .webform-client-form .form-item { margin: 0 0 1.1em; }
.page-contact-us .webform-client-form label {
  display: block;
  font-weight: bold;
  margin-bottom: .35em;
  text-transform: capitalize;
}
.page-contact-us .webform-client-form input.form-text,
.page-contact-us .webform-client-form input.form-email,
.page-contact-us .webform-client-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: .65em .8em;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid #bbb;
  border-radius: 8px;
  background: #fafafa;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.page-contact-us .webform-client-form input:focus,
.page-contact-us .webform-client-form textarea:focus {
  outline: none;
  border-color: var(--cr-red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(170,26,2,.14);
}
.page-contact-us .webform-client-form .form-actions { margin-top: .4em; }
.page-contact-us .webform-client-form input[type="submit"] {
  background: linear-gradient(180deg, #c22505, var(--cr-red));
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: .5px;
  border: none;
  border-radius: 8px;
  padding: .65em 2.2em;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(170,26,2,.35);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.page-contact-us .webform-client-form input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(170,26,2,.45);
  filter: brightness(1.05);
}
.page-contact-us #block-block-8 {
  max-width: 620px;
  background: var(--cr-grey);
  border-radius: 12px;
  padding: 1em 1.5em;
}
.page-contact-us .messages.status,
.page-contact-us .messages.error {
  max-width: 620px;
  border-radius: 10px;
  padding: .9em 1.3em;
  margin-bottom: 1.2em;
  font-weight: bold;
}
.page-contact-us .messages.status { background: #e8f3e4; border: 1px solid #9fc98f; color: #2c5e1d; }
.page-contact-us .messages.error { background: #fdeeee; border: 1px solid #e0b9b9; color: #9b1c1c; }

/* --------------------------------------------------------------------------
   Front page: the two content boxes as modern cards
   -------------------------------------------------------------------------- */
.is-front #front2col .region {
  border-radius: 14px;
  border: 1px solid var(--cr-line);
  border-top: 4px solid var(--cr-red);
  box-shadow: var(--cr-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  background: linear-gradient(180deg, #f6f7f6, var(--cr-grey));
}
.is-front #front2col .region:hover {
  transform: translateY(-4px);
  box-shadow: var(--cr-shadow-lift);
}
.is-front #block-block-4 a[href*="about"] {
  display: inline-block;
  margin-top: .4em;
  padding: .5em 1.4em;
  border-radius: 999px;
  background: var(--cr-red);
  color: #fff !important;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(170,26,2,.35);
  transition: transform .18s ease, box-shadow .18s ease;
}
.is-front #block-block-4 a[href*="about"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(170,26,2,.45);
}

/* --------------------------------------------------------------------------
   Scroll-reveal animation (elements get .cr-reveal from modern.js)
   -------------------------------------------------------------------------- */
.cr-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s ease-out, transform .55s ease-out;
}
.cr-reveal.cr-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .cr-reveal { opacity: 1; transform: none; transition: none; }
  .page-participants .perticipant,
  .is-front #front2col .region { transition: none; }
}

/* Participant names that are links (e.g. LinkedIn) look like the other
   names — dark, with only a subtle dotted hint of the link. */
.page-participants .perticipant .right a {
  color: var(--cr-ink);
  border-bottom: 1px dotted rgba(170,26,2,.55);
}
.page-participants .perticipant .right a:hover {
  color: var(--cr-red);
  background: none;
}

/* Card geometry hardening: wpautop injects stray <p> wrappers around the
   card images (source-linebreak dependent), which shifted photos and red
   lines. display:contents dissolves any injected wrapper, and the fixed
   image + name-bar heights keep every red line at the same position. */
.page-participants .perticipant p { margin: 0 !important; display: contents; }
.page-participants .perticipant br { display: none; }
.page-participants .perticipant {
  display: flex;
  flex-direction: column;
}
.page-participants .perticipant img {
  flex: none;
  margin: 0 !important;
}
.page-participants .perticipant .right {
  min-height: 3.4em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
/* Keep the cards clear of the footer sponsor images */
.page-participants .field-name-body { margin-bottom: 6em; }

/* ==========================================================================
   Dynamic effects layer (2026-07-08)
   ========================================================================== */

/* Smooth in-page anchor scrolling (TOC pills, Top links, glossary refs) */
html { scroll-behavior: smooth; }


/* Main menu: center-out underline sweep */
.region-main-menu ul.menu li a,
.region-footermenu ul.menu li a { position: relative; }
.region-main-menu ul.menu li a::after,
.region-footermenu ul.menu li a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 1px;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--cr-red), #d9b382);
  transition: left .22s ease, right .22s ease;
}
.region-main-menu ul.menu li a:hover::after,
.region-footermenu ul.menu li a:hover::after { left: 6%; right: 6%; }

/* Whole content area gently fades up on every page load */
.region-content, #front2col {
  animation: cr-page-in .5s ease-out both;
}
@keyframes cr-page-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Page-title accent bar draws itself in */
.region-content h1.title::after { animation: cr-bar .7s ease-out .25s both; }
@keyframes cr-bar {
  from { width: 0; }
  to   { width: 72px; }
}

/* Search buttons: lift on hover */
.views-submit-button input,
.rrr-submit input {
  transition: transform .15s ease, filter .15s ease;
}
.views-submit-button input:hover,
.rrr-submit input:hover {
  transform: translateY(-1px) scale(1.03);
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.35));
}


/* Database results: staggered entrance + hover accent */
.page-database .views-row {
  animation: cr-page-in .45s ease-out both;
  border-left: 3px solid transparent;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.page-database .views-row:nth-child(1)  { animation-delay: .03s; }
.page-database .views-row:nth-child(2)  { animation-delay: .08s; }
.page-database .views-row:nth-child(3)  { animation-delay: .13s; }
.page-database .views-row:nth-child(4)  { animation-delay: .18s; }
.page-database .views-row:nth-child(5)  { animation-delay: .23s; }
.page-database .views-row:nth-child(6)  { animation-delay: .28s; }
.page-database .views-row:nth-child(7)  { animation-delay: .33s; }
.page-database .views-row:nth-child(8)  { animation-delay: .38s; }
.page-database .views-row:nth-child(9)  { animation-delay: .43s; }
.page-database .views-row:nth-child(10) { animation-delay: .48s; }
.page-database .views-row:hover {
  background: #f5f0ee;
  border-left-color: var(--cr-red);
  box-shadow: inset 0 0 0 1px rgba(170,26,2,.08);
}

/* Glossary: pulse the row you jumped to */
table.glossary-table tr:target { animation: cr-pulse 1.2s ease-out 1; }
@keyframes cr-pulse {
  0%   { box-shadow: inset 0 0 0 3px rgba(170,26,2,.65); }
  100% { box-shadow: inset 0 0 0 3px rgba(170,26,2,0); }
}

/* Reading progress bar (injected by modern.js) */
#cr-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--cr-red), #d9b382);
  z-index: 9999;
  transition: width .1s linear;
  pointer-events: none;
}

/* Floating back-to-top button (injected by modern.js) */
#cr-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cr-red);
  color: #fff;
  font-size: 22px;
  line-height: 44px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
  z-index: 9998;
}
#cr-top.cr-show { opacity: .92; transform: none; pointer-events: auto; }
#cr-top:hover { background: #c22505; opacity: 1; }

/* Respect reduced-motion for all dynamic effects */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .region-content, #front2col,
  .region-content h1.title::after,
  .page-database .views-row,
  table.glossary-table tr:target { animation: none !important; }
  #cr-progress { display: none; }
}

/* --------------------------------------------------------------------------
   Front-page image carousel ("From the world of the Latin East")
   -------------------------------------------------------------------------- */
.cr-carousel-band { margin: 0 2% 2.2em; }
.cr-carousel-title {
  color: var(--cr-red);
  font-size: 22px;
  margin: 0 0 .5em;
}
#cr-carousel {
  position: relative;
  height: 400px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--cr-line);
  box-shadow: var(--cr-shadow);
  background: #1c1a18;
}
#cr-carousel .cr-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 1.1s ease;
  pointer-events: none;
}
#cr-carousel .cr-slide.is-active { opacity: 1; pointer-events: auto; }
#cr-carousel .cr-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 0;
  box-shadow: none;
}
#cr-carousel figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2.2em 1.2em .8em;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.72));
  color: #fff;
  font-size: 15.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
#cr-carousel figcaption .cr-credit {
  display: block;
  font-size: 12px;
  color: #d9c9a8;
  text-decoration: none;
  margin-top: .15em;
}
#cr-carousel figcaption .cr-credit:hover { color: #fff; text-decoration: underline; }
#cr-carousel .cr-dots {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  gap: 7px;
  z-index: 3;
}
#cr-carousel .cr-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.25);
  cursor: pointer;
  padding: 0;
  transition: background .2s ease, transform .2s ease;
}
#cr-carousel .cr-dot:hover { transform: scale(1.25); }
#cr-carousel .cr-dot.is-active { background: #fff; }
@media (max-width: 700px) { #cr-carousel { height: 260px; } }
@media (prefers-reduced-motion: reduce) {
  #cr-carousel .cr-slide { transition: none; }
}

/* Slim carousel variant for inner pages */
.cr-carousel-band.cr-slim { margin: 2.5em 0 1.5em; }
.cr-carousel-band.cr-slim .cr-carousel-title { font-size: 17px; margin-bottom: .4em; }
#cr-carousel.cr-slim { height: 230px; }
#cr-carousel.cr-slim figcaption { font-size: 13.5px; padding: 1.6em 1em .55em; }
#cr-carousel.cr-slim figcaption .cr-credit { font-size: 11px; }
@media (max-width: 700px) { #cr-carousel.cr-slim { height: 180px; } }

/* Faded charter watermarks behind the central page column (generated
   pre-blended to white so no opacity/stacking tricks are needed; see
   sites/default/files/bg-*.jpg) */
#page {
  background-image: url('/regesta/sites/default/files/bg-charter-tall.jpg'), url('/regesta/sites/default/files/bg-charter-wide.jpg');
  background-repeat: no-repeat !important;
  background-position: center 470px, center calc(100% - 70px) !important;
  background-size: 620px auto, 860px auto;
}
@media (max-width: 1100px) { #page { background-image: none; } }
