/* TheChiangMaiGuide.com — single hand-written stylesheet.
   Design values measured off the original theme (2026-07-13):
   navy #1a2b49, red #de1220 (light #ee2b38, dark #af0e19), body DM Sans
   17.92/1.6, headings Inter 900 navy, content 1200px, red 10px site rule. */

/* ---------- fonts (self-hosted; latin + latin-ext) ---------- */
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/dm-sans/latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/dm-sans/latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; font-style: italic; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/dm-sans/latin-italic.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: italic; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/dm-sans/latin-ext-italic.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 900; font-display: swap; src: url(/assets/fonts/inter/latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 900; font-display: swap; src: url(/assets/fonts/inter/latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* weight 500 (nav/menu links only) — the Kirki mirror only shipped 900 */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/inter/500-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/inter/500-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- tokens + reset ---------- */
:root {
  --navy: #1a2b49;
  --red: #de1220;
  --red-light: #ee2b38;
  --red-dark: #af0e19;
  --body: #222;
  --grey: #555;
  --grey-light: #999;
  --line: #cdcdcd;
  --alt-bg: #f9f9f9;
  --heading-font: Inter, system-ui, sans-serif;
  --body-font: 'DM Sans', system-ui, sans-serif;
  --wrap: 1200px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body-font);
  font-size: 1.12rem;          /* 17.92px */
  line-height: 1.6;
  color: var(--body);
  background: #fff;
  border-bottom: 10px solid var(--red);
}
h1, h2, h3, h4 { font-family: var(--heading-font); font-weight: 900; color: var(--navy); line-height: 1.25; }
h2, h3 { text-transform: capitalize; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--red); }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

/* ---------- buttons ---------- */
.button {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-family: var(--heading-font);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  padding: 0.9em 2em;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.button:hover { background: var(--red-dark); color: #fff; }
.button.secondary { background: var(--navy); }
.button.secondary:hover { background: #243c65; }

/* ---------- header ---------- */
.site-header { background: var(--navy); }
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 87px;
}
.logo { display: flex; align-items: center; }
.logo img { width: 200px; height: auto; display: block; }
.top-nav ul { display: flex; align-items: center; gap: 0; list-style: none; margin: 0; padding: 0; }
.top-nav li { position: relative; }
.top-nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-family: var(--heading-font);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  padding: 10px 0 10px 30px;
}
.top-nav a:hover { color: #fff; opacity: 0.75; }
.top-nav svg { fill: currentColor; }
.top-nav .sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 30px;
  z-index: 50;
  background: #fff;
  min-width: 180px;
  padding: 6px 0;
  border-radius: 0 0 3px 3px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
.top-nav li:hover .sub, .top-nav li:focus-within .sub { display: block; }
.top-nav .sub a { color: var(--navy); font-size: 13px; padding: 8px 16px; }
.top-nav .sub a:hover { color: var(--red); opacity: 1; }

/* icon category nav */
.icon-nav { background: var(--navy); padding-bottom: 5px; }
.icon-nav ul {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.icon-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-family: var(--heading-font);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  padding: 14px 0 15px;
}
.icon-nav a:hover { color: #fff; opacity: 0.75; }
.icon-nav svg { fill: currentColor; flex: none; }

/* ---------- ad slot (after header, non-home pages) ---------- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  margin: 0;
  padding: 1.2rem;
  border: 2px dashed rgba(26, 43, 73, 0.35);
  background: #f6f7f9;
  color: var(--navy);
  font-family: var(--heading-font);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-align: center;
}
@media (min-width: 1000px) { .ad-slot { min-height: 130px; } }

/* ---------- breadcrumb ---------- */
.breadcrumb { text-transform: uppercase; font-size: 70%; margin: 24px 0 0; }
.breadcrumb p { margin: 0; }
.breadcrumb a { color: var(--navy); font-weight: 700; }
.breadcrumb .separator { padding: 0 5px; color: var(--grey-light); font-weight: 300; }
.breadcrumb .last { border-bottom: 2px solid #ef3340; }

/* ---------- layout ---------- */
/* top/bottom only — must NOT reset the .wrap horizontal padding, or the post
   column drops 32px left of the header/hero/logo (they'd stop aligning) */
.site-main { padding-top: 25px; padding-bottom: 64px; }
/* stretch (not start) so the sticky newsletter can travel the column's height */
.with-sidebar { display: grid; grid-template-columns: 1fr 368px; gap: 36px; }
.with-sidebar > * { min-width: 0; }
@media (max-width: 900px) { .with-sidebar { grid-template-columns: 1fr; } }

/* ---------- home hero ---------- */
.hero {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
}
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 23% 46%; }
.hero::after { content: ""; position: absolute; inset: 0; background: rgba(11, 11, 11, 0.8); }
.hero .wrap { width: 100%; } /* flex child must fill, or the text block centers */
.hero-inner { position: relative; z-index: 1; max-width: 620px; }
.hero h1 { font-size: 50px; font-weight: 800; text-transform: uppercase; color: #fff; margin: 0 0 0.4em; }
.hero p { color: #fff; margin: 0 0 1.4em; }
.hero .buttons { display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 700px) { .hero h1 { font-size: 34px; } }

/* ---------- home feed cards (single column, image left / excerpt right) --- */
/* no top margin: the first card's top edge aligns with the intro box top
   (the date ribbon overhangs into the site-main padding above) */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 48px; margin: 0; }
.card {
  position: relative;
  border: 1px solid var(--line);
  padding: 14px 30px 24px;
}
.card .date {
  position: absolute;
  top: -15px;
  left: 10px;
  z-index: 5;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
  padding: 4px 10px;
}
.card .date::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 15px 10px;
  border-color: transparent transparent rgba(175, 14, 25, 1) transparent;
}
.card h2 { font-size: 1.79rem; margin: 10px 0 0; }
.card h2 a { color: var(--navy); }
.card h2 a:hover { color: var(--red); }
.card .cats { margin: 4px 0 0; font-size: 15px; }
.card .cats a { color: var(--grey); }
.card .cats a:hover { color: var(--red); }
.card-media { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 18px; }
@media (max-width: 700px) { .card-media { grid-template-columns: 1fr; } }
.card-media img { border-radius: 3px; width: 100%; display: block; }
.card-text { display: flex; flex-direction: column; }
.card .excerpt { margin: 0; font-size: 0.995rem; line-height: 1.55; }
.card .more { text-align: right; margin: auto 0 0; padding-top: 12px; }
.card .more a {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 0.89rem;
  text-transform: uppercase;
  padding: 5px 15px;
  border-radius: 2px;
}
.card .more a:hover { background: var(--red-dark); }

/* ---------- archive list (blog/categories) ---------- */
.archive-title { margin: 0.4em 0; }
.archive-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin-top: 24px; }
@media (max-width: 700px) { .archive-grid { grid-template-columns: 1fr; } }
.archive-card img { border-radius: 3px; width: 100%; }
.archive-card .meta { text-transform: uppercase; font-size: 70%; color: var(--grey); margin: 8px 0 0; }
.archive-card h2 { font-size: 1.6rem; margin: 5px 0 8px; text-align: left; }
.archive-card p { margin: 0; font-size: 0.995rem; }

/* ---------- pagination ---------- */
.pagination { display: flex; gap: 8px; list-style: none; margin: 48px 0 0; padding: 0; }
.pagination a, .pagination .current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #ccc;
  background: #fff;
  color: var(--grey);
  line-height: 1;
  transition: all 0.25s ease;
}
.pagination a:hover, .pagination .current { background: var(--red); color: #fff; border-color: var(--red); }

/* ---------- sidebar ---------- */
/* navy intro card (matches the WP sidebar block) */
.intro-box {
  background: var(--navy);
  color: #fff;
  border-radius: 3px 3px 0 0;
  padding: 32px 28px 24px;
}
.intro-box h2 {
  color: #fff;
  font-size: 1.25rem;
  text-align: center;
  text-transform: uppercase;
  margin: 0 0 20px;
}
.intro-box figure { float: left; width: 96px; margin: 4px 16px 6px 0; }
.intro-box figure img { width: 100%; height: auto; display: block; border-radius: 3px; }
.intro-box p { font-size: 0.98rem; }
.intro-box a { color: #fff; text-decoration: underline; }
.intro-box a:hover { color: #fff; opacity: 0.8; }
.intro-box p:last-of-type { text-align: right; clear: both; margin-bottom: 0; }
/* only the email form is sticky (WP is-sticky block) */
.newsletter-box {
  position: sticky;
  top: 20px;
  background: #efefef;
  border-radius: 0 0 3px 3px;
  padding: 32px;
}
.newsletter-box h2 { color: var(--navy); }
.newsletter-box h2 {
  font-size: 1.12rem;
  text-align: center;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.newsletter-box .note { text-align: center; font-size: 10px; margin: 12px 0 0; }
.newsletter-form input[type="email"] {
  width: 100%;
  font-size: 0.84rem;
  font-family: var(--body-font);
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0;
  background: #fff;
  margin-bottom: 10px;
}
.newsletter-form .button { width: 100%; }
.newsletter-form .newsletter-note { margin: 8px 0 0; font-size: 0.9em; }
.newsletter-form .newsletter-note.is-error { color: var(--red-dark); }
.newsletter-hp { position: absolute !important; left: -9999px !important; opacity: 0; }

/* sidebar widgets (single posts) */
.widget { margin-bottom: 36px; }
.widget h3 { font-size: 1.2rem; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { margin: 0 0 10px; }
.widget .search-form { display: flex; gap: 8px; }

/* ---------- single post ---------- */
.entry-title { font-size: 1.68rem; text-transform: uppercase; text-align: left; margin: 18px 0 10px; }
.featured img { border-radius: 3px; width: 100%; }
.entry-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 0; margin: 14px 0 6px; font-size: 0.995rem; }
.entry-meta .author { font-weight: 700; color: #000; }
.entry-meta .date { color: var(--grey-light); padding-left: 30px; }
.share { display: flex; align-items: center; gap: 0; margin-left: auto; padding-left: 24px; }
.share .label { font-size: 0.995rem; }
.share a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  margin-left: 12px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  transition: background 0.2s ease;
}
.share a:hover { background: var(--navy); }
.share svg { fill: #fff; width: 17px; height: 17px; }

/* post body */
.post-body { margin-top: 18px; }
.post-body h2 { font-size: 1.6rem; }
.post-body h3 { font-size: 1.35rem; }
.post-body a { color: var(--navy); font-weight: 700; }
.post-body a:hover { color: var(--red); }
.post-body img { border-radius: 3px; }
.post-body figure { margin: 28px 0; }
.post-body figcaption { font-size: 0.85rem; color: var(--grey); margin-top: 8px; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0 32px; }
.post-body blockquote { border-left: 4px solid var(--red); margin: 28px 0; padding: 4px 0 4px 20px; color: var(--grey); }
.post-body iframe { max-width: 100%; border: 0; border-radius: 3px; }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li { margin-bottom: 6px; }
.post-body .btn-row { margin: 28px 0; }
.post-body table { border-collapse: collapse; width: 100%; margin: 28px 0; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }

/* table of contents (native details, replaces the old JS toggle) */
.post-body details { background: var(--alt-bg); border: 1px solid var(--line); border-radius: 3px; padding: 12px 18px; margin: 24px 0; }
.post-body details details { border: 0; background: none; padding: 0 0 0 6px; margin: 0; }
.post-body summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.post-body details ul { margin: 8px 0; }

/* notice callouts (were Mai Notices) */
.notice { background: var(--alt-bg); border-left: 4px solid var(--navy); border-radius: 0 3px 3px 0; padding: 16px 20px; margin: 28px 0; }
.notice.notice-warning, .notice.notice-alert { border-left-color: var(--red); }
.notice p { margin: 0; }
.notice p + p { margin-top: 10px; }

/* social icon row (about page) */
.social-icons { display: flex; justify-content: center; gap: 18px; list-style: none; margin: 20px 0; padding: 0; }
.social-icons a { color: var(--navy); }
.social-icons a:hover { color: var(--red); }
.social-icons svg { fill: currentColor; width: 28px; height: 28px; }

/* author box */
.author-box {
  display: flex;
  gap: 24px;
  background: var(--alt-bg);
  padding: 36px;
  margin-top: 48px;
}
.author-box img { width: 80px; height: 80px; flex: none; }
.author-box h4 { margin: 0 0 8px; }
.author-box p { margin: 0; font-size: 0.995rem; }

/* comments (read-only list) */
.comments { margin-top: 48px; }
.comments ol { list-style: none; padding: 0; }
.comments li { border-top: 1px solid var(--line); padding: 20px 0; }
.comments .comment-author { font-weight: 700; }
.comments .comment-date { color: var(--grey-light); font-size: 0.85rem; }

/* ---------- search page ---------- */
.search-page-form { display: flex; gap: 10px; margin: 24px 0 32px; max-width: 560px; }
.search-page-form input {
  flex: 1;
  font-size: 1rem;
  font-family: var(--body-font);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
}
#search-results ul { list-style: none; padding: 0; }
#search-results li { margin: 0 0 1.5em; }
#search-results .r-date { text-transform: uppercase; color: var(--grey-light); font-size: 0.8rem; }

/* ---------- footer ---------- */
.site-footer { padding: 8px 0; border-bottom: 7px solid #fff; }
.footer-bar { background: var(--navy); color: #fff; }
.footer-cols {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 0;
  font-size: 12px;
  font-family: var(--heading-font);
  font-weight: 500;
}
.footer-cols p { margin: 0; }
.footer-cols a { color: #fff; text-decoration: underline; }
.footer-cols a:hover { text-decoration: none; }
.footer-cols svg { fill: currentColor; vertical-align: middle; }

/* ---------- responsive header ---------- */
@media (max-width: 800px) {
  .header-bar { flex-direction: column; padding-top: 12px; padding-bottom: 12px; gap: 8px; }
  .top-nav a { padding-left: 15px; padding-right: 15px; }
  .icon-nav ul { justify-content: flex-start; gap: 0 18px; overflow-x: auto; }
  .entry-meta .date { padding-left: 12px; }
  .share { margin-left: 0; padding-left: 0; width: 100%; }
}
