/* Search, planning tools and article-flow upgrade. Loaded after the legacy styles. */

.site-search-shell {
  position: relative;
  z-index: 12;
  width: 100%;
  padding: 13px max(4vw, 24px);
  background: #fffdf8;
  border-bottom: 1px solid rgba(23, 28, 32, .16);
  box-shadow: 0 8px 24px rgba(23, 28, 32, .05);
}

.site-search-shell--home {
  position: absolute;
  top: 84px;
  left: 0;
  background: rgba(247, 242, 233, .94);
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(255, 255, 255, .35);
}

.site-search {
  position: relative;
  width: min(100%, 1440px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 52px;
  padding: 0 0 0 18px;
  background: #fff;
  border: 1px solid rgba(23, 28, 32, .2);
  box-shadow: 0 10px 28px rgba(23, 28, 32, .08);
}

.site-search:focus-within {
  border-color: #c7552d;
  box-shadow: 0 0 0 3px rgba(199, 85, 45, .13), 0 13px 34px rgba(23, 28, 32, .1);
}

.site-search__icon {
  width: 22px;
  height: 22px;
  color: #c7552d;
}

.site-search__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.site-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #171c20;
  padding: 13px 16px;
  font: 600 clamp(.92rem, 1.3vw, 1.05rem)/1.2 var(--sans);
}

.site-search input::placeholder {
  color: #6d726f;
  opacity: 1;
}

.site-search button {
  align-self: stretch;
  min-width: 104px;
  border: 0;
  background: #171c20;
  color: #fff;
  padding: 0 24px;
  font: 700 .76rem/1 var(--sans);
  letter-spacing: .025em;
  cursor: pointer;
}

.site-search button:hover { background: #c7552d; }

.site-search-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(64vh, 540px);
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(23, 28, 32, .17);
  box-shadow: 0 22px 55px rgba(23, 28, 32, .19);
}

.site-search-results[hidden] { display: none; }

.site-search-results a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(23, 28, 32, .1);
  color: #171c20;
}

.site-search-results a:last-child { border-bottom: 0; }
.site-search-results a:hover,
.site-search-results a.is-active { background: #f1e7d9; }
.site-search-results a span { min-width: 0; }
.site-search-results b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 .96rem/1.25 var(--sans);
}
.site-search-results small {
  display: block;
  margin-top: 4px;
  color: #666d69;
  font: 500 .62rem/1.3 var(--mono);
  letter-spacing: .045em;
  text-transform: uppercase;
}
.site-search-results i {
  color: #c7552d;
  font: 400 1.25rem/1 var(--sans);
  font-style: normal;
}
.site-search-empty {
  margin: 0;
  padding: 18px 20px;
  color: #626966;
  font-size: .88rem;
}

/* Full-width, scan-first planning layer. */
.affiliate-module,
.affiliate-module.compact {
  display: block;
  width: 100%;
  padding: clamp(50px, 6vw, 86px) max(4vw, 24px);
  background: #eee4d6;
  color: #171c20;
  border-top: 1px solid rgba(23, 28, 32, .12);
  border-bottom: 1px solid rgba(23, 28, 32, .12);
}

.affiliate-module__inner {
  width: min(100%, 1440px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, .68fr) minmax(0, 1.32fr);
  gap: clamp(36px, 5vw, 78px);
  align-items: stretch;
}

.affiliate-intro {
  align-self: center;
}

.affiliate-intro .eyebrow {
  margin-bottom: 14px;
  color: #a74325;
}

.affiliate-intro h2 {
  max-width: 610px;
  color: #171c20;
  font-size: clamp(2.65rem, 4.7vw, 5.1rem);
  line-height: .91;
}

.affiliate-intro > p:not(.eyebrow) {
  max-width: 530px;
  margin: 24px 0 0;
  color: #3f4643;
  font-size: .98rem;
  line-height: 1.65;
}

.affiliate-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 27px 0 20px;
}

.affiliate-facts span {
  min-width: 0;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(23, 28, 32, .12);
  color: #303633;
  font-size: .78rem;
  line-height: 1.35;
}

.affiliate-facts b {
  display: block;
  margin-bottom: 4px;
  color: #a74325;
  font: 600 .57rem/1.2 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.affiliate-explainer {
  display: inline-flex;
  padding-bottom: 3px;
  border-bottom: 1px solid #171c20;
  color: #171c20;
  font-size: .78rem;
  font-weight: 700;
}

.affiliate-explainer:hover { color: #c7552d; border-color: #c7552d; }

.affiliate-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 14px;
  background: transparent;
}

.affiliate-card {
  position: relative;
  min-height: 315px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  background: #fffdf9;
  color: #171c20;
  border: 1px solid rgba(23, 28, 32, .16);
  box-shadow: 0 15px 32px rgba(23, 28, 32, .07);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.affiliate-card:hover {
  transform: translateY(-3px);
  border-color: rgba(199, 85, 45, .55);
  box-shadow: 0 20px 40px rgba(23, 28, 32, .11);
}

.affiliate-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 25px;
}

.affiliate-tool-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #171c20;
  color: #ffd3b3;
}

.affiliate-tool-icon svg {
  width: 39px;
  height: 39px;
  display: block;
}

.affiliate-provider {
  max-width: 145px;
  padding: 8px 10px 7px;
  background: #f2e5d5;
  color: #171c20;
  border: 1px solid rgba(23, 28, 32, .11);
  font: 700 .62rem/1.15 var(--sans);
  letter-spacing: .035em;
  text-align: right;
  text-transform: uppercase;
}

.affiliate-card .eyebrow {
  margin: 0 0 7px;
  color: #a74325;
}

.affiliate-card h3 {
  margin: 0;
  color: #171c20;
  font: 650 clamp(1.85rem, 2.6vw, 2.6rem)/.96 var(--serif);
  letter-spacing: -.048em;
}

.affiliate-card .affiliate-context {
  margin: 15px 0 22px;
  color: #555d59;
  font-size: .82rem;
  line-height: 1.55;
}

.affiliate-action {
  margin-top: auto;
  min-height: 48px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #c7552d;
  color: #fff;
  font: 700 .78rem/1.2 var(--sans);
  text-decoration: none;
}

.affiliate-action:hover { background: #171c20; color: #fff; }
.affiliate-action b { font-size: 1.15rem; }
.affiliate-action--pending { background: #d6d0c7; color: #59605d; }

/* The article's planning layer now leaves the narrow text column entirely. */
.content-wrap-single {
  display: block;
}

.content-wrap-single .article-copy {
  width: min(100%, 720px);
}

.article-content-before { padding-bottom: clamp(58px, 7vw, 92px); }
.article-content-after { padding-top: clamp(62px, 7vw, 96px); }

.article-markdown figure img {
  background: #d9d3ca;
}

@media (max-width: 1020px) {
  .affiliate-module__inner {
    grid-template-columns: 1fr;
  }

  .affiliate-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .65fr);
    gap: 18px 34px;
    align-items: end;
  }

  .affiliate-intro .eyebrow,
  .affiliate-intro h2 { grid-column: 1; }
  .affiliate-intro > p:not(.eyebrow),
  .affiliate-facts,
  .affiliate-explainer { grid-column: 2; }
  .affiliate-intro > p:not(.eyebrow) { grid-row: 1 / span 2; align-self: end; }
}

@media (max-width: 800px) {
  .site-search-shell,
  .site-search-shell--home {
    position: relative;
    top: auto;
    padding: 10px 12px;
    background: #f7f2e9;
  }

  .home-header + .site-search-shell { margin-top: 84px; }

  .site-search {
    grid-template-columns: 23px minmax(0, 1fr) auto;
    min-height: 48px;
    padding-left: 13px;
  }

  .site-search input {
    padding: 12px 10px;
    font-size: .85rem;
  }

  .site-search button {
    min-width: 68px;
    padding: 0 13px;
    font-size: .68rem;
  }

  .affiliate-module,
  .affiliate-module.compact {
    padding: 45px 18px;
  }

  .affiliate-intro {
    display: block;
  }

  .affiliate-intro h2 {
    font-size: clamp(2.55rem, 12vw, 4.2rem);
  }

  .affiliate-facts {
    grid-template-columns: 1fr;
  }

  .affiliate-cards {
    grid-template-columns: 1fr;
  }

  .affiliate-card {
    min-height: 285px;
  }

  .article-content-before,
  .article-content-after {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 480px) {
  .site-search input::placeholder { font-size: 0; }
  .affiliate-card__top { margin-bottom: 20px; }
  .affiliate-tool-icon { width: 52px; height: 52px; }
  .affiliate-provider { max-width: 130px; }
}

/* Replace the temporary Tirana illustrations with actual Tirana photography. */
.article-hero:has(> img[src*="tirana-hero.svg"]) {
  background-image: url("https://commons.wikimedia.org/wiki/Special:Redirect/file/Tirana_Skanderbeg_Square.png?width=1800");
  background-size: cover;
  background-position: center 48%;
}
.article-hero:has(> img[src*="tirana-hero.svg"]) > img { display: none; }

.article-markdown figure:has(img[src*="tirana-cafe.svg"]) img,
.article-markdown figure:has(img[src*="tirana-rewritten-city.svg"]) img { display: none; }

.article-markdown figure:has(img[src*="tirana-cafe.svg"])::before,
.article-markdown figure:has(img[src*="tirana-rewritten-city.svg"])::before {
  content: '';
  display: block;
  width: 100%;
  aspect-ratio: 5 / 3;
  background-size: cover;
  background-repeat: no-repeat;
  border: 1px solid rgba(23, 28, 32, .18);
}

.article-markdown figure:has(img[src*="tirana-cafe.svg"])::before {
  background-image: url("https://commons.wikimedia.org/wiki/Special:Redirect/file/Tirana_-_street%2C_cafe%2C_lifestyle_2017.jpg?width=1600");
  background-position: 56% 55%;
}

.article-markdown figure:has(img[src*="tirana-cafe.svg"]) figcaption::after {
  content: ' Photo: Peter Chovanec · CC BY 2.0 · creativecommons.org/licenses/by/2.0';
}

.article-markdown figure:has(img[src*="tirana-rewritten-city.svg"])::before {
  background-image: url("https://commons.wikimedia.org/wiki/Special:Redirect/file/Pyramid_of_Tirana%2C_interior%2C_2025_%281%29.jpg?width=1600");
  background-position: center 51%;
}
