/* ERW change #6 */ One-viewport ElliottOnline.co mobile case-study styling */

:root {
  --background: #50617f;
  --background-deep: #43536f;
  --yellow: #FDD746;
  --yellow-soft: #ffe46f;
  --white: #ffffff;
  --navy: #263653;
  --muted: rgba(255, 255, 255, 0.80);
  --border: rgba(255, 255, 255, 0.18);
  --shadow: 0 10px 24px rgba(24, 37, 60, 0.25);
  --header-height: 66px;
  --nav-height: 58px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  min-width: 320px;
  background: var(--background);
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.app,
.portfolio-view,
.viewer-view {
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

/* ERW change #7 */
[hidden] {
  display: none !important;
}

/* ERW change #12 */
.portfolio-view {
  display: block;
  overflow: hidden;
  background:
    linear-gradient(180deg, var(--background-deep) 0%, var(--background) 100%);
}

.site-header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.4rem;
  font-weight: 900;
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 1rem;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
}

/* ERW change #13 */
.portfolio-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 18px 14px 16px;
}

/* ERW change #33 */
.portfolio-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  text-align: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--yellow);
  font-size: 0.70rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ERW change #28 */
.portfolio-header h1 {
  margin: 0;
  color: #FDD746;
  font-size: clamp(1.05rem, 4.5vw, 1.35rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(24, 37, 60, 0.35);
  font-family: "Staatliches", "Arial Narrow", Arial, sans-serif;
}

/* ERW change #34 */
.portfolio-home-link,
.portfolio-home-link:visited {
  justify-self: start;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.portfolio-home-link:hover,
.portfolio-home-link:focus-visible {
  color: #FDD746;
  text-decoration: underline;
}

.portfolio-intro {
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.case-study-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
}

/* ERW change #20 */
.case-study-card {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: var(--background-deep);
  box-shadow: var(--shadow);
  color: var(--white);
  cursor: pointer;
  text-align: left;
}

.case-study-card:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

/* ERW change #21 */
.case-study-card__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.02);
}

/* ERW change #22 */
.case-study-card::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(
      180deg,
      rgba(20, 31, 51, 0.10) 0%,
      rgba(20, 31, 51, 0.45) 48%,
      rgba(20, 31, 51, 0.96) 100%
    );
}

/* ERW change #23 */
.case-study-card__content {
  position: relative;
  z-index: 2;
  display: flex;
  height: 100%;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px;
}

.case-study-card__number {
  display: block;
  margin-bottom: 5px;
  color: var(--yellow);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-study-card__title {
  display: block;
  font-size: clamp(0.82rem, 3.4vw, 1rem);
  font-weight: 800;
  line-height: 1.15;
}

.case-study-card__arrow {
  flex: 0 0 auto;
  color: var(--yellow);
  font-size: 1.2rem;
}

/* ERW change #14 */
.viewer-view {
  position: relative;
  display: block;
  overflow: hidden;
  background: #000000;
}

/* ERW change #15 */
/* ERW change #18 */
.viewer-navigation {
  position: absolute;
  top: -20px;
  right: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  min-height: 108px;
  padding: 12px 10px 28px;
  border: 0;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.82) 0%,
      rgba(0, 0, 0, 0.48) 52%,
      rgba(0, 0, 0, 0) 100%
    );
  color: var(--white);
  pointer-events: none;
}

.viewer-navigation button {
  pointer-events: auto;
}

.nav-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.nav-button:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.nav-button:disabled {
  cursor: default;
  opacity: 0.30;
}

.nav-button--portfolio {
  justify-self: start;
  padding: 8px 6px;
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 800;
}

/* ERW change #19 */
.page-counter {
  justify-self: center;
  height: 40px;
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 40px;
  white-space: nowrap;
}

.page-controls {
  display: flex;
  justify-self: end;
  gap: 5px;
}

.nav-button--icon {
  width: 40px;
  padding: 0;
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 900;
}

.nav-button--icon:disabled {
  background: rgba(255, 216, 61, 0.35);
  color: rgba(38, 54, 83, 0.60);
}

/* ERW change #16 */
.image-stage {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 0;
  background: #000000;
  touch-action: none;
}

/* ERW change #17 */
.case-study-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center top;
  background: #000000;
  user-select: none;
  -webkit-user-drag: none;
}

.noscript-message {
  margin: 24px;
  padding: 16px;
  border: 1px solid var(--border);
  background: var(--background-deep);
  color: var(--white);
  line-height: 1.5;
}

.noscript-message a {
  color: var(--yellow);
  font-weight: 800;
}

@media (max-height: 650px) {
  :root {
    --header-height: 58px;
  }

  .portfolio-content {
    gap: 8px;
    padding-top: 10px;
  }

  .portfolio-intro {
    display: none;
  }

  .case-study-grid {
    gap: 8px;
  }

  .case-study-card__content {
    padding: 9px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .case-study-image {
    animation: imageFade 180ms ease-out;
  }

  @keyframes imageFade {
    from {
      opacity: 0.60;
    }

    to {
      opacity: 1;
    }
  }
}
