/* /my-usa-visa-rejection-story — the book's editorial page, framed in the site's classic Mac window */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #c0c0c0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.6;
  color: #000000;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.mac-desktop {
  width: 100%;
  max-width: 640px;
  margin: 2rem 1rem;
  position: relative;
  z-index: 1;
}

/* Flag wallpaper */
.flag-filter {
  position: absolute;
  width: 0;
  height: 0;
}

.flag-bg {
  position: fixed;
  inset: -80px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  filter: url(#flag-wave);
  will-change: transform;
  animation: flag-drift 40s ease-in-out infinite alternate;
  background: repeating-linear-gradient(
    to bottom,
    #b22234 0 7.6923%,
    #ffffff 7.6923% 15.3846%
  );
}

.flag-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 53.846%;
  background-color: #3c3b6e;
  background-image: radial-gradient(circle, #ffffff 2px, transparent 2.6px);
  background-size: 34px 34px;
  background-position: 17px 17px;
}

/* transform-only motion: composited on the GPU, no per-frame repaint */
@keyframes flag-drift {
  from { transform: translate3d(-20px, 0, 0) rotate(-0.4deg); }
  to   { transform: translate3d(20px, 8px, 0) rotate(0.4deg); }
}

@media (prefers-reduced-motion: reduce) {
  .flag-bg {
    animation: none;
  }
}

/* Window chrome — same look as the home page */
.mac-window {
  background: #ffffff;
  border: 2px solid #000000;
  box-shadow:
    2px 2px 0 #000000,
    inset -1px -1px 0 #808080,
    inset 1px 1px 0 #dfdfdf;
  display: flex;
  flex-direction: column;
}

.window-header {
  background: #000000;
  color: #ffffff;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: Chicago, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  -webkit-font-smoothing: none;
}

.window-controls {
  display: flex;
  gap: 4px;
}

.control {
  width: 12px;
  height: 12px;
  border: 1px solid #000000;
  background: #ffffff;
  display: block;
}

a.control.close:hover {
  background: #c0c0c0;
}

.window-title {
  flex: 1;
  text-align: center;
  font-weight: bold;
  font-size: 13px;
}

.window-version {
  font-size: 10px;
  opacity: 0.5;
  padding: 0 8px;
}

.window-content {
  padding: 36px 32px 28px;
  background: #ffffff;
}

/* Cover */
.book-cover {
  padding-bottom: 24px;
  border-bottom: 2px dotted #000000;
}

.kicker {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #555555;
  margin-bottom: 18px;
}

.title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: 44px;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.subtitle {
  font-family: Lora, Georgia, serif;
  font-style: italic;
  font-size: 18px;
  color: #222222;
  max-width: 30em;
  margin-bottom: 18px;
}

.byline {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Photo */
.polaroid {
  margin: 28px 0 8px;
}

.slide-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 2px solid #000000;
  background: #000000;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: grayscale(1);
  transition: opacity 0.6s ease, filter 0.4s ease;
  /* hidden slides must not catch clicks, right-clicks or drags: only the visible one is interactive */
  pointer-events: none;
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.slide-frame:hover .slide.is-active {
  filter: grayscale(0);
}

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 2px solid #000000;
  background: #ffffff;
  color: #000000;
  font: bold 20px/1 Georgia, serif;
  cursor: pointer;
  box-shadow:
    inset -1px -1px 0 #808080,
    inset 1px 1px 0 #dfdfdf;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.slide-nav.prev { left: 10px; }
.slide-nav.next { right: 10px; }

.slide-frame:hover .slide-nav,
.slide-nav:focus-visible {
  opacity: 1;
}

.slide-nav:hover {
  background: #000000;
  color: #ffffff;
}

.polaroid figcaption {
  font-size: 13px;
  line-height: 1.5;
  color: #555555;
  margin-top: 10px;
  min-height: 3em;
}

.slide-caption {
  display: none;
}

.slide-caption.is-active {
  display: block;
}

.slide-dots {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.slide-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 2px solid #000000;
  background: #ffffff;
  cursor: pointer;
}

.slide-dots button[aria-selected="true"] {
  background: #000000;
}

@media (hover: none) {
  .slide-nav {
    opacity: 1;
  }
}

/* Body copy */
.prose {
  padding: 24px 0 8px;
}

.prose p {
  margin-bottom: 1.1em;
}

.prose p:last-child {
  margin-bottom: 0;
}

h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* Contents */
.contents {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 2px dotted #000000;
}

.contents ol {
  list-style: none;
}

.contents li {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
  font-size: 15px;
}

.contents li:last-child {
  border-bottom: none;
}

.contents .num {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: #808080;
  flex: 0 0 2em;
  padding-top: 3px;
}

/* Buy box */
.buy {
  margin-top: 28px;
  padding: 20px;
  background: #f0f0f0;
  border: 1px solid #000000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.price {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
}

.price .tax {
  font-size: 13px;
  font-weight: 400;
  color: #555555;
}

.format {
  font-size: 13px;
  color: #555555;
  margin-top: 4px;
}

.mac-button {
  font-family: Chicago, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 12px 22px;
  background: #ffffff;
  border: 2px solid #000000;
  color: #000000;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  box-shadow:
    inset -1px -1px 0 #808080,
    inset 1px 1px 0 #dfdfdf;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mac-button:hover {
  background: #000000;
  color: #ffffff;
}

.mac-button:active {
  box-shadow:
    inset 1px 1px 0 #808080,
    inset -1px -1px 0 #dfdfdf;
}

/* Disclaimer */
.honest {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 2px dotted #000000;
  font-size: 15px;
  color: #333333;
}

.honest p {
  margin-bottom: 1em;
}

.honest p:last-child {
  margin-bottom: 0;
}

/* Footer */
.page-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #000000;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 12px;
}

.foot-legal,
.foot-contact {
  color: #808080;
}

.page-footer {
  flex-wrap: wrap;
}

.page-footer a,
.prose a {
  color: #000000;
  text-decoration: underline;
}

.page-footer a:hover,
.prose a:hover {
  background: #000000;
  color: #ffffff;
  text-decoration: none;
}

/* Phone */
@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .mac-desktop {
    margin: 1rem 0.75rem;
  }

  .window-content {
    padding: 28px 20px 22px;
  }

  .title {
    font-size: 34px;
  }

  .subtitle {
    font-size: 16px;
  }

  .buy {
    flex-direction: column;
    align-items: stretch;
  }

  .buy-button {
    text-align: center;
  }
}

/* Who this is for */
.who {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 2px dotted #000000;
}

.who ul {
  list-style: none;
}

.who li {
  padding: 8px 0 8px 22px;
  position: relative;
  font-size: 15px;
}

.who li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  top: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color: #808080;
}

.who .cost-line {
  margin-top: 16px;
  padding: 14px 16px;
  background: #000000;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.5;
}

/* Ex-officer highlight */
.officer {
  margin-top: 24px;
  padding: 16px 18px;
  border: 2px solid #000000;
  box-shadow: 4px 4px 0 #000000;
  font-size: 15px;
}

.officer-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Buy strip under the cover */
.buy-top {
  margin-top: 22px;
  margin-bottom: 0;
}

/* Posts from X */
.posts {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 2px dotted #000000;
}

.posts-lead {
  font-size: 15px;
  color: #333333;
  margin-bottom: 16px;
}

.post-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.post {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #000000;
  background: #ffffff;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post:first-child {
  grid-column: 1 / -1;
}

.post p {
  flex: 1;
}

.post footer {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: #555555;
}

.post footer a {
  color: #000000;
  text-decoration: underline;
}

.post footer a:hover {
  background: #000000;
  color: #ffffff;
  text-decoration: none;
}

@media (max-width: 480px) {
  .post-grid {
    grid-template-columns: 1fr;
  }
}

.posts-more {
  margin-top: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #555555;
  text-align: right;
}

/* Former-officer referral */
.coach {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 2px dotted #000000;
  font-size: 15px;
}

.coach > p {
  margin-bottom: 14px;
}

.coach-form {
  padding: 16px;
  background: #f0f0f0;
  border: 1px solid #000000;
}

.coach-label {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.coach-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.coach-row input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  border: 2px solid #000000;
  background: #ffffff;
  box-shadow: inset 1px 1px 0 #808080;
}

.coach-row input:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

.coach-row .mac-button {
  font-size: 13px;
  padding: 10px 16px;
}

.coach-row .mac-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.coach-fine,
.coach-disclosure {
  font-size: 13px;
  color: #555555;
  margin-top: 10px;
}

.coach-result {
  padding: 16px;
  border: 2px solid #000000;
  box-shadow: 4px 4px 0 #000000;
}

.coach-result p + p {
  margin-top: 8px;
}

.coach-result a {
  color: #000000;
  text-decoration: underline;
  font-weight: 600;
}

.coach-result a:hover {
  background: #000000;
  color: #ffffff;
  text-decoration: none;
}

.coach-code {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 2px 8px;
  border: 1px solid #000000;
  background: #ffffff;
  color: #000000;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 2px 2px 0 #000000;
}

.coach-code:hover {
  background: #000000;
  color: #ffffff;
}

.coach-code:active {
  box-shadow: none;
  transform: translate(1px, 1px);
}

.coach-disclosure {
  margin-top: 14px;
}

.officer a {
  color: #000000;
  text-decoration: underline;
}

.officer a:hover {
  background: #000000;
  color: #ffffff;
  text-decoration: none;
}

/* Terms page */
.legal h2 {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 2px dotted #000000;
}

.legal h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.legal p,
.legal li {
  font-size: 15px;
  margin-bottom: 0.9em;
}

.legal ul {
  padding-left: 1.2em;
  margin-bottom: 0.9em;
}

.legal .updated {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: #555555;
  margin-bottom: 24px;
}

/* Read-the-guide email boxes */
.read-box {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.read-box .buy-info {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.read-box .format {
  margin-top: 0;
}

.read-form .coach-fine {
  margin-top: 8px;
}

.read-again {
  font-size: 15px;
}

.read-again a {
  color: #000000;
  font-weight: 600;
}

.read-again a:hover {
  background: #000000;
  color: #ffffff;
}

/* Turnstile */
.ts:empty {
  display: none;
}

.ts {
  margin-top: 10px;
}

.ts-msg {
  margin-top: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #000000;
}

.mac-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.mac-button:disabled:hover {
  background: #ffffff;
  color: #000000;
}
