/* Standalone per-site page. Rides on styles.css for the shared chrome
   (header, status pills, gantt bar) and adds the article layout. */

.site-page-body main {
  padding-bottom: 40px;
}

.site-page {
  width: min(880px, calc(100% - 48px));
  margin: 22px auto 0;
}

.site-loading {
  color: var(--muted);
}

.site-back {
  display: inline-block;
  margin-bottom: 14px;
  color: #b8492c;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.site-back:hover {
  text-decoration: underline;
}

.site-hero {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 14px 32px rgba(83, 50, 26, 0.1);
}

.site-hero-photo {
  padding: 0;
  border: 0;
  cursor: zoom-in;
  overflow: hidden;
  border-radius: 10px;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #cbe5ea, #e1a362);
}

.site-hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-hero-copy h1 {
  margin: 8px 0 4px;
  /* Same face as the header brand ("Japan Foliage Forecast"). */
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.35;
}

/* Name and wishlist button share a row; the button hugs the right edge. */
.site-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-right: 4px;
}

.site-title-row h1 {
  margin-right: auto;
}

.site-sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.site-wishlist {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #4b4037;
  font-size: 13px;
  font-weight: 700;
}

.site-wishlist span {
  font-size: 15px;
  line-height: 1;
}

.site-wishlist:hover {
  border-color: rgba(231, 71, 47, 0.45);
  background: #fff0e8;
  color: #df4e22;
}

.site-wishlist.active {
  border-color: rgba(231, 71, 47, 0.45);
  background: #fff4ea;
  color: #df4e22;
}

.site-section {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.site-section h2 {
  margin: 0 0 12px;
  font-size: 19px;
}

.site-section h3 {
  margin: 18px 0 6px;
  font-size: 15px;
}

.site-section p {
  margin: 0 0 10px;
  line-height: 1.65;
}

.site-section ul {
  margin: 0 0 10px;
  padding-left: 20px;
  line-height: 1.65;
}

.site-section li {
  margin-bottom: 5px;
}

.site-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 14px 0 0;
}

.site-facts.compact {
  margin-top: 16px;
}

.site-facts dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-facts dd {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.site-window-chart {
  margin-bottom: 6px;
}

.site-axis {
  position: relative;
  height: 15px;
}

.site-axis-month {
  position: absolute;
  bottom: 0;
  border-left: 1px solid rgba(82, 60, 44, 0.14);
  padding-left: 5px;
  color: #5a514a;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.site-window-chart .gantt-track {
  height: 26px;
  background-color: rgba(120, 96, 72, 0.08);
}

.site-window-chart .gantt-track::after {
  content: none;
}

.site-highlights {
  padding-left: 0;
  list-style: none;
}

.site-highlights li {
  display: grid;
  margin-bottom: 8px;
  padding-left: 12px;
  border-left: 3px solid rgba(231, 71, 47, 0.35);
}

.site-highlights strong {
  font-size: 14px;
}

.site-highlights span {
  color: var(--muted);
  font-size: 13px;
}

.site-plan {
  padding-left: 20px;
}

.site-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.site-unesco {
  border-color: rgba(196, 138, 46, 0.4);
  background: linear-gradient(180deg, rgba(255, 249, 235, 0.9), rgba(255, 255, 255, 0.7));
}

.site-unesco-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 700;
}

.site-unesco-desc {
  color: #4a4038;
}

@media (max-width: 720px) {
  .site-page {
    width: calc(100% - 28px);
  }

  .site-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-hero-photo {
    aspect-ratio: 16 / 9;
  }
}

.site-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-marks li {
  padding: 5px 11px;
  border: 1px solid rgba(138, 106, 31, 0.35);
  border-radius: 999px;
  background: rgba(255, 249, 235, 0.9);
  color: #6d541a;
  font-size: 13px;
  font-weight: 700;
}

.site-why {
  padding: 10px 14px;
  border-left: 3px solid rgba(231, 71, 47, 0.4);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 244, 234, 0.7);
  font-size: 15px;
}

/* --- Region page: all sites in one region, grouped by prefecture --------- */

.region-page {
  width: min(1020px, calc(100% - 48px));
}

.region-hero.no-photo {
  grid-template-columns: minmax(0, 1fr);
}

.region-hero-photo {
  cursor: default;
}

.region-list {
  /* main info | window text | season track | wishlist star — the axis shares
     the same columns so the track scale lines up. */
  --region-grid: minmax(220px, 1.3fr) 150px minmax(240px, 1.7fr) 26px;
}

.region-axis {
  display: grid;
  grid-template-columns: var(--region-grid);
  align-items: end;
  column-gap: 16px;
  margin-top: 20px;
  padding: 0 14px;
}

.region-axis-caption {
  grid-column: 1 / 3;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.region-group {
  margin-top: 14px;
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.region-group h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 17px;
}

.region-group h2 small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.region-row {
  display: grid;
  grid-template-columns: var(--region-grid);
  align-items: center;
  column-gap: 16px;
  padding: 8px 0;
  border-top: 1px solid rgba(115, 75, 49, 0.1);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.region-row:first-of-type {
  border-top: 0;
}

.region-row:hover .region-row-names strong,
.region-row:focus-visible .region-row-names strong {
  color: #df4e22;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.region-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.region-photo {
  flex: 0 0 auto;
  width: 68px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #cbe5ea, #e1a362);
}

.region-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.region-row-names {
  display: grid;
  min-width: 0;
}

.region-row-names strong {
  font-size: 14px;
  line-height: 1.3;
}

.region-row-names small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-row-station {
  font-size: 11px;
}

.region-row-window {
  display: grid;
  line-height: 1.35;
}

.region-row-window small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.region-row-window small:last-child {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.region-row-window strong {
  font-size: 13px;
}

.region-row .gantt-track {
  display: block;
  position: relative;
  height: 14px;
  border-radius: 7px;
  background-color: rgba(120, 96, 72, 0.08);
}

/* No date slider on this page, so no "selected date" hairline. */
.region-row .gantt-track::after {
  content: none;
}

/* …but the wishlist view (index.html) reuses these rows next to the date
   slider, so there the hairline comes back. */
.wishlist-view .region-row .gantt-track::after {
  content: "";
}

.region-row .gantt-bar {
  top: 2px;
  bottom: 2px;
}

.region-others .region-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.region-chip {
  display: grid;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 250, 244, 0.9);
  color: inherit;
  text-decoration: none;
}

.region-chip:hover {
  border-color: rgba(231, 71, 47, 0.45);
  background: #fff0e8;
}

.region-chip strong {
  font-size: 14px;
}

.region-chip small {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 860px) {
  .region-axis {
    display: none;
  }

  .region-row {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 6px;
  }

  .region-row .gantt-track {
    display: none;
  }

  .region-row-window {
    padding-left: 80px; /* aligns under the names, past the 68px photo + gap */
  }

  .region-row .row-star {
    position: absolute;
    top: 10px;
    right: 2px;
  }
}

/* --- roamtime.ai-only sites-index layout --------------------------------
 * build-landing.sh stamps class "roamtime" on the shells' <body>; the repo
 * deploy (foliage.pathtravel.app) never carries it, so none of this changes
 * that site. */

/* The app sizes .sites-view against the full-width body, but on sites.html it
 * sits inside the already-capped .region-page wrapper — without this it would
 * be shrunk twice (especially on phones). Applies to both deploys: the repo
 * site squeezed its toolbar and folder heads into overlapping chunks. */
.region-page .sites-view {
  width: 100%;
}

@media (max-width: 860px) {
  .region-page .sites-toolbar {
    flex-wrap: wrap;
  }

  .region-page .folder-title {
    flex-wrap: wrap;
  }
}

/* On phones the app stacks the window and bar under the names (its rows are
 * narrower and end in a wishlist star), but this index has neither constraint:
 * keep every row on one line — photo + names on the left, the viewing window
 * stacked over its season bar on the right, like the region-page rows. */
@media (max-width: 860px) {
  .roamtime .sites-view {
    --sites-grid: minmax(0, 1fr) minmax(122px, 40%);
  }

  /* The bar column is too narrow for the month scale; each row's window
   * dates carry the timing instead. */
  .roamtime .sites-view .sites-axis {
    display: none;
  }

  .roamtime .sites-view .site-row {
    grid-template-columns: var(--sites-grid);
    column-gap: 10px;
    row-gap: 2px;
  }

  .roamtime .site-row .site-main {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .roamtime .site-row .site-window {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }

  .roamtime .site-row .gantt-track {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }
}

/* Language picker, swapped in for the app's EN/中文 toggle by
 * build-landing.sh — roamtime.ai serves four languages. */
.lang-select {
  align-self: center;
  height: 30px;
  margin-left: 4px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #4b4037;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.lang-select:hover {
  border-color: rgba(231, 71, 47, 0.45);
  background: #fff0e8;
  color: #df4e22;
}

/* Back-to-top, injected into the roamtime shells by build-landing.sh (the
 * repo deploy has no such element). Mirrors the landing page's control. */
.rt-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #4b4037;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(83, 50, 26, 0.16);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.rt-top:hover {
  border-color: rgba(231, 71, 47, 0.45);
  color: #df4e22;
  transform: translateY(-2px);
}

/* Sites index (sites.html): region headings link to their region page but
 * read as headings, not raw links. */
.region-index-section h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
}
.region-index-section h2 a {
  color: inherit;
  text-decoration: none;
}
.region-index-section h2 a:hover {
  color: var(--ember);
}
.region-index-section h2 small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.region-index-section {
  margin-bottom: 26px;
}
