/*
  Preferred Clinical Research responsive modernization layer
  Purpose: preserve the original HTML pages, content, images, PHP form handling,
  and legacy animations while adding a modern, mobile-compatible layout.
  No frameworks are used. This file intentionally loads after the original CSS.
*/

/* ---------- Base reset and readability ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0 0 32px 0;
  background: #c7c7cb;
  color: #4c4c55;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

p, li {
  line-height: 1.65;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.15rem;
}

a {
  color: #3e5f9f;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

a:hover, a:focus {
  color: #263d76;
}

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

h1, h2, h3, h4, h5, h6 {
  color: #252532;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.25;
}

h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

/* Retain the legacy custom h7/h8 styling while improving legibility. */
h7, h8 {
  line-height: 1.55;
}

/* ---------- Main site shell ---------- */
#header,
#container,
#navigation,
#nivoslider,
#kwicksdisplay,
#roundaboutdisplay,
#calltoaction,
#content,
#pagetitle,
#footer_top,
#footer_bttm {
  width: 100%;
  max-width: 1100px;
}

#header {
  height: auto;
  min-height: 130px;
  margin: 0 auto;
  background-image: url(../images/header.jpg);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

#container {
  margin: 0 auto;
  padding-left: 0;
  background: #f7f7f8;
  box-shadow: 0 16px 40px rgba(20, 20, 35, 0.18);
  overflow: hidden;
}

/* ---------- Navigation ---------- */
#navigation {
  min-height: 48px;
  height: auto;
  margin: 0 auto;
  background: #1f1f27;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

#navigation ul {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.ddsmoothmenu ul li {
  display: block;
  float: none;
  margin: 0;
}

.ddsmoothmenu ul li a {
  display: block;
  padding: 16px 13px;
  min-height: 48px;
  color: #fff;
  background: transparent;
  text-decoration: none;
}

.ddsmoothmenu ul li a:link,
.ddsmoothmenu ul li a:visited {
  color: #fff;
}

.ddsmoothmenu ul li a:hover,
.ddsmoothmenu ul li a:focus,
.ddsmoothmenu ul li a.selected {
  background: #5c428e;
  color: #fff;
  text-decoration: none;
}

.ddsmoothmenu ul li ul {
  background: #262631;
  box-shadow: 0 14px 22px rgba(0, 0, 0, 0.24);
}

.ddsmoothmenu ul li ul li a {
  width: 220px;
  color: #e9e9ee;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ddsmoothmenu ul li ul li a:link,
.ddsmoothmenu ul li ul li a:visited {
  color: #e9e9ee;
}

.ddsmoothmenu ul li ul li a:hover,
.ddsmoothmenu ul li ul li a:focus {
  background: #5c428e;
  color: #fff;
}

#mobile-menu-toggle {
  display: none;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: #1f1f27;
  color: #fff;
  font: bold 1rem Arial, Helvetica, sans-serif;
  min-height: 50px;
  padding: 14px 18px;
  text-align: left;
  cursor: pointer;
}

#mobile-menu-toggle::after {
  content: "☰";
  float: right;
  font-size: 1.25rem;
  line-height: 1;
}

#navigation.is-open #mobile-menu-toggle::after {
  content: "×";
}

/* ---------- Home slider and call-to-action ---------- */
#nivoslider,
#kwicksdisplay,
#roundaboutdisplay {
  padding: 40px;
  background-size: cover;
  background-position: center center;
}

#nivoslider {
  height: auto;
  min-height: 0;
}

#nivoslider .display,
.nivoSlider {
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  overflow: hidden;
}

#nivoslider .display img,
.nivoSlider img {
  width: 100% !important;
  max-width: none;
  height: auto !important;
}

.nivo-caption {
  font-size: 0.95rem;
  line-height: 1.45;
}

.nivo-controlNav {
  padding-top: 12px;
}

#calltoaction {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  height: auto;
  padding: 28px 40px;
  background: #eeeeef;
  border-top: 5px solid #dddddf;
  font-size: 1rem;
}

.calltoaction_left,
.calltoaction_right {
  float: none;
  width: auto;
  padding: 0;
}

.calltoaction_left {
  flex: 1 1 auto;
}

.calltoaction_right {
  flex: 0 0 auto;
}

.bigbutton a,
.button a,
button,
input[type="submit"],
.form-submit-button {
  display: inline-block;
  border-radius: 999px;
  background: #5c428e !important;
  color: #fff !important;
  padding: 12px 20px;
  font-weight: bold;
  text-decoration: none !important;
  border: 0;
  box-shadow: 0 7px 18px rgba(92, 66, 142, 0.25);
}

.bigbutton a:hover,
.button a:hover,
button:hover,
input[type="submit"]:hover,
.form-submit-button:hover {
  background: #432f6b !important;
  color: #fff !important;
  text-decoration: none !important;
}

/* ---------- Content and page headers ---------- */
#content {
  padding: 46px 48px;
  margin: 0 auto;
  background: #fff;
}

#pagetitle {
  height: auto;
  min-height: 86px;
  padding: 26px 34px;
  color: #fff;
  background-size: cover;
  background-position: center center;
}

#pagetitle h1 {
  float: none;
  color: #fff;
  margin: 0;
  font-size: 2rem;
}

.subnav {
  float: none;
  margin: 10px 0 0 0;
}

.subnav li a {
  display: inline-block;
  padding: 8px 12px;
}

.left,
.right,
.twocols_1,
.twocols_2,
.twocols_3,
.twocols_4,
.threecols_1,
.threecols_2,
.threecols_3 {
  box-sizing: border-box;
}

.twocols_1,
.twocols_2 {
  width: 50%;
}

.twocols_1 {
  padding-right: 24px;
}

.twocols_2 {
  padding-left: 24px;
}

.twocols_3,
.twocols_4 {
  max-width: 100%;
}

.threecols_1,
.threecols_2,
.threecols_3 {
  width: 33.333%;
}

.threecols_1 { padding-right: 16px; }
.threecols_2 { padding-left: 16px; padding-right: 16px; }
.threecols_3 { padding-left: 16px; }

.left {
  width: 66%;
  padding-right: 34px;
}

.right {
  width: 34%;
  padding-left: 22px;
  margin-top: 0;
}

#content img {
  border-radius: 6px;
}

#content .portfolio_box_anime img,
#nivoslider img,
#header img,
#footer_top img {
  border-radius: 0;
}

ul.bullets,
ul.blackarrows,
ul.checks,
ul.arrows,
ul.nobullets {
  padding-left: 0;
}

/* ---------- Forms ---------- */
form,
fieldset,
#contact,
.form-all,
.form-section,
.form-line,
.form-input,
.form-input-wide,
.form-line-column,
.form-sub-label-container {
  max-width: 100% !important;
  box-sizing: border-box;
}

input,
textarea,
select,
.form-textbox,
.form-textarea,
.form-dropdown {
  max-width: 100% !important;
  box-sizing: border-box;
  font-size: 1rem;
}

#contact form input,
#contact form textarea,
.form-textbox,
.form-textarea,
.form-dropdown {
  border-radius: 6px;
  border: 1px solid #cfcfd7;
  background: #fff;
  padding: 10px 12px;
}

.form-all {
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ---------- Footer ---------- */
#footer_top {
  padding: 30px 40px 24px;
  background-color: #1b1b1f;
  background-size: cover;
  color: #ededed;
}

#footer_top .threecols_1,
#footer_top .threecols_2,
#footer_top .threecols_3 {
  width: 33.333%;
  box-sizing: border-box;
}

#footer_top .threecols_1 { padding-right: 18px; }
#footer_top .threecols_2 { padding-left: 18px; padding-right: 18px; }
#footer_top .threecols_3 { padding-left: 18px; }

#footer_top .twocols_1,
#footer_top .twocols_2,
#footer_top .twocols_3 {
  box-sizing: border-box;
}

#footer_top ul {
  padding-left: 0;
}

#footer_top li {
  margin-bottom: 0;
}

#footer_bttm {
  height: auto;
  min-height: 30px;
  padding: 14px 16px 26px;
}

.spacer {
  clear: both;
}

/* ---------- Tablet ---------- */
@media screen and (max-width: 900px) {
  body {
    font-size: 15.5px;
  }

  #header {
    min-height: 112px;
  }

  #content,
  #nivoslider,
  #kwicksdisplay,
  #roundaboutdisplay,
  #calltoaction,
  #footer_top {
    padding-left: 28px;
    padding-right: 28px;
  }

  .ddsmoothmenu ul li a {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 0.88rem;
  }

  #calltoaction {
    gap: 18px;
  }
}

/* ---------- Mobile ---------- */
@media screen and (max-width: 760px) {
  body {
    padding-bottom: 0;
    font-size: 16px;
  }

  #header {
    min-height: 88px;
    background-size: contain;
    background-color: #fff;
  }

  #container {
    box-shadow: none;
  }

  #mobile-menu-toggle {
    display: block;
  }

  #navigation ul {
    display: block;
    width: 100%;
  }

  body.mobile-js #navigation ul {
    display: none;
  }

  body.mobile-js #navigation.is-open ul {
    display: block;
  }

  .ddsmoothmenu ul li {
    display: block;
    width: 100%;
    float: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .ddsmoothmenu ul li a {
    width: 100%;
    min-height: 48px;
    padding: 14px 18px;
    font-size: 1rem;
  }

  .ddsmoothmenu ul li ul {
    position: static !important;
    visibility: visible !important;
    display: block !important;
    width: 100% !important;
    background: #30303c;
    box-shadow: none;
  }

  .ddsmoothmenu ul li ul li a {
    width: 100%;
    padding-left: 32px;
    color: #f1f1f5;
  }

  .downarrowclass,
  .rightarrowclass {
    display: none !important;
  }

  #nivoslider,
  #kwicksdisplay,
  #roundaboutdisplay {
    padding: 20px;
  }

  .nivo-caption {
    position: static !important;
    width: 100% !important;
    padding: 12px !important;
    background: #272733 !important;
    opacity: 1 !important;
    filter: none !important;
  }

  #calltoaction {
    display: block;
    padding: 24px 20px;
  }

  .calltoaction_left {
    margin-bottom: 18px;
  }

  .calltoaction_right .bigbutton a {
    width: 100%;
    text-align: center;
  }

  #content {
    padding: 28px 20px;
  }

  #pagetitle {
    min-height: 0;
    padding: 22px 20px;
  }

  #pagetitle h1 {
    font-size: 1.55rem;
  }

  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.12rem; }

  .left,
  .right,
  .twocols_1,
  .twocols_2,
  .twocols_3,
  .twocols_4,
  .threecols_1,
  .threecols_2,
  .threecols_3,
  #footer_top .threecols_1,
  #footer_top .threecols_2,
  #footer_top .threecols_3,
  #footer_top .twocols_1,
  #footer_top .twocols_2,
  #footer_top .twocols_3 {
    float: none;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    margin-top: 0;
    margin-bottom: 24px;
  }

  img.floatleft,
  img.floatright {
    float: none;
    display: block;
    margin: 0 0 18px 0;
  }

  .pullout-left,
  .pullout-right {
    float: none;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .portfolio_box_anime,
  .kwicks_overlay {
    float: none;
    width: 100%;
  }

  .kwicks_description {
    position: static;
    width: 100%;
    margin-top: 10px;
  }

  table {
    width: 100%;
  }

  th, td {
    display: block;
    width: 100%;
  }

  .success,
  .error,
  .bademail,
  .badserver,
  .warning {
    width: 100%;
    height: auto;
    line-height: 1.5;
  }

  .form-line,
  .form-line-column,
  .form-input,
  .form-input-wide,
  .form-sub-label-container,
  .form-address-table,
  .form-address-table tbody,
  .form-address-table tr,
  .form-address-table td {
    display: block !important;
    width: 100% !important;
  }

  input,
  textarea,
  select,
  .form-textbox,
  .form-textarea,
  .form-dropdown {
    width: 100% !important;
  }

  .form-label-left,
  .form-label-right,
  .form-label-top {
    width: 100% !important;
    float: none !important;
    display: block !important;
    text-align: left !important;
    margin-bottom: 8px;
  }

  #footer_top {
    padding: 28px 20px 20px;
  }
}

/* ---------- Small phones ---------- */
@media screen and (max-width: 420px) {
  #header {
    min-height: 72px;
  }

  #content,
  #nivoslider,
  #kwicksdisplay,
  #roundaboutdisplay,
  #calltoaction,
  #footer_top {
    padding-left: 16px;
    padding-right: 16px;
  }

  #pagetitle {
    padding-left: 16px;
    padding-right: 16px;
  }
}
