/*
Theme Name: CUBIC management
Theme URI: https://www.cubic.management/
Author: CUBIC management
Description: ธีมสำหรับ CUBIC management — รับบริหาร OTA และ revenue management ให้โรงแรมอิสระทั่วไทย ไม่ต้องใช้ page builder
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cubic
Tags: business, thai, dark, one-column
*/

/* ============================================================
   1. TOKENS
   ============================================================ */
:root {
  /* palette */
  --navy:        #0A1C33;   /* brand base */
  --navy-raised: #142943;   /* surfaces one step up */
  --navy-line:   #24405F;   /* hairlines */
  --gold:        #D4A028;   /* brand accent */
  --gold-bright: #E8B94A;   /* hover / emphasis */
  --drained:     #6B4A2A;   /* gold with the life taken out = leaking money */
  --ink:         #FFFFFF;
  --ink-dim:     #8C93A8;

  /* type */
  --face-text: "IBM Plex Sans Thai", "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --face-data: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  /* rhythm */
  --gutter:  clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(4.5rem, 9vw, 8rem);
  --maxw:    1180px;

  --radius: 4px;
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   2. BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--ink);
  font-family: var(--face-text);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.85;          /* Thai needs room for สระ above/below */
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--gold-bright); }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--gold); color: var(--navy);
  padding: .75rem 1.25rem; z-index: 999;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

/* ============================================================
   3. LAYOUT UTILITIES
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band { padding-block: var(--section); }
.band--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.band--raised { background: var(--navy-raised); }

.eyebrow {
  font-family: var(--face-data);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}

.h-lead {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  max-width: 22ch;
}

.lede {
  color: var(--ink-dim);
  max-width: 62ch;
}

.rule {
  height: 1px;
  background: var(--navy-line);
  border: 0;
  margin: 0;
}

/* buttons */
.btn {
  display: inline-block;
  font-family: var(--face-text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  padding: 1.0625rem 2rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s var(--ease), background-color .18s var(--ease);
}
.btn--gold {
  background: var(--gold);
  color: var(--navy);
}
.btn--gold:hover {
  background: var(--gold-bright);
  color: var(--navy);
  transform: translateY(-2px);
}
.btn--ghost {
  border-color: var(--navy-line);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn--onGold {
  background: var(--navy);
  color: var(--gold);
}
.btn--onGold:hover { background: #05060F; color: var(--gold-bright); transform: translateY(-2px); }

/* ============================================================
   4. HEADER
   ============================================================ */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,28,51,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--navy-line);
}
.site-head__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 78px;
}
.site-head__logo img { height: 42px; width: auto; }
.site-head__logo .txt { font-weight: 700; font-size: 1.25rem; color: var(--ink); }

.nav { margin-left: auto; }
.nav ul {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav a {
  color: var(--ink);
  font-size: .95rem;
  font-weight: 500;
  padding-block: .5rem;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--gold); }
.nav .current-menu-item > a { border-bottom-color: var(--gold); color: var(--gold); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  color: var(--ink);
  padding: .6rem .8rem;
  cursor: pointer;
  font-family: var(--face-data);
  font-size: .8rem;
}

/* ============================================================
   5. HERO + RATE GRID  (the signature)
   ============================================================ */
.hero { padding-block: clamp(3.5rem, 7vw, 6rem) clamp(4rem, 8vw, 7rem); }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

.hero__title {
  font-size: clamp(2.35rem, 5vw, 4rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
  margin: 0 0 1.5rem;
}
.hero__title .plug { color: var(--gold); }

.hero__lede {
  color: var(--ink-dim);
  max-width: 52ch;
  margin-bottom: 2rem;
}

.pains { list-style: none; margin: 0 0 2.5rem; padding: 0; }
.pains li {
  display: flex;
  gap: .85rem;
  padding: .85rem 0;
  border-top: 1px solid var(--navy-line);
  font-size: .98rem;
  line-height: 1.7;
}
.pains li:last-child { border-bottom: 1px solid var(--navy-line); }
.pains .arw {
  color: var(--gold);
  font-family: var(--face-data);
  flex-shrink: 0;
}

/* --- rate grid --- */
.rategrid {
  background: var(--navy-raised);
  border: 1px solid var(--navy-line);
  border-radius: 8px;
  padding: 1.25rem;
}
.rategrid__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--face-data);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding-bottom: .9rem;
  margin-bottom: .9rem;
  border-bottom: 1px solid var(--navy-line);
}
.rategrid__bar b { color: var(--gold); font-weight: 500; }

.rategrid__days,
.rategrid__cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.rategrid__days {
  margin-bottom: 5px;
  font-family: var(--face-data);
  font-size: .62rem;
  letter-spacing: .1em;
  color: var(--ink-dim);
  text-align: center;
}

.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: rgba(212,160,40,.08);
  border: 1px solid rgba(212,160,40,.18);
  font-family: var(--face-data);
  font-size: clamp(.5rem, .95vw, .68rem);
  font-weight: 500;
  color: var(--gold);
  line-height: 1;
}

/* leaking cells: drained, dim, and they hold two values */
.cell--leak {
  background: rgba(107,74,42,.14);
  border-color: rgba(107,74,42,.4);
  color: var(--drained);
  animation: cell-plug 9s var(--ease) infinite;
  animation-delay: calc(var(--i) * .11s);
}
.cell__val { grid-area: 1 / 1; }
.cell__val--after { opacity: 0; color: var(--gold); }

.cell--leak .cell__val--before { animation: val-out 9s var(--ease) infinite; animation-delay: calc(var(--i) * .11s); }
.cell--leak .cell__val--after  { animation: val-in  9s var(--ease) infinite; animation-delay: calc(var(--i) * .11s); }

@keyframes cell-plug {
  0%, 34%   { background: rgba(107,74,42,.14); border-color: rgba(107,74,42,.4); }
  46%, 90%  { background: rgba(212,160,40,.14); border-color: rgba(212,160,40,.45); }
  100%      { background: rgba(107,74,42,.14); border-color: rgba(107,74,42,.4); }
}
@keyframes val-out {
  0%, 34% { opacity: 1; }
  46%, 90% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes val-in {
  0%, 34% { opacity: 0; }
  46%, 90% { opacity: 1; }
  100% { opacity: 0; }
}

.rategrid__foot {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--navy-line);
  font-family: var(--face-data);
  font-size: .64rem;
  letter-spacing: .08em;
  color: var(--ink-dim);
}
.key { display: inline-flex; align-items: center; gap: .4rem; }
.key::before {
  content: "";
  width: 9px; height: 9px; border-radius: 2px;
}
.key--leak::before { background: rgba(107,74,42,.6); }
.key--ok::before   { background: var(--gold); }

/* ============================================================
   6. STATS
   ============================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--navy-line);
  border: 1px solid var(--navy-line);
  border-radius: 8px;
  overflow: hidden;
}
.stat { background: var(--navy); padding: 2rem 1.75rem; }
.stat__fig {
  font-family: var(--face-data);
  font-size: clamp(1.6rem, 2.8vw, 2.25rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--gold);
  letter-spacing: -0.02em;
  margin-bottom: .65rem;
}
.stat__txt { font-size: .92rem; line-height: 1.7; color: var(--ink-dim); margin: 0; }
.stat__txt strong { color: var(--ink); font-weight: 600; }

.stats-note {
  font-family: var(--face-data);
  font-size: .7rem;
  letter-spacing: .04em;
  color: var(--ink-dim);
  margin-top: 1.25rem;
  text-align: center;
}

/* ============================================================
   7. CONTRAST  (ทำ OTA vs บริหาร OTA)
   ============================================================ */
.versus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--navy-line);
  border: 1px solid var(--navy-line);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 3rem;
}
.side { background: var(--navy); padding: clamp(1.75rem, 3vw, 2.75rem); }
.side--now { color: var(--ink-dim); }
.side--right { background: var(--navy-raised); }

.side__tag {
  font-family: var(--face-data);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.side--now .side__tag { color: var(--drained); }
.side--right .side__tag { color: var(--gold); }

.side__list { list-style: none; margin: 0; padding: 0; }
.side__list li {
  padding: .7rem 0 .7rem 1.5rem;
  position: relative;
  font-size: .96rem;
  line-height: 1.7;
}
.side__list li::before {
  content: "—";
  position: absolute; left: 0;
  font-family: var(--face-data);
}
.side--now .side__list li::before { color: var(--drained); }
.side--right .side__list li::before { color: var(--gold); }
.side--right .side__list li { color: var(--ink); }

.verdict {
  margin-top: 2.5rem;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 600;
  color: var(--gold);
  text-align: center;
}

/* ============================================================
   8. PATHS  (three parallel ways in — not a sequence, no numbering)
   ============================================================ */
.paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}
.path {
  background: var(--navy-raised);
  border: 1px solid var(--navy-line);
  border-radius: 8px;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.path:hover { border-color: rgba(212,160,40,.45); transform: translateY(-3px); }
.path__who {
  display: flex; gap: .6rem;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: .9rem;
  color: var(--ink);
}
.path__who .arw { color: var(--gold); font-family: var(--face-data); }
.path__txt { font-size: .94rem; line-height: 1.75; color: var(--ink-dim); flex: 1; }
.path__link {
  margin-top: 1.25rem;
  font-family: var(--face-data);
  font-size: .78rem;
  letter-spacing: .06em;
}

.paths-close {
  margin-top: 2.5rem;
  text-align: center;
  color: var(--ink-dim);
}

/* ============================================================
   9. SERVICES
   ============================================================ */
.svcs { margin-top: 3rem; border-top: 1px solid var(--navy-line); }
.svc {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 3rem);
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--navy-line);
}
.svc__name { font-size: 1.05rem; font-weight: 600; color: var(--gold); margin: 0; }
.svc__txt { font-size: .96rem; line-height: 1.75; color: var(--ink-dim); margin: 0; }

/* ============================================================
   10. GOLD CTA  (echoes the navy/gold split of the business card)
   ============================================================ */
.cta { background: var(--gold); color: var(--navy); }
.cta__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}
.cta__eyebrow {
  font-family: var(--face-data);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(10,28,51,.65);
  margin: 0 0 .9rem;
}
.cta__title {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.25;
  margin: 0 0 1rem;
  color: var(--navy);
}
.cta__txt { color: rgba(10,28,51,.78); margin: 0; max-width: 46ch; }
.cta__actions { display: flex; flex-direction: column; gap: .9rem; }
.cta__alt {
  font-family: var(--face-data);
  font-size: .78rem;
  letter-spacing: .04em;
  color: rgba(10,28,51,.7);
  text-align: center;
}
.cta__alt a { color: var(--navy); font-weight: 600; text-decoration: underline; }
.cta__alt a:hover { color: #05060F; }

/* ============================================================
   11. BLOG
   ============================================================ */
.posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.post-card {
  background: var(--navy-raised);
  border: 1px solid var(--navy-line);
  border-radius: 8px;
  padding: 1.75rem;
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.post-card:hover { border-color: rgba(212,160,40,.45); transform: translateY(-3px); }
.post-card__date {
  font-family: var(--face-data);
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--ink-dim);
  margin-bottom: .75rem;
}
.post-card__title { font-size: 1.05rem; line-height: 1.5; margin-bottom: .75rem; }
.post-card__title a { color: var(--ink); }
.post-card__title a:hover { color: var(--gold); }
.post-card__ex { font-size: .92rem; line-height: 1.75; color: var(--ink-dim); margin: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.section-head__link { font-family: var(--face-data); font-size: .78rem; letter-spacing: .06em; }

/* ============================================================
   12. ARTICLE / PAGE CONTENT
   ============================================================ */
.entry { max-width: 720px; margin-inline: auto; }
.entry__head { margin-bottom: 2.5rem; }
.entry__title { font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.25; margin-bottom: 1rem; }
.entry__meta { font-family: var(--face-data); font-size: .72rem; letter-spacing: .1em; color: var(--ink-dim); }

.prose { font-size: 1.0625rem; line-height: 1.9; }
.prose h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; }
.prose h3 { font-size: 1.2rem; margin: 2rem 0 .75rem; color: var(--gold); }
.prose ul, .prose ol { padding-left: 1.35rem; margin: 0 0 1.35rem; }
.prose li { margin-bottom: .5rem; }
.prose img { border-radius: 8px; margin: 2rem 0; }
.prose blockquote {
  margin: 2rem 0;
  padding: .5rem 0 .5rem 1.5rem;
  border-left: 2px solid var(--gold);
  color: var(--ink-dim);
}
.prose code {
  font-family: var(--face-data);
  font-size: .9em;
  background: var(--navy-raised);
  padding: .15em .4em;
  border-radius: 3px;
}
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--navy-line);
  font-family: var(--face-data);
  font-size: .8rem;
}

/* ============================================================
   13. FOOTER
   ============================================================ */
.site-foot {
  border-top: 1px solid var(--navy-line);
  padding-block: clamp(3rem, 5vw, 4rem);
}
.site-foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
}
.site-foot__logo img { height: 46px; width: auto; margin-bottom: 1rem; }
.site-foot__co { font-size: .9rem; color: var(--ink-dim); margin: 0; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li {
  font-family: var(--face-data);
  font-size: .82rem;
  letter-spacing: .04em;
  padding: .3rem 0;
  color: var(--ink-dim);
}
.contact-list li span { color: var(--gold); display: inline-block; width: 3.5rem; }
.contact-list a { color: var(--ink); }
.contact-list a:hover { color: var(--gold); }
.site-foot__legal {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--navy-line);
  font-family: var(--face-data);
  font-size: .7rem;
  letter-spacing: .06em;
  color: var(--ink-dim);
}

/* ============================================================
   14. RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .rategrid { max-width: 460px; }
  .versus { grid-template-columns: 1fr; }
  .cta__inner { grid-template-columns: 1fr; }
  .svc { grid-template-columns: 1fr; gap: .5rem; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--navy-raised);
    border-bottom: 1px solid var(--navy-line);
    padding: 1rem var(--gutter) 1.5rem;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav li { border-bottom: 1px solid var(--navy-line); }
  .nav li:last-child { border-bottom: 0; }
  .nav a { display: block; padding: .95rem 0; }
  .site-head__inner { position: relative; }
}

/* ============================================================
   15. REDUCED MOTION — show the plugged (fixed) state, no looping
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .cell--leak {
    background: rgba(212,160,40,.14);
    border-color: rgba(212,160,40,.45);
  }
  .cell--leak .cell__val--before { opacity: 0; }
  .cell--leak .cell__val--after  { opacity: 1; }
}
