/* ═══════════════════════════════════════════════════════════════════════
   KKM Custom Overrides
   Site-specific tweaks layered on top of theme.css / helper.css.
   Loaded AFTER theme.css so these rules win the cascade.
   =========================================================================== */


/* ───────────────────────────────────────────────────────────────────────
   1. Blog post titles ("Unfiltered Musings")
   Post titles are full sentences, not 1-2 word page names like "Contact"
   or "About" — the theme's default page-header size (clamp up to 94px,
   or up to 180px on the no-image layout) was designed for short captions
   and made long titles look oddly huge / cramped. Scale it down and give
   it tighter, more readable line-height.
   ─────────────────────────────────────────────────────────────────────── */
#page-header.ph-cap-blog .ph-caption-title {
    font-size: clamp(26px, 3.4vw, 54px);
    line-height: 1.35;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

#page-header.ph-cap-blog .ph-caption-title-ghost {
    font-size: calc(16px + 6vw);
}

#page-header.ph-cap-blog .ph-categories {
    margin-bottom: 18px;
}


/* ───────────────────────────────────────────────────────────────────────
   2. Contact form
   The markup used real theme classes (.tt-contact-form, .tt-input-group)
   that theme.css never actually defined, so the form rendered as bare
   unstyled browser inputs. This gives it a proper card + floating-label
   treatment that matches the site's dark, Poppins-set look and its
   existing accent color (the same maroon used by .tt-btn-primary).
   ─────────────────────────────────────────────────────────────────────── */
:root {
    --kkm-accent:       #4c2122;
    --kkm-accent-light: #7a3436;
    --kkm-panel-bg:     #131313;
    --kkm-panel-border: #2a2a2a;
    --kkm-text-muted:   #999;
}

.kkm-contact-card {
    background: var(--kkm-panel-bg);
    border: 1px solid var(--kkm-panel-border);
    border-radius: 6px;
    padding: 48px;
}
@media (max-width: 767px) {
    .kkm-contact-card { padding: 30px 22px; }
}

.kkm-contact-form { font-family: 'Poppins', sans-serif; }

.kkm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 30px;
}
@media (max-width: 640px) {
    .kkm-form-row { grid-template-columns: 1fr; }
}

.kkm-field {
    position: relative;
    margin-bottom: 30px;
    text-align: left;
}
.kkm-field input,
.kkm-field textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #3a3a3a;
    color: #fff;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    padding: 10px 2px;
    outline: none;
    resize: vertical;
    transition: border-color .2s ease;
}
.kkm-field textarea { min-height: 60px; }
.kkm-field input:focus,
.kkm-field textarea:focus { border-bottom-color: var(--kkm-accent-light); }
.kkm-field label {
    position: absolute;
    left: 2px;
    top: 12px;
    color: var(--kkm-text-muted);
    font-size: 15px;
    pointer-events: none;
    transition: all .15s ease;
}
.kkm-field input:focus + label,
.kkm-field input:not(:placeholder-shown) + label,
.kkm-field textarea:focus + label,
.kkm-field textarea:not(:placeholder-shown) + label {
    top: -14px;
    font-size: 11px;
    color: var(--kkm-accent-light);
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Honeypot — kept off-screen but focusable-safe (display:none is fine here
   since it's never meant to receive real input; tabindex -1 keeps it out
   of keyboard tab order regardless). */
.kkm-hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Captcha */
.kkm-captcha-row {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 18px 30px;
    margin-bottom: 10px;
    padding: 18px 22px;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--kkm-panel-border);
    border-radius: 4px;
}
.kkm-captcha-question {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
    font-size: 14px;
    flex: 1 1 220px;
}
.kkm-captcha-question strong { color: #fff; font-size: 16px; }
.kkm-captcha-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--kkm-accent);
    color: #fff;
    font-size: 13px;
    flex-shrink: 0;
}
.kkm-captcha-field {
    flex: 0 1 160px;
    margin-bottom: 0;
}

.kkm-form-submit { margin-top: 10px; }

.kkm-form-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    margin-bottom: 24px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}
.kkm-form-msg-ok  { color: #7bd88f; background: rgba(76,175,80,.1); border: 1px solid rgba(76,175,80,.3); }
.kkm-form-msg-err { color: #ff8a8a; background: rgba(229,57,53,.1); border: 1px solid rgba(229,57,53,.3); }


/* ───────────────────────────────────────────────────────────────────────
   3. Homepage "Categories" — visual cards + AJAX project listing
   Replaces the old text-only accordion (title/subtitle/paragraph) with
   image-led cards, so the section reads as a gallery, not a wall of copy.
   Clicking a card loads that category's projects inline via AJAX so
   people can browse work without leaving the homepage.
   ─────────────────────────────────────────────────────────────────────── */
.kkm-cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media (max-width: 900px) {
    .kkm-cat-grid { grid-template-columns: 1fr; }
}

.kkm-cat-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    border: 1px solid var(--kkm-panel-border);
    border-radius: 6px;
    overflow: hidden;
    background: #111 no-repeat center center;
    background-size: cover;
    cursor: pointer;
    padding: 0;
    text-align: left;
    font-family: 'Poppins', sans-serif;
    -webkit-appearance: none;
    appearance: none;
}
@media (max-width: 900px) {
    .kkm-cat-card { aspect-ratio: 16 / 10; }
}

.kkm-cat-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}
.kkm-cat-card:hover .kkm-cat-card-bg,
.kkm-cat-card-active .kkm-cat-card-bg { transform: scale(1.06); }

.kkm-cat-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,10,10,.15) 0%, rgba(10,10,10,.55) 55%, rgba(10,10,10,.92) 100%);
    transition: background .3s ease;
}
.kkm-cat-card:hover .kkm-cat-card-overlay,
.kkm-cat-card-active .kkm-cat-card-overlay {
    background: linear-gradient(180deg, rgba(76,33,34,.15) 0%, rgba(20,10,10,.6) 55%, rgba(10,10,10,.94) 100%);
}

.kkm-cat-card-body {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 26px 26px 24px;
    color: #fff;
}
.kkm-cat-card-count {
    display: inline-block;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #d9a8a8;
    background: rgba(76,33,34,.55);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 30px;
    padding: 4px 12px;
    margin-bottom: 12px;
}
.kkm-cat-card-title {
    display: block;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 6px;
}
.kkm-cat-card-sub {
    display: block;
    font-size: 12.5px;
    color: #bbb;
    margin-bottom: 16px;
}
.kkm-cat-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #fff;
    opacity: .85;
}
.kkm-cat-cta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.4);
    font-size: 11px;
    transition: transform .3s ease, background .3s ease;
}
.kkm-cat-card-active .kkm-cat-cta-icon { transform: rotate(45deg); background: var(--kkm-accent); border-color: var(--kkm-accent); }
.kkm-cat-card:hover .kkm-cat-cta-icon { border-color: #fff; }

/* Result panel */
.kkm-cat-panel {
    margin-top: 34px;
    background: var(--kkm-panel-bg);
    border: 1px solid var(--kkm-panel-border);
    border-radius: 6px;
    overflow: hidden;
}
.kkm-cat-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    border-bottom: 1px solid var(--kkm-panel-border);
}
.kkm-cat-panel-title {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}
.kkm-cat-panel-close {
    background: none;
    border: 0;
    color: #999;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.kkm-cat-panel-close:hover { color: #fff; }

.kkm-cat-panel-body { padding: 28px; min-height: 80px; }
.kkm-cat-panel-loading,
.kkm-cat-panel-empty {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 30px 10px;
    font-family: 'Poppins', sans-serif;
}
.kkm-cat-panel-loading i { margin-right: 8px; color: var(--kkm-accent-light); }

.kkm-cat-panel-foot {
    padding: 0 28px 28px;
    text-align: center;
}

.kkm-cat-proj-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 900px) {
    .kkm-cat-proj-grid { grid-template-columns: repeat(2, 1fr); }
}

.kkm-cat-proj-card {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 4px;
    overflow: hidden;
    background: #1a1a1a;
}
.kkm-cat-proj-card img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.kkm-cat-proj-card:hover img { transform: scale(1.08); }
.kkm-cat-proj-noimg { position: absolute; inset: 0; background: #1a1a1a; }
.kkm-cat-proj-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.85) 100%);
}
.kkm-cat-proj-caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 12px 14px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
}
.kkm-cat-proj-title {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
}
.kkm-cat-proj-meta {
    display: block;
    font-size: 11px;
    color: #bbb;
    margin-top: 3px;
}
