/**
 * Search Landing Page Styles
 * Used by SearchLanding.cshtml
 */

/* ── Hero Section ── */
.landing-hero {
    background: var(--sam-dark);
    color: #fff;
    padding: 56px 0 48px;
}

/* One content column for every full-width section, so their edges line up at every width. */
.landing-hero .inner,
.cms-section .inner,
.landing-trust .inner,
.notify-section .inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--s-5);
}

.landing-hero h1 {
    font-size: clamp(32px, 5vw, 54px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 14px;
}

.landing-hero h1 em {
    color: var(--sam-red);
    font-style: normal;
}

.landing-hero__kicker {
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 var(--s-2);
}

.landing-hero__count {
    font-size: var(--text-lg);
    color: rgba(255, 255, 255, 0.85);
    margin: calc(-1 * var(--s-2)) 0 var(--s-4);
}

/* Trustpilot score + customer count, reusing the start page's hero row (_hero.css),
   recoloured for the dark hero. */
.landing-hero .hero__trustpilot--top {
    margin-bottom: var(--s-3);
}

.landing-hero .hero__customers {
    color: var(--sam-white);
}

/* Three promises between the headline and the form. */
.landing-hero .hero__trust-row {
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    max-width: none;
    list-style: none;
    padding: 0;
    margin-top: 0;
}

.landing-hero .hero__trust {
    color: var(--sam-white);
    font-size: var(--text-sm);
}

.landing-hero .hero__trust svg {
    color: var(--sam-red);
}

@media (max-width: 640px) {
    .landing-hero .hero__trust-row {
        grid-template-columns: 1fr;
    }
}

/* ── Hero Search Box ── */
.hero-search-box {
    background: var(--sam-white);
    border-radius: var(--radius-xl);
    padding: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.hero-search-box .field {
    flex: 1;
    min-width: 140px;
    margin-bottom: 0;
}

.hero-search-box .field__input-wrap {
    position: relative;
}

.hero-search-box .field__leading-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    width: 16px;
    height: 16px;
    color: var(--sam-medium);
}

.hero-search-box .field__leading-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.hero-search-box .field:has(.field__leading-icon) .field__input {
    padding-left: 38px;
}

.hero-search-box .field__trailing-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    width: 16px;
    height: 16px;
    color: var(--sam-medium);
}

.hero-search-box .field__trailing-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.hero-search-box .field:has(.field__trailing-icon) .field__input {
    padding-right: 38px;
}

/* Chips for room selection */
.hero-search-box .chips {
    display: flex;
    gap: 6px;
}

.hero-search-box .chips button {
    padding: 10px 14px;
    border: 1.5px solid var(--sam-light);
    background: var(--sam-white);
    border-radius: var(--radius-md);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    color: var(--sam-medium);
    transition: all 0.12s;
    min-width: 40px;
}

.hero-search-box .chips button:hover {
    border-color: var(--sam-brown-medium);
    color: var(--text-primary);
}

.hero-search-box .chips button.on {
    background: var(--sam-dark);
    border-color: var(--sam-dark);
    color: #fff;
}

/* Autocomplete dropdown */
.hero-search-box .autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--sam-white);
    border: 1px solid var(--sam-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}

.hero-search-box .autocomplete-dropdown.is-open {
    display: block;
}

.hero-search-box .autocomplete-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--sam-light);
}

.hero-search-box .autocomplete-item:last-child {
    border-bottom: none;
}

.hero-search-box .autocomplete-item:hover {
    background: var(--sam-brown-light);
}

.hero-search-box .autocomplete-item__title {
    font-weight: 600;
    font-size: var(--text-sm);
}

.hero-search-box .autocomplete-item__subtitle {
    font-size: 12px;
    color: var(--sam-medium);
    margin-top: 2px;
}

/* Submit button */
.hero-search-box .btn {
    flex-shrink: 0;
}

/* ── Search Results Section ── */
.search-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 32px 48px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
}

/* ── Results Bar ── */
.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sam-light);
}

.results-bar__summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
}

.result-count {
    font-size: var(--text-sm);
    color: var(--sam-medium);
}

.result-count b {
    color: var(--text-primary);
    font-weight: 700;
}

.results-bar .controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-select {
    padding: 8px 32px 8px 12px;
    border: 1.5px solid var(--sam-light);
    border-radius: var(--radius-md);
    font: inherit;
    font-size: var(--text-sm);
    font-size: max(16px, var(--text-sm)); /* Prevent iOS zoom on focus */
    color: var(--text-primary);
    background-color: var(--sam-white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234F4341' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    opacity: 1; /* iOS can dim elements */
}

/* ── CMS Content Section ── */
.cms-section {
    background: var(--sam-brown-light);
    padding: 48px 0 60px;
}

.cms-section h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 20px;
}

/* ── Area Grid ── */
.area-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 48px;
}

.area-card {
    background: var(--sam-white);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
    transition: background 0.12s, transform 0.12s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.area-card::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--sam-red);
    border-radius: 50%;
    flex-shrink: 0;
}

.area-card:hover {
    background: var(--sam-light);
    transform: translateY(-1px);
}

.area-card__name {
    font-size: var(--text-base);
    font-weight: 700;
    margin: 0;
    min-width: 0;
    overflow-wrap: break-word;
}

.landing-areas__intro {
    font-size: var(--text-base);
    color: var(--sam-brown-dark);
    line-height: 1.65;
    margin: 0 0 var(--s-4);
}

.landing-faq {
    margin-bottom: var(--s-6);
}

.landing-article {
    background: var(--sam-white);
    border-radius: var(--radius-lg);
    padding: var(--s-5);
}

.landing-article h2 {
    font-size: var(--text-lg);
    margin: var(--s-5) 0 var(--s-2);
}

.landing-article h2:first-child {
    margin-top: 0;
}

.landing-article p {
    font-size: var(--text-base);
    color: var(--sam-brown-dark);
    line-height: 1.7;
    margin: 0 0 var(--s-3);
}

/* Read-more links in the article and FAQ answers (same treatment as .cms-content a) */
.landing-article a,
.landing-faq .faq-item__answer a {
    color: var(--sam-red-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 160ms ease;
}

.landing-article a:hover,
.landing-faq .faq-item__answer a:hover {
    color: var(--sam-dark);
}

/* ── Trust section ── */
.landing-trust {
    background: var(--sam-white);
    padding: var(--s-6) 0;
    border-bottom: 1px solid var(--sam-light);
}

.landing-trust__title {
    font-size: var(--text-xl);
    font-weight: 800;
    margin: 0 0 var(--s-3);
}

.landing-trust__intro {
    font-size: var(--text-base);
    color: var(--sam-brown-dark);
    line-height: 1.6;
    margin: 0 0 var(--s-3);
}

.landing-trust__list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--s-4);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-2) var(--s-4);
}

.landing-trust__item {
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
    font-size: var(--text-base);
}

.landing-trust__item svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    color: var(--sam-red);
}

.landing-trust__trustpilot {
    margin-bottom: var(--s-4);
}

.landing-trust__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
}

/* ── City Description (from CMS) ── */
.city-content {
    background: var(--sam-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-top: 40px;
    display: flex;
}

.city-content h2,
.city-content h3 {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 16px;
    color: var(--text-primary);
}

.city-content h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 24px 0 12px;
    color: var(--text-primary);
}

.city-content p {
    font-size: 15px;
    color: var(--sam-brown-dark);
    line-height: 1.75;
    margin: 0 0 16px;
}

.city-content p:last-child {
    margin-bottom: 0;
}

.city-content ul,
.city-content ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.city-content li {
    font-size: 15px;
    color: var(--sam-brown-dark);
    line-height: 1.75;
    margin-bottom: 8px;
}

.city-content a {
    color: var(--color-action);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.city-content a:hover {
    color: var(--color-action-hover);
}

.city-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 16px 0;
}

.city-content strong {
    font-weight: 700;
    color: var(--text-primary);
}

/* CMS content often has div wrappers - clean them up */
.city-content > div {
    margin-bottom: 16px;
}

.city-content > div:last-child {
    margin-bottom: 0;
}

/* Hide CMS headings that duplicate page heading */
.landing-city-heading {
    display: none;
}

/* ── Notify Section ── */
.notify-section {
    background: var(--sam-white);
    padding: 40px 0;
    border-top: 1px solid var(--sam-light);
    border-bottom: 1px solid var(--sam-light);
}

.notify-card {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--sam-brown-light);
    border-radius: var(--radius-xl);
    padding: 28px 32px;
}

.notify-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: var(--sam-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notify-icon svg {
    color: #fff;
}

.notify-content {
    flex: 1;
}

.notify-content h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 6px;
}

.notify-content p {
    font-size: var(--text-sm);
    color: var(--sam-medium);
    margin: 0;
}

/* ── Subscribe Form (inside modal) ── */
#subscribe-form .field {
    margin-bottom: 16px;
}

#subscribe-form .field:last-of-type {
    margin-bottom: 0;
}

/* Areas input */
.areas-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.areas-input-wrap .field__input-wrap {
    position: relative;
}

.areas-input-wrap .field__input {
    padding-right: 38px;
}

.areas-input-wrap .area-loader {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    width: 16px;
    height: 16px;
    color: var(--sam-medium);
}

.areas-input-wrap .area-loader .spinner {
    animation: spin 1s linear infinite;
}

/* Modal overflow fix for dropdowns */
#subscribe-modal .modal__panel {
    overflow: visible;
}

#subscribe-modal .modal__body {
    overflow: visible;
}

.areas-input-wrap .autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--sam-white);
    border: 1px solid var(--sam-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2);
    z-index: 1001;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}

.areas-input-wrap .autocomplete-dropdown.is-open {
    display: block;
}

.areas-input-wrap .autocomplete-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--sam-light);
}

.areas-input-wrap .autocomplete-item:last-child {
    border-bottom: none;
}

.areas-input-wrap .autocomplete-item:hover {
    background: var(--sam-brown-light);
}

.areas-input-wrap .autocomplete-item__title {
    font-weight: 600;
    font-size: var(--text-sm);
}

.areas-input-wrap .autocomplete-item__subtitle {
    font-size: 12px;
    color: var(--sam-medium);
    margin-top: 2px;
}

.areas-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.area-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--sam-brown-light);
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: 600;
}

.area-tag__remove {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--sam-medium);
    padding: 0;
    margin: 0;
}

.area-tag__remove:hover {
    color: var(--sam-red-ink);
}

.btn--full {
    width: 100%;
    justify-content: center;
}

/* Button loader state */
#subscribe-submit-btn {
    position: relative;
    min-height: 48px;
}

#subscribe-submit-btn .btn__loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

#subscribe-submit-btn .spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#subscribe-submit-btn.is-loading .btn__text {
    visibility: hidden;
}

#subscribe-submit-btn.is-loading .btn__loader {
    display: flex !important;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
}

/* Subscribe success state */
.subscribe-success {
    text-align: center;
    padding: 48px 28px;
}

.subscribe-success__icon {
    width: 80px;
    height: 80px;
    background: var(--color-success-bg, #e8f5e9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.subscribe-success__icon svg {
    color: var(--color-success, #4caf50);
}

.subscribe-success__text {
    font-size: var(--text-md);
    font-weight: 600;
    margin: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .landing-hero {
        padding: 40px 0 36px;
    }

    /* 20px, as .search-section below, so the results line up with the sections around them. */
    .landing-hero .inner,
    .cms-section .inner,
    .landing-trust .inner,
    .notify-section .inner {
        padding: 0 20px;
    }

    .hero-search-box {
        flex-direction: column;
    }

    .hero-search-box .field {
        min-width: 100%;
    }

    /* Make search button full width on mobile for consistent alignment */
    .hero-search-box .btn {
        width: 100%;
        justify-content: center;
    }

    .search-section {
        padding: 24px 20px 40px;
    }

    /* Same as the search page: no sorting on a phone. */
    .sort-select {
        display: none;
    }

    .section-header h2 {
        font-size: 20px;
    }

    .area-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .area-card {
        padding: var(--s-3) var(--s-2);
        gap: var(--s-2);
    }

    .area-card__name {
        font-size: var(--text-sm);
    }

    .landing-trust__list {
        grid-template-columns: 1fr;
    }

    .landing-trust__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .results-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-bar .controls {
        width: 100%;
        justify-content: space-between;
    }

    .notify-card {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }
}
