/* OJS-specific overrides for IOP Science theme */
.content-grid__full-width[role="banner"] {
  background: #fefefe;
  padding-top: 15px;
  padding-bottom: 15px;
}
.header-logo img {
  display: block;
  outline: none !important;
}
.wd-header-graphic {
  outline: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
  margin-left: -20px;
  width: auto !important;
  min-height: auto !important;
}
.header-logo:after,
.header-logo:hover:after,
.header-logo:not(:focus-visible):hover:after {
  display: none !important;
  content: none !important;
  width: 0 !important;
  height: 0 !important;
}
@media (max-width: 767px) {
  .wd-header-graphic {
    margin-left: 0;
  }
  .wd-main-nav {
    gap: 4px;
  }
}
a.wd-header-graphic,
a.wd-header-graphic:focus,
a.wd-header-graphic:focus-visible,
a.wd-header-graphic:focus-within,
a.wd-header-graphic:active,
a.wd-header-graphic:visited {
  outline: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
}
a.wd-header-graphic:focus-visible:before,
a.wd-header-graphic:focus-visible:after {
  display: none !important;
  content: none !important;
}
.header-logo {
  outline: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
}
.header-logo:focus,
.header-logo:focus-visible,
.header-logo:focus-within,
.header-logo:active {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-color: transparent !important;
  color: inherit !important;
}
.header-logo:focus-visible:before,
.header-logo:focus-visible:after {
  display: none !important;
  content: none !important;
}

.page-body {
  margin-bottom: 1.25em;
}
.page-body h1 {
  margin-top: 1.25em;
}
.search_results {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cmp_form {
  margin: 2em 0;
}
.cmp_form .search_input {
  margin-bottom: 1em;
}
.cmp_form input[type="text"],
.cmp_form input[type="search"] {
  padding: 0.5em;
  border: 1px solid var(--grey-light, #ccc);
  border-radius: 2px;
  font-size: 1.4rem;
  width: 100%;
  box-sizing: border-box;
}
.cmp_form .submit {
  margin-top: 1em;
}
.cmp_pagination {
  margin: 2em 0;
  text-align: center;
}
.obj_article_summary {
  margin-bottom: 1.5em;
}
.obj_article_summary .title a {
  color: var(--blue-dark, #006eb2);
  text-decoration: none;
  font-size: 1.8rem;
  line-height: 1.25;
}
.obj_article_summary .title a:hover {
  color: var(--red, #c00);
  text-decoration: underline;
}
.obj_article_summary .meta {
  font-size: 1.3rem;
  color: #666;
  margin-top: 0.25em;
}
.obj_article_summary .authors {
  margin-bottom: 0.25em;
}
.obj_issue_toc .section {
  margin-bottom: 2em;
}
.block {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--grey-tint, #f3f3f3);
}
.block h2 {
  font-size: 1.8rem;
  font-weight: 400;
  margin: 1.25em 0 0.25em;
}
.block p {
  font-size: 1.3rem;
  line-height: 1.5;
}
.cmp_announcements {
  margin-bottom: 2rem;
}
.obj_announcement {
  margin-bottom: 1.5rem;
}
.obj_announcement h3 {
  margin-bottom: 0.25em;
}
.obj_announcement .date {
  font-size: 1.3rem;
  color: #666;
}
.obj_announcement h3 a {
  color: var(--blue-dark, #006eb2);
  text-decoration: none;
}
.obj_announcement h3 a:hover {
  color: var(--red, #c00);
  text-decoration: underline;
}
.additional-home-content {
  margin-bottom: 2rem;
}
.ad-iframe-wrap {
  min-height: 250px;
  background: var(--grey-tint, #f3f3f3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--grey-light, #ccc);
  margin-top: 2rem;
}

.cookie-consent {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a2e;
  color: #fff;
  z-index: 9999;
  padding: 15px 20px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}
.cookie-consent__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.cookie-consent__text {
  font-size: 1.3rem;
  line-height: 1.5;
}
.cookie-consent__text a {
  color: #66b3ff;
}
.cookie-consent__buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cookie-consent__buttons .btn {
  padding: 8px 20px;
  font-size: 1.3rem;
  border-radius: 3px;
  cursor: pointer;
}
.cookie-consent__buttons .btn-default {
  background: #c00;
  color: #fff;
  border: none;
}
.cookie-consent__buttons .btn-link {
  background: transparent;
  color: #ccc;
  border: 1px solid #555;
}

.metrics {
  border-top: 1px solid #ccc;
  margin-bottom: 2em;
  padding-top: 0.8em;
}
.metrics__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.metrics__metric {
  display: grid;
  padding: 4px 8px;
}
.metrics__score {
  color: #006eb2;
  font-size: 2.7rem;
  font-weight: 600;
  line-height: 3.3rem;
}
.metrics__description {
  grid-row: 2;
  font-size: 1.4rem;
  line-height: 1.6rem;
}
.metrics__view-more {
  font-size: 1.4rem;
  line-height: 1.6rem;
  display: inline-block;
  margin-top: 0.5em;
}
.metrics__view-more:hover {
  color: #004b8d;
}
@media (max-width: 767px) {
  .metrics__grid {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .metrics__metric {
    padding: 2px 4px;
  }
  .metrics__score {
    font-size: 2rem;
    line-height: 2.4rem;
  }
  .metrics__description {
    font-size: 1.1rem;
    line-height: 1.3rem;
  }
}

.home-search-form {
  display: flex;
  max-width: 420px;
  border: 2px solid #006eb2;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
}
.home-search-form:focus-within {
  box-shadow: 0 0 0 3px rgba(0, 110, 178, 0.15);
}
.home-search-form input {
  flex: 1;
  padding: 10px 16px;
  border: none;
  font-size: 1.4rem;
  outline: none;
  background: transparent;
  color: #333;
}
.home-search-form input::placeholder {
  color: #999;
}
.home-search-form button {
  background: transparent;
  color: #006eb2;
  border: none;
  padding: 8px 16px 8px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-search-form button svg {
  fill: #006eb2;
  width: 18px;
  height: 18px;
}
.home-search-form button:hover svg {
  fill: #004b8d;
}

@media only screen and (max-width: 767px) {
  .m-show { display: block !important; }
  .d-n { display: none !important; }
}
@media only screen and (min-width: 768px) {
  .m-hide { display: block !important; }
}

/* Grid responsive stacking */
@media only screen and (max-width: 767px) {
  .da1, .da2, .db1, .db2, .ta1, .ta2, .tb1, .tb2,
  .dgh-showgrid > div[name="contentCol"] > .da1,
  .dgh-showgrid > div[name="contentCol"] > .da2,
  .dgh-showgrid > div[name="contentCol"] > .db1,
  .dgh-showgrid > div[name="contentCol"] > .db2,
  .dgh-showgrid > div[name="contentCol"] > .ta1,
  .dgh-showgrid > div[name="contentCol"] > .ta2,
  .dgh-showgrid > div[name="contentCol"] > .tb1,
  .dgh-showgrid > div[name="contentCol"] > .tb2 {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .article-content {
    clear: both;
    width: 100%;
  }
  .article-head .btn-multi-block {
    z-index: 100;
    background-color: #006eb2e6;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    margin: 0;
    padding: 10px;
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }
  .article-head .btn-multi-block .btn {
    margin: 0;
    display: block;
  }
  .toolbar-mobile .reveal-content { display: none; }
  .toolbar-mobile .reveal-open .reveal-content { display: block; }
  .toolbar-mobile { display: block !important; }
  .article-toolbar { display: none !important; }
}

/* Tablet responsive (768px - 1070px) */
@media only screen and (min-width: 768px) and (max-width: 1070px) {
  .da1, .da2, .db1, .db2, .ta1, .ta2, .tb1, .tb2 {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* Navigation responsive */
@media only screen and (max-width: 1070px) {
  .nav__list { display: none; }
  #simple-menu { display: block !important; }
  .nav-top-link-drop-down { display: none; }
  .wd-main-nav {
    flex-wrap: wrap;
  }
}
@media only screen and (min-width: 1071px) {
  #simple-menu { display: none !important; }
}

/* Content grid responsive */
@media only screen and (max-width: 767px) {
  .content-grid {
    padding: 0 10px;
  }
  .header-logo img {
    max-width: 100%;
    height: auto !important;
  }
  .home-search-form {
    max-width: 100%;
  }
}

/* Fix content clipping: remove height:100vh and body overflow:hidden so all content is always visible */
.content-grid {
  height: auto !important;
  min-height: auto !important;
}
body {
  overflow: visible !important;
}
html {
  overflow-x: hidden;
  overflow-y: auto;
}

/* Prevent overflow on small screens */
@media only screen and (max-width: 767px) {
  body, html {
    overflow-x: hidden;
    max-width: 100%;
  }
  img, table, figure {
    max-width: 100% !important;
    height: auto !important;
  }
  .wd-jnl-art-title {
    font-size: 2rem !important;
    word-break: break-word;
  }
  .article-info__info {
    padding: 10px;
  }
  .side-and-below {
    width: 100%;
  }
  .sidebar-list {
    width: 100%;
  }
}
