/* ===================================================================
 * Lin Family · Europe Summer 2026 — site stylesheet
 * Mobile-first, bilingual EN/zh-TW
 * Palette: navy #1F4E79, accent #2E5984, cream #FAF7F0
 * =================================================================== */

:root {
  --navy:   #1F4E79;
  --accent: #2E5984;
  --cream:  #FAF7F0;
  --ink:    #1f1f1f;
  --muted:  #6b6b6b;
  --line:   #d4d4d4;
  --card:   #ffffff;
  --warn:   #b03a2e;
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
               "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top nav ---------- */
header.site {
  background: var(--navy);
  color: white;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
header.site .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
header.site .brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: white;
  white-space: nowrap;
}
header.site nav {
  display: flex;
  gap: 0.75rem;
  flex: 1;
  flex-wrap: wrap;
}
header.site nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
header.site nav a:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
header.site nav a.active { background: rgba(255,255,255,0.15); color: white; }

.lang-toggle {
  display: flex;
  gap: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
  overflow: hidden;
}
.lang-toggle button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.8);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}
.lang-toggle button.active {
  background: white;
  color: var(--navy);
  font-weight: 600;
}

/* ---------- Layout ---------- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

h1, h2, h3 { color: var(--navy); margin-top: 1.5em; }
h1 { font-size: 1.8rem; margin-top: 0.5em; }
h2 { font-size: 1.35rem; border-bottom: 1px solid var(--line); padding-bottom: 0.3rem; }
h3 { font-size: 1.1rem; color: var(--accent); }

p { margin: 0.6em 0; }
ul { padding-left: 1.4rem; }
li { margin: 0.3em 0; }

/* ---------- Bilingual layout ---------- */
.bilingual {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 900px) {
  .bilingual { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .bilingual .zh { border-left: 2px solid var(--line); padding-left: 1.5rem; }
}
.lang-en .zh { display: none; }
.lang-zh .en { display: none; }
.lang-zh .bilingual { grid-template-columns: 1fr; }
.lang-en .bilingual { grid-template-columns: 1fr; }
@media (min-width: 900px) {
  body:not(.lang-en):not(.lang-zh) .bilingual { grid-template-columns: 1fr 1fr; }
}

/* ---------- Hero / glance ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy), var(--accent));
  color: white;
  padding: 2.5rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  text-align: center;
}
.hero h1, .hero p { color: white; margin: 0.4em 0; }
.hero h1 { font-size: 1.9rem; }
.hero .dates { font-size: 1.1rem; opacity: 0.95; font-style: italic; }
.hero .travellers { font-size: 0.95rem; opacity: 0.85; }

/* ---------- Cards / tables ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card h3 { margin-top: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1.5rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
th, td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  vertical-align: top;
}
th {
  background: var(--navy);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
tr:last-child td { border-bottom: none; }
tr.row-link { cursor: pointer; }
tr.row-link:hover { background: #f0f6fb; }

.row-link a { display: block; color: var(--ink); }
.row-link a:hover { text-decoration: none; }

/* ---------- Day timeline (home page) ---------- */
.timeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin: 1rem 0;
}
@media (min-width: 700px) {
  .timeline { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .timeline { grid-template-columns: repeat(4, 1fr); }
}
.day-tile {
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.day-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  text-decoration: none;
}
.day-tile .date {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.day-tile .title {
  font-weight: 600;
  color: var(--navy);
  margin: 0.2rem 0;
}
.day-tile .city {
  font-size: 0.85rem;
  color: var(--muted);
}
.day-tile.placeholder { border-left-color: var(--line); opacity: 0.7; }

/* ---------- Landmark gallery ---------- */
.places-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
@media (min-width: 700px) { .places-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .places-grid { grid-template-columns: repeat(3, 1fr); } }

.place-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.1s, box-shadow 0.1s;
}
.place-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  text-decoration: none;
}
.place-card .photo {
  aspect-ratio: 16 / 10;
  background: #efe9d8 url('../img/markers/photo-placeholder.svg') no-repeat center;
  background-size: 80px;
}
.place-card .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.place-card .body { padding: 0.85rem 1rem; }
.place-card .title { font-weight: 700; color: var(--navy); }
.place-card .city { font-size: 0.85rem; color: var(--muted); }
.place-card .tag { font-style: italic; color: var(--accent); margin-top: 0.4rem; font-size: 0.9rem; }

/* ---------- Map containers ---------- */
.map {
  width: 100%;
  height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 1rem 0;
}
.map-overview { height: 460px; }
.map-day { height: 380px; }
.map-place { height: 320px; }

/* ---------- Sketch (schematic transit) ---------- */
.sketch {
  width: 100%;
  max-width: 1100px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 1rem 0;
  display: block;
}

/* ---------- Photo upload ---------- */
.uploader {
  background: white;
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 1.2rem;
  text-align: center;
  margin: 1rem 0;
}
.uploader.dragover { border-color: var(--accent); background: #f4f9fc; }
.uploader input[type=file] { display: none; }
.uploader .btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.uploader .btn:hover { background: var(--navy); }
.uploader .hint { color: var(--muted); margin-top: 0.5rem; font-size: 0.85rem; }
.uploader .status { margin-top: 0.6rem; font-size: 0.9rem; }
.uploader .status.ok { color: #2e7d32; }
.uploader .status.err { color: var(--warn); }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}
.gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  cursor: pointer;
}
.gallery .empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 1.5rem;
}

/* ---------- Buttons / pills ---------- */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
}
.btn:hover { background: var(--navy); text-decoration: none; }
.btn.outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn.outline:hover { background: var(--accent); color: white; }

.pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  background: #e8f0f6;
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0.15rem 0.2rem;
}

/* ---------- Day prev/next nav ---------- */
.day-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
}
.day-nav .btn { font-size: 0.85rem; padding: 0.4rem 0.8rem; }
.day-nav .home-link { color: var(--muted); font-size: 0.9rem; }

/* ---------- Footer ---------- */
footer.site {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
  margin-top: 3rem;
}

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.italic { font-style: italic; }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.warn { color: var(--warn); }
.spacer { height: 1.5rem; }

@media print {
  header.site, footer.site, .uploader, .day-nav { display: none; }
  .map { display: none; }  /* hide interactive maps when printing */
  body { background: white; }
  .sketch { max-width: 100%; }
}
