/* Header menu (src/menu-render.mjs): desktop mega menu from 1180px, drawer below that.
   AIA palette: red #D31145 / hover #B80E3B, ink #14171C, muted #585858, surfaces #F5F5F7,
   borders #E8EAEE. Type: AIA Body (aia-fonts.css). */
#masthead { position: relative; z-index: 60; }
#masthead .inside-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: nowrap; }
#masthead .site-branding { flex: 0 0 auto; }
.afa-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; font-family: "AIA Body", "Leelawadee UI", Tahoma, sans-serif; }
.afa-i { width: 1.1em; height: 1.1em; flex: 0 0 auto; }
.afa-bar { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.afa-item { position: static; margin: 0; }
.afa-top {
  display: inline-flex; align-items: center; gap: 4px; padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; color: #14171C; font: 700 16px/1.2 "AIA Body", "Leelawadee UI", Tahoma, sans-serif; cursor: pointer;
  white-space: nowrap; transition: background-color .15s, color .15s;
}
.afa-top .afa-i { width: 16px; height: 16px; color: #585858; transition: transform .2s; }
.afa-top:hover, .afa-top[aria-expanded="true"] { background: #F5F5F7; color: #D31145; }
.afa-top[aria-expanded="true"] .afa-i { transform: rotate(180deg); color: #D31145; }
.afa-item.is-active > .afa-top { color: #D31145; box-shadow: inset 0 -2px 0 #D31145; border-radius: 10px 10px 0 0; }
.afa-top:focus-visible, .afa-nav a:focus-visible, .afa-burger:focus-visible, .afa-drawer button:focus-visible, .afa-drawer summary:focus-visible { outline: 3px solid #E4708F; outline-offset: 2px; }

/* Mega panel: full header width, content kept to the 1200px grid */
.afa-panel {
  position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-top: 1px solid #E8EAEE;
  box-shadow: 0 24px 48px -24px rgba(15, 23, 42, .28), 0 2px 6px rgba(15, 23, 42, .05);
  animation: afa-drop .16s ease-out;
}
.afa-panel[hidden] { display: none; }
@keyframes afa-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.afa-panel__inner { max-width: 1200px; margin: 0 auto; padding: 28px 24px 30px; display: grid; grid-template-columns: 240px 1fr; gap: 32px; box-sizing: border-box; }
.afa-intro {
  display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 18px; text-decoration: none;
  background: linear-gradient(160deg, #FDF3F6 0%, #FBE7EC 100%); color: #14171C; align-self: start;
}
.afa-intro__label { font: 400 26px/1.15 "AIA Heading", "AIA Body", Tahoma, sans-serif; color: #D31145; }
.afa-intro__text { font-size: 15px; line-height: 1.55; color: #585858; }
.afa-intro__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-weight: 700; font-size: 15px; color: #D31145; }
.afa-intro:hover .afa-intro__more .afa-i { transform: translateX(3px); }
.afa-intro__more .afa-i { transition: transform .15s; }
.afa-cols { display: grid; gap: 8px 28px; }
.afa-cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.afa-cols--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.afa-cols--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.afa-col ul { list-style: none; margin: 0; padding: 0; }
.afa-col li { margin: 0; }
.afa-col__title { margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid #E8EAEE; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: #585858; }
.afa-link {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px; margin: 0 -8px; border-radius: 8px;
  color: #14171C; text-decoration: none; font-size: 15px; line-height: 1.35; transition: background-color .12s, color .12s;
}
.afa-link:hover { background: #F5F5F7; color: #D31145; }
.afa-link.is-current { color: #D31145; font-weight: 700; background: #FDF3F6; }
.afa-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #D31145; color: #fff; font-size: 11px; font-weight: 700; line-height: 1.5; }
.afa-legacy { margin-top: 16px; padding: 12px; border-radius: 12px; background: #F5F5F7; }
.afa-legacy__title { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: #6B6B6B; }
.afa-legacy__links { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.afa-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid #E4E7EB; color: #3B4048; font-size: 13px; text-decoration: none; line-height: 1.4; }
.afa-chip:hover, .afa-chip.is-current { border-color: #D31145; color: #D31145; }

/* Small dropdown (เกี่ยวกับเรา) sits under its button instead of spanning the header */
.afa-item--small { position: relative; }
.afa-panel--small { left: auto; right: 0; width: 260px; border: 1px solid #E8EAEE; border-radius: 14px; top: calc(100% + 8px); }
.afa-panel--small .afa-panel__inner { display: block; padding: 14px 18px 16px; }

/* Call to action and burger */
.afa-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; padding: 11px 18px; border-radius: 999px;
  background: #D31145; color: #fff !important; text-decoration: none; font-weight: 700; font-size: 16px; white-space: nowrap;
  box-shadow: 0 8px 18px -10px rgba(211, 17, 69, .8); transition: background-color .15s, transform .15s;
}
.afa-cta:hover { background: #B80E3B; transform: translateY(-1px); }
.afa-burger {
  display: none; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid #F6CFD9; border-radius: 14px;
  background: #FDF3F6; color: #D31145; font: 700 16px/1 "AIA Body", "Leelawadee UI", Tahoma, sans-serif; cursor: pointer;
}
.afa-burger .afa-i { width: 22px; height: 22px; }

/* Drawer (mobile and tablet) */
.afa-drawer { position: fixed; inset: 0; z-index: 9999; font-family: "AIA Body", "Leelawadee UI", Tahoma, sans-serif; }
.afa-drawer[hidden] { display: none; }
.afa-drawer__backdrop { position: absolute; inset: 0; background: rgba(13, 19, 34, .45); animation: afa-fade .2s ease-out; }
.afa-drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: #fff; display: flex; flex-direction: column;
  box-shadow: -20px 0 40px -20px rgba(15, 23, 42, .4); animation: afa-slide .22s ease-out;
}
@keyframes afa-fade { from { opacity: 0; } }
@keyframes afa-slide { from { transform: translateX(40px); opacity: .4; } }
.afa-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 20px; border-bottom: 1px solid #E8EAEE; }
.afa-drawer__home { font-weight: 700; font-size: 17px; color: #14171C; text-decoration: none; }
.afa-drawer__home.is-current { color: #D31145; }
.afa-drawer__close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: #F5F5F7; color: #14171C; cursor: pointer; }
.afa-drawer__close .afa-i { width: 22px; height: 22px; }
.afa-drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 0 12px; }
.afa-d-sec { border-bottom: 1px solid #E8EAEE; }
.afa-d-sec > summary {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; list-style: none;
  font-weight: 700; font-size: 17px; color: #14171C;
}
.afa-d-sec > summary::-webkit-details-marker { display: none; }
.afa-d-sec > summary .afa-i { width: 20px; height: 20px; color: #585858; transition: transform .2s; }
.afa-d-sec[open] > summary { color: #D31145; }
.afa-d-sec[open] > summary .afa-i { transform: rotate(180deg); color: #D31145; }
.afa-d-body { padding: 0 20px 16px; }
.afa-d-body ul { list-style: none; margin: 0 0 4px; padding: 0; }
.afa-d-body li { margin: 0; }
.afa-d-hub { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; padding: 8px 12px; border-radius: 10px; background: #FDF3F6; color: #D31145; font-weight: 700; font-size: 15px; text-decoration: none; }
.afa-d-title { margin: 14px 0 4px; font-size: 13px; font-weight: 700; color: #585858; }
.afa-d-title--muted { color: #6B6B6B; }
.afa-d-link { display: flex; align-items: center; gap: 6px; padding: 10px 0; color: #14171C; text-decoration: none; font-size: 16px; border-bottom: 1px dashed #EEF0F3; }
.afa-d-body li:last-child .afa-d-link { border-bottom: 0; }
.afa-d-link.is-current { color: #D31145; font-weight: 700; }
.afa-drawer__foot { display: grid; gap: 10px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #E8EAEE; background: #fff; }
.afa-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 16px; border-radius: 14px; font-weight: 700; font-size: 16px; text-decoration: none; }
.afa-btn .afa-i { width: 22px; height: 22px; }
.afa-btn--line { background: #06C755; color: #fff !important; }
.afa-btn--ghost { border: 1px solid #E4E7EB; color: #14171C !important; }
html.afa-noscroll { overflow: hidden; }

@media (max-width: 1179px) {
  .afa-bar, .afa-cta { display: none; }
  .afa-burger { display: inline-flex; }
}
@media (min-width: 1180px) and (max-width: 1260px) {
  .afa-top { padding: 10px 9px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .afa-panel, .afa-drawer__panel, .afa-drawer__backdrop { animation: none; }
}
