/*
 * RG Referenciak es termekek - plugin CSS (ALT-09: a setup.typoscript regisztralja).
 *
 * A szinek CSS-valtozokbol jonnek. A :where(:root) nulla specifitasu, ezert a sitepackage
 * custom.css-e barmilyen betoltesi sorrendben egyszeruen felulirhatja oket, pl.:
 *   :root { --rg-accent: #3347d6; }
 *
 * Nincs !important: igy a mobil media query-k (SP-09) sima szabalyokkal is felulirnak.
 */

:where(:root) {
    --rg-accent: #3347d6;
    --rg-accent-dark: #2735b0;
    --rg-accent-soft: #eef0fc;
    --rg-ink: #0a0f24;
    --rg-text: #1b2340;
    --rg-muted: #5b6585;
    --rg-line: #e4e7f0;
    --rg-tint: #f3f6ff;
    --rg-shot-bg: #eceef6;
    --rg-ok: #15803d;
    --rg-radius: 12px;
    --rg-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Alap: Bootstrap Package globalis margoinak nullazasa (SP-06) ---------- */

.rg-ref,
.rg-prod {
    color: var(--rg-text);
    min-width: 0;
}

.rg-ref :where(h1, h2, h3, p, ul, dl, dd, figure),
.rg-prod :where(h1, h2, h3, p, ul, dl, dd, figure) {
    margin: 0;
    padding: 0;
}

.rg-ref :where(ul),
.rg-prod :where(ul) {
    list-style: none;
}

.rg-ref img,
.rg-prod img {
    max-width: 100%;
}

.rg-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.rg-nowrap {
    white-space: nowrap;
}

/* ---------- Gombok ---------- */

.rg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: 42px;
    padding: 0.45em 1.1em;
    font: inherit;
    font-size: 0.94rem;
    font-weight: 620;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border: 1.5px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rg-btn--primary {
    background: var(--rg-accent);
    border-color: var(--rg-accent);
    color: #fff;
}

.rg-btn--primary:hover,
.rg-btn--primary:focus {
    background: var(--rg-accent-dark);
    border-color: var(--rg-accent-dark);
    color: #fff;
    text-decoration: none;
}

.rg-btn--outline {
    background: #fff;
    border-color: #d5d9e8;
    color: var(--rg-ink);
}

.rg-btn--outline:hover,
.rg-btn--outline:focus {
    border-color: var(--rg-accent);
    color: var(--rg-accent);
    text-decoration: none;
}

.rg-btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--rg-accent);
    padding-left: 0.4em;
    padding-right: 0.4em;
}

.rg-btn--ghost:hover,
.rg-btn--ghost:focus {
    color: var(--rg-accent-dark);
    text-decoration: underline;
}

.rg-btn--disabled,
.rg-btn--disabled:hover {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #d5d9e8;
    color: var(--rg-muted);
}

.rg-stores {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------- Cimkek (chips) ---------- */

.rg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rg-chips li {
    padding: 0.28em 0.75em;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.4;
    color: #4a5578;
    background: #f1f2f9;
    border-radius: 999px;
}

/* ---------- Szuro ---------- */

.rg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.rg-filters__item {
    display: inline-block;
    padding: 0.5em 1.1em;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--rg-text);
    text-decoration: none;
    background: #fff;
    border: 1.5px solid var(--rg-line);
    border-radius: 999px;
}

.rg-filters__item:hover,
.rg-filters__item:focus {
    border-color: var(--rg-accent);
    color: var(--rg-accent-dark);
    text-decoration: none;
}

.rg-filters__item.is-active {
    background: var(--rg-accent-soft);
    border-color: var(--rg-accent);
    color: var(--rg-accent-dark);
}

/* ---------- Referencia-lista ---------- */

.rg-ref-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.rg-ref-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--rg-line);
    border-radius: 14px;
}

.rg-empty {
    padding: 24px;
    color: var(--rg-muted);
    background: var(--rg-tint);
    border-radius: var(--rg-radius);
}

/* Kep-keret: bongeszoablak (weboldal, szoftver) vagy telefon (mobilalkalmazas) */

.rg-shot {
    padding: 20px 20px 0;
    background: var(--rg-shot-bg);
}

.rg-shot__frame {
    overflow: hidden;
    background: #fff;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -2px 20px rgba(11, 18, 38, 0.1);
}

.rg-shot__bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    background: #eef0f7;
    border-bottom: 1px solid var(--rg-line);
}

.rg-shot__bar i {
    display: inline-block;
    width: 9px;
    height: 9px;
    background: #c9cfe2;
    border-radius: 50%;
}

.rg-shot__bar em {
    margin-left: 10px;
    padding: 2px 12px;
    font-family: var(--rg-font-mono);
    font-size: 0.76rem;
    font-style: normal;
    color: var(--rg-muted);
    background: #fff;
    border-radius: 6px;
}

.rg-shot__img {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
    object-position: top center;
}

.rg-shot__placeholder {
    display: grid;
    place-items: center;
    height: 240px;
    color: var(--rg-accent);
    background: var(--rg-tint);
}

.rg-shot__placeholder .rg-icon {
    width: 48px;
    height: 48px;
    stroke-width: 1.5;
}

.rg-shot--mobile_app .rg-shot__frame {
    width: 180px;
    max-width: 70%;
    margin: 0 auto;
    background: var(--rg-ink);
    border: 6px solid var(--rg-ink);
    border-bottom: 0;
    border-radius: 26px 26px 0 0;
}

.rg-shot--mobile_app .rg-shot__notch {
    display: block;
    width: 56px;
    height: 5px;
    margin: 3px auto 6px;
    background: #2b3350;
    border-radius: 4px;
}

.rg-shot--mobile_app .rg-shot__img,
.rg-shot--mobile_app .rg-shot__placeholder {
    height: 260px;
    background-color: #fff;
}

.rg-ref-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 14px;
    padding: 26px 28px 28px;
}

.rg-ref-card__title {
    font-size: 1.15rem;
    font-weight: 740;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--rg-ink);
}

.rg-ref-card__title a {
    color: inherit;
    text-decoration: none;
}

.rg-ref-card__title a:hover,
.rg-ref-card__title a:focus {
    color: var(--rg-accent);
}

.rg-ref-card__teaser {
    color: var(--rg-muted);
    line-height: 1.6;
}

.rg-ref-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-top: auto;
    padding-top: 6px;
}

/* ---------- Reszletes oldal ---------- */

.rg-detail__back {
    margin-bottom: 20px;
    font-size: 0.94rem;
}

.rg-detail__back a {
    color: var(--rg-accent);
    text-decoration: none;
}

.rg-detail__back a:hover,
.rg-detail__back a:focus {
    text-decoration: underline;
}

.rg-detail__header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 36px;
}

.rg-detail__type {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--rg-accent);
}

.rg-detail__title {
    font-size: clamp(1.8rem, 1.2rem + 2vw, 2.7rem);
    font-weight: 760;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: var(--rg-ink);
}

.rg-detail__lead {
    max-width: 62ch;
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--rg-muted);
}

.rg-detail__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    align-items: start;
}

.rg-detail__main {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-width: 0;
}

.rg-gallery {
    display: grid;
    gap: 20px;
}

.rg-gallery__item {
    overflow: hidden;
    background: var(--rg-shot-bg);
    border: 1px solid var(--rg-line);
    border-radius: 14px;
}

.rg-gallery__img {
    display: block;
    width: 100%;
    height: auto;
}

.rg-detail__text {
    line-height: 1.75;
}

.rg-detail__text p,
.rg-detail__text ul,
.rg-detail__text ol {
    margin: 0 0 1em;
}

.rg-detail__text ul {
    padding-left: 1.3em;
    list-style: disc;
}

.rg-detail__text ol {
    padding-left: 1.3em;
}

.rg-detail__side {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    padding: 28px;
    background: var(--rg-tint);
    border: 1px solid var(--rg-line);
    border-radius: 14px;
}

.rg-facts {
    display: grid;
    gap: 16px;
}

.rg-facts dt {
    margin-bottom: 2px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rg-muted);
}

.rg-facts dd {
    font-weight: 600;
    color: var(--rg-ink);
    overflow-wrap: anywhere;
}

/* ---------- Szoftverek (termek-lista) ---------- */

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

.rg-prod-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--rg-line);
    border-radius: var(--rg-radius);
}

.rg-prod-card__tile {
    position: relative;
    display: grid;
    place-items: center;
    height: 104px;
    margin-bottom: 18px;
    color: var(--rg-accent);
    background: #f3f4fa;
    border-radius: 10px;
}

.rg-prod-card__tile .rg-icon {
    width: 44px;
    height: 44px;
    stroke-width: 1.5;
}

.rg-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 0.25em 0.7em;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--rg-muted);
    background: #fff;
    border: 1px solid var(--rg-line);
    border-radius: 6px;
}

.rg-prod-card__title {
    margin-bottom: 0.3em;
    font-size: 1.1rem;
    font-weight: 740;
    line-height: 1.25;
    color: var(--rg-ink);
}

.rg-prod-card__teaser {
    flex: 1;
    margin-bottom: 14px;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--rg-muted);
}

.rg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.rg-meta li {
    padding: 0.22em 0.65em;
    font-family: var(--rg-font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--rg-muted);
    background: #eef1fb;
    border-radius: 6px;
}

.rg-prod-card__foot {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--rg-line);
}

.rg-prod-card__foot > .rg-btn {
    width: 100%;
}

.rg-price {
    line-height: 1.2;
    white-space: nowrap;
}

.rg-price__value,
.rg-price__free {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--rg-ink);
}

.rg-price small {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--rg-muted);
}

.rg-prod__sample-note {
    display: inline-block;
    margin-bottom: 18px;
    padding: 0.3em 0.8em;
    font-size: 0.78rem;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    border-radius: 6px;
}

.rg-prod-card--sample {
    border-style: dashed;
}

.rg-prod__all {
    margin-top: 30px;
    text-align: center;
}

/* ---------- Mobil / reszponziv (SP-09) ---------- */

@media (max-width: 1100px) {
    .rg-prod-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .rg-ref-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .rg-detail__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .rg-ref-card__body {
        padding: 22px 20px 24px;
    }
}

@media (max-width: 600px) {
    .rg-prod-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .rg-shot {
        padding: 14px 14px 0;
    }

    .rg-shot__img,
    .rg-shot__placeholder {
        height: 200px;
    }

    .rg-shot--mobile_app .rg-shot__img,
    .rg-shot--mobile_app .rg-shot__placeholder {
        height: 230px;
    }

    .rg-filters {
        gap: 8px;
    }

    .rg-detail__side {
        padding: 22px 18px;
    }
}

/* ---------- Illesztés a sitepackage-hez (v0.1.2) ----------
   A belső oldalak ".inner-page-content a" szabálya (kék, aláhúzott link)
   erősebb, mint az egyosztályos plugin-szabályok, ezért a gombok szövege
   eltűnt (kék a kéken), a kártyacímek pedig aláhúzottak voltak.
   Itt a plugin gyökérosztályával növeljük a specifitást. */
.rg-ref a.rg-btn,
.rg-prod a.rg-btn {
    text-decoration: none;
}

.rg-ref a.rg-btn--primary,
.rg-prod a.rg-btn--primary,
.rg-ref a.rg-btn--primary:hover,
.rg-prod a.rg-btn--primary:hover,
.rg-ref a.rg-btn--primary:focus,
.rg-prod a.rg-btn--primary:focus {
    color: #fff;
    text-decoration: none;
}

.rg-ref a.rg-btn--outline,
.rg-prod a.rg-btn--outline {
    color: var(--rg-ink);
}

.rg-ref a.rg-btn--outline:hover,
.rg-prod a.rg-btn--outline:hover,
.rg-ref a.rg-btn--outline:focus,
.rg-prod a.rg-btn--outline:focus {
    color: var(--rg-accent);
    text-decoration: none;
}

.rg-ref a.rg-btn--ghost,
.rg-prod a.rg-btn--ghost {
    color: var(--rg-accent);
}

.rg-ref a.rg-btn--ghost:hover,
.rg-prod a.rg-btn--ghost:hover,
.rg-ref a.rg-btn--ghost:focus,
.rg-prod a.rg-btn--ghost:focus {
    color: var(--rg-accent-dark);
    text-decoration: underline;
}

.rg-ref .rg-ref-card__title a {
    color: var(--rg-ink);
    text-decoration: none;
}

.rg-ref .rg-ref-card__title a:hover,
.rg-ref .rg-ref-card__title a:focus {
    color: var(--rg-accent);
    text-decoration: none;
}

/* Hosszú leírás a kártyán legfeljebb 3 sor; a teljes szöveg a részletes oldalon van */
.rg-ref-card__teaser,
.rg-prod-card__teaser {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* ---------- Élő oldal linkje (v0.1.3) ----------
   A "Weboldal" adat a részletek oldalon és a gépnév a kártya böngészőkeretén
   kattintható, új lapon nyitja az élő oldalt. A ".rg-ref" előtag a sitepackage
   ".inner-page-content a" szabálya miatt kell (l. fent, v0.1.2). */
.rg-ref a.rg-livelink {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--rg-accent);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.rg-ref a.rg-livelink:hover,
.rg-ref a.rg-livelink:focus {
    color: var(--rg-accent-dark);
    text-decoration: underline;
}

.rg-livelink__arrow {
    flex: none;
    margin-left: 6px;
    font-size: 0.9em;
    line-height: 1;
}

.rg-ref a.rg-shot__url {
    display: inline-block;
    min-width: 0;
    max-width: calc(100% - 60px);
    margin-left: 10px;
    padding: 2px 12px;
    overflow: hidden;
    font-family: var(--rg-font-mono);
    font-size: 0.76rem;
    font-style: normal;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--rg-muted);
    text-decoration: none;
    background: #fff;
    border-radius: 6px;
    transition: color 0.15s ease, box-shadow 0.15s ease;
}

.rg-ref a.rg-shot__url:hover,
.rg-ref a.rg-shot__url:focus {
    color: var(--rg-accent);
    text-decoration: none;
    box-shadow: 0 0 0 1px var(--rg-accent);
}

@media (max-width: 600px) {
    .rg-ref a.rg-shot__url {
        padding: 6px 12px;
    }
}

/* ---------- Galéria: kattintható, nagyítható képek (v0.1.4) ---------- */

.rg-ref a.rg-gallery__link {
    position: relative;
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: zoom-in;
}

.rg-gallery__zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #fff;
    background: rgba(10, 15, 36, 0.62);
    border-radius: 50%;
    opacity: 0.85;
    transition: opacity 0.15s ease, background-color 0.15s ease;
    pointer-events: none;
}

.rg-gallery__zoom .rg-icon {
    width: 20px;
    height: 20px;
}

.rg-ref a.rg-gallery__link:hover .rg-gallery__zoom,
.rg-ref a.rg-gallery__link:focus .rg-gallery__zoom {
    opacity: 1;
    background: var(--rg-accent);
}

.rg-ref a.rg-gallery__link:focus-visible {
    outline: 3px solid var(--rg-accent);
    outline-offset: 2px;
}

/* Lightbox réteg (a body végére kerül, ezért nem a .rg-ref alatt van) */

html.rg-lightbox-open,
html.rg-lightbox-open body {
    overflow: hidden;
}

.rg-lightbox {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 72px;
    background: rgba(6, 10, 24, 0.92);
}

.rg-lightbox[hidden],
.rg-lightbox [hidden] {
    display: none;
}

.rg-lightbox__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

.rg-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 140px);
    width: auto;
    height: auto;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.rg-lightbox__counter {
    font-family: var(--rg-font-mono);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.rg-lightbox .rg-lightbox__btn {
    position: absolute;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    font-family: inherit;
    font-size: 2rem;
    line-height: 1;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 0;
    border-radius: 50%;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.rg-lightbox .rg-lightbox__btn:hover,
.rg-lightbox .rg-lightbox__btn:focus {
    color: #fff;
    background: var(--rg-accent);
}

.rg-lightbox .rg-lightbox__btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.rg-lightbox .rg-lightbox__close {
    top: 14px;
    right: 14px;
}

.rg-lightbox .rg-lightbox__prev {
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
}

.rg-lightbox .rg-lightbox__next {
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
}

@media (max-width: 600px) {
    .rg-lightbox {
        padding: 64px 10px 72px;
    }

    .rg-lightbox__img {
        max-height: calc(100vh - 170px);
    }

    .rg-lightbox .rg-lightbox__prev,
    .rg-lightbox .rg-lightbox__next {
        top: auto;
        bottom: 14px;
        transform: none;
    }

    .rg-lightbox .rg-lightbox__prev {
        left: calc(50% - 60px);
    }

    .rg-lightbox .rg-lightbox__next {
        right: calc(50% - 60px);
    }

    .rg-gallery__zoom {
        opacity: 1;
    }
}
