/* ==========================================================================
   Review V2 — modern, maintainable rebuild of the review cards.

   Same visual identity as the legacy `.entry-wrapper` cards:
   floating avatar, colored header, white card, rating stars, institution
   name, quoted italic text, soft shadow, rounded corners, hover lift.

   Rebuilt with clean HTML + modern CSS (Flexbox + Grid):
   - ticker cards use a fixed equal height so columns stay aligned
   - one component that works on Home / Kommuner / Sygehuse / Skat
     with no page-specific CSS
   ========================================================================== */

.review-v2 {
    font-family: 'Open Sans', sans-serif;
    margin-bottom: 40px;
    padding-top: 40px;
}

.review-v2__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

/* -- Section title ------------------------------------------------------- */

.review-v2__title {
    margin: 0 0 32px;
    text-align: center;
    text-transform: uppercase;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .5px;
    line-height: 1.2;
}

.review-v2__title span {
    display: inline-block;
    padding: 9px 28px;
    border-radius: 8px;
    background: #26a7c4;
    color: #443a37;
    box-shadow: 0 6px 16px rgba(38, 167, 196, .25);
}

/* -- Grid: 1 column on mobile, exactly 2 from tablet up (never 3) -------- */

.review-v2__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
    align-items: stretch;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .review-v2__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* ==========================================================================
   Ticker variant (home page): two columns, cards scroll one-by-one.
   Left column scrolls first, right column follows with a stagger.
   Uses CSS transform transition + minimal vanilla JS to cycle cards.
   ========================================================================== */

.review-v2__ticker {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.review-v2__ticker-col {
    overflow: hidden;
    padding: 15px;
    margin: -15px;
}

.review-v2__ticker-track {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.review-v2__ticker-track .review-v2__card {
    flex-shrink: 0;
    /* Equal card height so columns line up while scrolling (like legacy ticker). */
    height: 276px;
}

/* Clamp name + body so every ticker card stays the same height. */
.review-v2__ticker .review-v2__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    max-width: 100%;
}

.review-v2__ticker .review-v2__content {
    flex: 1 1 auto;
    min-height: 0;
    /* Matches legacy ticker .sub fixed area (3 lines of text + quotes/padding). */
    overflow: hidden;
    padding-bottom: 18px;
}

.review-v2__ticker .review-v2__quote {
    flex-shrink: 0;
}

.review-v2__ticker .review-v2__text {
    /* Lock to exactly 3 lines — matches legacy portal display limit. */
    flex: 0 0 auto;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    white-space: normal;
    height: calc(1.7em * 3);
    max-height: calc(1.7em * 3);
    min-height: calc(1.7em * 3);
    line-height: 1.7;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.review-v2__ticker .review-v2__quote--close {
    margin-top: auto;
}

@media (max-width: 929px) and (min-width: 768px) {
    .review-v2__ticker-track .review-v2__card {
        height: 296px;
    }
}

@media (max-width: 767px) {
    .review-v2__ticker-track .review-v2__card {
        height: 296px;
    }
}

@media (max-width: 414px) {
    .review-v2__ticker-track .review-v2__card {
        height: 316px;
    }
}

@media (max-width: 767px) {
    .review-v2__ticker {
        grid-template-columns: 1fr;
    }
    .review-v2__ticker-col:last-child {
        display: none;
    }
}

/* -- Card ---------------------------------------------------------------- */

.review-v2__card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(31, 45, 61, .10);
    cursor: pointer;
    transition: transform .3s ease, box-shadow .3s ease;
}

.review-v2__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(31, 45, 61, .16);
}

.review-v2__card:focus-visible {
    outline: 3px solid #345a8b;
    outline-offset: 2px;
}

/* -- Colored header ------------------------------------------------------ */

.review-v2__header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-height: 68px;
    /* left space reserved for the floating avatar (20 + 72 + 12 gap) */
    padding: 12px 20px 12px 104px;
    color: #ffffff;
}

/* Brand color variants (match the existing kommune / sygehus / skat palette) */
.review-v2__card--county   .review-v2__header { background: #34598b; }
.review-v2__card--hospital .review-v2__header { background: #e04c5a; }
.review-v2__card--tax       .review-v2__header { background: #c6b349; }

/* -- Floating avatar ----------------------------------------------------- */

.review-v2__avatar {
    position: absolute;
    left: 20px;
    bottom: 0;
    /* centered on the header / body seam, fully inside the card */
    transform: translateY(50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    background: #e5e7eb;
    border: 3px solid #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
    z-index: 2;
}

/* -- Header meta (stars + name) ------------------------------------------ */

.review-v2__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 0;
    text-align: right;
}

.review-v2__stars {
    display: flex;
}

.review-v2__stars .ranking {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 0;
}

.review-v2__stars .ranking span {
    display: inline-flex;
}

.review-v2__stars .ranking img {
    display: block;
    height: 22px;
    width: auto;
}

.review-v2__name {
    margin: 0;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.25;
    color: #ffffff;
    overflow-wrap: anywhere;
}

.review-v2__name a {
    color: #ffffff;
}

/* -- Review content ------------------------------------------------------ */

.review-v2__content {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    /* top padding clears the avatar that overlaps the seam */
    padding: 42px 24px 22px;
    color: #3f3f46;
    font-size: .95rem;
    font-style: italic;
    line-height: 1.7;
}

.review-v2__quote {
    color: #c3c9d2;
    font-style: normal;
    font-size: 26px;
    flex: 0 0 auto;
}

.review-v2__quote--open {
    margin-bottom: 6px;
}

.review-v2__text {
    margin: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

.review-v2__quote--close {
    align-self: flex-end;
    margin-top: 10px;
}

/* -- Small phones: a touch tighter --------------------------------------- */

@media (max-width: 480px) {
    .review-v2__container {
        padding: 0 16px;
    }

    .review-v2__content {
        padding: 40px 18px 20px;
    }
}

/* ==========================================================================
   Triple-column grid variant (compact institution page: /Aalborg-Kommune etc.)
   3 cols desktop / 2 cols tablet / 1 col mobile
   ========================================================================== */

.review-v2__grid--triple {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 600px) {
    .review-v2__grid--triple {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .review-v2__grid--triple {
        grid-template-columns: repeat(3, 1fr);
        gap: 26px;
    }
}

/* ==========================================================================
   Full-review variant (institution show page: /vis/)
   Single-column grid, card shows ALL data: author, dates, title, full text,
   like/report actions.
   ========================================================================== */

/* Single-column grid for the show page */
.review-v2__grid--single {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

/* Full card: horizontal layout on desktop (author sidebar + content) */
.review-v2__card--full .review-v2__body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

/* -- Author sidebar ------------------------------------------------------ */

.review-v2__author {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 48px 20px 24px;
    min-width: 140px;
    max-width: 160px;
    text-align: center;
    border-right: 1px solid #eef0f3;
    background: #fafbfc;
    font-size: .85rem;
    color: #6b7280;
}

.review-v2__author-name {
    font-weight: 700;
    font-size: 1rem;
    color: #1f2937;
    line-height: 1.3;
}

.review-v2__author-city {
    font-size: .88rem;
    color: #4b5563;
    font-style: italic;
}

.review-v2__author-count {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
    font-size: .82rem;
    color: #6b7280;
    line-height: 1.4;
}

.review-v2__author-count strong {
    display: block;
    font-size: 1.1rem;
    color: #1f2937;
    margin-top: 2px;
}

/* -- Content area (full variant) ----------------------------------------- */

.review-v2__content--full {
    flex: 1 1 auto;
    padding: 24px 24px 16px;
    font-style: normal;
}

/* Dates row */
.review-v2__dates {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
    font-size: .82rem;
    color: #6b7280;
    text-align: right;
    margin-left: auto;
}

/* Review title */
.review-v2__review-title {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: #1f2937;
}

/* Full text (no truncation) */
.review-v2__text--full {
    margin: 0;
    font-size: .95rem;
    line-height: 1.7;
    color: #3f3f46;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* -- Actions row (like + report / edit + delete) ------------------------- */

.review-v2__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px 16px;
    border-top: 1px solid #eef0f3;
    background: #fafbfc;
    position: relative;
    z-index: 2;
}

.review-v2__actions--profile {
    justify-content: flex-end;
}

.review-v2__icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 9px 14px;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: #fff;
    color: #345a8b;
    font-size: .88rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background .2s, border-color .2s, color .2s, box-shadow .2s, transform .15s;
}

.review-v2__icon-btn i {
    font-size: 1rem;
    line-height: 1;
}

.review-v2__icon-btn:hover {
    background: #eef3f9;
    border-color: #b7c7dc;
    color: #2a4a75;
    box-shadow: 0 4px 10px rgba(52, 90, 139, 0.12);
    transform: translateY(-1px);
}

.review-v2__icon-btn--like .review-v2__likes-count {
    min-width: 1.25em;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef3f9;
    color: #1f2937;
    font-size: .8rem;
    font-weight: 700;
}

.review-v2__icon-btn--report {
    color: #9a3412;
    border-color: #f1d5c8;
}

.review-v2__icon-btn--report:hover {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

/* -- Share (Del) — no Facebook SDK -------------------------------------- */

.review-v2__share {
    position: relative;
    display: inline-flex;
}

.review-v2__icon-btn--share {
    color: #1f4e79;
    border-color: #c5d4e8;
}

.review-v2__icon-btn--share:hover,
.review-v2__share.is-open .review-v2__icon-btn--share {
    background: #eef3f9;
    border-color: #9eb6d4;
    color: #163a5c;
}

.review-v2__share-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 40;
    box-sizing: border-box;
    min-width: 200px;
    max-width: calc(100% - 8px);
    padding: 8px 12px 12px;
    border: 1px solid #d8e0ea;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.review-v2__share-menu-head {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 28px;
    margin: 0 0 4px;
}

.review-v2__share-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #345a8b;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.review-v2__share-close:hover {
    background: #eef3f9;
    color: #163a5c;
}

.review-v2__share-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0 0 8px;
    padding: 10px 14px;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: #fff;
    color: #243447;
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.review-v2__share-item:last-child {
    margin-bottom: 0;
}

.review-v2__share-item i {
    width: 1.1em;
    text-align: center;
    font-size: 1rem;
}

.review-v2__share-item--facebook {
    color: #1877f2;
    border-color: #b7d0f5;
}

.review-v2__share-item--facebook:hover {
    background: #f0f6ff;
    border-color: #1877f2;
    color: #0f5fcc;
    text-decoration: none;
}

.review-v2__share-item--copy:hover {
    background: #eef3f9;
    border-color: #9eb6d4;
    color: #163a5c;
}

.review-v2__share-item--copy.is-copied {
    border-color: #86b7a0;
    background: #f0faf4;
    color: #1f6b45;
}

.review-v2__card--shared-focus {
    box-shadow: 0 0 0 3px rgba(38, 167, 196, 0.35);
    transition: box-shadow .4s ease;
}

.review-v2__action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 118px;
    padding: 10px 18px;
    border: 1px solid #c5d4e8;
    border-radius: 10px;
    background: #fff;
    color: #345a8b;
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: background .2s, border-color .2s, color .2s, box-shadow .2s, transform .15s;
}

.review-v2__action-btn i {
    /* Beat legacy Site.css .fa-trash-o { color: #0ca7c6 !important } */
    color: inherit !important;
    font-size: 1rem;
    line-height: 1;
    width: 1.1em;
    text-align: center;
}

.review-v2__action-btn:hover {
    background: #eef3f9;
    border-color: #345a8b;
    color: #2a4a75;
    box-shadow: 0 4px 12px rgba(52, 90, 139, 0.14);
    transform: translateY(-1px);
}

.review-v2__action-btn--danger {
    color: #b42318;
    border-color: #f0c7c2;
    background: #fff;
}

.review-v2__action-btn--danger:hover {
    background: #fef3f2;
    border-color: #f04438;
    color: #912018;
    box-shadow: 0 4px 12px rgba(180, 35, 24, 0.12);
}

.review-v2__rejected {
    font-weight: 700;
    font-size: .85rem;
}

/* -- Mobile: stack author above content ---------------------------------- */

@media (max-width: 600px) {
    .review-v2__card--full .review-v2__body {
        flex-direction: column;
    }

    .review-v2__author {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        max-width: none;
        min-width: 0;
        padding: 44px 16px 12px;
        border-right: none;
        border-bottom: 1px solid #eef0f3;
        gap: 4px 12px;
    }

    .review-v2__author-count {
        border-top: none;
        margin-top: 0;
        padding-top: 0;
    }

    .review-v2__author-count strong {
        display: inline;
        font-size: inherit;
    }

    .review-v2__content--full {
        padding: 16px 18px 12px;
    }

    .review-v2__actions {
        padding: 12px 18px 14px;
        gap: 10px;
    }

    .review-v2__action-btn,
    .review-v2__icon-btn {
        min-width: 0;
        flex: 1 1 auto;
        justify-content: center;
    }

    .review-v2__share {
        flex: 1 1 auto;
        min-width: 0;
        /* Position menu against the full actions row (stays inside card) */
        position: static;
    }

    .review-v2__share .review-v2__icon-btn {
        width: 100%;
    }

    /* Keep menu fully inside the card — no overflow:visible needed */
    .review-v2__share-menu {
        left: 10px;
        right: 10px;
        width: auto;
        min-width: 0;
        max-width: none;
        transform: none;
    }
}
