/* Global styles */

:root {
  --bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #0047ab;
  --primary-contrast: #ffffff;
  --surface: #f2f2f2;
  --surface-2: #f2f2f2;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

header {
  background-color: var(--primary);
  color: var(--primary-contrast);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

header a {
  color: var(--primary-contrast);
  text-decoration: none;
  display: inline-block;
}

h1 {
  font-size: clamp(1.8rem, 1.2rem + 2vw, 2.4rem);
  margin: 0;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem);
  margin: 0;
  font-weight: 600;
}

main {
  display: block;
}

section {
  padding: 20px 24px;
  margin: 20px auto;
  background-color: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: min(900px, 92vw);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

section:hover {
  transform: translateY(-2px);
}

h3 {
  font-size: 1.25rem;
  margin: 0 0 10px;
  color: var(--text);
}

p {
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 6px 0 0 0;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 10px;
}

article {
  margin: 20px 0;
}

h4 {
  font-size: 1.1rem;
  margin: 0 0 10px;
}

em {
  font-style: italic;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 3px solid rgba(0, 71, 171, 0.35);
  outline-offset: 2px;
}

footer {
  background-color: #f2f2f2;
  padding: 20px;
  text-align: center;
  font-size: 0.8em;
  color: #666;
  border-top: 1px solid #ddd;
}

footer p {
  margin: 0;
}

.text-image {
  width: 100%;
  height: auto;
  display: block;
  margin: 10px 0 16px 0;
  border-radius: 10px;
  box-shadow: var(--shadow);
  cursor: zoom-in;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.text-image:hover {
  transform: scale(1.01);
}

.text-video {
  width: 100%;
  height: auto;
  display: block;
  margin: 10px 0 16px 0;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.image-popup {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.image-popup-content img {
  max-width: 95%;
  margin: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

.image-popup-text {
  color: #fff;
  text-align: center;
  margin-top: 5px;
  font-size: 0.95rem;
}

.map-navigation {
  position: absolute;
  bottom: 15px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  z-index: 1000;
  backdrop-filter: blur(6px);
}

.map-navigation.prev {
  left: 10px;
}

.map-navigation.next {
  right: 10px;
}

.map-navigation a {
  text-decoration: none;
  color: #333;
}

.map-navigation a:hover {
  color: #666;
}

.legend {
  padding: 10px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  line-height: 1.5;
  font-size: 14px;
  border: 1px solid var(--border);
}

.legend i {
  width: 18px;
  height: 18px;
  float: left;
  margin-right: 8px;
  opacity: 0.7;
  border-radius: 3px;
}

#map {
  height: 500px;
  width: 100%;
  position: relative;
}

@media (max-width: 1099px) {
  body.trip-map-page #map {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 30vh;
    max-height: 30vh;
  }
}

@media (min-width: 1380px) {
  body.trip-map-page {
    --trip-map-gap: 32px;
    --trip-map-width: clamp(420px, calc(100vw - 960px), 680px);
    box-sizing: border-box;
    padding-left: calc(var(--trip-map-width) + var(--trip-map-gap));
  }

  body.trip-map-page #map {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--trip-map-width);
    height: 100vh;
    max-width: 100vw;
    z-index: 20;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.14);
  }
}

#map:fullscreen,
#map:-webkit-full-screen,
#map:-ms-fullscreen {
  width: 100%;
  height: 100%;
}

.leaflet-control-fullscreen a {
  background: #ffffff;
  color: #333;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  font-size: 16px;
  border-radius: 4px;
}

.leaflet-control-fullscreen a:hover {
  background: #f4f4f4;
}

.footer-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.footer-updated {
  grid-column: 2;
  text-align: center;
  margin: 0;
}

.footer-rss {
  grid-column: 3;
  justify-self: end;
}

.rss-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  text-decoration: none;
}

.rss-link:hover {
  background: rgba(0, 0, 0, 0.06);
}

.rss-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

@media (min-width: 1024px) {
  section {
    max-width: 960px;
  }
}

@media (max-width: 480px) {
  header {
    padding: 22px 16px;
  }

  section {
    padding: 16px 18px;
    margin: 16px auto;
  }
}

body.resume .resume-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

body.resume .resume-sidebar {
  flex: 0 0 280px;
  min-width: 240px;
}

body.resume .resume-sidebar section {
  background-color: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin-bottom: 24px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

body.resume .resume-sidebar section:hover {
  transform: translateY(-2px);
}

body.resume .resume-main {
  flex: 1;
  min-width: 300px;
}

body.resume .resume-main section {
  background-color: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin-bottom: 24px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

body.resume .resume-main section:hover {
  transform: translateY(-2px);
}

@media (max-width: 799px) {
  body.resume .resume-container {
    flex-direction: column;
    padding: 0 12px;
  }

  body.resume .resume-sidebar {
    flex: 1;
  }

  body.resume .resume-sidebar section,
  body.resume .resume-main section {
    margin-left: auto;
    margin-right: auto;
    max-width: min(900px, 92vw);
  }
}

body.resume footer {
  margin-top: 40px;
}
