/*
Theme Name: Astra Child
Template: astra
Version: 1.0.0
*/ 

/* === Font Faces === */
/* ExtraLight (100) */
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-ExtraLight.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-ExtraLightItalic.woff2') format('woff2');
    font-weight: 100;
    font-style: italic;
    font-display: swap;
}

/* Thin (200) */
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-Thin.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-ThinItalic.woff2') format('woff2');
    font-weight: 200;
    font-style: italic;
    font-display: swap;
}

/* Light (300) */
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-LightItalic.woff2') format('woff2');
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

/* Regular (400) */
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

/* Medium (500) */
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-MediumItalic.woff2') format('woff2');
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

/* SemiBold (600) */
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-SemiBoldItalic.woff2') format('woff2');
    font-weight: 600;
    font-style: italic;
    font-display: swap;
}

/* Bold (700) */
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-BoldItalic.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* ExtraBold (800) */
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-ExtraBoldItalic.woff2') format('woff2');
    font-weight: 800;
    font-style: italic;
    font-display: swap;
}

/* Black (900) */
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-optimized/Inter-BlackItalic.woff2') format('woff2');
    font-weight: 900;
    font-style: italic;
    font-display: swap;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
} 

#content{
  background-color: #ededed;
}

/* === Common Utilities === */
.margin-top-10 { margin-top: 10px; }
.display-none { display: none; }

/* === Shared Layout === */
#thailand-map-layout,
#bangkok-map-wrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  max-width: 1200px;
  padding: 1rem 0;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

#map-controls-thailand,
#map-controls-bangkok {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  background: var(--primary-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--light-gray);
  color: var(--text);
}

#map-controls-thailand input,
#map-controls-thailand button,
#map-controls-thailand label,
#map-controls-bangkok input,
#map-controls-bangkok button,
#map-controls-bangkok label {
  display: inline-block;
  margin-bottom: 0.2rem;
  padding: 4px 6px;
}

#map-controls-thailand button,
#map-controls-bangkok button {
  padding: 6px 10px;
  cursor: pointer;
}

.spacer-map-controls-play-button{
  height: 2rem;
}

.spacer-map-controls-clear-button{
  height: 2.4rem;
}

.controls-wrapper{
  display: flex;
  gap: 1rem;
}

.input-wrapper {
  margin-bottom: 1rem;
}

/* Fix for select options display */
select option {
  font-size: 1rem; /* Changed from 0.1rem to make options visible */
  padding: 8px;
}

/* Enhance select styling */
select.tw-input,
select.map-controls-select {
  appearance: auto; /* Ensures dropdown arrow is visible */
  padding-right: 2rem; /* Space for dropdown arrow */
}

/* Improve dropdown appearance */
select option:hover,
select option:focus {
  background-color: var(--secondary-bg);
}

#thailand-map,
#bangkok-map {
  flex: 1 1 50%;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}

#thailand-map { 
  height: 500px; 
  min-height: 500px;
}

#bangkok-map { 
  height: 500px; 
  min-height: 500px;
  padding: 1rem; /* Adds uniform space around the SVG */
}

#bkk-predictions-map { 
  height: 500px; 
  min-height: 500px;
  padding: 1rem; /* Adds uniform space around the SVG */
}

/* Bangkok line graph container */
#bangkok-linegraph {
  flex: 1 1 100% !important;   /* Full width within its column */
  width: 100% !important;
  max-width: 100% !important;
  height: 500px !important;    /* Align height with map */
  min-height: 500px !important;
  display: flex;
  flex-direction: column;
}

/* Make sure SVG elements are visible */
#bangkok-map svg,
#thailand-map svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Ensure Bangkok wrapper has proper layout */
.bangkok-map-wrapper,
.thailand-map-wrapper {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .bangkok-map-wrapper,
  .thailand-map-wrapper {
    flex-direction: column;
  }
}

/* === Map Legend === */
.info.legend,
.map-legend {
  background: white;
  padding: 10px;
  border-radius: 6px;
  line-height: 1.4;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
  font-size: 14px;
  z-index: 1 !important;
}

.map-legend {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 1 !important;
}

.map-legend i {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: middle;
}

.info.legend h4 { margin-bottom: 5px; }

/* === Choices.js === */
.choices, .choices__inner { width: 100% !important; }

.choices__inner {
  box-sizing: border-box;
  min-height: 38px;
  font-size: 14px;
  padding: 4px 6px;
}

.choices__list--multiple .choices__item {
  font-size: 13px;
  padding: 2px 10px;
  margin: 4px;
  border-radius: 10px;
  box-sizing: border-box;
  background-color: gray;
  color: #ffffff;
  align-items: center;
  border: 0;
}

.choices__list--multiple .choices__item .choices__button {
  border: none;
  margin-left: 6px;
  padding-left: 6px;
  position: relative;
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.choices__list--multiple .choices__item .choices__button::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.4);
  margin-bottom: 0 !important;
}

.choices__list--multiple .choices__item .choices__button:hover,
.choices__list--multiple .choices__item .choices__button:focus {
  background: transparent !important;
  opacity: 1;
}

/* === Province Styling === */
.top-province {
  transition: background-color 0.3s ease;
  border-radius: 6px;
  display: inline-block;
  background-color: transparent;
  color: inherit;
  font-weight: normal;
  text-shadow: 0 0 2px rgba(0,0,0,0.2);
}

.top-province-name, .top-bkk-name {
  min-height: 2.2rem;
  max-height: 2rem;
  overflow: hidden;
  display: inline-block;
}

.top-province-value,
.top-bkk-value { padding: 0 8px; }

.top-bkk-value {
  border-radius: 6px;
  color: #fff;
  transition: background-color 0.4s ease;
}

/* === Mobile-specific CSS fix for Leaflet maps === */
@media (max-width: 768px) {
  #thailand-map-layout,
  #bangkok-map-wrapper {
    flex-direction: column;
  }

  #map-controls-thailand,
  #map-controls-bangkok {
    flex: 1 1 100%;
    min-width: 100%;
  }

  #thailand-map {
    min-height: 400px !important;
  }

  #bangkok-map {
    min-height: 500px !important;
  }
}

/* Legacy top indicator styles - now deprecated in favor of circular indicators */
/* Only hide the old non-circular indicators, not the container divs */
/* Temporarily commented out to debug visibility issues */
/*
.top_indicator .value,
.top_indicator .label {
  display: none; /* Hide old value/label spans */

*/

/* Ensure all circular indicators are visible */
.top-indicator-circle,
div[id*="circle"] {
  display: flex !important;
}

/* === Top Indicator Rows === */
.top_indicator_row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
  width: 100%;
  justify-content: space-around;
  align-items: center;
}

.top_indicator_row .top-indicator {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

/* Ensure circles are properly spaced and sized */
.top_indicator_row .top-indicator-circle {
  margin: 0;
  flex-shrink: 0;
}

/* === Circular Top Indicators === */
.top-indicator-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: 50%;
  background: transparent;
  background-color: transparent;
  border: 3px solid #dee2e6;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
  width: 120px;
  height: 120px;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
}

.top-indicator-circle .top-indicator-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0.5rem;
  box-sizing: border-box;
}

.top-indicator-circle .top-indicator-value {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 0.25rem;
  text-align: center;
  background: transparent;
  background-color: transparent;
}

.top-indicator-circle .top-indicator-name {
  display: block;
  font-size: 1rem;
  line-height: 1.1;
  word-wrap: break-word;
  max-width: 100%;
  text-align: center;
  background: transparent;
  background-color: transparent;
}

/* Responsive sizing for different screen sizes */
@media (max-width: 768px) {
  .top_indicator_row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 1rem;
    justify-items: center;
    align-items: center;
    width: 100%;
  }
  
  /* First row: 2 indicators */
  .top_indicator_row .top-indicator:nth-child(1),
  .top_indicator_row .top-indicator:nth-child(2) {
    grid-row: 1;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  /* Second row: 2 indicators */
  .top_indicator_row .top-indicator:nth-child(3),
  .top_indicator_row .top-indicator:nth-child(4) {
    grid-row: 2;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  /* Third row: 1 indicator (centered) */
  .top_indicator_row .top-indicator:nth-child(5) {
    grid-row: 3;
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  .top-indicator-circle {
    width: 140px;
    height: 140px;
    margin: 0.5rem;
  }
  
  .top-indicator-circle .top-indicator-content {
    padding: 0.5rem;
  }
  
  .top-indicator-circle .top-indicator-value {
    font-size: 2rem;
    margin-bottom: 0.3rem;
  }
  
  .top-indicator-circle .top-indicator-name {
    font-size: 1.1rem;
    line-height: 1.2;
  }
}

/* --- Year Comparison and Graph Toggle Controls --- */
/* Base style for each year comparison button */
.year-comp-btn {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  /* Remove margin so buttons sit flush against each other */
  margin: 0;
  /* Remove default rounded corners; will be added selectively */
  border-radius: 0;
  padding: 4px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  color: #495057;
}

/* Round only the first and last buttons in the group */
.year-control-group .year-comp-btn:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.year-control-group .year-comp-btn:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.year-comp-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.year-comp-btn-active {
  background: var(--brand) !important; /* Corporate green */
  border-color: var(--brand) !important;
  color: #ffffff !important;
}

.graph-toggle-btn {
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 4px !important;
  outline: none !important;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.graph-toggle-btn:hover {
  background: #f0f0f0 !important;
}

#year-comparison-controls {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  justify-content: center;
}

#graph-type-toggle {
  position: absolute;
  top: 12px;
  right: 10px;
  z-index: 20;
  display: flex;
  gap: 8px;
}

/* --- Fix for Leaflet zoom button rendering issue --- */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  border: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
}
.leaflet-control-zoom-in span,
.leaflet-control-zoom-out span {
  border: none !important;
  box-shadow: none !important;
  font-weight: bold !important;
}
.leaflet-control-zoom-in::after,
.leaflet-control-zoom-out::after,
.leaflet-control-zoom-in::before,
.leaflet-control-zoom-out::before {
  content: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* === Theme Variables === */
:root {
  --brand: #54b435;
  --alt-brand: #379237;
  --headings: #0f172a;
  --text: #2f3b40;
  --primary-bg: #ffffff;
  --secondary-bg: #edfbe2;
  --alt-bg: #0c1406;
  --subtle-bg: #d5ead8;
  --supporting: #222222;
  --light-gray: #dfdfdf;
  --border-radius: 4px;
}

/* === Map Controls === */
.map-controls-label {
  color: var(--headings);
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: block;
}
.map-controls-select,
.map-controls-multiselect {
  width: 100%;
  background: var(--secondary-bg);
  border: 1px solid var(--subtle-bg);
  border-radius: var(--border-radius);
  color: var(--text);
  padding: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.map-controls-checkbox-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.map-controls-checkbox-group label {
  font-weight: 400;
  color: var(--text);
}
.map-controls-slider-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.map-controls-slider {
  flex: 1;
  accent-color: var(--brand);
}
.map-controls-slider-value {
  min-width: 48px;
  text-align: right;
  color: var(--supporting);
  font-size: 0.95em;
}
.map-controls-play-btn,
.map-controls-clear-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.6rem 1.2rem;
  margin-bottom: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
  align-self: flex-end;
}
.map-controls-play-btn:hover,
.map-controls-clear-btn:hover {
  background: var(--alt-brand);
}
.map-controls-section-title {
  color: var(--headings);
  font-weight: 700;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}
.map-controls-hr {
  border: none;
  border-top: 1px solid var(--subtle-bg);
  margin: 1.2rem 0;
}

/* === Utility Classes === */
.text-brand { color: #54b435; }
.border-subtle { border-color: #d5ead8; }

/* === Tailwind-like Inputs and Buttons === */
.tw-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--light-gray);
  border-radius: 0.5rem;
  background: var(--primary-bg);
  color: #2f3b40;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tw-input:focus {
  outline: none;
  border-color: #54b435;
  box-shadow: 0 0 0 2px #d5ead8;
}
.tw-checkbox {
  accent-color: #54b435;
  width: 1.1em;
  height: 1.1em;
  border-radius: 0.25em;
  border: 1px solid #d5ead8;
}
.tw-slider {
  flex: 1;
  accent-color: #379237;
  height: 2px;
  margin: 0 0.5rem;
}
.tw-slider-value {
  min-width: 48px;
  text-align: right;
  color: #222;
  font-size: 0.95em;
}
.tw-btn {
  background: #54b435;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  margin-top: 0.5rem;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(47,59,64,0.04);
  cursor: pointer;
}
.tw-btn:hover, .tw-btn:focus {
  background: #379237;
}
.tw-btn-secondary {
  background: #edfbe2;
  color: #379237;
  border: 1px solid #d5ead8;
  border-radius: 0.5rem;
  padding: 0.5rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  margin-top: 0.5rem;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
}
.tw-btn-secondary:hover, .tw-btn-secondary:focus {
  background: #d5ead8;
  color: #0f172a;
}

/* Bangkok Map Layout - Match Thailand Structure */
#bangkok-map-layout-v2 {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

#bangkok-map-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 2em;
  align-items: flex-start;
  width: 100%;
}

#bangkok-map {
  flex: 1 1 48%;
  min-width: 320px;
  max-width: 100%;
  height: 500px !important;
  min-height: 500px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #f8f9fa;
  position: relative;
  overflow: hidden;
}

#bangkok-linegraph {
  flex: 1 1 48%;
  min-width: 320px;
  max-width: 100%;
  height: 500px !important;
  min-height: 500px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #f8f9fa;
  position: relative;
  overflow: hidden;
}

/* Responsive adjustments for Bangkok */
@media (max-width: 768px) {
  #bangkok-map-flex {
    flex-direction: column;
    gap: 1.5em;
  }
  
  #bangkok-map,
  #bangkok-linegraph {
    flex: 1 1 100%;
    min-width: 100%;
  }
  
  #bangkok-map {
    height: 400px !important;
    min-height: 400px;
  }
  
  #bangkok-linegraph {
    height: 350px !important;
    min-height: 350px;
  }
}

/* Bangkok controls styling - match Thailand */
#map-controls-bangkok {
  width: 100%;
  margin-bottom: 1.5em;
  padding: 1em;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
}

#map-controls-bangkok .control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  align-items: center;
  margin-bottom: 0.75em;
}

#map-controls-bangkok .control-row:last-child {
  margin-bottom: 0;
}

#map-controls-bangkok label {
  font-weight: 600;
  margin-right: 0.5em;
  min-width: 80px;
}

#map-controls-bangkok select {
  padding: 0.5em;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  min-width: 120px;
}

/* === Custom Range Slider (Flowbite style) === */
input[type=range].range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 0.5rem; /* 2px --> 0.5rem for better visibility */
  background-color: #e5e7eb; /* gray-200 */
  border-radius: 0.5rem; /* rounded-lg */
  cursor: pointer;
  outline: none;
}
input[type=range].range-slider:focus {
  outline: none;
}
input[type=range].range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem; /* 16px */
  height: 1rem;
  background-color: #2563eb; /* blue-600 similar to screenshot */
  border-radius: 9999px;
  cursor: pointer;
  border: none;
}
input[type=range].range-slider::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  background-color: #2563eb;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
}
input[type=range].range-slider::-ms-thumb {
  width: 1rem;
  height: 1rem;
  background-color: #2563eb;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
}
/* Track for Firefox */
input[type=range].range-slider::-moz-range-track {
  background-color: #e5e7eb;
  height: 0.5rem;
  border-radius: 0.5rem;
}
/* Focus ring */
input[type=range].range-slider:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.4); /* ring effect */
}

/* Base button style */
.btn-base {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
}

/* ------------------------------------------------------------------
   Override Bangkok Graph & Controls to match Thailand layout
------------------------------------------------------------------ */
#bangkok-linegraph {
  flex: 1 1 100% !important;   /* Full width within its column */
  width: 100% !important;
  max-width: 100% !important;
  height: 500px !important;    /* Align height with map */
  min-height: 500px !important;
  display: flex;
  flex-direction: column;
}

/* Ensure year comparison buttons span full width and align similarly */
#year-comparison-controls-bkk {
  width: 100% !important;
  justify-content: center !important;
  gap: 0.75rem !important;
}

#year-comparison-controls-bkk .year-comp-btn {
  flex: 0 0 auto;
}

/* Box styling for Thailand graph to match Bangkok */
#thailand-linegraph {
  flex: 1 1 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 500px !important;
  min-height: 500px !important;
  display: flex;
  flex-direction: column;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f8f9fa;
  position: relative;
  overflow: hidden;
}

/* -------- Graph container flex layout -------- */
#bangkok-linegraph,
#thailand-linegraph {
  display: flex;
  flex-direction: column;
  height: 500px !important;  /* exact match to map */
  max-height: 500px !important;
}

#bangkok-linegraph svg,
#thailand-linegraph svg {
  flex: 1 1 auto;
  order: 1;
}

#year-comparison-controls-bkk,
#year-comparison-controls-thai {
  order: 2;
  margin-top: auto; /* push to bottom */
  margin-bottom: 10px;
}

/* Remove double border between adjacent buttons */
.year-control-group .year-comp-btn + .year-comp-btn {
  border-left-width: 0;
}

.graph-toggle-btn{
  border: 1px solid #eee !important;
}

.primary{
  background-color: #fff;
  padding: 2rem;
  border-radius: 0.1rem;
}

.blog .primary{
  background-color: transparent !important;
}

/* === Remove white background for specific posts === */
body.postid-10 .primary,
body.postid-45 .primary,
body.postid-149 .primary {
  background-color: transparent !important;
}

body.page-id-10 .primary,
body.page-id-45 .primary,
body.page-id-149 .primary {
  background-color: transparent !important;
}

h1{
  font-size: 2.8rem !important;
}

.wp-block-image.size-full {
  height: auto !important;
}

/* === Navigation Icon Replacement === */
#menu-item-1242 > a.menu-link {
  /* Hide the original text */
  font-size: 0;           /* Prevents text from taking up space */
  line-height: 0;
  text-indent: -9999px;   /* Moves text off-screen while keeping it accessible for screen readers */
  width: 24px;            /* Icon dimensions */
  height: 24px;
  position: relative;
  margin-left: 1rem;
}

#menu-item-1242 > a.menu-link::before {
  content: "";
  position: absolute;
  inset: 0;               /* Fills the anchor */
  display: block;
  background-image: url('/wp-content/uploads/2025/08/email-w.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.scrolled #menu-item-1242 > a.menu-link::before {
  background-image: url('/wp-content/uploads/2025/07/email.svg');
}

/* --------------------------------------------------
   Homepage Proportional Symbol Map Styles
-------------------------------------------------- */
.home-map-section .home-map-bg {
  background-size: cover;
  background-position: center;
  position: absolute;
  inset: 0;
}
.home-map-section .home-map-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

/* Ensure SVG elements render above the dark overlay */
.home-map-section svg {
  position: relative;
  z-index: 1;
}

#home-map-section{
  min-height: 100vh;
  padding-top: 40px;
  padding-bottom: 40px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: relative; /* Needed for absolute bg positioning */
  overflow: hidden;  /* Crop scaled/blurred bg to avoid white borders */
}

#home-map {
  width: 100%;
}
@media (max-width: 640px) {
  #home-map {
    min-height: 60vh;
  }
}

/* Blur animation for background */
@keyframes bg-blur {
  from { filter: blur(0); transform: scale(1); }
  to   { filter: blur(6px); transform: scale(1.15); }
}
.home-map-bg.anim-blur {
  animation: bg-blur 1.5s forwards;
}

#pred-model-help{
  padding: .25rem .75rem;
  border-radius: 9999px;
  text-decoration: none;
  color: gray;
}

.leaflet-attribution-flag{
  display: none !important;
}

.home-area{
  background: 
    linear-gradient(rgba(0, 0, 0, .8), rgba(0, 0, 0, .8)), 
    url(/wp-content/uploads/2025/09/bg.jpg);
  background-repeat: no-repeat;
  background-size: cover, cover;
  background-position: 0 0, center;
  position: relative;
}

.home-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(90deg, transparent 0px, transparent 2px, rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px, transparent 4px),
    linear-gradient(0deg, transparent 0px, transparent 2px, rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px, transparent 4px);
  background-size: 4px 4px;
  background-position: 0 0;
  pointer-events: none;
  z-index: 1;
}

/* Modern image format support with fallbacks */
@supports (background-image: url('data:image/avif;base64,')) {
  .home-area{
    background: 
      linear-gradient(rgba(0, 0, 0, .8), rgba(0, 0, 0, .8)), 
      url(/wp-content/compressx-nextgen/uploads/2025/09/bg-1024x682.jpg.avif);
    background-repeat: no-repeat;
    background-size: cover, cover;
    background-position: 0 0, center;
    position: relative;
  }
  
  .home-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
      linear-gradient(90deg, transparent 0px, transparent 2px, rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px, transparent 4px),
      linear-gradient(0deg, transparent 0px, transparent 2px, rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px, transparent 4px);
    background-size: 4px 4px;
    background-position: 0 0;
    pointer-events: none;
    z-index: 1;
  }
}

@supports not (background-image: url('data:image/avif;base64,')) {
  .home-area{
    background: 
      linear-gradient(rgba(0, 0, 0, .8), rgba(0, 0, 0, .8)), 
      url(/wp-content/compressx-nextgen/uploads/2025/09/bg-1024x682.jpg.webp);
    background-repeat: no-repeat;
    background-size: cover, cover;
    background-position: 0 0, center;
    position: relative;
  }
  
  .home-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
      linear-gradient(90deg, transparent 0px, transparent 2px, rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px, transparent 4px),
      linear-gradient(0deg, transparent 0px, transparent 2px, rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px, transparent 4px);
    background-size: 4px 4px;
    background-position: 0 0;
    pointer-events: none;
    z-index: 1;
  }
}

.home-wrapper{
  max-width: 1200px !important;
  position: relative;
  z-index: 2;
}

.home-wrapper h1{
  color: white;
}
.home-wrapper h2{
  color: white;
  font-size: 1.6rem;
}

.home-wrapper p{
  color: white;
}

.page-id-899 header{
  margin: 0 !important;
}

.page-id-899 h1{
  /* margin: 0 0 .5rem 0 !important; */
}

.page-id-899 h3{
  font-weight: 300;
  margin: 1rem  0 .5rem 0;
}

.page-id-899 h4{
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0  0 .5rem 0;
}

.page-id-899 h5{
  margin: 0  0 1rem 0;
  font-size: 1rem;
  font-weight: 300;
}

.page-id-899 p{
  font-size: 1rem;
  font-weight: 300;
  margin: 0  0 .75rem 0;
}

.page-id-899{
  gap: 1rem;
}

#content{
  background-image: url(/wp-content/uploads/2025/08/vectorBG.svg);
  background-size: 100px;
}

#primary{
  border-radius: 3px;
}

.page-id-10 #primary{
  border: none;
}

.page-id-45 #primary{
  border: none;
}

#ast-scroll-top {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

#primary{
  /* margin: 8em 0 !important; */
}

.home #primary{
  margin: 0 !important;
}

.home-area{
  padding-top: 8em !important;
}

.home .site-title a{
  color: white
}

.site-title a{
  color: white !important; 
}

@media (min-width: 921px) {
  .main-header-bar-navigation .menu-link{
    color: white !important;
  }
}

/* Mobile menu toggle button styles - screens below 921px */
@media (max-width: 920px) {
  .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle,
  .ast-mobile-header-content .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle,
  .ast-header-break-point .main-header-bar-navigation .menu-item-has-children > .ast-menu-toggle {
    box-shadow: none !important;
    height: 65px !important;
    width: auto !important;
  }
  .menu-link{
    font-size: 1.5rem !important;
  }
  .menu-link .ast-icon{
    display: none !important;
  }
}

.main-header-bar-navigation .current_page_item .menu-link{
  color: var(--ast-global-color-0) !important;
}

.main-header-bar-navigation .sub-menu .menu-link{
  color: black !important;
}

.main-header-bar-navigation .sub-menu .menu-link:hover{
  color: var(--ast-global-color-1) !important;
}

#masthead{
  position: fixed !important;
  z-index: 1000 !important;
  /* background-color: rgba(255, 255, 255, 0.5) !important; */
}

#masthead{
  background-color: transparent !important;
}

#masthead.scrolled{
  background-color: white !important;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
}

#masthead.scrolled .main-header-bar-navigation .menu-link{
  color: inherit !important;
}

#masthead.scrolled .main-header-bar-navigation .current_page_item .menu-link{
  color: var(--ast-global-color-0) !important;
}

#masthead.scrolled .main-header-bar-navigation .current_page_item .sub-menu .menu-link{
  color: black !important;
}

#masthead.scrolled .main-header-bar-navigation .current_page_item .sub-menu .menu-link:hover{
  color: var(--ast-global-color-1) !important;
}

#masthead.scrolled .site-title a{
  color: black !important;
}

/* Header menu font-size responsive adjustment */
@media (max-width: 1080px) and (min-width: 920px) {
  .main-header-bar-navigation .menu-link {
    font-size: 14px !important;
  }
}

@media (max-width: 990px) and (min-width: 920px) {
  .main-header-bar-navigation .menu-link {
    font-size: 12px !important;
  }
}

article {
  padding: 0 !important;
}

.wp-block-post-title a{
  text-decoration: none !important;
}

.wp-block-post-terms a{
  text-decoration: none !important;
}

.wp-block-post-terms a:hover{
  text-decoration: underline !important;
}

.max-w-1200{
  max-width: 1200px !important;
}

:target::before { content: ''; display: block; height: 120px; margin: -120px 0 0 0; }

.texture-bg{
  background-image: url(/wp-content/uploads/2025/08/vectorBG.svg);
  background-size: 100px;
  background-repeat: repeat;
}

@media (max-width: 499px) {
  .texture-bg {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* Year comparison controls responsive font size */
@media (max-width: 500px) {
  #year-comparison-controls button,
  #year-comparison-controls-bkk button,
  #year-comparison-controls-thai button,
  #year-comparison-controls-weather button {
    font-size: 12px;
  }
}

/* Responsive styling for wp-block-columns on specific pages */
@media (max-width: 500px) {
  body.page-id-45 .wp-block-columns,
  body.page-id-10 .wp-block-columns {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

@media (max-width: 500px) {
  body.page-id-45 h2,
  body.page-id-10 h2 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}