/*
 * tailwind-local.css
 * Hand-crafted Tailwind-compatible utility classes for this site.
 * No CDN or build step required.
 *
 * Custom brand colours:
 *   --brand     : #003265  (deep navy)
 *   --brand-mid : #5DA3CC  (sky blue)
 */

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, video { max-width: 100%; height: auto; display: block; }
input, button, select, textarea { font-family: inherit; font-size: 100%; }
button { cursor: pointer; }

/* ── Custom properties ──────────────────────────────────────────────────────── */
:root {
    --brand:        #003265;
    --brand-mid:    #5DA3CC;
    --brand-light:  #e8f4fd;
    --gray-50:      #f9fafb;
    --gray-100:     #f3f4f6;
    --gray-200:     #e5e7eb;
    --gray-300:     #d1d5db;
    --gray-400:     #9ca3af;
    --gray-500:     #6b7280;
    --gray-600:     #4b5563;
    --gray-700:     #374151;
    --gray-800:     #1f2937;
    --gray-900:     #111827;
    --white:        #ffffff;
    --red-500:      #ef4444;
    --shadow:       0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);
    --shadow-lg:    0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
    --radius-md:    0.375rem;
    --radius-lg:    0.5rem;
    --radius-xl:    0.75rem;
}

/* ── Display ────────────────────────────────────────────────────────────────── */
.block        { display: block; }
.inline-block { display: inline-block; }
.inline       { display: inline; }
.flex         { display: flex; }
.grid         { display: grid; }
.hidden       { display: none; }

/* ── Flexbox ────────────────────────────────────────────────────────────────── */
.flex-col        { flex-direction: column; }
.flex-row        { flex-direction: row; }
.flex-wrap       { flex-wrap: wrap; }
.flex-1          { flex: 1 1 0%; }
.flex-auto       { flex: 1 1 auto; }
.shrink-0        { flex-shrink: 0; }
.grow            { flex-grow: 1; }
.items-start     { align-items: flex-start; }
.items-center    { align-items: center; }
.items-end       { align-items: flex-end; }
.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-2   { gap: 0.5rem; }
.gap-3   { gap: 0.75rem; }
.gap-4   { gap: 1rem; }
.gap-6   { gap: 1.5rem; }

/* ── Sizing ─────────────────────────────────────────────────────────────────── */
.w-auto    { width: auto; }
.w-full    { width: 100%; }
.w-48      { width: 12rem; }
.w-52      { width: 13rem; }
.h-16      { height: 4rem; }
.min-w-0   { min-width: 0; }
.min-h-screen { min-height: 100vh; }
.max-w-screen-xl { max-width: 80rem; }
.max-w-none  { max-width: none; }

/* ── Spacing ────────────────────────────────────────────────────────────────── */
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-2  { margin-top: 0.5rem; }
.mt-4  { margin-top: 1rem; }
.mt-6  { margin-top: 1.5rem; }
.mb-2  { margin-bottom: 0.5rem; }
.mb-3  { margin-bottom: 0.75rem; }
.mb-4  { margin-bottom: 1rem; }
.mb-6  { margin-bottom: 1.5rem; }
.ml-2  { margin-left: 0.5rem; }
.mr-2  { margin-right: 0.5rem; }
.px-2  { padding-left: 0.5rem;  padding-right: 0.5rem; }
.px-3  { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4  { padding-left: 1rem;    padding-right: 1rem; }
.py-2  { padding-top: 0.5rem;   padding-bottom: 0.5rem; }
.py-3  { padding-top: 0.75rem;  padding-bottom: 0.75rem; }
.py-4  { padding-top: 1rem;     padding-bottom: 1rem; }
.py-6  { padding-top: 1.5rem;   padding-bottom: 1.5rem; }
.p-2   { padding: 0.5rem; }
.p-3   { padding: 0.75rem; }
.p-4   { padding: 1rem; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* Vertical sibling spacing */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* ── Typography ─────────────────────────────────────────────────────────────── */
.font-sans    { font-family: Arial, Helvetica, sans-serif; }
.font-normal  { font-weight: 400; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.text-xs  { font-size: 0.75rem;  line-height: 1rem; }
.text-sm  { font-size: 0.875rem; line-height: 1.25rem; }
.text-base{ font-size: 1rem;     line-height: 1.5rem; }
.text-lg  { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl  { font-size: 1.25rem;  line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem;   line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.uppercase   { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.leading-none  { line-height: 1; }
.prose         { line-height: 1.7; }
.italic        { font-style: italic; }
.underline     { text-decoration: underline; }
.no-underline  { text-decoration: none; }
.truncate {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Colours — text ─────────────────────────────────────────────────────────── */
.text-white      { color: var(--white); }
.text-brand      { color: var(--brand); }
.text-brand-mid  { color: var(--brand-mid); }
.text-gray-400   { color: var(--gray-400); }
.text-gray-500   { color: var(--gray-500); }
.text-gray-600   { color: var(--gray-600); }
.text-gray-700   { color: var(--gray-700); }
.text-gray-800   { color: var(--gray-800); }
.text-red-500    { color: var(--red-500); }

/* Opacity modifier for white text (used on dark backgrounds) */
.text-white\/60  { color: rgba(255,255,255,0.60); }
.text-white\/70  { color: rgba(255,255,255,0.70); }

/* ── Colours — background ───────────────────────────────────────────────────── */
.bg-white      { background-color: var(--white); }
.bg-gray-50    { background-color: var(--gray-50); }
.bg-gray-100   { background-color: var(--gray-100); }
.bg-brand      { background-color: var(--brand); }
.bg-brand-mid  { background-color: var(--brand-mid); }

/* ── Border ─────────────────────────────────────────────────────────────────── */
.border          { border: 1px solid var(--gray-200); }
.border-t        { border-top: 1px solid var(--gray-200); }
.border-b        { border-bottom: 1px solid var(--gray-200); }
.border-gray-200 { border-color: var(--gray-200); }
.border-gray-300 { border-color: var(--gray-300); }
.border-white\/30{ border-color: rgba(255,255,255,0.30); }

/* ── Border-radius ──────────────────────────────────────────────────────────── */
.rounded     { border-radius: var(--radius-md); }
.rounded-md  { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-xl  { border-radius: var(--radius-xl); }

/* ── Shadow ─────────────────────────────────────────────────────────────────── */
.shadow    { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ── Overflow ───────────────────────────────────────────────────────────────── */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* ── Misc ───────────────────────────────────────────────────────────────────── */
.object-contain { object-fit: contain; }
.transition-colors { transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.whitespace-nowrap { white-space: nowrap; }

/* ── Focus ring ─────────────────────────────────────────────────────────────── */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus       { box-shadow: 0 0 0 2px var(--brand-mid); }

/* ── Hover states ───────────────────────────────────────────────────────────── */
.hover\:bg-brand-mid:hover  { background-color: var(--brand-mid); }
.hover\:bg-blue-400:hover   { background-color: #60a5fa; }
.hover\:text-brand:hover    { color: var(--brand); }
.hover\:underline:hover     { text-decoration: underline; }

/* ── Component: card ─────────────────────────────────────────────────────────── */
.card {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 1rem;
}

.sidebar-box {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 0.75rem;
    margin-bottom: 1rem;
}

/* ── Responsive: sm breakpoint (≥ 640 px) ──────────────────────────────────── */
@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:w-auto   { width: auto; }
}

/* ── Base typography overrides (used by layout partials) ───────────────────── */
h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-mid);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--brand);
    margin-bottom: 0.5rem;
}
a {
    color: var(--brand-mid);
    font-weight: 600;
    text-decoration: none;
}
a:hover {
    color: var(--brand);
    text-decoration: underline;
}

/* ── Library-generated HTML patches ────────────────────────────────────────── */

/* Product mini-blocks emitted by gen_mini_block() */
table.mini_block,
table[cellpadding="6"] {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    background: var(--white);
    margin-bottom: 1rem;
    width: 100%;
}

/* Category sidebar table emitted by show_categories() */
.sidebar-box table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.875rem;
}
.sidebar-box table tr td a {
    display: block;
    padding: 0.2rem 0;
    color: var(--brand);
}
.sidebar-box table tr td a:hover {
    color: var(--brand-mid);
}

/* Hide old decorative images from library output */
img.shrink { display: none; }

/* Constrain images inside library HTML fragments */
@media (max-width: 600px) {
    table { width: 100% !important; }
    td    { display: block; width: 100% !important; }
    img   { max-width: 100%; height: auto; }
}
