/* Moving from US Section Styles */

/* Page background override */
body:has(.moving-from-us-container) {
  background-color: #EAE3E2;
}

body:has(.moving-from-us-entry) {
  background-color: #EAE3E2;
}

/* Page background and gradient header */
.moving-from-us-container {
  position: relative;
  max-width: var(--c-max-width);
  margin: 0 auto;
  padding: 8rem 2rem 8rem 2rem;
  box-sizing: border-box;
}

.moving-from-us-container::before {
  content: '';
  position: absolute;
  top: -15rem;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 40rem;
  background: linear-gradient(180deg, #FEBD8F 0%, #FDC2B0 40%, transparent 100%);
  z-index: -1;
  pointer-events: none;
}

/* Header section */
.moving-from-us-header {
  text-align: center;
      text-align: center;
    margin-bottom: 1rem;
    margin-top: 4rem;
    width: 75%;
    margin-left: auto;
    margin-right: auto;
}

.moving-from-us-header h1 {
  font-size: var(--s2);
  line-height: calc(var(--s2) * 1.1);
  font-weight: normal;
  font-family: var(--f-serif);
  font-style: italic;
  color: var(--c-black-800);
  margin-bottom: 0.5rem;
}

.moving-from-us-header p {
  font-size: 1.4rem;
  line-height: 1.8rem;
  opacity: 0.75;
  color: var(--c-black-800);
}

/* Intro Section */
.moving-intro-section {
  max-width: 900px;
  margin: 0 auto 2rem auto;
  text-align: center;
}

.moving-intro-section h2 {
  font-size: 2.8rem;
  line-height: 3.2rem;
  font-weight: normal;
  color: var(--c-black-800);
  margin-bottom: 2rem;
}

.moving-intro-section .intro-body {
    font-size: .9rem;
    line-height: 1.35rem;
    font-style: italic;
  color: var(--c-black-800);
  opacity: 0.65;
  margin-bottom: 1rem;
  max-width: 50rem;
  padding: 0 2rem;
  margin-left: auto;
  margin-right: auto;
}

.moving-intro-section .intro-body em {
  font-style: italic;
  font-weight: 500;
}

/* Intro Points Grid */
.intro-points-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 3rem;
  text-align: left;
}

.intro-point {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  border-radius: var(--c-round);
  padding: 2rem 1.5rem;
  transition: transform 0.3s ease, background 0.3s ease;
}

.intro-point:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: translateY(-4px);
}

.intro-point h3 {
  font-size: 1.4rem;
  line-height: 1.6rem;
  font-weight: 700;
  color: var(--c-orange-500);
  margin: 0 0 0.75rem 0;
  font-family: var(--f-sans);
}

.intro-point p {
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--c-black-800);
  opacity: 0.8;
  margin: 0;
}

/* Grid layout for countries */
.countries-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
  width: 100%;
}

.countries-grid > a {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Individual country card */
.country-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--c-round);
  overflow: visible;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  width: 100%;
}

.country-card:hover {
  transform: translateY(-4px);
}

/* Country image with gradient overlay */
.country-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--c-round);
  margin-bottom: 1rem;
}

.country-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.country-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

.country-name {
  color: white;
  font-size: 1.8rem;
  font-weight: 600;
  font-family: var(--f-serif);
  font-style: italic;
  margin: 0;
  padding: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Rating boxes container */
.country-ratings {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  width: 100%;
}

.country-rating-box {
  flex: 1;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  border-radius: 0.375rem;
  padding: 0.75rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0rem;
  min-height: 4rem;
  box-sizing: border-box;
}

.rating-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-black-800);
  margin: 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.025rem;
  line-height: 1;
}

/* Star rating specific styles */
.stars-rating {
  display: flex;
  flex-direction: row;
  gap: 0.125rem;
  justify-content: center;
  align-items: center;
  width: fit-content;
  height: 16px;
}

.stars-rating svg.star-icon {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex-shrink: 0;
  flex-grow: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Individual country page styles */
.moving-from-us-entry {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-top: 6rem;
  padding-bottom: 8rem;
}

.moving-from-us-entry::before {
  content: '';
  position: absolute;
  top: -6rem;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 30rem;
  background: linear-gradient(180deg, #FEBD8F 0%, #FDC2B0 40%, transparent 100%);
  z-index: -1;
  pointer-events: none;
}

.moving-from-us-entry .hero {
  width: calc(100% + 6rem);
  margin: 3rem -3rem 0 -3rem;
  height: auto;
  aspect-ratio: 16 / 8;
  border-radius: 0.5rem;
  object-fit: cover;
}

.moving-from-us-entry .entry-title {
  font-size: var(--s2);
  line-height: calc(var(--s2) * 1.1);
  font-weight: normal;
  font-family: var(--f-serif);
  font-style: italic;
  color: var(--c-black-800);
  margin-top: 3rem;
  margin-bottom: 0.5rem;
}

.moving-from-us-entry .entry-date {
  font-size: 0.9rem;
  color: var(--c-orange-500);
  opacity: 0.7;
  margin-bottom: 2.5rem;
  font-weight: 500;
}

.moving-from-us-entry .country-stats-inline {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  margin: 0 0 1rem 0;
  justify-content: center;
  flex-wrap: wrap;
}

.moving-from-us-entry .country-stats-inline .country-rating-box {
  background: rgba(255, 255, 255, 0.3);
  padding: 1rem 1.25rem;
  min-width: 120px;
  transition: background 0.2s ease;
}

.moving-from-us-entry .country-stats-inline .country-rating-box:hover {
  background: rgba(255, 255, 255, 0.45);
}

.moving-from-us-entry .country-stats-inline .rating-label {
  font-size: 0.8rem;
  display: block;
}

.moving-from-us-entry .ratings-subtitle {
  font-size: 0.75rem;
  color: var(--c-black-800);
  opacity: 0.5;
  margin-bottom: 4rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.moving-from-us-entry .stars-rating svg.star-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
}

/* Content styling - improved hierarchy */
.moving-from-us-entry p {
  font-size: 1.2rem;
  color: var(--c-black-800);
  line-height: 170%;
  margin-bottom: 1em;
}

.moving-from-us-entry h2 {
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  font-size: 2.4rem;
  line-height: 2.6rem;
  font-family: var(--f-serif);
  color: var(--c-black-800);
}

.moving-from-us-entry h2:first-of-type {
  margin-top: 0;
}

.moving-from-us-entry h3 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.6rem;
  line-height: 2rem;
  color: var(--c-orange-500);
  font-weight: 600;
}

.moving-from-us-entry h4 {
  font-size: 1.4rem;
  line-height: 1.65rem;
  font-family: var(--f-sans);
  color: var(--c-black-800);
}

.moving-from-us-entry a:not(.button),
.moving-from-us-entry a:not(.button):visited,
.moving-from-us-entry a:not(.button):active,
.moving-from-us-entry a:not(.button):hover {
  color: #0e8ab7;
}

/* Ensure buttons work properly */
a.button,
a.button:visited,
a.button:active,
a.button:hover {
  text-decoration: none;
  color: inherit;
}

a.button div {
  color: var(--c-white-100);
}

.moving-from-us-entry blockquote {
  background-color: var(--c-white-300);
  padding: 1.25rem;
  display: block;
  border-radius: 0.25rem;
  font-family: var(--f-serif);
}

.moving-from-us-entry blockquote p {
  font-style: italic;
  font-size: 1.4rem;
  line-height: 165%;
  display: block;
  margin-bottom: 0;
}

.moving-from-us-entry li {
  margin-bottom: 1em;
  line-height: 165%;
}

.moving-from-us-entry .disclaimer {
  background-color: var(--c-white-300);
  padding: 1.25rem;
  display: block;
  border-radius: 0.25rem;
  font-style: italic;
  font-family: var(--f-sans);
  margin-bottom: 1.5rem;
}

.moving-from-us-entry .disclaimer p {
  font-size: 0.9rem;
  display: block;
  line-height: 170%;
}

/* Back to countries link */
.moving-from-us-entry .back-to-countries-link {
  font-size: 1rem;
  color: var(--c-orange-500);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.moving-from-us-entry .back-to-countries-link:hover {
  color: var(--c-orange-600);
  text-decoration: underline;
}

/* TL;DR Box */
.tldr-box {
  background: linear-gradient(135deg, rgba(254, 189, 143, 0.2), rgba(253, 194, 176, 0.2));
  border-left: 4px solid var(--c-orange-500);
  border-radius: var(--c-round);
  padding: 2rem;
  margin: 3rem 0;
}

.tldr-box h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--c-orange-500);
  margin: 0 0 1rem 0;
  font-family: var(--f-sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tldr-box p {
  font-size: 1.1rem;
  line-height: 1.8rem;
  color: var(--c-black-800);
  margin: 0;
  opacity: 0.9;
}

/* Author Card */
.author-card {
  display: flex;

    flex-direction: column;
    text-align: center;
  align-items: center;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  border-radius: var(--c-round);
  padding: 1.5rem;
  margin: 3rem 0;
}

.author-image {
  width: 5rem !important;
  height: 5rem !important;
  border-radius: 9999px !important;
  object-fit: cover !important;
  flex-shrink: 0;
}

.author-info {
  flex: 1;
}

.author-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-black-800);
  margin: 0 0 0.5rem 0;
}

.author-bio {
  font-size: 0.75rem !important;
  font-style: italic !important;
  line-height: 1.4rem !important;
  color: var(--c-black-800);
  opacity: 0.75;
  margin: 0 !important;
}

/* Visa Pathways Styling */
.moving-from-us-entry .visa-pathways {
  background: rgba(255, 255, 255, 0.35);
  border-radius: var(--c-round);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
}

.moving-from-us-entry .visa-pathways ul {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0 0 0;
}

.moving-from-us-entry .visa-pathways li {
  padding-left: 2rem;
  margin-bottom: 0.75em;
  position: relative;
  font-size: 1.1rem;
}

.moving-from-us-entry .visa-pathways li::before {
  content: "✓";
  color: var(--c-orange-500);
  font-weight: bold;
  font-size: 1.3em;
  position: absolute;
  left: 0;
  top: -0.05em;
}

/* Target visa pathway lists that come after paragraphs (from markdown) */
.moving-from-us-entry p + ul {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0 2rem 0;
}

.moving-from-us-entry p + ul li {
  padding-left: 2rem;
  margin-bottom: 0.75em;
  position: relative;
  font-size: 1.1rem;
}

.moving-from-us-entry p + ul li::before {
  content: "✓";
  color: var(--c-orange-500);
  font-weight: bold;
  font-size: 1.3em;
  position: absolute;
  left: 0;
  top: -0.05em;
}

/* Responsive styles */

/* Tablet landscape */
@media (min-width: 820px) and (max-width: 1180px) {
  .intro-points-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .moving-intro-section h2 {
    font-size: 2.4rem;
    line-height: 2.8rem;
  }

  .moving-intro-section .intro-body {
    font-size: 1.1rem;
    line-height: 1.7rem;
  }

  .countries-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .moving-from-us-entry .hero {
    width: 100%;
        margin: 0 0 0rem 0;
  }
}

/* Mobile portrait */
@media (max-width: 819px) {
  .moving-from-us-container {
    padding: 6rem 1rem 6rem 1rem;
  }

  .moving-from-us-header h1 {
    font-size: 2.5rem;
    line-height: 2.6rem;
  }

  .moving-from-us-header p {
    font-size: 1.2rem;
    line-height: 1.6rem;
  }

  .moving-intro-section {
    margin-bottom: 4rem;
  }

  .moving-intro-section h2 {
    font-size: 2rem;
    line-height: 2.4rem;
    margin-bottom: 1.5rem;
  }

  .moving-intro-section .intro-body {
    font-size: 1rem;
    line-height: 1.6rem;
    margin-bottom: 1.25rem;
  }

  .intro-points-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 2rem;
  }

  .intro-point {
    padding: 1.5rem 1.25rem;
  }

  .intro-point h3 {
    font-size: 1.2rem;
    line-height: 1.4rem;
  }

  .intro-point p {
    font-size: 0.95rem;
    line-height: 1.4rem;
  }

  .countries-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .country-ratings {
    gap: 0.375rem;
  }

  .country-rating-box {
    padding: 0.5rem 0.25rem;
    min-height: 3.5rem;
  }

  .rating-label {
    font-size: 0.65rem;
  }

  .stars-rating svg.star-icon {
    width: .8rem;
    height: .8rem;
    min-width: .8rem;
    min-height: .8rem;
    max-width: .8rem;
    max-height: .8rem;
  }

  .moving-from-us-entry {
    padding: 10rem 3rem 6rem 3rem;
  }

  .moving-from-us-entry .hero {
    width: 100%;
    margin: 0 0 0rem 0;
  }

  .moving-from-us-entry h1 {
    font-size: 2rem;
    line-height: 2.1rem;
  }
  .moving-from-us-entry .entry-title {
    font-size: 3rem;
    line-height: 105%;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .moving-from-us-entry .country-stats-inline {
    gap: 0.5rem;
  }

  .moving-from-us-entry .country-stats-inline .country-rating-box {
    min-width: 10rem;
    padding: 1rem 1.25rem;
  }
}
