:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3f9;
  --text: #132238;
  --heading: #081525;
  --muted: #607086;
  --accent: #006d77;
  --accent-strong: #00535c;
  --accent-soft: #dff4f3;
  --border: #dce4ed;
  --radius-sm: 10px;
  --radius: 18px;
  --shadow-sm: 0 2px 8px rgba(15, 35, 58, 0.06);
  --shadow: 0 16px 40px rgba(15, 35, 58, 0.1);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 109, 119, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: var(--heading);
  background: #a8e2df;
}

.container {
  width: min(100% - 2.5rem, 1180px);
  margin-inline: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

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

a:focus-visible {
  outline: 3px solid rgba(0, 109, 119, 0.28);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Header and navigation */
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(220, 228, 237, 0.9);
  box-shadow: 0 8px 28px rgba(15, 35, 58, 0.06);
  backdrop-filter: blur(16px) saturate(150%);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 72px;
}

.brand {
  position: relative;
  flex: 0 0 auto;
  color: var(--heading);
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: -0.055em;
  line-height: 1;
}

.brand::after {
  position: absolute;
  right: -0.48rem;
  bottom: 0;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar { display: none; }

.nav a {
  flex: 0 0 auto;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: #34455b;
  font-size: 0.79rem;
  font-weight: 750;
  letter-spacing: 0.075em;
  line-height: 1;
  text-transform: uppercase;
}

.nav a:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  text-decoration: none;
}

.lang-switch {
  display: flex;
  flex: 0 0 auto;
  gap: 0.2rem;
  padding: 0.22rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
}

.lang-switch a {
  min-width: 2.25rem;
  padding: 0.34rem 0.5rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.lang-switch a:hover {
  color: var(--accent);
  text-decoration: none;
}

.lang-switch a.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 109, 119, 0.24);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-search {
  display: flex;
  flex: 0 1 14rem;
  align-items: stretch;
  min-width: 10rem;
  max-width: 16rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.site-search input[type="search"] {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0.42rem 0.85rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.2;
}

.site-search input[type="search"]::placeholder {
  color: var(--muted);
}

.site-search input[type="search"]::-webkit-search-decoration,
.site-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.site-search input[type="search"]:focus {
  outline: none;
}

.site-search:focus-within {
  border-color: rgba(0, 109, 119, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.16);
}

.site-search button {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.42rem 0.85rem;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

.site-search button:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.site-search button:focus-visible {
  outline: 3px solid rgba(0, 109, 119, 0.28);
  outline-offset: -3px;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  overflow: hidden;
  margin: 1.65rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.breadcrumbs a { flex: 0 0 auto; }
.breadcrumbs .sep { color: #a5b0bd; }
.breadcrumbs .current {
  overflow: hidden;
  color: #526177;
  text-overflow: ellipsis;
}

/* Home */
.home-section {
  margin: clamp(2.5rem, 6vw, 5rem) 0;
}

.home-section:first-child {
  margin-top: clamp(2rem, 5vw, 4rem);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-head h2 {
  margin: 0;
  color: var(--heading);
  font-family: var(--serif);
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.section-head h2::before {
  display: block;
  width: 2.5rem;
  height: 0.28rem;
  margin-bottom: 0.65rem;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.section-head h2 a { color: inherit; }

.section-head .see-all,
.read-more {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  display: flex;
  min-height: 270px;
  flex-direction: column;
  overflow: hidden;
  padding: 1.65rem;
  border: 1px solid rgba(220, 228, 237, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #59c3c3);
  content: "";
  opacity: 0;
  transition: opacity 200ms ease;
}

.card:hover {
  border-color: #c7d6e3;
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.card:hover::before { opacity: 1; }

.card-image {
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 1;
  margin: -1.65rem -1.65rem 1.35rem;
  background: var(--surface-soft);
}

.card-image:hover { text-decoration: none; }

.card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card:hover .card-image img { transform: scale(1.035); }

.image-credit {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 550;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.card h3 {
  margin: 0 0 0.8rem;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.42rem);
  letter-spacing: -0.025em;
  line-height: 1.28;
}

.card h3 a { color: var(--heading); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }

.card p {
  flex: 1;
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.65;
}

/* Category listings */
.page-heading {
  max-width: 850px;
  margin: 1.25rem 0 2.25rem;
  color: var(--heading);
  font-family: var(--serif);
  font-size: clamp(2.35rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1;
}

.page-heading::after {
  display: block;
  width: 4rem;
  height: 0.35rem;
  margin-top: 1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #59c3c3);
  content: "";
}

.subcat-heading {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 2.75rem 0 1rem;
  color: var(--heading);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.subcat-heading::after {
  height: 1px;
  flex: 1;
  background: var(--border);
  content: "";
}

.subcat-heading a { color: inherit; }

.post-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.list-item {
  position: relative;
  display: flex;
  gap: 1rem;
  align-items: stretch;
  padding: 1.4rem 1.5rem 1.4rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-sm);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.list-item-media {
  padding: 0.85rem;
  padding-left: 1rem;
}

.list-item-image {
  flex: 0 0 38%;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 1;
  max-width: 11rem;
  border-radius: calc(var(--radius-sm) - 0.15rem);
  background: var(--surface-soft);
}

.list-item-image:hover { text-decoration: none; }

.list-item-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.list-item::before {
  position: absolute;
  top: 1.45rem;
  bottom: 1.45rem;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--accent);
  content: "";
  opacity: 0;
  transition: opacity 160ms ease;
}

.list-item:hover {
  border-color: #c7d6e3;
  background: var(--surface);
  transform: translateY(-2px);
}

.list-item:hover::before { opacity: 1; }

.list-item h3 {
  margin: 0 0 0.45rem;
  font-family: var(--serif);
  font-size: 1.13rem;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.list-item h3 a { color: var(--heading); }
.list-item h3 a:hover { color: var(--accent); text-decoration: none; }

.list-item p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 3rem 0;
  font-size: 0.8rem;
  font-weight: 750;
}

.page-btn {
  min-width: 7.5rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

a.page-btn:hover {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  text-decoration: none;
}

.page-btn.disabled {
  color: #a5b0bd;
  background: transparent;
  box-shadow: none;
}

.page-label { padding: 0 0.4rem; color: var(--muted); }

/* Post page */
.post {
  max-width: 780px;
  margin: 0 auto;
  padding-bottom: 1rem;
}

.post-title {
  margin: 1.25rem 0 1rem;
  color: var(--heading);
  font-family: var(--serif);
  font-size: clamp(2.3rem, 6vw, 4.35rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.post-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 2.75rem;
  padding: 0.48rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.77rem;
}

.post-meta strong { color: var(--text); }
.post-meta-sep { opacity: 0.55; }

.card-date,
.list-item-date {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.list-item-date { margin-bottom: 0.4rem; }

.post-hero {
  margin: 0 0 2.75rem;
}

.post-hero-media {
  overflow: hidden;
  aspect-ratio: 2 / 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: var(--shadow);
}

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

.post-hero .image-credit {
  margin-top: 0.55rem;
  font-size: 0.72rem;
}

.post-body {
  color: #24364c;
  font-family: var(--serif);
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  line-height: 1.86;
}

.post-body p { margin: 0 0 1.55em; }

.post-body p:first-child {
  color: var(--heading);
  font-size: 1.08em;
  line-height: 1.75;
}

.post-body p:first-child::first-letter {
  float: left;
  margin: 0.08em 0.1em 0 0;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 3.4em;
  font-weight: 700;
  line-height: 0.8;
}

.author-box {
  position: relative;
  overflow: hidden;
  margin: 3.25rem 0;
  padding: 1.5rem 1.75rem;
  border: 1px solid #cde3e4;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), #f7fbfb);
}

.author-box::after {
  position: absolute;
  top: -2.5rem;
  right: -2.5rem;
  width: 8rem;
  height: 8rem;
  border: 1.5rem solid rgba(0, 109, 119, 0.06);
  border-radius: 50%;
  content: "";
}

.author-box h2 {
  margin: 0 0 0.45rem;
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.author-box p {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 0.92rem;
}

.related { margin: 3.25rem 0; }

.related h2 {
  margin-bottom: 1rem;
  color: var(--heading);
  font-family: var(--serif);
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

.related ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related li {
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.4;
}

.related li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.related li a { color: var(--heading); }
.related li a:hover { color: var(--accent); }

/* Static pages */
.static-page {
  max-width: 780px;
  min-height: 45vh;
  margin: 0 auto 3rem;
}

.static-page > p {
  color: #34455b;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.8;
}

.contact-card {
  margin-top: 2rem;
  padding: 1.4rem 1.6rem;
  border: 1px solid #cde3e4;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
  box-shadow: var(--shadow-sm);
}

.contact-card p { margin: 0.25rem 0; }

/* Footer */
.footer {
  position: relative;
  overflow: hidden;
  margin-top: 5rem;
  color: #b8c4d3;
  background: #091726;
}

.footer::before {
  position: absolute;
  top: -7rem;
  left: 50%;
  width: 34rem;
  height: 14rem;
  border-radius: 50%;
  background: rgba(0, 109, 119, 0.2);
  filter: blur(50px);
  content: "";
  transform: translateX(-50%);
}

.footer-inner {
  position: relative;
  padding-top: 3rem;
  padding-bottom: 3rem;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 0.6rem 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.footer-links a { color: #edf4fb; }
.footer-links a:hover { color: #78d4d0; }

.copyright {
  margin: 0;
  color: #8392a5;
  font-size: 0.74rem;
}

@media (max-width: 860px) {
  .topbar-inner {
    gap: 1rem;
    min-height: 64px;
  }

  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container { width: min(100% - 1.5rem, 1180px); }

  .topbar-inner {
    align-items: center;
    flex-wrap: wrap;
    padding: 0.75rem 0;
  }

  .brand { font-size: 1.3rem; }

  .nav {
    order: 3;
    width: 100%;
    flex-basis: 100%;
    margin: 0 -0.25rem;
  }

  .nav a { padding: 0.45rem 0.65rem; }

  .site-search {
    order: 4;
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }

  .lang-switch { margin-left: auto; }
  .breadcrumbs { margin-top: 1.15rem; }

  .home-section { margin: 2.75rem 0; }
  .card-grid { grid-template-columns: 1fr; }
  .card { min-height: 0; padding: 1.35rem; }
  .card-image { margin: -1.35rem -1.35rem 1.2rem; }

  .page-heading { margin-bottom: 1.75rem; }
  .post-list { grid-template-columns: 1fr; }
  .list-item { padding: 1.2rem 1.25rem 1.2rem 1.5rem; }
  .list-item-media { padding: 0.75rem; }
  .list-item-image { flex-basis: 34%; max-width: 8.5rem; }
  .post-meta { margin-bottom: 2rem; }

  .post-body p:first-child::first-letter {
    float: none;
    margin: 0;
    font-size: inherit;
    line-height: inherit;
  }

  .related ul { grid-template-columns: 1fr; }
  .related li:last-child:nth-child(odd) { grid-column: auto; }

  .pagination {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .page-label {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }

  .page-btn { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
