@import url("../fonts/fonts.css");

/* ===========================================================================
   niruttitime.com — design tokens
   Values carried over from the Squarespace original:
     page background rgb(238,243,247)   accent rgb(61,140,219)
     headings Acumin Pro 500  →  Archivo 500 (Acumin is Adobe-licensed)
     body Poppins 300 / 16px / 1.8      content max-width 1400px
   =========================================================================== */
:root {
  --bg:          #eef3f7;
  --card:        #ffffff;
  --ink:         #000000;
  --ink-soft:    rgba(0, 0, 0, 0.68);
  --ink-faint:   rgba(0, 0, 0, 0.45);
  --rule:        rgba(0, 0, 0, 0.12);
  --accent:      #3d8cdb;
  --accent-dark: #2f74ba;

  --font-head: "Archivo", "Noto Sans Thai", "Sukhumvit Set", Thonburi,
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Poppins", "Noto Sans Thai", "Sukhumvit Set", Thonburi,
               "Helvetica Neue", Arial, sans-serif;

  --maxw:    1400px;
  --gutter:  clamp(20px, 4vw, 52px);
  --section: clamp(38px, 5.2vw, 64px);

  --h1: clamp(2.1rem, 1.30rem + 3.55vw, 3.40rem);
  --h2: clamp(1.9rem, 1.32rem + 2.55vw, 2.73rem);
  --h3: clamp(1.6rem, 1.24rem + 1.60vw, 2.15rem);
  --h4: clamp(1.3rem, 1.13rem + 0.75vw, 1.58rem);
}

/* --- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 1rem/1.8 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 0.5em;
}
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
h4 { font-size: var(--h4); line-height: 1.45; }
.h2 { font-size: var(--h2); }
.h3 { font-size: var(--h3); }
.h4 { font-size: var(--h4); line-height: 1.45; }
p  { margin: 0 0 1.2em; }
p:last-child, h1:last-child, h2:last-child,
h3:last-child, h4:last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--section) 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 12px 20px;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* --- layout --------------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section) 0; }
.section--tight { padding: calc(var(--section) * 0.45) 0; }
.measure { max-width: 62ch; }

/* --- header --------------------------------------------------------------- */
.site-header { padding: 30px 0; }
.site-header .wrap {
  display: flex; align-items: center; gap: clamp(16px, 3vw, 40px);
}
.site-title {
  font-family: var(--font-head); font-weight: 500;
  font-size: clamp(1.25rem, 0.95rem + 1.3vw, 1.96rem);
  line-height: 1.2; text-decoration: none; margin-right: auto;
}
.nav { display: flex; align-items: center; gap: clamp(14px, 1.8vw, 26px); }
.nav a { font-size: 1rem; font-weight: 300; text-decoration: none; }
.nav a:hover { text-decoration: underline; }

/* dropdown folder — matches the original "Current Works" menu */
.nav-folder { position: relative; }
.nav-folder > summary {
  list-style: none; cursor: pointer; font-size: 1rem; font-weight: 300;
  display: inline-flex; align-items: center; gap: 7px;
}
.nav-folder > summary::-webkit-details-marker { display: none; }
.nav-folder > summary:hover { text-decoration: underline; }
.nav-folder > summary::after {
  content: ""; width: 6px; height: 6px; margin-top: -3px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: rotate(45deg); transition: transform 0.18s;
}
.nav-folder[open] > summary::after { transform: rotate(-135deg); margin-top: 2px; }
.nav-folder-menu {
  display: none;
  position: absolute; top: calc(100% + 14px); left: 50%; translate: -50% 0;
  background: var(--card); padding: 8px 0; min-width: 262px; z-index: 30;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.13);
}
.nav-folder[open] > .nav-folder-menu { display: block; }
.nav-folder-menu a {
  display: block; padding: 10px 22px; font-size: 0.95rem; white-space: nowrap;
}
.nav-folder-menu a:hover { text-decoration: underline; }

.social { display: flex; align-items: center; gap: 13px; }
.social a { display: inline-flex; opacity: 0.82; transition: opacity 0.15s; }
.social a:hover { opacity: 1; }
.social svg { width: 19px; height: 19px; fill: currentColor; }

/* --- buttons -------------------------------------------------------------- */
.btn {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: 0.9rem; font-weight: 500; letter-spacing: 0.02em;
  padding: 1.26em 2.1em; text-decoration: none; border: 0;
  transition: background 0.16s;
}
.btn:hover { background: var(--accent-dark); }
.btn--ghost {
  background: none; color: var(--ink);
  box-shadow: inset 0 0 0 1px currentColor;
}
.btn--ghost:hover { background: var(--ink); color: var(--bg); }
.btn + .btn { margin-left: 10px; }

/* --- image blocks --------------------------------------------------------- */
/* card: image one side, text the other, both flush */
.imgcard {
  display: grid; gap: clamp(24px, 4vw, 64px); align-items: center;
  grid-template-columns: 1fr 1fr; margin: var(--section) 0;
}
.imgcard--left  .imgcard__media { order: -1; }
.imgcard--right .imgcard__media { order: 1; }
.imgcard__body > :last-child { margin-bottom: 0; }
.imgcard__actions { margin-top: 1.6em; }

/* collage: text panel on white, overlapping the image */
.collage {
  display: grid; align-items: center; margin: var(--section) 0;
  grid-template-columns: repeat(12, 1fr);
}
.collage__media  { grid-row: 1; }
.collage__body {
  grid-row: 1; z-index: 2; background: var(--card);
  padding: clamp(26px, 3.6vw, 54px);
}
.collage__body > :last-child { margin-bottom: 0; }
.collage--right .collage__media { grid-column: 5 / -1; }
.collage--right .collage__body  { grid-column: 1 / 7; }
.collage--left  .collage__media { grid-column: 1 / 9; }
.collage--left  .collage__body  { grid-column: 7 / -1; }
.collage__actions { margin-top: 1.5em; }

figure.plain { margin: var(--section) 0; }
figure.plain figcaption {
  font-size: 0.85rem; color: var(--ink-faint); margin-top: 0.7em;
}

/* --- galleries ------------------------------------------------------------ */
.gallery { display: grid; gap: 14px; }
.gallery--grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.gallery--grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery--masonry { display: block; columns: 3 260px; column-gap: 14px; }
.gallery--masonry img { margin-bottom: 14px; width: 100%; break-inside: avoid; }
.gallery a { display: block; }

/* --- blog ----------------------------------------------------------------- */
.postlist { display: grid; gap: clamp(34px, 5vw, 62px); }
.postcard {
  display: grid; gap: clamp(20px, 3.4vw, 52px); align-items: center;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}
.postcard:nth-child(even) .postcard__media { order: 1; }
.postcard__media img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.postcard__title { font-size: var(--h3); margin: 0.2em 0 0.4em; }
.postcard__title a { text-decoration: none; }
.postcard__title a:hover { text-decoration: underline; }
.meta {
  font-size: 0.83rem; color: var(--ink-faint); letter-spacing: 0.02em;
  display: flex; flex-wrap: wrap; gap: 0 10px;
}
.meta a { color: inherit; }
.post { max-width: 46rem; margin: 0 auto; }
.post__banner { margin-bottom: var(--section); }
.post__title { margin-bottom: 0.35em; }
.post__body { font-size: 1.02rem; }
.post__body h2, .post__body h3 { margin-top: 1.6em; }
.post-nav {
  display: flex; justify-content: space-between; gap: 20px;
  margin-top: var(--section); padding-top: 26px; border-top: 1px solid var(--rule);
  font-size: 0.9rem;
}

/* --- portfolio / products ------------------------------------------------- */
.tiles { display: grid; gap: clamp(18px, 2.6vw, 34px);
         grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tile { text-decoration: none; display: block; }
.tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.tile__label { margin-top: 0.85em; font-family: var(--font-head);
               font-size: var(--h4); font-weight: 500; }
.tile:hover .tile__label { text-decoration: underline; }
.tile--noimg .tile__ph {
  aspect-ratio: 4 / 3; background: var(--card);
  display: grid; place-items: center; color: var(--ink-faint);
  font-size: 0.85rem;
}
.tile__price { font-size: 0.92rem; color: var(--ink-soft); margin-top: 0.2em; }

.product { display: grid; gap: clamp(26px, 4vw, 64px);
           grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); align-items: start; }
.product__meta { position: sticky; top: 30px; }
.product__price { font-size: 1.2rem; margin: 0.4em 0 1.2em; }
.crumbs { font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 1.4em; }
.crumbs a { color: inherit; }
.note {
  border-left: 2px solid var(--accent); padding: 0.9em 1.2em;
  background: rgba(61, 140, 219, 0.07); font-size: 0.9rem;
  color: var(--ink-soft); margin: 1.6em 0 0;
}

/* --- embeds --------------------------------------------------------------- */
.embed { position: relative; aspect-ratio: 16 / 9; margin: var(--section) 0;
         background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* --- footer --------------------------------------------------------------- */
.site-footer {
  margin-top: var(--section); padding: var(--section) 0;
  border-top: 1px solid var(--rule); font-size: 0.88rem; color: var(--ink-soft);
}
.site-footer .wrap {
  display: flex; flex-wrap: wrap; gap: 16px 30px; align-items: center;
}
.site-footer .social { margin-left: auto; }
.site-footer a { color: inherit; }

/* --- responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .imgcard, .postcard, .product { grid-template-columns: 1fr; }
  .imgcard--left .imgcard__media,
  .imgcard--right .imgcard__media,
  .postcard:nth-child(even) .postcard__media { order: -1; }
  .collage { display: block; }
  .collage__media img { width: 100%; }
  .collage__body { margin: -34px clamp(12px, 4vw, 40px) 0; position: relative; }
  .product__meta { position: static; }
  .gallery--masonry { columns: 2 200px; }
}
@media (max-width: 700px) {
  .nav-folder-menu {
    left: 0; translate: none; min-width: 0;
    width: max-content; max-width: calc(100vw - 2 * var(--gutter));
  }
  .site-header .wrap { flex-wrap: wrap; row-gap: 14px; }
  .site-title { width: 100%; margin-right: 0; }
  .nav { flex-wrap: wrap; gap: 12px 18px; }
  .site-footer .social { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}

/* --- sections with a background image ------------------------------------- */
.section--bg {
  position: relative; isolation: isolate;
  min-height: min(78vh, 640px); display: grid;
  background-image: var(--bg-image);
  background-size: cover; background-position: center;
}
.section--bg::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: #000; opacity: var(--bg-overlay, 0.15);
}
.section--bg > .wrap { width: 100%; }
.section--v-bottom > .wrap { align-self: end; }
.section--v-top    > .wrap { align-self: start; }
.section--v-middle > .wrap { align-self: center; }
.section--dark { color: #fff; }
.section--dark a { color: #fff; }
.section--dark .btn--ghost { color: #fff; }
