/*
Theme Name: MaxList
Theme URI: https://maxlist.ch/
Author: MaxList
Description: Fast, mobile-first directory theme for MaxList.
Version: 0.9.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: maxlist
*/

:root {
    --ml-ink: #171722;
    --ml-muted: #686879;
    --ml-line: #e6e5ec;
    --ml-soft: #f7f6fa;
    --ml-white: #fff;
    --ml-accent: #6d34df;
    --ml-accent-dark: #4d20b5;
    --ml-featured: #fff7d6;
    --ml-radius: 15px;
    --ml-shadow: 0 10px 35px rgba(32, 22, 60, .08);
    --ml-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ml-ink);
    background: var(--ml-soft);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.55;
}
img { display: block; max-width: 100%; }
a { color: var(--ml-accent-dark); }
button, input { font: inherit; }
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.ml-shell { width: min(calc(100% - 40px), var(--ml-width)); margin-inline: auto; }
.ml-site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--ml-line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.ml-header__inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.ml-brand { display: block; flex: 0 0 auto; text-decoration: none; }
.ml-brand img { width: 165px; height: auto; }
.ml-nav { display: flex; align-items: center; gap: 18px; }
.ml-nav a { color: var(--ml-ink); font-weight: 700; text-decoration: none; }
.ml-nav a:hover { color: var(--ml-accent); }
.ml-nav__post { padding: 10px 17px; border-radius: 999px; color: #fff !important; background: var(--ml-accent); }

.ml-site-main { min-height: 70vh; }
.ml-directory, .ml-listing, .ml-home, .ml-gone { width: min(calc(100% - 40px), var(--ml-width)); margin: 0 auto; }
.ml-directory { padding: 46px 0 76px; }
.ml-directory__heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 480px); align-items: end; gap: 44px; }
.ml-eyebrow { margin: 0 0 4px; color: var(--ml-accent); font-size: 13px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
.ml-directory h1 { margin: 0; font-size: clamp(34px, 4vw, 54px); }
.ml-search { display: flex; padding: 5px; border: 1px solid var(--ml-line); border-radius: 13px; background: var(--ml-white); box-shadow: var(--ml-shadow); }
.ml-search input { width: 100%; min-width: 0; border: 0; padding: 11px 12px; outline: 0; background: transparent; }
.ml-search button, .ml-button { border: 0; border-radius: 10px; padding: 11px 18px; color: #fff; background: var(--ml-accent); font-weight: 800; cursor: pointer; text-decoration: none; }
.ml-search button:hover, .ml-button:hover { background: var(--ml-accent-dark); }

.ml-city-links { display: flex; flex-wrap: wrap; gap: 9px; margin: 28px 0 40px; padding: 3px 0 12px; }
.ml-city-links a { flex: 0 0 auto; padding: 8px 13px; border: 1px solid var(--ml-line); border-radius: 999px; color: var(--ml-ink); background: var(--ml-white); font-size: 14px; font-weight: 750; text-decoration: none; }
.ml-city-links a:hover, .ml-city-links a.is-active { border-color: var(--ml-accent); color: #fff; background: var(--ml-accent); }

.ml-section { margin-top: 38px; }
.ml-section__title { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 15px; }
.ml-section__title h2 { margin: 0; font-size: 25px; }
.ml-section__title span { color: var(--ml-muted); font-size: 14px; font-weight: 700; }
.ml-featured-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.ml-regular-list { display: grid; gap: 14px; }

.ml-card { position: relative; overflow: hidden; border: 1px solid var(--ml-line); border-radius: var(--ml-radius); background: var(--ml-white); box-shadow: 0 3px 15px rgba(34, 25, 53, .04); transition: transform .18s ease, box-shadow .18s ease; }
.ml-card:hover { transform: translateY(-2px); box-shadow: var(--ml-shadow); }
.ml-card__link { position: absolute; inset: 0; z-index: 5; }
.ml-card__media { position: relative; overflow: hidden; background: #e9e7ef; }
.ml-card__image { width: 100%; height: 100%; object-fit: cover; }
.ml-card__placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: #9b98aa; font-weight: 900; }
.ml-card__badge { position: absolute; top: 10px; left: 10px; padding: 5px 9px; border-radius: 999px; color: #513500; background: #ffd86c; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.ml-card__body { padding: 15px 17px; }
.ml-card h3 { margin: 0 0 6px; font-size: 20px; }
.ml-card__meta { margin: 0; color: var(--ml-muted); font-size: 14px; font-weight: 700; }
.ml-card--featured { background: linear-gradient(180deg, var(--ml-featured), #fff 42%); }
.ml-card--featured .ml-card__media { aspect-ratio: 4 / 5; }
.ml-card--featured h3 { font-size: 18px; }
.ml-card--regular { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 190px; }
.ml-card--regular .ml-card__media { min-height: 190px; }
.ml-card--regular .ml-card__body { display: flex; flex-direction: column; justify-content: center; padding: 22px 27px; }
.ml-card--regular h3 { font-size: 24px; }
.ml-card__description { margin: 10px 0; color: #3f3e4a; }
.ml-card time { color: var(--ml-muted); font-size: 13px; font-weight: 700; }
.ml-empty { padding: 35px; border: 1px dashed #c8c5d2; border-radius: var(--ml-radius); text-align: center; }

.page-numbers { display: flex; gap: 7px; padding: 0; list-style: none; }
.page-numbers a, .page-numbers span { display: grid; min-width: 38px; height: 38px; place-items: center; border: 1px solid var(--ml-line); border-radius: 9px; background: #fff; text-decoration: none; }
.page-numbers .current { color: #fff; background: var(--ml-accent); }

.ml-listing { padding: 34px 0 80px; }
.ml-breadcrumbs { display: flex; gap: 9px; margin-bottom: 25px; color: var(--ml-muted); font-size: 14px; }
.ml-breadcrumbs a { color: var(--ml-muted); }
.ml-listing__header { max-width: 860px; margin-bottom: 24px; }
.ml-listing__header h1 { margin: 0; font-size: clamp(34px, 5vw, 60px); }
.ml-listing__title-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.ml-listing__edit { flex: 0 0 auto; }
.ml-listing__categories { margin: 10px 0 0; color: var(--ml-muted); font-weight: 750; }
.ml-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 190px; gap: 8px; overflow: hidden; border-radius: 18px; background: #dedce5; }
.ml-gallery__item { overflow: hidden; background: #ddd; }
.ml-gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.ml-gallery__item:hover img { transform: scale(1.025); }
.ml-gallery__item.is-primary { grid-column: span 2; grid-row: span 2; }
.ml-lightbox-open { overflow: hidden; }
.ml-lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-columns: minmax(52px, 90px) minmax(0, 1fr) minmax(52px, 90px); align-items: center; padding: 70px 16px 28px; background: rgba(10, 8, 15, .94); }
.ml-lightbox[hidden] { display: none; }
.ml-lightbox__figure { display: grid; place-items: center; max-width: 1200px; max-height: calc(100vh - 100px); margin: auto; }
.ml-lightbox__image { max-width: 100%; max-height: calc(100vh - 135px); object-fit: contain; }
.ml-lightbox__count { margin-top: 10px; color: #fff; font-size: 14px; font-weight: 750; }
.ml-lightbox__close, .ml-lightbox__previous, .ml-lightbox__next { border: 0; color: #fff; background: transparent; cursor: pointer; }
.ml-lightbox__close { position: absolute; top: 18px; right: 20px; padding: 10px 13px; border: 1px solid rgba(255,255,255,.45); border-radius: 8px; font-size: 16px; font-weight: 800; }
.ml-lightbox__previous, .ml-lightbox__next { min-width: 52px; min-height: 70px; font-size: 55px; line-height: 1; }
.ml-lightbox__previous:disabled, .ml-lightbox__next:disabled { visibility: hidden; }
.ml-listing__layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 38px; margin-top: 36px; }
.ml-listing__main { padding: 31px; border: 1px solid var(--ml-line); border-radius: var(--ml-radius); background: #fff; }
.ml-description > :first-child { margin-top: 0; }
.ml-description > :last-child { margin-bottom: 0; }
.ml-contact { position: sticky; top: 105px; display: grid; gap: 11px; padding: 24px; border: 1px solid var(--ml-line); border-radius: var(--ml-radius); background: #fff; box-shadow: var(--ml-shadow); }
.ml-contact h2 { margin: 0 0 4px; }
.ml-contact > a { display: block; padding: 12px 14px; border: 1px solid var(--ml-line); border-radius: 9px; font-weight: 800; text-align: center; text-decoration: none; }
.ml-contact > a.ml-contact__primary { border-color: var(--ml-accent); color: #fff; background: var(--ml-accent); font-size: 19px; }
.ml-contact dl { margin: 8px 0 0; border-top: 1px solid var(--ml-line); }
.ml-contact dl div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 0; border-bottom: 1px solid var(--ml-line); }
.ml-contact dt { color: var(--ml-muted); }
.ml-contact dd { margin: 0; font-weight: 750; text-align: right; }
.ml-therapeutic-warning { margin: 5px 0 0; padding: 12px; border-radius: 9px; color: #654900; background: #fff1bd; font-size: 13px; font-weight: 700; }

.ml-modal-open { overflow: hidden; }
.ml-exit-modal { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 20px; background: rgba(10, 8, 15, .82); }
.ml-exit-modal[hidden] { display: none; }
.ml-exit-modal__panel { position: relative; width: min(100%, 590px); max-height: calc(100vh - 40px); overflow-y: auto; padding: 32px; border-radius: 18px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.ml-exit-modal__panel h2 { margin: 2px 40px 10px 0; font-size: 32px; }
.ml-exit-modal__panel > p:not(.ml-eyebrow) { color: var(--ml-muted); }
.ml-exit-modal__close { position: absolute; top: 15px; right: 16px; width: 38px; height: 38px; border: 1px solid var(--ml-line); border-radius: 50%; color: var(--ml-ink); background: #fff; font-size: 27px; line-height: 1; cursor: pointer; }
.ml-exit-modal__ad { display: grid; min-height: 100px; margin: 23px 0; padding: 13px; place-items: center; border: 1px dashed #c8c5d2; border-radius: 11px; text-align: center; }
.ml-exit-modal__ad:empty::before { content: "Advertisement space"; color: #92909c; font-size: 13px; font-weight: 700; }
.ml-exit-modal__ad img { max-height: 180px; margin: auto; object-fit: contain; }
.ml-exit-modal__ad p { margin: 0; }
.ml-exit-modal__actions { display: flex; justify-content: flex-end; gap: 10px; }
.ml-exit-modal__cancel { padding: 11px 16px; border: 1px solid var(--ml-line); border-radius: 10px; color: var(--ml-ink); background: #fff; font-weight: 800; cursor: pointer; }

.ml-home { padding: 72px 0 90px; }
.ml-home__hero { display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: 60px; padding: 56px; border-radius: 24px; color: #fff; background: linear-gradient(135deg, #17141f, #3d1d73 70%, #6d34df); }
.ml-home__hero h1 { margin: 5px 0 17px; font-size: clamp(42px, 6vw, 72px); }
.ml-home__hero p { max-width: 650px; margin: 0; color: #e7dff8; font-size: 20px; }
.ml-home__mark { display: grid; aspect-ratio: 1; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(255,255,255,.08); }
.ml-home__mark img { width: 58%; height: 58%; object-fit: contain; }
.ml-home__categories { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 25px; }
.ml-category-tile { min-height: 220px; padding: 30px; border: 1px solid var(--ml-line); border-radius: 19px; color: var(--ml-ink); background: #fff; box-shadow: var(--ml-shadow); text-decoration: none; }
.ml-category-tile span { color: var(--ml-accent); font-weight: 850; }
.ml-category-tile h2 { margin: 35px 0 8px; font-size: 34px; }
.ml-category-tile p { margin: 0; color: var(--ml-muted); }
.ml-gone { padding: 100px 0; text-align: center; }
.ml-gone h1 { margin: 0; font-size: clamp(40px, 6vw, 70px); }
.ml-gone p:not(.ml-eyebrow) { margin: 16px auto 28px; color: var(--ml-muted); }

.ml-account { width: min(calc(100% - 40px), 920px); min-height: 65vh; margin: 0 auto; padding: 55px 0 85px; }
.ml-account--narrow { max-width: 520px; }
.ml-account h1 { margin: 0 0 28px; font-size: clamp(38px, 5vw, 58px); }
.ml-account__heading { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 28px; }
.ml-account__heading h1 { margin-bottom: 0; }
.ml-account form:not(.ml-listing-form) { display: grid; gap: 14px; padding: 26px; border: 1px solid var(--ml-line); border-radius: var(--ml-radius); background: #fff; }
.ml-account form:not(.ml-listing-form) p { margin: 0; }
.ml-account form:not(.ml-listing-form) label { display: block; font-weight: 750; }
.ml-account form:not(.ml-listing-form) input[type="text"], .ml-account form:not(.ml-listing-form) input[type="password"] { width: 100%; padding: 12px; border: 1px solid #c9c6d2; border-radius: 9px; }
.ml-listing-form { display: grid; gap: 20px; }
.ml-listing-form [hidden] { display: none !important; }
.ml-listing-form fieldset { display: grid; gap: 17px; margin: 0; padding: 25px; border: 1px solid var(--ml-line); border-radius: var(--ml-radius); background: #fff; }
.ml-listing-form legend { padding: 0 8px; font-size: 22px; font-weight: 850; letter-spacing: -.025em; }
.ml-listing-form label { display: grid; gap: 6px; font-weight: 750; }
.ml-listing-form input:not([type="checkbox"]), .ml-listing-form select, .ml-listing-form textarea { width: 100%; padding: 12px 13px; border: 1px solid #c9c6d2; border-radius: 9px; color: var(--ml-ink); background: #fff; }
.ml-listing-form input:user-invalid, .ml-listing-form select:user-invalid, .ml-listing-form textarea:user-invalid, .ml-listing-form .is-invalid { border: 2px solid #c51e1e !important; background: #fff5f5 !important; box-shadow: 0 0 0 3px rgba(197,30,30,.12); }
.ml-listing-form textarea { resize: vertical; }
.ml-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ml-field-label { display: block; margin-bottom: 8px; font-weight: 750; }
.ml-category-choices { padding: 12px 13px; border: 1px solid #c9c6d2; border-radius: 9px; }
.ml-category-choices.is-invalid { border: 2px solid #c51e1e; background: #fff5f5; box-shadow: 0 0 0 3px rgba(197,30,30,.12); }
.ml-checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 15px; margin-bottom: 7px; }
.ml-checkbox-grid label, .ml-checkbox-label { display: flex; grid-template-columns: none; align-items: flex-start; gap: 8px; font-weight: 650; }
.ml-checkbox-grid input, .ml-checkbox-label input { flex: 0 0 auto; margin-top: 5px; }
.ml-confirmations label { grid-template-columns: 22px minmax(0, 1fr); align-items: start; font-weight: 500; }
.ml-confirmations input { margin-top: 5px; }
.ml-form-help { margin: 0; color: var(--ml-muted); font-size: 14px; }
.ml-form-error, .ml-form-notice, .ml-form-success { margin: 0 0 22px; padding: 14px 16px; border-radius: 10px; }
.ml-form-error { color: #7d1717; background: #ffe4e4; }
.ml-form-notice { color: #514a61; background: #eeeaf5; }
.ml-form-success { color: #125b32; background: #dff6e8; }
.ml-account-list { display: grid; gap: 12px; margin-bottom: 25px; }
.ml-account-list article { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px; border: 1px solid var(--ml-line); border-radius: 12px; background: #fff; }
.ml-account-list h2 { margin: 0 0 3px; font-size: 21px; }
.ml-account-list p { margin: 0; color: var(--ml-muted); font-size: 14px; }
.ml-account-list a { font-weight: 800; }
.ml-account-list__actions { display: flex; gap: 14px; }
.ml-invitation-summary { margin: 0 0 20px; padding: 13px 15px; border: 1px solid #d9d2ec; border-radius: 10px; color: #514a61; background: #f2eef9; }
.ml-photo-input { position: absolute; width: 1px !important; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ml-photo-button { display: inline-flex !important; width: fit-content; align-items: center; justify-content: center; padding: 12px 18px; border: 0; border-radius: 10px; color: #fff; background: var(--ml-accent); font-weight: 850 !important; cursor: pointer; }
.ml-photo-button:hover { background: var(--ml-accent-dark); }
.ml-photo-button:disabled { cursor: not-allowed; opacity: .55; }
.ml-photo-clear { width: fit-content; padding: 0; border: 0; color: #8a1f1f; background: transparent; font-weight: 750; text-decoration: underline; cursor: pointer; }
.ml-photo-preview { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ml-photo-preview button { position: relative; overflow: hidden; aspect-ratio: 1; padding: 0; border: 3px solid transparent; border-radius: 10px; background: #e9e7ef; cursor: pointer; }
.ml-photo-preview button.is-primary { border-color: var(--ml-accent); box-shadow: 0 0 0 2px rgba(109,52,223,.2); }
.ml-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.ml-photo-preview span { position: absolute; right: 5px; bottom: 5px; padding: 3px 6px; border-radius: 999px; color: #fff; background: var(--ml-accent); font-size: 10px; font-weight: 900; }
.ml-existing-photos__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ml-existing-photo { overflow: hidden; padding: 7px; border: 1px solid var(--ml-line); border-radius: 10px; background: var(--ml-soft); }
.ml-existing-photo.is-removed { opacity: .48; }
.ml-existing-photo img { width: 100%; aspect-ratio: 1; margin-bottom: 7px; border-radius: 7px; object-fit: cover; }
.ml-existing-photo label { display: flex; align-items: center; grid-template-columns: none; gap: 6px; margin-top: 4px; font-size: 12px; font-weight: 700; }

.ml-site-footer { border-top: 1px solid var(--ml-line); color: var(--ml-muted); background: #fff; }
.ml-footer__inner { display: flex; justify-content: space-between; gap: 25px; padding: 30px 0; font-size: 14px; }
.ml-footer__inner p { margin: 0; }

@media (max-width: 900px) {
    .ml-listing__layout { grid-template-columns: 1fr; }
    .ml-contact { position: static; }
    .ml-gallery { grid-template-columns: repeat(3, 1fr); }
    .ml-home__hero { grid-template-columns: 1fr; }
    .ml-home__mark { display: none; }
}

@media (max-width: 680px) {
    body { font-size: 16px; }
    .ml-shell, .ml-directory, .ml-listing, .ml-home, .ml-gone { width: min(calc(100% - 24px), var(--ml-width)); }
    .ml-header__inner { min-height: 64px; }
    .ml-brand img { width: 137px; }
    .ml-nav a:not(.ml-nav__post) { display: none; }
    .ml-nav__post { padding: 8px 13px; font-size: 14px; }
    .ml-directory { padding-top: 28px; }
    .ml-directory__heading { grid-template-columns: 1fr; gap: 20px; }
    .ml-search button { padding-inline: 13px; }
    .ml-city-links { margin-top: 21px; }
    .ml-featured-grid { gap: 9px; }
    .ml-card--featured .ml-card__body { padding: 11px; }
    .ml-card--featured h3 { font-size: 15px; letter-spacing: -.02em; }
    .ml-card--featured .ml-card__meta { font-size: 12px; }
    .ml-card--regular { grid-template-columns: 112px minmax(0, 1fr); min-height: 150px; }
    .ml-card--regular .ml-card__media { min-height: 150px; }
    .ml-card--regular .ml-card__body { padding: 15px; }
    .ml-card--regular h3 { font-size: 18px; }
    .ml-card__description { display: -webkit-box; overflow: hidden; margin: 7px 0; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; }
    .ml-gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
    .ml-gallery__item.is-primary { grid-column: span 2; }
    .ml-lightbox { grid-template-columns: 44px minmax(0, 1fr) 44px; padding-inline: 4px; }
    .ml-lightbox__previous, .ml-lightbox__next { min-width: 44px; padding: 0; font-size: 44px; }
    .ml-listing__main { padding: 22px; }
    .ml-listing__title-row { align-items: flex-start; flex-direction: column; }
    .ml-listing__layout { gap: 18px; margin-top: 20px; }
    .ml-home { padding-top: 25px; }
    .ml-home__hero { padding: 33px 24px; }
    .ml-home__hero p { font-size: 17px; }
    .ml-home__categories { grid-template-columns: 1fr; }
    .ml-footer__inner { flex-direction: column; }
    .ml-account { width: min(calc(100% - 24px), 920px); padding-top: 32px; }
    .ml-account__heading { align-items: flex-start; flex-direction: column; }
    .ml-account-list article { align-items: flex-start; flex-direction: column; }
    .ml-form-grid { grid-template-columns: 1fr; }
    .ml-checkbox-grid { grid-template-columns: 1fr; }
    .ml-listing-form fieldset { padding: 20px 16px; }
    .ml-photo-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ml-existing-photos__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ml-exit-modal { padding: 12px; }
    .ml-exit-modal__panel { max-height: calc(100vh - 24px); padding: 25px 19px; }
    .ml-exit-modal__actions { align-items: stretch; flex-direction: column-reverse; }
    .ml-exit-modal__actions > * { text-align: center; }
}
