/* General Layout & Modal Styles */

body {
  position: relative;
  width: 100%;
}

.modal {
  display: none;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  height: 100%;
  background-color: var(--backgroundModal);
  border: 0;
  color: var(--textColourPrimary);
  z-index: 1000;
}

.modal[open] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.modal .container {
  background-color: var(--backgroundCard);
  border-radius: 32px;
  padding: 40px;
  width: 60vw;
  max-width: 700px;
  max-height: 75vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 1001;
  margin: 0;
}

.close-button {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 120px;
  z-index: 1002;
  cursor: pointer;
}

.close-button::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
}

.close-button span {
  position: fixed;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 24px;
  font-weight: 500;
  color: var(--accentLink);
  text-decoration: underline;
  cursor: pointer;
  z-index: 1003;
}

.close-button span:hover {
  color: var(--accentLinkHover);
}

.close-button span:active {
  color: white;
}

.thread .job {
  margin: 0;
}

.thread .job-thumb,
.case-study-image-wrapper {
  margin-top: 24px;
  margin-bottom: 24px;
  border-radius: 12px;
  border: var(--image-border);
  padding: 16px;
  background-color: var(--backgroundCard);
  box-sizing: border-box;
  display: block;
  cursor: zoom-in;
}

.job-thumb img,
.case-study-image-wrapper img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: none !important;
  padding: 0 !important;
  display: block;
}

/* Ensure fullscreen zoomed image has dark background despite parent transparent overrides */
.case-study-image-wrapper img.img-fullscreen,
.job-thumb img.img-fullscreen,
img.img-fullscreen {
  background: rgba(0, 0, 0, 0.95) !important;
}

/* Typography & Links */

h2 {
  color: var(--textColourSecondary);
}

.meta,
.type {
  color: var(--textColourSecondary);
}

.job-link a {
  cursor: pointer;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.modal p {
  margin-bottom: 16px;
  line-height: 1.7;
}

.modal video {
  width: 100% !important;
  height: auto;
  border-radius: 8px;
  border: none !important;
  display: block;
  transform: scale(1.0125);
}

.tagline {
  font-size: 18px !important;
  font-weight: 500 !important;
}

/* Image Fullscreen Styles */
.modal img {
    cursor: zoom-in;
}

.img-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    object-fit: contain !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 99999 !important;
    cursor: zoom-out !important;
    padding: 40px !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
}

/* Work List Layout - Card Stack (Mimic angelaluk.com/work/) */
.work-list {
    margin: 24px 0 64px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 40px !important;
}

.work-card {
    display: block !important;
    text-decoration: none !important;
    transition: opacity 0.25s ease !important;
    cursor: pointer !important;
}

/* Grizz.fyi style focus-dimming hover effect */
.work-list:hover .work-card {
    opacity: 0.35 !important;
}

.work-list:hover .work-card:hover {
    opacity: 1 !important;
}

.work-card__image-wrapper {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    padding: 24px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.work-card__image-wrapper--bleed {
    padding: 0 !important;
}

.work-card__image-wrapper--bleed .work-card__image-inner {
    border-radius: 12px !important;
}

.work-card__image-inner {
    width: 100% !important;
    height: 100% !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    display: block !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.work-card:hover .work-card__image-inner {
    transform: scale(1.03) !important;
}

.work-card__image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

.work-card__image--cover {
    object-fit: cover !important;
}

.work-card__details {
    padding: 16px 4px 4px !important;
}

.work-card__title-row {
    display: flex !important;
    align-items: baseline !important;
    gap: 8px !important;
    margin-bottom: 6px !important;
}

.work-card__title {
    margin: 0 !important;
    font-size: inherit !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    color: #ff5a36 !important;
    transition: color 0.25s ease !important;
}

.work-card:hover .work-card__title {
    color: var(--textColourPrimary) !important;
}


.work-card__description {
    font-size: inherit !important;
    font-weight: 400 !important;
    line-height: 1.6 !important;
    color: var(--textColourSecondary) !important;
    margin: 6px 0 12px 0 !important;
}

.work-card__tags {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.work-card__tag {
    font-size: 0.77em !important;
    font-weight: 500 !important;
    padding: 4px 10px !important;
    border-radius: 9999px !important;
    background-color: var(--tagBg) !important;
    color: var(--tagText) !important;
    border: 1px solid var(--tagBorder) !important;
    white-space: nowrap !important;
    line-height: 1 !important;
}
