/*
 * Site styles — mobile first.
 *   Mobile:  below 600px  (default styles)
 *   Tablet:  600px – 1024px
 *   Desktop: 1025px and up
 * The header color (--brand) comes from theme_color in site.config.js.
 */

:root {
  --brand: #0e5a6b;
  --brand-dark: #0a3f4b;
  --text: #1b1b1b;
  --muted: #555;
  --link: #0a4fa0;
  --border: #c9d3d6;
  --soft: #f3f6f7;
  --focus: #ffbf47;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
a { color: var(--link); }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
h1, h2, h3 { line-height: 1.3; }
h1 { font-size: 1.5rem; margin: 0.5em 0; }
h2 { font-size: 1.2rem; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 8px; top: 8px; z-index: 10; background: #fff; color: var(--text); padding: 10px 14px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { background: var(--brand); color: #fff; padding: 14px 0 12px; text-align: center; }
.brand { margin: 0; font-size: 1.75rem; font-weight: 800; line-height: 1.2; letter-spacing: 0.5px; }
.brand a { color: #fff; text-decoration: none; }
.tagline { margin: 4px 0 0; font-size: 0.95rem; color: #e8f1f3; }

/* ---------- Nav bar ---------- */
.main-nav { background: var(--brand-dark); }
.main-nav .wrap { padding: 0; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: block;
  min-height: 44px;
  padding: 11px 16px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.nav-list a:hover, .nav-list a[aria-current="page"] { background: rgba(255, 255, 255, 0.16); text-decoration: underline; }
.nav-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.nav-toggle[hidden] { display: none; }
.nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after {
  display: block; width: 22px; height: 2px; background: #fff; position: relative;
}
.nav-toggle-icon::before, .nav-toggle-icon::after { content: ""; position: absolute; left: 0; }
.nav-toggle-icon::before { top: -7px; }
.nav-toggle-icon::after { top: 7px; }
/* With JavaScript on, the mobile menu starts closed. Without JS it stays open. */
.js .nav-list { display: none; }
.js .nav-list.open { display: block; }

/* ---------- Home page boxes ---------- */
.row { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
.box {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}
.box-head { margin: 0; background: var(--brand); border-radius: 3px 3px 0 0; font-size: 1.15rem; text-align: center; }
.box-head a { display: block; padding: 10px 12px; color: #fff; text-decoration: none; }
.box-head a:hover { text-decoration: underline; }
.box-list { list-style: none; margin: 0; padding: 4px 12px; flex: 1 1 auto; }
.box-list li { border-bottom: 1px dashed #dde3e5; }
.box-list li:last-child { border-bottom: 0; }
.box-list a { display: block; padding: 9px 0; font-weight: 600; text-decoration: none; }
.box-list a:hover { text-decoration: underline; }
.box-list .empty { padding: 10px 0; color: var(--muted); }
.view-more {
  display: block;
  padding: 11px 12px;
  border-top: 1px solid var(--border);
  background: var(--soft);
  font-weight: 700;
  text-align: right;
  text-decoration: none;
}

/* ---------- Ads (kept apart from content and buttons) ---------- */
/* Every ad is centered, at most 970px wide, with clear space above and below. */
.ad {
  max-width: 970px;
  margin: 28px auto;
  padding: 6px 0 10px;
  min-height: 130px; /* reserves space so the page does not jump when the ad loads */
  border-top: 1px solid #e3e3e3;
  border-bottom: 1px solid #e3e3e3;
  text-align: center;
  overflow: hidden;
}
/* Extra gap under the menu so a finger aiming for a menu link cannot hit the ad */
.ad-below_nav { margin-top: 28px; }
.ad-label { margin: 0 0 4px; font-size: 0.75rem; color: #666; text-transform: uppercase; letter-spacing: 0.08em; }
.ad .adsbygoogle { margin: 0 auto; }
/* Grey box shown only in "npm run preview:ads" */
.ad-placeholder {
  display: flex; align-items: center; justify-content: center;
  height: 100px; margin: 0 auto; max-width: 728px;
  border: 2px dashed #b9c2c5; background: #f1f3f4; color: #666; font-size: 0.9rem;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 16px 0 0; padding: 0; font-size: 0.95rem; color: var(--muted); }
.breadcrumb li { padding: 4px 0; }
.breadcrumb li + li::before { content: "\203A"; margin: 0 8px; color: #888; }

/* ---------- Inner pages: one centered column ---------- */
.page { max-width: 860px; margin: 0 auto; }

/* ---------- Category list ---------- */
.intro { color: var(--muted); margin-top: 0; }
.post-list { list-style: none; margin: 16px 0; padding: 0; border: 1px solid var(--border); border-radius: 4px; }
.post-list li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-bottom: 1px solid #e3e8ea; }
.post-list li:last-child { border-bottom: 0; }
.post-list a { font-weight: 600; text-decoration: none; }
.post-list a:hover { text-decoration: underline; }
.post-list time { font-size: 0.9rem; color: var(--muted); white-space: nowrap; }

/* ---------- Post page ---------- */
.meta { color: var(--muted); margin-top: 0; font-size: 0.95rem; }
.lead { font-size: 1.05rem; }
.post section, .prose section { margin-top: 24px; }
.post h2, .prose h2, .related h2 {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 5px solid var(--brand);
  background: var(--soft);
  font-size: 1.15rem;
}
.prose h2 { margin-top: 28px; }

.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td { padding: 10px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.info-table th { width: 40%; background: var(--soft); font-weight: 700; }
/* On small screens: label on top, value below (no sideways scrolling) */
@media (max-width: 599px) {
  .info-table, .info-table tbody, .info-table tr, .info-table th, .info-table td { display: block; width: 100%; }
  .info-table tr { margin-bottom: 10px; border: 1px solid var(--border); }
  .info-table th, .info-table td { border: 0; }
}

.btn-list { display: flex; flex-direction: column; gap: 12px; list-style: none; margin: 0; padding: 0; }
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border: 2px solid var(--brand);
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; }
.btn-outline { background: #fff; color: var(--brand); }
.btn-outline:hover { color: #fff; }

.notice { margin: 20px 0; padding: 12px 14px; border-left: 5px solid #c98a00; background: #fff6dd; }

.related { margin-top: 32px; }
.related ul { margin: 0; padding-left: 20px; }
.related li { margin: 6px 0; }

/* ---------- Contact form ---------- */
.contact-form { display: grid; gap: 6px; max-width: 560px; margin: 20px 0; }
.contact-form label { font-weight: 600; margin-top: 8px; }
.contact-form input, .contact-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #8a9a9f;
  border-radius: 4px;
  font: inherit;
  font-size: 16px; /* 16px stops iPhones from zooming in */
}
.contact-form .btn { margin-top: 12px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; padding: 24px 0; background: #22313a; color: #e6ecee; font-size: 0.95rem; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; list-style: none; margin: 0 0 12px; padding: 0; }
.footer-links a { display: inline-block; padding: 8px 0; color: #fff; }
.site-footer p { margin: 8px 0; }

/* ---------- Tablet (600px and up) ---------- */
@media (min-width: 600px) {
  h1 { font-size: 1.8rem; }
  .row-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Admission box: links in a neat grid so the rows line up */
  .row-2 .box-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .row-2 .box-list li:last-child { border-bottom: 1px dashed #dde3e5; }

  .nav-toggle { display: none !important; }
  .nav-list, .js .nav-list { display: flex; flex-wrap: wrap; justify-content: center; }
  .nav-list a { border-top: 0; padding: 11px 9px; font-size: 0.95rem; }

  .post-list li { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 16px; }
  .btn-list { flex-direction: row; flex-wrap: wrap; }
}

/* ---------- Desktop (1025px and up) ---------- */
@media (min-width: 1025px) {
  .brand { font-size: 2rem; }
  .nav-list a { padding: 11px 14px; font-size: 1rem; }
  .row-1 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .row-2 .box-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
