/* Lertchai Master — Homepage refinement (2026-09-13)
   Purpose: refine the approved original homepage without restructuring it.
   Shared header/footer remain in lertchai-shell.css.
*/

/* --------------------------------------------------------------------------
   Thai typography and section rhythm
   -------------------------------------------------------------------------- */
#home {
  --home-radius-hero: 30px;
  --home-radius-section: 24px;
  --home-radius-card: 20px;
  --home-radius-small: 14px;
  --home-line: rgba(7, 36, 77, 0.085);
  --home-shadow-soft: 0 8px 24px rgba(6, 26, 56, 0.055);
  --home-shadow-card: 0 10px 28px rgba(6, 26, 56, 0.075);
  --home-shadow-hover: 0 16px 38px rgba(6, 26, 56, 0.12);
  --home-shadow-feature: 0 20px 52px rgba(6, 26, 56, 0.14);
}

#home h1,
#home h2,
#home h3,
#home h4,
#home p,
#home a,
#home button,
#home span {
  word-break: normal;
  overflow-wrap: normal;
  line-break: auto;
  hyphens: none;
}

#home h1,
#home h2,
#home h3,
#home h4 {
  text-wrap: balance;
}

#home p {
  text-wrap: pretty;
}

#home .section {
  padding-block: 48px;
}

#home .section-header {
  max-width: 860px;
  margin-bottom: 26px;
}

#home .section-title {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2.8vw, 2.28rem);
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: 0;
}

#home .section-desc {
  margin-top: 10px;
  line-height: 1.82;
}

/* --------------------------------------------------------------------------
   Hero — keep original content, refine only presentation
   -------------------------------------------------------------------------- */
#home .hero {
  width: min(1440px, calc(100% - 28px));
  height: var(--hero-height);
  margin: 16px auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: var(--home-radius-hero);
  background: var(--blue-top);
  box-shadow: var(--home-shadow-feature);
  isolation: isolate;
}

#home .hero-content {
  max-width: 790px;
  padding-block: 22px;
}

#home .hero-title {
  max-width: 790px;
  margin-bottom: 22px;
  font-size: clamp(2.15rem, 4.45vw, 4.25rem);
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: 0;
}

#home .hero-desc {
  max-width: 700px;
  margin-bottom: 0;
  font-size: clamp(1rem, 1.42vw, 1.18rem);
  line-height: 1.9;
}

#home .hero-controls {
  bottom: 20px;
}

#home .hero-arrow {
  width: 40px;
  height: 40px;
  background: rgba(6, 26, 56, 0.38);
  backdrop-filter: blur(8px);
}

/* --------------------------------------------------------------------------
   Featured works — preserve original layout, use Thai category labels
   -------------------------------------------------------------------------- */
#home .featured-badge {
  font-family: var(--lm-font-th, "Prompt", sans-serif);
  letter-spacing: 0;
  line-height: 1.45;
}

#home .featured-card h3,
#home .featured-card p,
#home .featured-link {
  word-break: normal;
  overflow-wrap: normal;
  line-break: auto;
}

/* Keep featured cards clean: distinction comes from restrained accents, not
   decorative corner circles or unrelated full-card colours. */
#home .featured-card:not(.featured-main) {
  --card-accent: #d7a437;
  --card-accent-soft: #fff5d8;
  --card-accent-text: #805a0c;
  border-radius: var(--home-radius-card);
  border-top: 3px solid var(--card-accent);
  box-shadow: var(--home-shadow-card);
}

#home .featured-card:not(.featured-main)::before {
  display: none;
}

#home .featured-grid > .featured-card:nth-child(3) {
  --card-accent: #2f6fb3;
  --card-accent-soft: #eaf3ff;
  --card-accent-text: #174f8d;
}

#home .featured-grid > .featured-card:nth-child(4) {
  --card-accent: #288b81;
  --card-accent-soft: #e7f7f4;
  --card-accent-text: #17685f;
}

#home .featured-grid > .featured-card:nth-child(5) {
  --card-accent: #6673a8;
  --card-accent-soft: #eef0fa;
  --card-accent-text: #485483;
}

#home .featured-card:not(.featured-main) .featured-badge {
  background: var(--card-accent-soft);
  color: var(--card-accent-text);
}

#home .featured-card:not(.featured-main):hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--card-accent) 52%, transparent);
  border-top-color: var(--card-accent);
  box-shadow: var(--home-shadow-hover);
}

#home .featured-main {
  border-radius: var(--home-radius-card);
  box-shadow: var(--home-shadow-feature);
}

/* --------------------------------------------------------------------------
   Awards — real images instead of CSS custom-property backgrounds
   -------------------------------------------------------------------------- */
#home .awards-grid {
  gap: 18px;
}

#home .award-image-inner {
  overflow: hidden;
  background: #ffffff;
}

#home .award-image-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
}

#home .award-body h4 {
  line-height: 1.62;
}

#home .award-body p {
  line-height: 1.72;
}

#home .award-card {
  border-radius: var(--home-radius-card);
  box-shadow: var(--home-shadow-card);
}

#home .award-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--home-shadow-hover);
}

/* --------------------------------------------------------------------------
   Knowledge/resource library — use the cleaner card treatment from the
   previously approved refresh, without changing content or links.
   -------------------------------------------------------------------------- */
#home #resource-library .resource-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px !important;
}

#home #resource-library .resource-card {
  min-height: 238px !important;
  padding: 20px !important;
  overflow: hidden;
  border: 1px solid rgba(11, 60, 120, 0.11) !important;
  border-radius: var(--home-radius-card) !important;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
  box-shadow: var(--home-shadow-card) !important;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

#home #resource-library .resource-card::before,
#home #resource-library .resource-card::after {
  opacity: 0;
}

#home #resource-library .resource-card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 197, 66, 0.52) !important;
  background:
    radial-gradient(circle at 90% 0%, rgba(244, 197, 66, 0.16), transparent 30%),
    linear-gradient(135deg, #071f42 0%, #0b3c78 58%, #0b579f 100%) !important;
  box-shadow: var(--home-shadow-hover) !important;
}

#home #resource-library .resource-icon {
  width: 62px;
  height: 62px;
  margin-bottom: 16px;
  border-radius: 18px;
}

#home #resource-library .resource-icon img {
  width: 36px;
  height: 36px;
}

#home #resource-library .resource-icon-text {
  max-width: 54px;
  color: var(--blue-deep);
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

#home #resource-library .resource-card h3 {
  color: #1d3553;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.55;
}

#home #resource-library .resource-card p {
  color: #758092;
  font-size: 0.76rem;
  line-height: 1.78;
}

#home #resource-library .resource-more {
  font-size: 0.74rem;
  font-weight: 600;
}

#home #resource-library .resource-card:hover .resource-icon {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(244, 197, 66, 0.58);
  box-shadow: 0 8px 20px rgba(4, 21, 47, 0.18);
}

#home #resource-library .resource-card:hover h3 {
  color: #ffffff;
}

#home #resource-library .resource-card:hover p {
  color: rgba(255, 255, 255, 0.84);
}

#home #resource-library .resource-card:hover .resource-more {
  color: var(--gold-main);
}

/* --------------------------------------------------------------------------
   Recommended learning platforms — cleaner, lighter approved treatment
   -------------------------------------------------------------------------- */
#home .learning-platform-section {
  background:
    radial-gradient(circle at 8% 10%, rgba(11, 87, 159, 0.03), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(244, 197, 66, 0.035), transparent 32%),
    linear-gradient(180deg, #fbfcfe 0%, #ffffff 52%, #f8fafc 100%);
}

#home .learning-platform-cloud {
  padding: 26px;
  border: 1px solid var(--home-line);
  border-radius: var(--home-radius-section);
  background: #ffffff;
  box-shadow: var(--home-shadow-soft);
}

#home .learning-platform-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

#home .learning-platform-item {
  position: relative;
  min-height: 146px;
  padding: 18px 14px 16px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 64px auto auto;
  align-items: start;
  justify-items: center;
  gap: 8px;
  border: 1px solid rgba(6, 26, 56, 0.07);
  border-radius: var(--home-radius-card);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 5px 16px rgba(6, 26, 56, 0.035);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#home .learning-platform-item:hover {
  transform: translateY(-2px);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(6, 26, 56, 0.075);
}

#home .learning-platform-logo {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(7, 36, 77, 0.075);
  border-radius: var(--home-radius-small);
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(7, 36, 77, 0.035);
}

#home .learning-platform-logo img {
  max-width: 52px;
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: contain;
}

#home .learning-platform-name {
  color: var(--blue-top);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.45;
}

#home .learning-platform-desc {
  color: var(--text-muted);
  font-size: 0.80rem;
  font-weight: 500;
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   Education network — lighter logo grid from the previously approved refresh
   -------------------------------------------------------------------------- */
#home .agency-logo-cloud {
  padding: 22px !important;
  border: 1px solid var(--home-line) !important;
  border-radius: var(--home-radius-section);
  background: #ffffff !important;
  box-shadow: var(--home-shadow-soft) !important;
}

#home .agency-logo-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px !important;
}

#home .agency-logo-item {
  min-height: 104px;
  padding: 12px 9px 10px;
  display: grid;
  grid-template-rows: 54px auto;
  align-items: start;
  justify-items: center;
  gap: 7px;
  border: 1px solid rgba(6, 26, 56, 0.065) !important;
  border-radius: var(--home-radius-small) !important;
  background: #fbfcfe !important;
  box-shadow: 0 4px 14px rgba(6, 26, 56, 0.035) !important;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#home .agency-logo-item:hover {
  transform: translateY(-2px);
  background: #ffffff !important;
  box-shadow: 0 10px 24px rgba(6, 26, 56, 0.07) !important;
}

#home .agency-logo-icon {
  width: 58px;
  height: 54px;
  display: grid;
  place-items: center;
}

#home .agency-logo-icon img {
  max-width: 50px;
  max-height: 46px;
  width: auto;
  height: auto;
  object-fit: contain;
}

#home .agency-logo-name {
  color: var(--blue-deep);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.48;
}

/* --------------------------------------------------------------------------
   Experience statistics — remove decorative corner discs and use small,
   meaningful accent differences to improve scanability.
   -------------------------------------------------------------------------- */
#home .impact-soft-panel {
  border-radius: var(--home-radius-section);
  box-shadow: var(--home-shadow-soft);
}

#home .impact-soft-panel .impact-card {
  --stat-accent: #0b579f;
  --stat-soft: #edf5ff;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(7, 36, 77, 0.09) !important;
  border-radius: var(--home-radius-card) !important;
  background: linear-gradient(180deg, #ffffff 0%, var(--stat-soft) 175%) !important;
  box-shadow: 0 5px 16px rgba(6, 26, 56, 0.04) !important;
}

#home .impact-soft-panel .impact-card:nth-child(2) {
  --stat-accent: #d7a437;
  --stat-soft: #fff8e6;
}

#home .impact-soft-panel .impact-card:nth-child(3) {
  --stat-accent: #288b81;
  --stat-soft: #ebf8f6;
}

#home .impact-soft-panel .impact-card:nth-child(4) {
  --stat-accent: #6673a8;
  --stat-soft: #f0f2fa;
}

#home .impact-soft-panel .impact-card::after {
  display: none !important;
}

#home .impact-soft-panel .impact-card strong {
  color: var(--stat-accent) !important;
}

#home .impact-soft-panel .impact-card:hover {
  transform: translateY(-3px) !important;
  border-color: color-mix(in srgb, var(--stat-accent) 24%, rgba(7, 36, 77, 0.08)) !important;
  box-shadow: var(--home-shadow-card) !important;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1120px) {
  #home #resource-library .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #home .learning-platform-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #home .agency-logo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #home .hero {
    width: calc(100% - 20px);
    margin: 10px auto;
    border-radius: 24px;
  }

  #home .hero-title {
    line-height: 1.4;
  }

  #home .section {
    padding-block: 42px;
  }
}

@media (max-width: 680px) {
  #home .hero {
    width: calc(100% - 16px);
    height: 550px;
    margin: 8px auto;
    border-radius: 20px;
  }

  #home .hero-title {
    font-size: clamp(2rem, 10vw, 3rem);
    line-height: 1.42;
  }

  #home .hero-desc {
    font-size: 0.92rem;
    line-height: 1.82;
  }

  #home .section {
    padding-block: 36px;
  }

  #home #resource-library .resource-grid,
  #home .learning-platform-grid,
  #home .agency-logo-grid {
    grid-template-columns: 1fr;
  }

  #home .learning-platform-cloud,
  #home .agency-logo-cloud {
    padding: 18px;
    border-radius: 18px;
  }

  #home .learning-platform-item,
  #home .agency-logo-item {
    min-height: auto;
  }
}

/* Neutralize legacy decorative overlays on the two approved light panels. */
#home .agency-logo-cloud::after {
  display: none !important;
}

#home .agency-logo-cloud:hover {
  transform: none !important;
  border-color: var(--home-line) !important;
  box-shadow: var(--home-shadow-soft) !important;
}

/* --------------------------------------------------------------------------
   Homepage portfolio / experience sections
   Three curated modules placed directly after the experience statistics.
   -------------------------------------------------------------------------- */
#home .home-experience-section {
  position: relative;
  padding-block: 52px;
}

#home .home-experience-section-light {
  background: #ffffff;
}

#home .home-experience-section-soft {
  background: linear-gradient(180deg, #f8fafc 0%, #f4f7fb 100%);
}

#home .home-experience-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

#home .home-experience-heading {
  max-width: 850px;
}


#home .home-experience-head .section-title {
  margin-bottom: 5px;
}


#home .home-experience-view-all {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid #c9ddf5;
  border-radius: 10px;
  background: #eef6ff;
  color: #0b3c78;
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(7, 36, 77, 0.035);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#home .home-experience-view-all:hover {
  transform: translateY(-1px);
  background: #ddeeff;
  border-color: #a9c8ed;
  box-shadow: 0 8px 20px rgba(7, 36, 77, 0.07);
}

#home .home-experience-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

#home .home-experience-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(7, 36, 77, 0.095);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(7, 36, 77, 0.055);
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}

#home .home-experience-card:hover {
  border-color: rgba(11, 87, 159, 0.18);
  box-shadow: 0 15px 34px rgba(7, 36, 77, 0.09);
}

#home .home-experience-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #eef3f8 0%, #f8fafc 100%);
}

#home .home-experience-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: none;
}

#home .home-experience-card:hover .home-experience-media img {
  transform: none;
  filter: none;
}

#home .home-experience-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 3px;
  color: rgba(7, 36, 77, 0.48);
}

#home .home-experience-placeholder span {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
}

#home .home-experience-placeholder small {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

#home .home-experience-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  max-width: calc(100% - 24px);
  padding: 5px 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--blue-top);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(7, 36, 77, 0.08);
  backdrop-filter: blur(8px);
}

#home .home-experience-body {
  padding: 16px 17px 18px;
}

#home .home-experience-date {
  margin-bottom: 7px;
  color: #a96f00;
  font-size: 0.81rem;
  font-weight: 800;
  line-height: 1.45;
}

#home .home-experience-card h3 {
  display: -webkit-box;
  min-height: 3.35em;
  margin: 0 0 7px;
  overflow: hidden;
  color: var(--blue-deep);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.67;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#home .home-experience-card p {
  display: -webkit-box;
  min-height: 3.35em;
  margin: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.77rem;
  line-height: 1.72;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#home .home-experience-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

#home .home-experience-meta span {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.64rem;
  line-height: 1.45;
}

#home .home-experience-meta span.home-experience-meta-organizer {
  background: #fff9e8;
  border-color: #ecd88c !important;
  color: #0b2d5b;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.60;
  letter-spacing: 0;
  padding: 6px 9px;
}

#home .home-experience-meta span.home-experience-meta-location {
  background: #f3f6fa;
  color: #667085;
  font-weight: 500;
}

#home .home-experience-empty {
  padding: 28px 20px;
  border: 1px dashed rgba(7, 36, 77, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

@media (max-width: 1000px) {
  #home .home-experience-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #home .home-experience-section {
    padding-block: 38px;
  }

  #home .home-experience-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 18px;
  }

  #home .home-experience-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  #home .home-experience-view-all {
    min-height: 36px;
  }

  #home .home-experience-card h3,
  #home .home-experience-card p {
    min-height: 0;
  }
}
