/* =================================================================== */
/* Jot321 Design Layer (JDL) – Base                                    */
/* Visual identity + typography + core components                      */
/* =================================================================== */

/* ------------------------------ */
/* 1. Reset / Normalise           */
/* ------------------------------ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f3f4f6; /* light neutral background */
    color: #111827;
}

/* Remove default spacing on headings and paragraphs */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: #0b3a72; /* deep blue for headings */
}

p {
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

/* Lists */
ul, ol {
    margin: 0 0 0.75rem 1.25rem;
    padding: 0;
}

/* Links */
a {
    color: #0059b3; /* Jot321 link blue */
    text-decoration: none;
}
a:hover,
a:focus {
    text-decoration: underline;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ------------------------------ */
/* 2. CSS Variables (Design Tokens) */
/* ------------------------------ */

:root {
    /* Brand palette */
    --jot321-blue: #003366;
    --jot321-blue-light: #1e4f8f;
    --jot321-gold: #c98a2b;
    --jot321-gold-soft: #f8e9c7;
    --jot321-heritage: #f5f1e6; /* soft parchment tint */
    --jot321-danger: #b91c1c;
    --jot321-success: #15803d;
    --jot321-warning: #f59e0b;

    /* Neutrals */
    --jot321-gray-900: #111827;
    --jot321-gray-700: #374151;
    --jot321-gray-500: #6b7280;
    --jot321-gray-200: #e5e7eb;
    --jot321-gray-100: #f3f4f6;

    /* Surfaces */
    --jot321-surface: #ffffff;
    --jot321-surface-subtle: #f9fafb;

    /* Borders & radius */
    --jot321-border-radius-sm: 6px;
    --jot321-border-radius-md: 10px;
    --jot321-border-radius-pill: 999px;

    /* Shadows */
    --jot321-shadow-soft: 0 4px 12px rgba(0,0,0,0.08);
    --jot321-shadow-card: 0 8px 20px rgba(15,23,42,0.08);

    /* Typography scale */
    --jot321-font-xs: 12px;
    --jot321-font-sm: 13px;
    --jot321-font-md: 15px;
    --jot321-font-lg: 17px;
    --jot321-font-xl: 20px;
    --jot321-font-2xl: 24px;
}

/* ------------------------------ */
/* 3. Layout Helpers              */
/* ------------------------------ */

/* Generic page container */
.jt-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px;
}

/* Centered narrow container – ideal for forms / edit pages */
.jt-container--narrow {
    max-width: 720px;
}

/* Card surface – used by edit forms, message boxes etc. */
.jt-card {
    background: var(--jot321-surface);
    border-radius: var(--jot321-border-radius-md);
    box-shadow: var(--jot321-shadow-soft);
    padding: 20px;
}

/* Heritage tint card – light parchment effect */
.jt-card--heritage {
    background: var(--jot321-heritage);
}

/* Section header */
.jt-section-title {
    font-size: var(--jot321-font-2xl);
    color: var(--jot321-blue);
    margin-bottom: 6px;
    text-align: center;
}

/* Subtext below section title */
.jt-section-subtitle {
    font-size: var(--jot321-font-sm);
    color: var(--jot321-gray-500);
    text-align: center;
}

/* ------------------------------ */
/* 4. Buttons & Pills             */
/* ------------------------------ */

button,
input[type="submit"] {
    font-family: inherit;
}

/* Base button */
.jt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: var(--jot321-border-radius-md);
    border: 1px solid transparent;
    font-size: var(--jot321-font-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    text-decoration: none;
}

.jt-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary (Jot321 blue) */
.jt-btn--primary {
    background-color: var(--jot321-blue);
    color: #ffffff;
    box-shadow: var(--jot321-shadow-soft);
}
.jt-btn--primary:hover {
    background-color: var(--jot321-blue-light);
    text-decoration: none;
    transform: translateY(-1px);
}

/* Secondary (outline) */
.jt-btn--secondary {
    background-color: #ffffff;
    color: var(--jot321-blue);
    border-color: var(--jot321-blue);
}
.jt-btn--secondary:hover {
    background-color: #eef3fb;
    text-decoration: none;
}

/* Pill style (used across you site) */
.jt-pill {
    border-radius: var(--jot321-border-radius-pill);
    padding-inline: 22px;
}

/* Neutral / muted text button style */
.jt-btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--jot321-gray-700);
}
.jt-btn--ghost:hover {
    background: rgba(15,23,42,0.04);
}

/* ------------------------------ */
/* 5. Notices / Alerts            */
/* ------------------------------ */

.jt-notice {
    border-radius: var(--jot321-border-radius-md);
    padding: 10px 14px;
    font-size: var(--jot321-font-sm);
    margin: 10px auto;
    border-width: 1px;
    border-style: solid;
}

/* Success */
.jt-notice--ok {
    background: #ecfdf3;
    color: #14532d;
    border-color: #bbf7d0;
}

/* Error */
.jt-notice--error {
    background: #fef2f2;
    color: #7f1d1d;
    border-color: #fecaca;
}

/* Warning (used on sold messages etc.) */
.jt-notice--warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fed7aa;
}

/* ------------------------------ */
/* 6. Form Controls (Global)      */
/* ------------------------------ */

.jt-form-group {
    margin-bottom: 14px;
}

.jt-form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: var(--jot321-font-sm);
    color: var(--jot321-gray-700);
}

.jt-input,
.jt-textarea,
.jt-select {
    width: 100%;
    padding: 9px 10px;
    border-radius: var(--jot321-border-radius-sm);
    border: 1px solid var(--jot321-gray-200);
    font-size: var(--jot321-font-md);
    font-family: inherit;
    color: var(--jot321-gray-900);
    box-sizing: border-box;
    background-color: #ffffff;
}

.jt-textarea {
    resize: vertical;
    min-height: 90px;
}

.jt-input:focus,
.jt-textarea:focus,
.jt-select:focus {
    outline: none;
    border-color: var(--jot321-blue);
    box-shadow: 0 0 0 1px rgba(0, 51, 102, 0.2);
}

.jt-form-help {
    display: block;
    margin-top: 3px;
    font-size: var(--jot321-font-xs);
    color: var(--jot321-gray-500);
}

/* Inline radio / checkbox rows */
.jt-choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.jt-choice-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--jot321-font-sm);
    color: var(--jot321-gray-700);
}

/* ------------------------------ */
/* 7. Badges & Chips              */
/* ------------------------------ */

.jt-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--jot321-border-radius-pill);
    font-size: var(--jot321-font-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Featured */
.jt-badge--featured {
    background: #fef3c7;
    color: #92400e;
}

/* Offer */
.jt-badge--offer {
    background: #e0f2fe;
    color: #075985;
}

/* Sold */
.jt-badge--sold {
    background: #fee2e2;
    color: #991b1b;
}

/* New / Fresh listing */
.jt-badge--new {
    background: #dcfce7;
    color: #166534;
}

/* ------------------------------ */
/* 8. Price Line (Global Utility) */
/*    (used via jot321_render_price_line()) */
/* ------------------------------ */

.jt-price-line {
    font-size: var(--jot321-font-md);
    color: var(--jot321-gray-900);
    margin-bottom: 8px;
}

.jt-price-line span {
    font-size: var(--jot321-font-sm);
}

/* ------------------------------ */
/* 9. Save Button (Pill)          */
/* ------------------------------ */

.jt-save-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: var(--jot321-border-radius-pill);
    border: 1px solid #e5c36a;
    background: #fef9c3;
    font-size: var(--jot321-font-sm);
    font-weight: 500;
    color: #92400e;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.jt-save-pill:hover {
    background: #fef3c7;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Saved state */
.jt-save-pill--active {
    background: #facc15;
    border-color: #eab308;
    color: #1f2937;
}

/* ------------------------------ */
/* 10. Utility Text Styles        */
/* ------------------------------ */

.jt-text-muted {
    color: var(--jot321-gray-500);
    font-size: var(--jot321-font-sm);
}

.jt-text-small {
    font-size: var(--jot321-font-xs);
}

.jt-text-center {
    text-align: center;
}

/* ------------------------------ */
/* 11. Simple Responsive Helpers  */
/* ------------------------------ */

@media (max-width: 640px) {
    .jt-container {
        padding: 12px;
    }

    .jt-section-title {
        font-size: 20px;
    }
}
/* Force archive card images to keep full height – no slicing */
.jt-card .listing-image img,
.jt-card .card-img {
    max-width: 100%;
    width: auto;
    height: auto !important;
    max-height: 220px;
    object-fit: contain !important;
    display: block;
    border-radius: 8px;
}
/* Homepage: stop thumbnails being cropped in Latest Listings cards */
.home .listing-image img {
  width: auto;
  height: 100%;
  max-height: 100%;
  object-fit: contain !important;
  display: block;
}
