:root {
    --rhm-green: #154721;
    --rhm-green-dark: #0f3519;
    --rhm-red: #c51f2f;
    --rhm-bg: #f6f3ed;
    --rhm-card: #ffffff;
    --rhm-border: rgba(22, 45, 29, .12);
    --rhm-text: #1f251f;
    --rhm-muted: #657064;
    --rhm-radius: 22px;
    --rhm-control-radius: 16px;
    --rhm-shadow: 0 12px 35px rgba(20, 35, 24, .08);
}

/* Match the newer Ribe Handel / WoodMart visual direction. */
body.single-medlem,
body.post-type-archive-medlem {
    background: var(--rhm-bg);
}

body.single-medlem .main-page-wrapper,
body.post-type-archive-medlem .main-page-wrapper,
body.single-medlem .site-content,
body.post-type-archive-medlem .site-content,
body.single-medlem .website-wrapper,
body.post-type-archive-medlem .website-wrapper,
body:has(.rhm-wrap) .main-page-wrapper,
body:has(.rhm-wrap) .site-content {
    background: var(--rhm-bg);
}

.rhm-wrap {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 28px 0 36px;
    color: var(--rhm-text);
    box-sizing: border-box;
}

.rhm-page-header {
    margin: 0 0 24px;
}

.rhm-page-header h1,
.rhm-hero h1,
.rhm-panel h2 {
    color: var(--rhm-green);
    line-height: 1.1;
    margin: 0 0 12px;
}

.rhm-page-header h1 {
    font-size: clamp(34px, 4vw, 52px);
}

.rhm-page-header p {
    margin: 0;
    color: var(--rhm-muted);
    font-size: 18px;
}

.rhm-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 26px;
    align-items: center;
    background: var(--rhm-card);
    border: 1px solid var(--rhm-border);
    border-radius: var(--rhm-radius);
    padding: 18px;
    box-shadow: var(--rhm-shadow);
    margin-bottom: 20px;
}

.rhm-filter__field {
    min-width: 0;
    box-sizing: border-box;
}

.rhm-filter__search {
    flex: 1 1 420px;
    max-width: 520px;
    min-width: 320px;
    margin-right: 0;
}

.rhm-filter__field:not(.rhm-filter__search) {
    flex: 0 1 280px;
    max-width: 280px;
    min-width: 240px;
}

.rhm-filter input[type="search"],
.rhm-filter select,
.rhm-filter .select2-container--default .select2-selection--single {
    width: 100%;
    border: 1px solid var(--rhm-border) !important;
    border-radius: var(--rhm-control-radius) !important;
    min-height: 52px;
    height: 52px;
    padding: 0 16px;
    color: var(--rhm-text);
    box-shadow: none !important;
    outline: none;
    box-sizing: border-box;
}

.rhm-filter .select2-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

.rhm-filter input[type="search"] {
    background: #fff !important;
}

.rhm-filter select,
.rhm-filter .select2-container--default .select2-selection--single {
    background-color: var(--rhm-bg) !important;
}

.rhm-filter .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 52px;
    padding-left: 0;
    color: var(--rhm-text);
}

.rhm-filter .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 52px;
    right: 12px;
}

.rhm-filter__checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    color: var(--rhm-text);
}

.rhm-filter__actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
    flex: 0 0 auto;
}

.rhm-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.rhm-card {
    display: flex;
    flex-direction: column;
    background: var(--rhm-card);
    border: 1px solid var(--rhm-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(20, 35, 24, .06);
    min-width: 0;
}

.rhm-card__image {
    display: block;
    aspect-ratio: 16 / 10;
    background: #ece8de;
    overflow: hidden;
    color: var(--rhm-green);
    text-decoration: none;
}

.rhm-card__img,
.rhm-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.rhm-card:hover .rhm-card__image img {
    transform: scale(1.03);
}

.rhm-card__placeholder,
.rhm-hero__placeholder {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    font-weight: 700;
}

.rhm-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px;
}

.rhm-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.rhm-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #edf3ea;
    color: var(--rhm-green);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
}

.rhm-pill--gift {
    background: #f4efe4;
    color: #61543e;
}

.rhm-card__title {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.25;
}

.rhm-card__title a {
    color: var(--rhm-text);
    text-decoration: none;
}

.rhm-card__title a:hover {
    color: var(--rhm-green);
}

.rhm-card__text,
.rhm-card__address {
    margin: 0 0 12px;
    color: var(--rhm-muted);
    line-height: 1.5;
}

.rhm-card__address {
    font-size: 14px;
}

.rhm-card__actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: auto;
}

.rhm-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    border-radius: 14px;
    padding: 0 18px;
    border: 1px solid var(--rhm-border);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
    text-decoration: none !important;
    cursor: pointer;
}

.rhm-button--primary {
    background: var(--rhm-green) !important;
    color: #fff !important;
    border-color: var(--rhm-green) !important;
}

.rhm-button--primary:hover {
    background: var(--rhm-green-dark) !important;
    border-color: var(--rhm-green-dark) !important;
}

.rhm-button--secondary {
    background: #fff !important;
    color: var(--rhm-green) !important;
}

.rhm-pagination {
    margin-top: 30px;
}

.rhm-pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.rhm-pagination a,
.rhm-pagination span {
    display: inline-flex;
    min-width: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rhm-border);
    border-radius: 8px;
    text-decoration: none;
}

.rhm-pagination .current {
    background: var(--rhm-green);
    color: #fff;
}

.rhm-empty {
    background: #fff;
    border-radius: var(--rhm-radius);
    padding: 32px;
    text-align: center;
    border: 1px solid var(--rhm-border);
}

.rhm-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
    color: var(--rhm-muted);
    font-size: 14px;
}

.rhm-breadcrumb a {
    color: var(--rhm-green);
    text-decoration: none;
}

.rhm-hero {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 24px;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--rhm-border);
    border-radius: var(--rhm-radius);
    padding: 12px;
    box-shadow: var(--rhm-shadow);
    margin-bottom: 20px;
}

.rhm-hero__image {
    border-radius: 16px;
    overflow: hidden;
    background: #ece8de;
}

.rhm-hero__image img {
    width: 100%;
    height: 100%;
    min-height: 330px;
    object-fit: cover;
    display: block;
}

.rhm-hero__content {
    padding: clamp(24px, 4vw, 54px);
    align-self: center;
}

.rhm-hero h1 {
    font-size: clamp(32px, 4vw, 52px);
    margin-top: 12px;
}

.rhm-hero p {
    color: var(--rhm-muted);
    line-height: 1.65;
    font-size: 17px;
}

.rhm-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.rhm-single__layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, .9fr);
    gap: 24px;
    align-items: start;
}

.rhm-panel {
    background: #fff;
    border: 1px solid var(--rhm-border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(20, 35, 24, .05);
    margin-bottom: 20px;
}

.rhm-content {
    color: var(--rhm-text);
    line-height: 1.7;
}

.rhm-services {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.rhm-service {
    border: 1px solid var(--rhm-border);
    border-radius: 14px;
    padding: 18px;
    background: #fff;
}

.rhm-service__icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #edf3ea;
    color: var(--rhm-green);
    font-weight: 800;
    margin-bottom: 10px;
}

.rhm-service h3 {
    margin: 0 0 6px;
    font-size: 17px;
}

.rhm-service p {
    margin: 0;
    color: var(--rhm-muted);
    font-size: 14px;
    line-height: 1.5;
}

.rhm-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.rhm-gallery img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 12px;
}

.rhm-contact-card {
    position: sticky;
    top: 24px;
}

.rhm-contact-card p {
    margin: 0 0 12px;
    line-height: 1.55;
}

.rhm-contact-card a {
    color: var(--rhm-red);
    text-decoration: none;
}

.rhm-contact-card hr {
    border: 0;
    border-top: 1px solid var(--rhm-border);
    margin: 20px 0;
}

.rhm-contact-card h3 {
    margin: 0 0 10px;
    color: var(--rhm-green);
}

.rhm-giftcard {
    font-weight: 800;
    color: var(--rhm-green);
}

.rhm-map {
    display: block;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 14px;
    background: #edf3ea;
    min-height: 180px;
}

.rhm-map iframe {
    display: block;
    width: 100% !important;
    min-height: 220px;
    border: 0;
}

.rhm-map--link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rhm-green);
    font-weight: 800;
    text-decoration: none;
}

.rhm-grid--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rhm-card--compact {
    display: grid;
    grid-template-columns: 110px 1fr;
}

.rhm-card--compact .rhm-card__image {
    aspect-ratio: auto;
    min-height: 100%;
}

.rhm-card--compact .rhm-card__body {
    padding: 12px;
}

.rhm-card--compact .rhm-card__title {
    font-size: 15px;
}

.rhm-card--compact .rhm-pill--gift,
.rhm-card--compact .rhm-card__text {
    display: none;
}

.rhm-card--compact .rhm-card__actions {
    grid-template-columns: 1fr;
}

.rhm-card--compact .rhm-button--secondary {
    display: none;
}


@media (max-width: 1240px) {
    .rhm-wrap {
        width: calc(100% - 32px);
    }
}

@media (max-width: 1180px) {
    .rhm-grid,
    .rhm-grid--compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .rhm-filter__actions {
        margin-left: 0;
    }
}

@media (max-width: 900px) {
    .rhm-grid,
    .rhm-grid--compact,
    .rhm-services,
    .rhm-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rhm-hero,
    .rhm-single__layout {
        grid-template-columns: 1fr;
    }

    .rhm-contact-card {
        position: static;
    }
}

@media (max-width: 640px) {
    .rhm-wrap {
        width: calc(100% - 32px);
        padding: 24px 0 32px;
    }

    .rhm-grid,
    .rhm-grid--compact,
    .rhm-services,
    .rhm-gallery {
        grid-template-columns: 1fr;
    }

    .rhm-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .rhm-filter__search,
    .rhm-filter__field:not(.rhm-filter__search),
    .rhm-filter__actions {
        flex: 1 1 auto;
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .rhm-filter__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .rhm-card--compact {
        grid-template-columns: 1fr;
    }
}


/* Extra overrides for WoodMart/WPBakery form styling so every visible filter element keeps rounded corners. */
.rhm-filter .rhm-filter__search input[type="search"],
.rhm-filter .rhm-filter__field select,
.rhm-filter .select2-container,
.rhm-filter .select2-selection,
.rhm-filter .rhm-button,
.rhm-filter button,
.rhm-filter a.rhm-button {
    border-radius: var(--rhm-control-radius) !important;
}

.rhm-filter .rhm-button--primary,
.rhm-filter button[type="submit"] {
    background-color: var(--rhm-green) !important;
    border-color: var(--rhm-green) !important;
    color: #fff !important;
    opacity: 1 !important;
}

.rhm-filter .rhm-button--secondary {
    background-color: #fff !important;
    border-color: var(--rhm-border) !important;
}

.rhm-filter .rhm-filter__field:not(.rhm-filter__search) select,
.rhm-filter .rhm-filter__field:not(.rhm-filter__search) .select2-selection {
    background-color: var(--rhm-bg) !important;
}

@media (max-width: 1024px) {
    .rhm-filter__search {
        max-width: none;
    }
}

/* 1.1.6: Minimalistiske inline SVG-ikoner i stedet for emoji-ikoner. */
.rhm-icon {
    display: inline-block;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    vertical-align: -0.15em;
}

.rhm-card__address,
.rhm-contact-card p,
.rhm-giftcard,
.rhm-filter__checkbox span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rhm-card__address .rhm-icon,
.rhm-contact-card .rhm-icon,
.rhm-giftcard .rhm-icon,
.rhm-pill--gift .rhm-icon,
.rhm-filter__checkbox .rhm-icon,
.rhm-service__icon .rhm-icon {
    color: #111;
}

.rhm-button .rhm-icon {
    color: currentColor;
    width: 15px;
    height: 15px;
    margin-right: 6px;
}

.rhm-pill--link {
    text-decoration: none !important;
}

.rhm-pill--link:hover {
    background: #e2ecde;
    color: var(--rhm-green);
}

.rhm-pill--area {
    background: #f6f3ed;
    color: #343a34;
}

.rhm-service__icon {
    background: #f6f3ed;
    border: 1px solid var(--rhm-border);
    color: #111;
}

.rhm-contact-card a {
    color: var(--rhm-text);
    font-weight: 700;
}

.rhm-contact-card a:hover {
    color: var(--rhm-green);
}

.rhm-term-description {
    color: var(--rhm-muted);
    font-size: 18px;
    line-height: 1.6;
    max-width: 900px;
}

/* 1.2.2: Vis område pænt på single medlemssider. */
.rhm-hero__terms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.rhm-contact-card__area {
    align-items: center;
}

.rhm-contact-card__area .rhm-pill {
    margin-left: 2px;
}


/* 1.2.4: Logoer vises ikke i frontend. Feltet bevares i admin til senere brug. */
.rhm-card__logo,
.rhm-hero__logo {
    display: none !important;
}

.rhm-related .rhm-grid,
.rhm-related__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rhm-related .rhm-card {
    height: 100%;
}

@media (max-width: 1180px) {
    .rhm-related .rhm-grid,
    .rhm-related__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .rhm-related .rhm-grid,
    .rhm-related__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .rhm-related .rhm-grid,
    .rhm-related__grid {
        grid-template-columns: 1fr;
    }
}


/* 1.2.5: Sociale links på medlemsside */
.rhm-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 14px;
}

.rhm-social-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #111 !important;
    font-weight: 700;
    text-decoration: none !important;
    border: 1px solid var(--rhm-border);
    border-radius: 999px;
    padding: 8px 12px;
    background: #fff;
}

.rhm-social-links a:hover {
    border-color: var(--rhm-green);
    color: var(--rhm-green) !important;
}


/* 1.2.6: Rettelser af import og single-top */
.rhm-hero__actions .rhm-button {
    width: 170px;
    min-width: 170px;
    padding-left: 14px;
    padding-right: 14px;
}

.rhm-hero__socials {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.rhm-hero__socials a {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rhm-border);
    border-radius: 999px;
    background: #fff;
    color: #111 !important;
    text-decoration: none !important;
}

.rhm-hero__socials a:hover {
    color: var(--rhm-green) !important;
    border-color: var(--rhm-green);
}

.rhm-hero__socials .rhm-icon {
    width: 18px;
    height: 18px;
}

.rhm-contact-card .rhm-social-links {
    display: none !important;
}

@media (max-width: 640px) {
    .rhm-hero__actions .rhm-button {
        width: 100%;
        min-width: 0;
    }
}

/* 1.2.7: Ens hero-knapper og lidt pænere linkede badges. */
.rhm-hero__actions a.rhm-button,
.rhm-hero__actions .rhm-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    height: 46px !important;
    min-height: 46px !important;
    line-height: 1 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    vertical-align: middle !important;
}

.rhm-pill--gift.rhm-pill--link {
    color: var(--rhm-green) !important;
}

.rhm-giftcard .rhm-pill {
    display: inline-flex;
}

/* 1.2.8: Endelig ens højde på hero-knapper, også når WoodMart overskriver knapstyling. */
.rhm-single .rhm-hero__actions .rhm-button,
.rhm-single .rhm-hero__actions a.rhm-button,
body.single-medlem .rhm-hero__actions .rhm-button,
body.single-medlem .rhm-hero__actions a.rhm-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 170px !important;
    min-width: 170px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    padding: 0 16px !important;
    line-height: 46px !important;
    box-sizing: border-box !important;
    vertical-align: top !important;
}

.rhm-single .rhm-hero__actions .rhm-button .rhm-icon,
body.single-medlem .rhm-hero__actions .rhm-button .rhm-icon {
    flex: 0 0 15px !important;
}

@media (max-width: 640px) {
    .rhm-single .rhm-hero__actions .rhm-button,
    .rhm-single .rhm-hero__actions a.rhm-button,
    body.single-medlem .rhm-hero__actions .rhm-button,
    body.single-medlem .rhm-hero__actions a.rhm-button {
        width: 100% !important;
        min-width: 0 !important;
    }
}


/* 1.3.1: Gavekort-badge flyttes op på billedet i medlemskort, så titlerne starter samme sted. */
.rhm-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    background: #ece8de;
}

.rhm-card__media .rhm-card__image {
    position: relative;
    z-index: 1;
}

.rhm-card__gift-badge {
    position: absolute;
    z-index: 3;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 24px);
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: var(--rhm-green) !important;
    border: 1px solid rgba(22, 45, 29, .10);
    box-shadow: 0 6px 18px rgba(20, 35, 24, .12);
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    text-decoration: none !important;
    backdrop-filter: blur(6px);
}

.rhm-card__gift-badge:hover {
    background: #fff;
    color: var(--rhm-green-dark) !important;
}

.rhm-card__gift-badge .rhm-icon {
    width: 14px;
    height: 14px;
    color: currentColor;
}

.rhm-card__meta .rhm-pill--gift {
    display: none !important;
}

.rhm-card--compact .rhm-card__media {
    min-height: 100%;
}

.rhm-card--compact .rhm-card__gift-badge {
    display: none;
}
