/*
 * Kolmac — Tailwind CSS utility layer
 *
 * HOW TO USE TAILWIND IN THIS THEME
 * ===================================
 * This file is a pre-compiled Tailwind CSS subset that works without a build step.
 * For full Tailwind customisation (recommended for production):
 *
 * 1. Install Node.js dependencies:
 *    cd wp-content/themes/kolmac
 *    npm install
 *
 * 2. Edit tailwind.config.js (included in this theme) to customise colours, fonts, etc.
 *
 * 3. Build Tailwind:
 *    npm run build       (production)
 *    npm run watch       (development)
 *
 * The output goes to assets/css/tailwind.css (this file).
 *
 * Below are the most commonly used Tailwind utilities re-mapped to
 * Kolmac CSS variables so you can use tw-* classes in templates
 * or Gutenberg blocks without a build step.
 */

/* ============================================================
   SPACING — tw-p-*, tw-m-*, tw-gap-*
   ============================================================ */
.tw-p-0  { padding: 0; }
.tw-p-1  { padding: 0.25rem; }
.tw-p-2  { padding: 0.5rem; }
.tw-p-3  { padding: 0.75rem; }
.tw-p-4  { padding: 1rem; }
.tw-p-5  { padding: 1.25rem; }
.tw-p-6  { padding: 1.5rem; }
.tw-p-8  { padding: 2rem; }
.tw-p-10 { padding: 2.5rem; }
.tw-p-12 { padding: 3rem; }
.tw-p-16 { padding: 4rem; }

.tw-px-4  { padding-left: 1rem;  padding-right: 1rem; }
.tw-px-6  { padding-left: 1.5rem; padding-right: 1.5rem; }
.tw-px-8  { padding-left: 2rem;  padding-right: 2rem; }
.tw-py-2  { padding-top: 0.5rem;  padding-bottom: 0.5rem; }
.tw-py-3  { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.tw-py-4  { padding-top: 1rem;    padding-bottom: 1rem; }
.tw-py-6  { padding-top: 1.5rem;  padding-bottom: 1.5rem; }
.tw-py-8  { padding-top: 2rem;    padding-bottom: 2rem; }
.tw-py-12 { padding-top: 3rem;    padding-bottom: 3rem; }
.tw-py-16 { padding-top: 4rem;    padding-bottom: 4rem; }
.tw-py-20 { padding-top: 5rem;    padding-bottom: 5rem; }

.tw-m-0    { margin: 0; }
.tw-m-auto { margin: auto; }
.tw-mx-auto{ margin-left: auto; margin-right: auto; }
.tw-mb-2   { margin-bottom: 0.5rem; }
.tw-mb-4   { margin-bottom: 1rem; }
.tw-mb-6   { margin-bottom: 1.5rem; }
.tw-mb-8   { margin-bottom: 2rem; }
.tw-mt-4   { margin-top: 1rem; }
.tw-mt-6   { margin-top: 1.5rem; }
.tw-mt-8   { margin-top: 2rem; }

.tw-gap-2  { gap: 0.5rem; }
.tw-gap-4  { gap: 1rem; }
.tw-gap-6  { gap: 1.5rem; }
.tw-gap-8  { gap: 2rem; }
.tw-gap-10 { gap: 2.5rem; }
.tw-gap-12 { gap: 3rem; }

/* ============================================================
   FLEX / GRID
   ============================================================ */
.tw-flex         { display: flex; }
.tw-inline-flex  { display: inline-flex; }
.tw-grid         { display: grid; }
.tw-hidden       { display: none; }
.tw-block        { display: block; }
.tw-inline-block { display: inline-block; }

.tw-flex-col    { flex-direction: column; }
.tw-flex-row    { flex-direction: row; }
.tw-flex-wrap   { flex-wrap: wrap; }
.tw-items-center{ align-items: center; }
.tw-items-start { align-items: flex-start; }
.tw-items-end   { align-items: flex-end; }
.tw-justify-center    { justify-content: center; }
.tw-justify-between   { justify-content: space-between; }
.tw-justify-end       { justify-content: flex-end; }
.tw-flex-1            { flex: 1 1 0%; }
.tw-flex-shrink-0     { flex-shrink: 0; }
.tw-self-center       { align-self: center; }

.tw-grid-cols-1 { grid-template-columns: repeat(1, minmax(0,1fr)); }
.tw-grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.tw-grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.tw-grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

/* ============================================================
   COLOURS — mapped to CSS vars
   ============================================================ */
.tw-text-primary      { color: var(--color-primary); }
.tw-text-accent       { color: var(--color-accent); }
.tw-text-white        { color: var(--color-white); }
.tw-text-muted        { color: var(--color-text-muted); }
.tw-text-dark         { color: var(--color-text); }
.tw-text-green        { color: var(--color-green-accent); }

.tw-bg-primary        { background-color: var(--color-primary); }
.tw-bg-primary-dark   { background-color: var(--color-primary-dark); }
.tw-bg-accent         { background-color: var(--color-accent); }
.tw-bg-white          { background-color: var(--color-white); }
.tw-bg-light          { background-color: var(--color-bg-light); }
.tw-bg-teal           { background-color: var(--color-teal-light); }
.tw-bg-teal-mid       { background-color: var(--color-teal-mid); }
.tw-bg-transparent    { background-color: transparent; }

.tw-border-primary    { border-color: var(--color-primary); }
.tw-border-teal       { border-color: var(--color-teal-mid); }
.tw-border-gray       { border-color: var(--color-border); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.tw-font-heading { font-family: var(--font-heading); }
.tw-font-body    { font-family: var(--font-body); }

.tw-text-xs   { font-size: 0.75rem; }
.tw-text-sm   { font-size: 0.875rem; }
.tw-text-base { font-size: 1rem; }
.tw-text-lg   { font-size: 1.125rem; }
.tw-text-xl   { font-size: 1.25rem; }
.tw-text-2xl  { font-size: 1.5rem; }
.tw-text-3xl  { font-size: 1.875rem; }
.tw-text-4xl  { font-size: 2.25rem; }
.tw-text-5xl  { font-size: 3rem; }

.tw-font-normal   { font-weight: 400; }
.tw-font-medium   { font-weight: 500; }
.tw-font-semibold { font-weight: 600; }
.tw-font-bold     { font-weight: 700; }
.tw-font-black    { font-weight: 900; }

.tw-leading-tight  { line-height: 1.25; }
.tw-leading-snug   { line-height: 1.375; }
.tw-leading-normal { line-height: 1.5; }
.tw-leading-relaxed{ line-height: 1.625; }
.tw-leading-loose  { line-height: 2; }

.tw-tracking-tight  { letter-spacing: -0.025em; }
.tw-tracking-wide   { letter-spacing: 0.025em; }
.tw-tracking-wider  { letter-spacing: 0.05em; }
.tw-tracking-widest { letter-spacing: 0.1em; }

.tw-uppercase  { text-transform: uppercase; }
.tw-capitalize { text-transform: capitalize; }
.tw-italic     { font-style: italic; }
.tw-no-underline { text-decoration: none; }
.tw-underline  { text-decoration: underline; }
.tw-text-center { text-align: center; }
.tw-text-right  { text-align: right; }
.tw-text-left   { text-align: left; }

/* ============================================================
   BORDERS & RADIUS
   ============================================================ */
.tw-border       { border-width: 1px; border-style: solid; }
.tw-border-2     { border-width: 2px; border-style: solid; }
.tw-border-t     { border-top: 1px solid; }
.tw-border-b     { border-bottom: 1px solid; }
.tw-border-none  { border: none; }

.tw-rounded     { border-radius: var(--radius-sm); }
.tw-rounded-md  { border-radius: var(--radius-md); }
.tw-rounded-lg  { border-radius: var(--radius-lg); }
.tw-rounded-full{ border-radius: 9999px; }
.tw-rounded-none{ border-radius: 0; }
.tw-overflow-hidden { overflow: hidden; }

/* ============================================================
   SIZING
   ============================================================ */
.tw-w-full  { width: 100%; }
.tw-w-auto  { width: auto; }
.tw-w-1\/2  { width: 50%; }
.tw-w-1\/3  { width: 33.333%; }
.tw-w-2\/3  { width: 66.667%; }
.tw-h-full  { height: 100%; }
.tw-h-auto  { height: auto; }
.tw-max-w-sm    { max-width: 24rem; }
.tw-max-w-md    { max-width: 28rem; }
.tw-max-w-lg    { max-width: 32rem; }
.tw-max-w-xl    { max-width: 36rem; }
.tw-max-w-2xl   { max-width: 42rem; }
.tw-max-w-3xl   { max-width: 48rem; }
.tw-max-w-4xl   { max-width: 56rem; }
.tw-max-w-full  { max-width: 100%; }
.tw-min-h-screen{ min-height: 100vh; }

/* ============================================================
   POSITION
   ============================================================ */
.tw-relative  { position: relative; }
.tw-absolute  { position: absolute; }
.tw-fixed     { position: fixed; }
.tw-sticky    { position: sticky; }
.tw-inset-0   { top: 0; right: 0; bottom: 0; left: 0; }
.tw-z-10      { z-index: 10; }
.tw-z-50      { z-index: 50; }
.tw-z-100     { z-index: 100; }

/* ============================================================
   SHADOWS
   ============================================================ */
.tw-shadow-sm  { box-shadow: var(--shadow-sm); }
.tw-shadow     { box-shadow: var(--shadow-md); }
.tw-shadow-lg  { box-shadow: var(--shadow-lg); }
.tw-shadow-none{ box-shadow: none; }

/* ============================================================
   TRANSITIONS
   ============================================================ */
.tw-transition       { transition: all var(--transition); }
.tw-transition-colors{ transition: color var(--transition), background var(--transition), border-color var(--transition); }
.tw-transition-transform{ transition: transform var(--transition); }
.tw-duration-200     { transition-duration: 200ms; }
.tw-duration-300     { transition-duration: 300ms; }

/* ============================================================
   RESPONSIVE HELPERS
   ============================================================ */
@media (max-width: 640px)  {
  .sm\:tw-hidden       { display: none; }
  .sm\:tw-block        { display: block; }
  .sm\:tw-flex         { display: flex; }
  .sm\:tw-grid-cols-1  { grid-template-columns: repeat(1, minmax(0,1fr)); }
  .sm\:tw-text-center  { text-align: center; }
  .sm\:tw-py-8         { padding-top: 2rem; padding-bottom: 2rem; }
}
@media (min-width: 641px) and (max-width: 1023px) {
  .md\:tw-grid-cols-2  { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .md\:tw-flex-row     { flex-direction: row; }
  .md\:tw-hidden       { display: none; }
  .md\:tw-block        { display: block; }
}
@media (min-width: 1024px) {
  .lg\:tw-flex         { display: flex; }
  .lg\:tw-grid-cols-3  { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .lg\:tw-grid-cols-4  { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .lg\:tw-text-left    { text-align: left; }
  .lg\:tw-py-20        { padding-top: 5rem; padding-bottom: 5rem; }
}

/* ============================================================
   GUTENBERG BLOCK SUPPORT
   ============================================================ */
.wp-block-buttons .wp-block-button__link { display: inline-flex; align-items: center; }
.wp-block-image img { border-radius: var(--radius-md); }
.wp-block-separator { border-color: var(--color-border); }
.wp-block-quote {
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--color-teal-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--color-primary);
}
.wp-block-pullquote {
  border-top: 4px solid var(--color-primary);
  border-bottom: 4px solid var(--color-primary);
  text-align: center;
  padding: 2rem;
}
.wp-block-cover { border-radius: var(--radius-lg); overflow: hidden; }

/* Custom Kolmac block colours for Gutenberg palette */
.has-primary-color      { color: var(--color-primary) !important; }
.has-accent-color       { color: var(--color-accent) !important; }
.has-teal-light-color   { color: var(--color-teal-light) !important; }
.has-white-color        { color: var(--color-white) !important; }
.has-primary-background-color    { background-color: var(--color-primary) !important; }
.has-accent-background-color     { background-color: var(--color-accent) !important; }
.has-teal-light-background-color { background-color: var(--color-teal-light) !important; }
.has-white-background-color      { background-color: var(--color-white) !important; }
