/*
Theme Name: KylasKey
Theme URI: https://dbtickets.com
Author: KylasKey
Description: Dark discover-style events and ticketing theme. Poster-grid event listing with search and filters.
Version: 1.0.0
Requires PHP: 7.4
License: Proprietary
Text Domain: dbtickets
*/

:root {
    --door: #0a0a0a;
    --phantom: #1a1a1e;
    --phantom-raised: #232329;
    --smoke: #2e2e35;
    --fog: #6b6b73;
    --mist: #b8b8be;
    --ivory: #edeae3;
    --bone: #d6d2c9;
    --pulse: #e63946;
    --dur-enter: .22s;
    --ease-emphasized: cubic-bezier(.2, 0, 0, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--door);
    color: var(--ivory);
    font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.content-wrap {
    width: 100%;
    max-width: 94rem;
    margin-inline: auto;
    padding-inline: 2rem;
}
@media (max-width: 640px) {
    .content-wrap { padding-inline: 1rem; }
}

/* ---------- Header ---------- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1.25rem;
}
.site-logo {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    color: var(--ivory);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.site-logo .logo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pulse);
    display: inline-block;
}
.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--mist);
}
.site-nav a:hover { color: var(--ivory); }

/* ---------- Discover head ---------- */
.discover-head {
    padding-block: 2rem .5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.discover-title {
    margin: 0;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--fog);
}
.discover-search {
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 1px solid var(--smoke);
    padding-bottom: .9rem;
}
.discover-search svg { flex: none; color: var(--mist); }
.discover-search input {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--ivory);
    font-family: inherit;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.03em;
    outline: none;
    padding: 0;
}
.discover-search input::placeholder { color: var(--fog); }
.discover-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
@media (max-width: 640px) {
    .discover-search input { font-size: 20px; }
}

/* ---------- Filter chips ---------- */
.discover-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding-block: .25rem 1.5rem;
}
.chip {
    appearance: none;
    font-family: inherit;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--mist);
    background: transparent;
    border: 1px solid var(--smoke);
    border-radius: 999px;
    padding: .4rem .9rem;
    cursor: pointer;
    transition: color .15s, background .15s, border-color .15s;
}
.chip:hover { color: var(--ivory); border-color: var(--fog); }
.chip.is-active {
    background: var(--ivory);
    border-color: var(--ivory);
    color: var(--door);
}

/* ---------- Events grid ---------- */
.events-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem 1.5rem;
    padding-bottom: 4rem;
}
@media (min-width: 640px)  { .events-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .events-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .events-grid { grid-template-columns: repeat(4, 1fr); gap: 1.75rem 1rem; } }

@keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
.stagger-in > * { animation: rise-in var(--dur-enter) var(--ease-emphasized) both; }
.stagger-in > :nth-child(2) { animation-delay: 40ms; }
.stagger-in > :nth-child(3) { animation-delay: 80ms; }
.stagger-in > :nth-child(n+4) { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) {
    .stagger-in > * { animation: none; }
}

.event-card { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.event-poster {
    aspect-ratio: 210 / 297;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: var(--phantom);
    position: relative;
}
.event-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s var(--ease-emphasized);
}
.event-card:hover .event-poster img { transform: scale(1.03); }
.event-card:hover .event-name { color: #fff; }

.placeholder-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(48px, 7vw, 84px);
    font-weight: 800;
    letter-spacing: -.04em;
    color: rgba(237, 234, 227, .85);
}

.event-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.event-name {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ivory);
    transition: color .15s;
}
.event-date {
    color: var(--pulse);
    font-size: .8125rem;
    font-weight: 600;
}
.event-venue {
    color: var(--mist);
    font-size: .8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.event-price { color: var(--ivory); font-size: .8125rem; }

/* One-tap buy straight off the grid */
.card-buy {
    margin-top: .45rem;
    align-self: flex-start;
    appearance: none;
    font-family: inherit;
    font-size: .8125rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--door);
    background: var(--ivory);
    border: 0;
    border-radius: 8px;
    padding: .45rem .85rem;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.card-buy:hover { background: #fff; transform: translateY(-1px); }
.card-buy[data-busy] { opacity: .6; cursor: default; transform: none; }

.events-empty {
    grid-column: 1 / -1;
    padding: 4rem 0 6rem;
    text-align: center;
    color: var(--mist);
}
.events-empty strong { display: block; color: var(--ivory); font-size: 1.1rem; margin-bottom: .35rem; }

/* ---------- Single event ---------- */
.single-event {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-block: 2rem 5rem;
}
@media (min-width: 768px) {
    .single-event { grid-template-columns: 380px minmax(0, 1fr); align-items: start; }
}
.single-event .event-poster { border-radius: 12px; }
.single-details { display: flex; flex-direction: column; gap: 1rem; }
.single-details h1 {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
}
.single-meta { display: flex; flex-direction: column; gap: .35rem; font-size: .95rem; }
.single-meta .event-date { font-size: .95rem; }
.single-meta .event-venue { font-size: .95rem; white-space: normal; }
.single-desc { color: var(--bone); max-width: 60ch; }
.single-desc p { margin: 0 0 1em; }

.btn-tickets {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: var(--ivory);
    color: var(--door);
    font-weight: 800;
    font-size: .95rem;
    border-radius: 10px;
    padding: .85rem 1.75rem;
    margin-top: .5rem;
    align-self: flex-start;
    transition: background .15s, transform .15s;
}
.btn-tickets:hover { background: #fff; transform: translateY(-1px); }
.btn-back { color: var(--mist); font-size: .875rem; font-weight: 600; }
.btn-back:hover { color: var(--ivory); }

/* ---------- Ticket tier picker ---------- */
.tier-picker { display: flex; flex-direction: column; gap: .6rem; margin-top: .5rem; max-width: 30rem; }
.tier-row {
    display: flex; align-items: center; gap: 1rem;
    background: var(--phantom); border: 1px solid var(--smoke);
    border-radius: 12px; padding: .9rem 1.1rem;
}
.tier-info { flex: 1; min-width: 0; }
.tier-name { font-weight: 700; font-size: .95rem; }
.tier-desc { color: var(--mist); font-size: .8rem; margin-top: .1rem; }
.tier-price { font-weight: 800; font-size: .95rem; }
.tier-soldout { color: var(--fog); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.tier-qty { display: flex; align-items: center; gap: .6rem; }
.qty-btn {
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--smoke); border: 0; color: var(--ivory);
    font-size: 1.05rem; font-weight: 700; cursor: pointer; line-height: 1;
    transition: background .15s;
}
.qty-btn:hover { background: var(--fog); }
.qty { min-width: 1.2rem; text-align: center; font-weight: 800; }
.tier-checkout { margin-top: .35rem; width: 100%; }
.tier-checkout:disabled { opacity: .45; cursor: default; transform: none; }
.tier-error { color: var(--pulse); font-weight: 600; font-size: .875rem; }

/* Venue address (under the venue line) */
.event-address { font-size: .85rem; }
.event-address a { color: var(--fog); text-decoration: none; transition: color .15s; }
.event-address a:hover { color: var(--mist); }

/* Waitlist (sold out) */
.waitlist-box { margin-top: 1.1rem; padding: 1.1rem 1.2rem; border: 1px solid var(--smoke); border-radius: 14px; background: var(--phantom); max-width: 30rem; }
.waitlist-box h2 { margin: 0 0 .3rem; font-size: 1rem; font-weight: 800; letter-spacing: -.01em; }
.waitlist-box p { margin: 0 0 .9rem; color: var(--fog); font-size: .875rem; }
.waitlist-form { display: flex; flex-direction: column; gap: .6rem; }
.waitlist-form input {
    width: 100%; background: var(--door); border: 1px solid var(--smoke); border-radius: 10px;
    color: var(--ivory); font-family: inherit; font-size: .95rem; font-weight: 600; padding: .7rem .85rem;
    transition: border-color .15s, box-shadow .15s;
}
.waitlist-form input::placeholder { color: var(--fog); font-weight: 500; }
.waitlist-form input:focus { border-color: var(--pulse); box-shadow: 0 0 0 3px rgba(230, 57, 70, .18); outline: none; }
.waitlist-msg { margin-top: .8rem; font-size: .9rem; font-weight: 600; color: var(--mist); }

/* Order page: passes + returns */
.order-passes { list-style: none; padding: 0; margin: 1rem 0; }
.order-passes li { display: flex; align-items: center; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--smoke); flex-wrap: wrap; }
.order-passes li:last-child { border-bottom: 0; }
.pass-state { color: var(--fog); font-size: .8rem; font-weight: 600; }
.pass-actions { margin-left: auto; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.pass-transfer summary {
    cursor: pointer; list-style: none; color: var(--mist); font-size: .78rem; font-weight: 700;
    border: 1px solid var(--smoke); border-radius: 8px; padding: .35rem .7rem; transition: color .15s, border-color .15s;
}
.pass-transfer summary::-webkit-details-marker { display: none; }
.pass-transfer summary:hover { color: var(--ivory); border-color: var(--fog); }
.pass-transfer[open] { flex-basis: 100%; }
.pass-transfer form { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.pass-transfer input {
    flex: 1; min-width: 9rem; background: var(--phantom); border: 1px solid var(--smoke); border-radius: 8px;
    color: var(--ivory); font-family: inherit; font-size: .85rem; font-weight: 600; padding: .45rem .6rem;
}
.pass-transfer input::placeholder { color: var(--fog); font-weight: 500; }
.pass-transfer input:focus { border-color: var(--pulse); box-shadow: 0 0 0 3px rgba(230, 57, 70, .18); outline: none; }
.pass-transfer button {
    background: var(--ivory); border: 0; border-radius: 8px; cursor: pointer;
    color: var(--door); font-family: inherit; font-size: .8rem; font-weight: 800; padding: .45rem .8rem;
}
.pass-return { margin-left: 0; }
.pass-return button {
    background: transparent; border: 1px solid var(--smoke); border-radius: 8px; cursor: pointer;
    color: var(--mist); font-family: inherit; font-size: .78rem; font-weight: 700; padding: .35rem .7rem;
    transition: color .15s, border-color .15s;
}
.pass-return button:hover { color: var(--pulse); border-color: rgba(230, 57, 70, .5); }
.order-note { font-weight: 600; font-size: .9rem; padding: .7rem .9rem; border-radius: 10px; background: var(--phantom); border: 1px solid var(--smoke); max-width: 34rem; }
.order-note-ok { border-left: 3px solid #34d399; }
.order-note-err { border-left: 3px solid var(--pulse); }
.order-smallprint { color: var(--fog); font-size: .8rem; max-width: 34rem; }

/* In-page payment (express wallets + card) */
.pay-box { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--smoke); display: flex; flex-direction: column; gap: .8rem; max-width: 30rem; }
.pay-divider { display: flex; align-items: center; gap: .8rem; color: var(--fog); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.pay-divider::before, .pay-divider::after { content: ""; flex: 1; height: 1px; background: var(--smoke); }
.pay-input {
    width: 100%;
    background: var(--phantom);
    border: 1px solid var(--smoke);
    border-radius: 10px;
    color: var(--ivory);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    padding: .7rem .85rem;
    transition: border-color .15s, box-shadow .15s;
}
.pay-input::placeholder { color: var(--fog); font-weight: 500; }
.pay-input:focus { border-color: var(--pulse); box-shadow: 0 0 0 3px rgba(230, 57, 70, .18); outline: none; }
.pay-submit { width: 100%; }
.pay-note { color: var(--fog); font-size: .8rem; }

/* Contact the organiser */
.contact-organiser { margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid var(--smoke); max-width: 34rem; }
.contact-organiser h2 { font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 .9rem; }
.contact-form { display: flex; flex-direction: column; gap: .7rem; }
.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
@media (max-width: 640px) { .contact-row { grid-template-columns: 1fr; } }
.contact-form input:not(.contact-hp),
.contact-form textarea {
    width: 100%;
    background: var(--phantom);
    border: 1px solid var(--smoke);
    border-radius: 10px;
    color: var(--ivory);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    padding: .7rem .85rem;
    transition: border-color .15s, box-shadow .15s;
}
.contact-form textarea { font-weight: 400; line-height: 1.5; resize: vertical; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--fog); font-weight: 500; }
.contact-form input:focus, .contact-form textarea:focus {
    border-color: var(--pulse);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, .18);
    outline: none;
}
.contact-hp { position: absolute; left: -9999px; }
.contact-send { align-self: flex-start; }
.contact-note { font-size: .9rem; font-weight: 600; padding: .7rem .9rem; border-radius: 10px; background: var(--phantom); border: 1px solid var(--smoke); }
.contact-note-ok { border-left: 3px solid #34d399; }
.contact-note-err { border-left: 3px solid var(--pulse); }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--smoke);
    padding-block: 2rem 3rem;
    color: var(--fog);
    font-size: .8125rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}
.site-footer a { color: var(--mist); }
.site-footer a:hover { color: var(--ivory); }

/* ---------- Generic content fallback ---------- */
.page-content { padding-block: 2rem 4rem; max-width: 70ch; }
.page-content h1 { font-weight: 800; letter-spacing: -.02em; }
.page-content a { color: var(--pulse); }
