/**
 * Horse Trailers R Us theme styles.
 */

:root {
    --htr-primary: #8a2424;
    --htr-primary-dark: #6b1c1c;
    --htr-secondary: #2c3e50;
    --htr-accent: #007cba;
    --htr-surface: #f6f7f7;
    --htr-text: #1d2327;
    --htr-muted: #646970;
    --htr-border: #dcdcde;
    --htr-radius: 8px;
    --htr-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --htr-container: 720px;
    --htr-wide: 1200px;
    --htr-header-height: 50px;
    --htr-header-panel-radius: 12px;
    --htr-hero-height: min(52vh, 520px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--htr-text);
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
}

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

a {
    color: var(--htr-primary);
}

a:hover,
a:focus {
    color: var(--htr-primary-dark);
}

.htr-container,
.htr-container--wide {
    margin-inline: auto;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.htr-skip-link:focus {
    clip: auto;
    clip-path: none;
    height: auto;
    width: auto;
    margin: 0;
    padding: 0.75rem 1rem;
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 100000;
    background: #fff;
    box-shadow: var(--htr-shadow);
}

/* Header */
.htr-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    padding-inline: var(--htr-gutter);
    background: transparent;
    pointer-events: none;
}

.htr-header__inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: min(100%, var(--htr-wide));
    max-width: 100%;
    margin-inline: auto;
    min-height: var(--htr-header-height);
    padding: 0 1.25rem;
    background: #fff;
    border: 1px solid var(--htr-border);
    border-top: 0;
    border-radius: 0 0 var(--htr-header-panel-radius) var(--htr-header-panel-radius);
    box-shadow: var(--htr-shadow);
    pointer-events: auto;
}

.htr-branding {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.htr-site-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--htr-secondary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(14rem, 40vw);
}

.htr-site-title:hover,
.htr-site-title:focus {
    color: var(--htr-primary);
}

.custom-logo-link {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.custom-logo,
.htr-branding img {
    display: block;
    max-height: 36px;
    width: auto;
}

.htr-navigation {
    margin-left: auto;
}

.htr-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0 1.25rem;
}

.htr-menu a {
    display: inline-block;
    padding: 0;
    color: var(--htr-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    line-height: var(--htr-header-height);
    white-space: nowrap;
}

.htr-menu a:hover,
.htr-menu a:focus,
.htr-menu .current-menu-item > a {
    color: var(--htr-primary);
}

.htr-header__actions {
    flex: 0 0 auto;
}

.htr-nav-toggle {
    display: none;
    margin-left: auto;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--htr-border);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.htr-nav-toggle span,
.htr-nav-toggle span::before,
.htr-nav-toggle span::after {
    display: block;
    width: 1.25rem;
    height: 2px;
    margin: 0 auto;
    background: var(--htr-secondary);
    position: relative;
}

.htr-nav-toggle span::before,
.htr-nav-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
}

.htr-nav-toggle span::before {
    top: -6px;
}

.htr-nav-toggle span::after {
    top: 4px;
}

/* Buttons */
.htr-button {
    display: inline-block;
    padding: 0.65rem 1.1rem;
    border-radius: var(--htr-radius);
    border: 1px solid transparent;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
}

.htr-button--primary {
    background: var(--htr-primary);
    color: #fff;
}

.htr-button--primary:hover,
.htr-button--primary:focus {
    background: var(--htr-primary-dark);
    color: #fff;
}

.htr-button--secondary {
    background: #fff;
    color: var(--htr-secondary);
    border-color: var(--htr-border);
}

.htr-button--secondary:hover,
.htr-button--secondary:focus {
    border-color: var(--htr-secondary);
    color: var(--htr-secondary);
}

.htr-button--compact {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

/* Hero */
.htr-hero {
    position: relative;
    width: 100%;
    height: var(--htr-hero-height);
    min-height: 280px;
    overflow: hidden;
    background: var(--htr-secondary);
}

.htr-hero--carousel .htr-hero__slides {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.htr-hero--map {
    position: relative;
}

.htr-hero__slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.htr-hero__slide.is-active {
    opacity: 1;
}

.htr-hero__slide--placeholder {
    background-image: none;
}

.htr-hero__slide--placeholder-1 {
    background: linear-gradient(135deg, #2c3e50 0%, #4a6741 100%);
}

.htr-hero__slide--placeholder-2 {
    background: linear-gradient(135deg, #6b1c1c 0%, #2c3e50 100%);
}

.htr-hero__slide--placeholder-3 {
    background: linear-gradient(135deg, #1a252f 0%, #8a2424 100%);
}

.htr-hero__map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: var(--htr-surface);
}

.htr-hero__overlay {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.25) 45%, rgba(0, 0, 0, 0.55) 100%);
    color: #fff;
    text-align: center;
    pointer-events: none;
}

.htr-hero__overlay--map {
    align-items: flex-end;
    padding-bottom: 2rem;
}

.htr-hero__caption {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2rem 1.25rem 1.25rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.72) 100%);
    color: #fff;
    text-align: center;
    pointer-events: none;
}

.htr-hero__caption .htr-hero__title,
.htr-hero__caption .htr-hero__text {
    margin-bottom: 0;
}

.htr-hero__caption .htr-hero__text {
    margin-top: 0.35rem;
    font-size: 0.95rem;
}

.htr-hero__overlay a {
    pointer-events: auto;
}

.htr-hero__inner {
    max-width: 42rem;
}

.htr-hero__title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    line-height: 1.15;
    color: #fff;
}

.htr-hero__text {
    margin: 0 auto 1.25rem;
    max-width: 36rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.05rem;
}

.htr-hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.htr-hero__dots {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.htr-hero__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    transition: background 0.3s ease, transform 0.3s ease;
}

.htr-hero__dot.is-active {
    background: #fff;
    transform: scale(1.15);
}

/* Browse directory (component styles; shell in layout.css) */
/* Browse directory component tweaks */
.htr-browse-directory .ht-trailer-directory__search {
    margin-bottom: 0.5rem;
}

.htr-entry__content > *:first-child {
    margin-top: 0;
}

.htr-page-header,
.htr-entry__header {
    margin-bottom: 1.5rem;
}

.htr-page-header__title,
.htr-entry__title {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.2;
    color: var(--htr-secondary);
}

.htr-entry__meta {
    margin: 0.5rem 0 0;
    color: var(--htr-muted);
    font-size: 0.95rem;
}

.htr-entry__thumbnail {
    margin-bottom: 1.5rem;
    border-radius: var(--htr-radius);
    overflow: hidden;
}

/* Footer */
.htr-footer {
    background: var(--htr-surface);
    border-top: 1px solid var(--htr-border);
    padding: 2rem 0;
}

.htr-footer__inner {
    display: grid;
    gap: 1rem;
}

.htr-footer__title {
    margin: 0;
    font-weight: 700;
    color: var(--htr-secondary);
}

.htr-footer__tagline,
.htr-footer__copy {
    margin: 0;
    color: var(--htr-muted);
}

.htr-menu--footer {
    gap: 1rem;
}

/* Plugin block alignment */
.alignwide,
.htr-container--wide .alignwide {
    width: min(100%, var(--htr-wide));
    margin-inline: auto;
}

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.htr-site-content .htr-entry__content {
    padding-top: 0;
}

/* Plugin form styling harmony */
.ht-trailer-directory,
.ht-submit-trailer,
.ht-login-form,
.ht-user-register,
.ht-manage-listings {
    margin-block: 1rem;
}

/* Responsive */
@media (max-width: 900px) {
    .htr-header {
        height: auto;
        min-height: var(--htr-header-height);
    }

    .htr-header__inner {
        flex-wrap: wrap;
        height: auto;
        min-height: var(--htr-header-height);
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }

    .htr-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .htr-navigation {
        order: 4;
        width: 100%;
        display: none;
        margin-left: 0;
    }

    .htr-navigation.is-open {
        display: block;
        padding-bottom: 0.5rem;
    }

    .htr-menu--primary {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .htr-menu--primary a {
        line-height: 1.4;
        padding: 0.5rem 0;
    }

    .htr-header__actions {
        margin-left: 0;
    }

    .htr-hero {
        min-height: 240px;
    }
}

body.admin-bar .htr-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .htr-header {
        top: 46px;
    }
}

@media (max-width: 640px) {
    .htr-header__actions .htr-button {
        padding: 0.55rem 0.85rem;
        font-size: 0.9rem;
    }
}
