/*
Theme Name: Flavor
Theme URI:
Author: autoplatform.lv
Description: autoplatform.lv — Latvian Vehicle Marketplace & Auto News Theme
Version: 2.1
License: GNU General Public License v2 or later
Text Domain: flavor
*/

/* ===== BASE RESET ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Backgrounds */
    --bg:          #ffffff;
    --bg-alt:      #f4f6f8;   /* cool slate tint — replaces lavender */
    --bg-card:     #ffffff;
    --bg-deep:     #0f172a;   /* charcoal showroom — hero, footer */

    /* Text */
    --text:        #0f172a;
    --text-sec:    #334155;
    --text-muted:  #64748b;

    /* Accent — slate/charcoal brand */
    --accent:       #334155;
    --accent-dark:  #1e293b;
    --accent-soft:  rgba(51, 65, 85, 0.10);
    --accent-light: #94a3b8;  /* for text on dark backgrounds */

    /* Signal — sharp warm accent, used sparingly (price, featured, CTAs) */
    --signal:       #c2410c;
    --signal-dark:  #9a3412;
    --signal-soft:  rgba(194, 65, 12, 0.10);

    /* Status (vehicle conditions / deal ratings) */
    --ok:           #15803d;
    --ok-soft:      #dcfce7;
    --warn:         #b45309;
    --warn-soft:    #fef3c7;

    /* Borders */
    --border:       #dfe3e8;  /* light slate-tinted border */
    --border-light: #eef0f3;

    /* Shape */
    --radius: 4px;
    --shadow-sm: none;
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.14);

    /* Typography — grotesque display for a modern automotive feel, clean sans for UI */
    --font-display: 'Archivo', 'Helvetica Neue', 'Segoe UI', system-ui, sans-serif;
    --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Roboto', sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

    --max-w: 1080px;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.55;
    min-height: 100vh;
}

a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== UTILITY ===== */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
    letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 1rem;
}

/* ===== FORMS ===== */
input, textarea, select, button {
    font-family: var(--font-body);
    font-size: inherit;
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
textarea {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: var(--radius);
    width: 100%;
    transition: border-color 0.2s, background 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    background: var(--bg-card);
    border-color: var(--accent);
}

button,
input[type="submit"] {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    transition: background 0.2s;
}

button:hover,
input[type="submit"]:hover {
    background: var(--accent-dark);
}

/* ===== SEARCH FORM ===== */
.search-form {
    display: flex;
    gap: 8px;
}

.search-form .search-field {
    flex: 1;
    padding: 8px 14px;
    font-size: 14px;
}

.search-form .search-submit {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== WIDGETS ===== */
.widget {
    margin-bottom: 32px;
}

.widget .title,
.widget-title {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--text);
    color: var(--text);
}

.widget ul {
    list-style: none;
}

.widget ul li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.widget ul li:last-child {
    border-bottom: none;
}

/* ===== SINGLE POST ===== */
.single-post .entry-header {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
}

.single-post .entry-title {
    font-size: 2.75rem;
    margin-bottom: 16px;
    font-weight: 800;
}

.single-post .entry-meta {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.single-post .entry-content {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-sec);
}

.single-post .entry-content p {
    margin-bottom: 1.5rem;
}

/* ===== COMMENTS ===== */
.comments-area {
    margin-top: 48px;
    padding-top: 28px;
    border-top: 2px solid var(--text);
}

.comment-list {
    list-style: none;
}

.comment {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.comment-author {
    font-weight: 700;
}

.comment-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 40px 0;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    transition: background 0.2s, color 0.2s;
}

.pagination a:hover {
    background: var(--border);
}

.pagination .current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ===== ARCHIVE ===== */
.archive-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--text);
}

.archive-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.archive-description {
    color: var(--text-sec);
    margin-top: 8px;
    font-size: 1.125rem;
}

/* ===== 404 ===== */
.error-404 {
    text-align: center;
    padding: 80px 20px;
}

.error-404 h1 {
    font-size: 6rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}

/* ===== ACCESSIBILITY ===== */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* ===== WP BLOCKS ===== */
.wp-block-image img {
    max-width: 100%;
    border-radius: var(--radius);
}

.wp-block-quote {
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    margin: 32px 0;
    font-style: italic;
    font-size: 1.25rem;
    color: var(--text);
    font-weight: 600;
}

.wp-block-code {
    background: var(--bg-alt);
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: var(--font-mono);
    border: 1px solid var(--border);
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--bg-deep);
    color: #cbd5e1;
    border-top: none;
    padding: 0;
    margin-top: 60px;
}

.site-footer a {
    color: var(--accent-light);
    text-decoration: none;
}

.site-footer a:hover {
    color: #ffffff;
}

/* =========================================================
   VEHICLE LISTING CARD  —  autoplatform.lv
   Reusable card for car/motorcycle/vehicle listings.
   Drop the markup (see example at the bottom of this file)
   into any loop, archive, or related-listings widget.
   ========================================================= */

.fl-vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 32px 0;
}

.fl-vehicle-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.fl-vehicle-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

/* --- Media --- */
.fl-vehicle-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--bg-alt);
    overflow: hidden;
}

.fl-vehicle-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.fl-vehicle-card:hover .fl-vehicle-media img {
    transform: scale(1.05);
}

/* "Featured" ribbon — the one place the warm signal color appears */
.fl-vehicle-ribbon {
    position: absolute;
    top: 12px;
    left: 0;
    background: var(--signal);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 12px 5px 10px;
    border-radius: 0 3px 3px 0;
    box-shadow: 0 2px 6px rgba(154, 52, 18, 0.35);
}

/* Photo count badge */
.fl-vehicle-photos {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 99px;
    backdrop-filter: blur(2px);
}

.fl-vehicle-photos::before {
    content: '';
    width: 13px;
    height: 13px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Save / favourite button */
.fl-vehicle-save {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, transform 0.15s;
}

.fl-vehicle-save:hover { transform: scale(1.08); background: #fff; }

.fl-vehicle-save::before {
    content: '';
    width: 17px;
    height: 17px;
    background: var(--text-muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.29 1.49 4.04 3 5.5l7 7Z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.29 1.49 4.04 3 5.5l7 7Z'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: background 0.15s;
}

.fl-vehicle-save.is-saved::before { background: var(--signal); }

/* --- Body --- */
.fl-vehicle-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 18px 18px;
}

.fl-vehicle-price {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1;
}

.fl-vehicle-price .fl-vehicle-price-old {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 8px;
    letter-spacing: 0;
}

.fl-vehicle-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    margin: 8px 0 0;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fl-vehicle-card a.fl-vehicle-title:hover { color: var(--accent); }

/* --- Spec row (year / mileage / fuel / transmission) --- */
.fl-vehicle-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.fl-vehicle-spec {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sec);
    white-space: nowrap;
}

.fl-vehicle-spec::before {
    content: '';
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    background: var(--text-muted);
    -webkit-mask-size: contain;
            mask-size: contain;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
}

/* year — calendar */
.fl-vehicle-spec.year::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}

/* mileage — gauge */
.fl-vehicle-spec.mileage::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 14a2 2 0 0 0 2-2 2 2 0 0 0-.59-1.41L9 6'/%3E%3Cpath d='M3.34 19a10 10 0 1 1 17.32 0'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 14a2 2 0 0 0 2-2 2 2 0 0 0-.59-1.41L9 6'/%3E%3Cpath d='M3.34 19a10 10 0 1 1 17.32 0'/%3E%3C/svg%3E");
}

/* fuel — fuel pump */
.fl-vehicle-spec.fuel::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='22' x2='15' y2='22'/%3E%3Cline x1='4' y1='9' x2='14' y2='9'/%3E%3Cpath d='M14 22V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v18'/%3E%3Cpath d='M14 13h2a2 2 0 0 1 2 2v2a2 2 0 0 0 2 2 2 2 0 0 0 2-2V9.83a2 2 0 0 0-.59-1.42L18 5'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='22' x2='15' y2='22'/%3E%3Cline x1='4' y1='9' x2='14' y2='9'/%3E%3Cpath d='M14 22V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v18'/%3E%3Cpath d='M14 13h2a2 2 0 0 1 2 2v2a2 2 0 0 0 2 2 2 2 0 0 0 2-2V9.83a2 2 0 0 0-.59-1.42L18 5'/%3E%3C/svg%3E");
}

/* transmission — gearbox */
.fl-vehicle-spec.gearbox::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='6' r='2'/%3E%3Ccircle cx='18' cy='6' r='2'/%3E%3Ccircle cx='6' cy='18' r='2'/%3E%3Cpath d='M6 8v8M18 8v4a4 4 0 0 1-4 4H6'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='6' r='2'/%3E%3Ccircle cx='18' cy='6' r='2'/%3E%3Ccircle cx='6' cy='18' r='2'/%3E%3Cpath d='M6 8v8M18 8v4a4 4 0 0 1-4 4H6'/%3E%3C/svg%3E");
}

/* --- Footer: location + optional deal rating --- */
.fl-vehicle-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.fl-vehicle-location {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.fl-vehicle-deal {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 3px;
}

.fl-vehicle-deal.good  { background: var(--ok-soft);   color: var(--ok); }
.fl-vehicle-deal.fair  { background: var(--warn-soft); color: var(--warn); }

@media (max-width: 480px) {
    .fl-vehicle-grid { grid-template-columns: 1fr; }
}

/*
   USAGE EXAMPLE — vehicle listing card markup
   --------------------------------------------------------
   <div class="fl-vehicle-grid">

     <article class="fl-vehicle-card">
       <div class="fl-vehicle-media">
         <a href="LISTING_URL"><img src="CAR_PHOTO.jpg" alt="BMW 320d 2019"></a>
         <span class="fl-vehicle-ribbon">TOP</span>
         <button class="fl-vehicle-save" aria-label="Saglabāt"></button>
         <span class="fl-vehicle-photos">8</span>
       </div>
       <div class="fl-vehicle-body">
         <div class="fl-vehicle-price">
           12 900 &euro;
           <span class="fl-vehicle-price-old">14 500 &euro;</span>
         </div>
         <a href="LISTING_URL" class="fl-vehicle-title">BMW 320d xDrive M Sport</a>
         <div class="fl-vehicle-specs">
           <span class="fl-vehicle-spec year">2019</span>
           <span class="fl-vehicle-spec mileage">128 000 km</span>
           <span class="fl-vehicle-spec fuel">Dīzelis</span>
           <span class="fl-vehicle-spec gearbox">Automāts</span>
         </div>
         <div class="fl-vehicle-foot">
           <span class="fl-vehicle-location">Rīga</span>
           <span class="fl-vehicle-deal good">Laba cena</span>
         </div>
       </div>
     </article>

   </div>

   Toggle the saved state from JS by adding the class:
     button.classList.toggle('is-saved');
*/