/* =========================================================
   CODI IT – Publicity Website
   Luxury-minimal / Smooth / Responsive (Mobile + iPad)
   Font: TH Sarabun PSK (uses local if installed)
   ========================================================= */

/* ================= ROOT ================= */
:root{
  --primary:#0B1E3A;
  --secondary:#1F3C68;
  --accent:#2563EB;
  --danger:#D71920;

  --bg:#F5F7FA;
  --card:#FFFFFF;

  --text:#1F2937;
  --muted:#6B7280;
  --white:#FFFFFF;

  --line:rgba(15,23,42,.14);
  --radius:18px;

  --shadow:0 10px 28px rgba(15,23,42,.10);
  --shadow-strong:0 22px 52px rgba(15,23,42,.14);

  --focus: rgba(37,99,235,.28);

  /* micro interactions */
  --ease: cubic-bezier(.2,.8,.2,1);
  --t: 180ms var(--ease);

  /* HERO control */
  --hero-height: 300px;   /* ลดจาก 700 ให้กระชับขึ้น */
  --hero-fit: cover;      /* ⭐ เต็มกรอบ ลดพื้นที่ว่างซ้ายขวา */
}

/* ================= BASE ================= */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family:"TH SarabunPSK","TH Sarabun New","Sarabun","Tahoma","Segoe UI",Arial,sans-serif;
  font-size:20px;
  line-height:1.6;
  color:var(--text);

  background:
    radial-gradient(1100px 650px at 15% 0%, rgba(37,99,235,.10), transparent 60%),
    radial-gradient(900px 600px at 95% 10%, rgba(215,25,32,.06), transparent 55%),
    var(--bg);
}

a{ color:inherit; text-decoration:none; }

a:focus-visible,
button:focus-visible,
input:focus-visible{
  outline:3px solid var(--focus);
  outline-offset:2px;
  border-radius:12px;
}

img{ max-width:100%; }

.muted{ color:var(--muted); }
.small{ font-size:16px; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; scroll-behavior:auto !important; }
}

/* ================= LAYOUT ================= */
.container{
  max-width:1100px;
  margin:0 auto;
  padding:0 18px;
}

/* ================= HEADER ================= */
.site-header{
  position:sticky;
  top:0;
  z-index:20;
  background:linear-gradient(135deg,var(--primary),var(--secondary));
  color:var(--white);
  border-bottom:1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(6px);
}

.site-header .container{
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px 18px;
}

.header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.header-title h1{
  margin:0;
  font-size:22px;
  font-weight:900;
  letter-spacing:.2px;
}
.header-title p{ margin:2px 0 0; }

/* brand (index) */
.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.brand__mark{
  width:46px;
  height:46px;
  border-radius:14px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.22);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 24px rgba(0,0,0,.12);
  overflow:hidden;
  transition: transform var(--t), box-shadow var(--t);
}
.brand__mark:hover{
  transform: translateY(-1px);
  box-shadow:0 16px 34px rgba(0,0,0,.18);
}
.brand__mark img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  padding:6px;
}
.brand__text h1{
  margin:0;
  font-size:22px;
  font-weight:900;
}
.brand__text p{
  margin:2px 0 0;
  font-size:16px;
  color:rgba(255,255,255,.82);
}

/* header actions (category) */
.header-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

/* Search input (category) */
.search{
  width: 320px;
  max-width: 46vw;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.12);
  color: var(--white);
  padding:10px 14px;
  font-size:18px;
  transition: background var(--t), border-color var(--t);
}
.search::placeholder{ color: rgba(255,255,255,.78); }
.search:focus{
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.36);
}

/* Back button (category) */
.back{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.10);
  color: var(--white);
  font-size:18px;
  transition: transform var(--t), background var(--t);
}
.back:hover{
  background: rgba(255,255,255,.14);
  transform: translateY(-1px);
}

/* ================= HERO ================= */
.hero{
  position:relative;
  overflow:hidden;
  border-bottom:1px solid rgba(15,23,42,.10);
  background-color:#fff;

  /* ⭐ บีบซ้ายขวาเข้ามา ให้ดูแพงขึ้น */
  max-width:1600px;
  margin:0 auto;
}

/* Background image */
.hero--with-bg{
  --hero-bg: url("../assets/hero/hero-bg.jpg");
  background-image: var(--hero-bg);
  background-size: var(--hero-fit);
  background-position: center;
  background-repeat: no-repeat;
  min-height: var(--hero-height);
}

/* subtle premium vignette */
.hero--with-bg::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(900px 520px at 30% 40%, rgba(255,255,255,.16), transparent 60%),
    radial-gradient(900px 520px at 85% 20%, rgba(11,30,58,.10), transparent 58%);
  mix-blend-mode: multiply;
  opacity:.55;
}

.hero__ribbons{ display:none; }

.hero__grid{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  min-height: var(--hero-height);
  padding: 44px 0;

  /* ⭐ ขยับกล่องข้อความเข้ากลาง */
  justify-content: center;
}

.hero__left{
  max-width:760px;
  margin: 0 auto; /* ⭐ กลางจริง */
  background: rgba(255,255,255,.70);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 22px;
  box-shadow: 0 18px 60px rgba(15,23,42,.12);
  padding: 22px 22px 20px;
}

.hero__title{
  margin:0;
  font-size: clamp(34px, 3.6vw, 52px);
  line-height:1.12;
  font-weight:900;
  color:var(--primary);
  letter-spacing:.2px;
}
.hero__title--accent{ color:var(--accent); }

.hero__subtitle{
  margin:10px 0 0;
  font-size: clamp(22px, 2vw, 26px);
  font-weight:900;
}
.hero__meta{
  margin-top:6px;
  font-size:18px;
  color:rgba(31,41,55,.78);
}

/* Action buttons */
.hero__actions{
  margin-top:18px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 16px;
  border-radius:999px;
  background:rgba(255,255,255,.92);
  border:1px solid rgba(15,23,42,.14);
  box-shadow: 0 10px 26px rgba(15,23,42,.10);
  font-size:18px;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  will-change: transform;
}
.pill:hover{
  transform:translateY(-2px);
  box-shadow: 0 18px 44px rgba(15,23,42,.14);
  border-color: rgba(31,60,104,.22);
}

/* ================= MAIN TITLES ================= */
.section-title{
  margin:28px 0 14px;
  font-size:20px;
  font-weight:900;
  color:var(--muted);
  letter-spacing:.2px;
}

/* ================= CATEGORY "BACKGROUND" (premium panel) ================= */
.grid{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:16px;
  margin-bottom:30px;

  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(15,23,42,.10);
  background:
    radial-gradient(900px 340px at 10% 0%, rgba(37,99,235,.10), transparent 55%),
    radial-gradient(900px 340px at 90% 30%, rgba(215,25,32,.06), transparent 60%),
    rgba(255,255,255,.62);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(15,23,42,.08);
}

/* Category card */
.card{
  grid-column:span 6;
  position:relative;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.86));
  border-radius:var(--radius);
  border:1px solid rgba(15,23,42,.12);
  padding:18px 18px 16px;
  box-shadow:var(--shadow);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  will-change: transform;
  overflow:hidden;
}

/* subtle gradient edge */
.card::before{
  content:"";
  position:absolute;
  inset:0;
  padding:1px;
  border-radius: calc(var(--radius) + 1px);
  background: linear-gradient(135deg, rgba(37,99,235,.28), rgba(255,255,255,0) 35%, rgba(215,25,32,.20));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events:none;
  opacity:.55;
}

.card:hover{
  transform:translateY(-3px);
  box-shadow:var(--shadow-strong);
  border-color: rgba(31,60,104,.22);
}

.card h3{
  margin:0 0 6px;
  font-size:24px;
  font-weight:900;
}
.card p{
  margin:0;
  font-size:18px;
  color:var(--muted);
}

.badge{
  display:inline-block;
  margin-top:10px;
  padding:6px 12px;
  border-radius:999px;
  font-size:16px;
  font-weight:900;
  color:var(--danger);
  background:rgba(215,25,32,.08);
  border:1px solid rgba(215,25,32,.22);
}

/* ================= TOOLBAR (category page) ================= */
.toolbar{
  margin:18px 0 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.chips{ display:flex; gap:8px; flex-wrap:wrap; }

.chip{
  border:1px solid rgba(15,23,42,.14);
  background: rgba(255,255,255,.92);
  padding:8px 12px;
  border-radius:999px;
  font-size:18px;
  color: var(--muted);
  cursor:pointer;
  box-shadow: 0 10px 26px rgba(15,23,42,.06);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t), background var(--t), color var(--t);
}
.chip:hover{
  transform: translateY(-1px);
  border-color: rgba(31,60,104,.22);
  color: var(--text);
  box-shadow: 0 16px 36px rgba(15,23,42,.08);
}
.chip.active{
  background: var(--danger);
  border-color: var(--danger);
  color: var(--white);
  box-shadow: 0 18px 44px rgba(215,25,32,.22);
}

/* ================= GALLERY (category page) ================= */
.gallery{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:16px;
  padding-bottom: 10px;
}

.post{
  grid-column:span 4;
  background:rgba(255,255,255,.92);
  border-radius:var(--radius);
  border:1px solid rgba(15,23,42,.12);
  overflow:hidden;
  box-shadow:var(--shadow);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  will-change: transform;
}
.post:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-strong);
  border-color: rgba(31,60,104,.22);
}

.post__img{
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
  display:block;
  background:#eee;
  cursor: zoom-in;
}

.post__body{ padding:14px 14px 16px; }

.post__caption{
  margin:0 0 8px;
  font-size:19px;
  font-weight:900;
  letter-spacing:.1px;
}

.post__meta{
  font-size:16px;
  color:var(--muted);
  display:flex;
  justify-content:space-between;
  gap:10px;
}

/* ================= LIGHTBOX ================= */
.lightbox{
  position:fixed;
  inset:0;
  background:rgba(11,30,58,.78);
  display:none;
  align-items:center;
  justify-content:center;
  padding:24px;
  z-index:100;
}

.lightbox.open{ display:flex; }

.lightbox__content{
  background:rgba(255,255,255,.96);
  border-radius:22px;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: var(--shadow-strong);
  max-width:980px;
  width:100%;
  max-height:90vh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.lightbox__content img{
  max-height:70vh;
  object-fit:contain;
  background:#fff;
}

.lightbox__meta{
  padding:16px 18px;
  border-top:1px solid rgba(15,23,42,.12);
}

.lightbox__caption{ font-size:20px; font-weight:900; }

.lightbox__close{
  position:absolute;
  top:14px;
  right:14px;
  width:44px;
  height:44px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.14);
  color:#fff;
  cursor:pointer;
  font-size:18px;
  transition: transform var(--t), background var(--t);
}
.lightbox__close:hover{
  transform: scale(1.04);
  background: rgba(255,255,255,.18);
}

/* ================= FOOTER ================= */
.site-footer{
  margin-top:40px;
  padding:18px 0;
  border-top:1px solid rgba(15,23,42,.10);
  color:var(--muted);
  font-size:18px;
  background: linear-gradient(180deg, rgba(11,30,58,.02), rgba(11,30,58,0));
}

.footer-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

/* ================= RESPONSIVE ================= */
/* iPad / tablet */
@media (max-width: 1024px){
  :root{
    --hero-height: 460px;
  }

  .hero{
    max-width: 100%;
  }

  .hero__grid{ padding: 34px 0; }
  .hero__left{ max-width: 760px; }

  .card{ grid-column:span 12; }
  .post{ grid-column:span 6; }

  .search{ width: 260px; }
}

/* mobile */
@media (max-width: 768px){
  :root{
    --hero-height: 380px;
    --hero-fit: cover;
  }

  .site-header .container{ padding: 12px 16px; }
  .brand__text h1{ font-size: 20px; }

  .hero{
    max-width: 100%;
  }

  .hero__grid{ padding: 22px 0; }
  .hero__left{
    max-width: 100%;
    border-radius: 18px;
  }

  .grid{ padding: 14px; }
  .post{ grid-column:span 12; }

  .search{ width: 100%; max-width: 100%; }
}

/* very small */
@media (max-width: 560px){
  :root{ --hero-height: 340px; }

  .header-row{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
  }
  .header-actions{ width:100%; }

  .back{ width: fit-content; }

  .pill{ font-size:18px; }
}
/* ================= PC: FULL WIDTH (balanced scale) ================= */
@media (min-width: 1280px){
  .container{
    max-width: 100%;
    padding-left: clamp(24px, 4vw, 72px);
    padding-right: clamp(24px, 4vw, 72px);
  }

  .hero{
    max-width: 100%;
    margin: 0;
  }
}
/* ให้ HERO กว้างเต็มจอ (ไม่บีบ) */
  .hero{
    max-width: 100%;
    margin: 0;
  }
