/* ============================================================
   public/css/embed.css
   /opac/embed only: the catalogue snapshot framed by the main
   greeklibrary.org website. Every selector is `gle-` prefixed.

   Styled after that site, not the catalogue: DM Sans headings
   with tight tracking, system-font body text, near-black ink,
   black buttons and grey tags with small square-ish corners, and
   no shadows. DM Sans has no Greek, so Greek headings fall
   through to the system font, which is what the main site does
   too. Standalone: it does not load main.css.
   ============================================================ */

/* DM Sans — latin, variable 100-1000. Google's unicode-range. */
@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 100 1000;
    font-display: swap;
    src: url('../fonts/dm-sans-latin-var.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --gle-ink:      #111013;
    --gle-text:     #161519;
    --gle-muted:    rgba(22, 21, 25, 0.6);
    --gle-tint:     rgba(150, 144, 162, 0.08);
    --gle-tag:      rgba(150, 144, 162, 0.15);
    --gle-line:     rgba(150, 144, 162, 0.35);
    --gle-radius:   5.6px;
    --gle-sys:      -apple-system, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --gle-display:  'DM Sans', var(--gle-sys);
}

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

html, body { overflow: hidden; }

.gle-body {
    margin: 0;
    background: transparent;
    font-family: var(--gle-sys);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gle-text);
    -webkit-font-smoothing: antialiased;
}

.gle {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding: 2px 0 6px;
}

a { color: inherit; }

/* ── Search ─────────────────────────────────────────────────── */
.gle-search {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--gle-tint);
    border: 1px solid transparent;
    border-radius: var(--gle-radius);
    padding: 0.4rem 0.4rem 0.4rem 1rem;
    transition: border-color .15s;
}
.gle-search:focus-within { border-color: var(--gle-ink); }
.gle-search__icon { color: var(--gle-muted); display: flex; }
.gle-search__input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    padding: 0.55rem 0;
}
.gle-search__input::placeholder { color: var(--gle-muted); opacity: 1; }
.gle-search__btn,
.gle-cta {
    border: 0;
    border-radius: var(--gle-radius);
    background: var(--gle-ink);
    color: #fff;
    font-family: var(--gle-display);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: opacity .15s;
}
.gle-search__btn { padding: 0.7rem 1.3rem; }
.gle-search__btn:hover,
.gle-cta:hover { opacity: 0.85; }

/* ── Section headers ────────────────────────────────────────── */
.gle-section__hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.9rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--gle-line);
}
.gle-section__title {
    margin: 0;
    font-family: var(--gle-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.03em;
    color: var(--gle-ink);
}
.gle-section__tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.gle-section__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 0.5rem;
    font-family: var(--gle-display);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gle-ink);
    text-decoration: none;
}
.gle-section__link svg { transition: transform .2s; }
.gle-section__link:hover svg { transform: translateX(3px); }

/* Round grey buttons, like the main site's menu button. */
.gle-nav {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--gle-tint);
    color: var(--gle-ink);
    cursor: pointer;
    transition: background .15s;
}
.gle-nav:hover { background: var(--gle-tag); }

/* ── Category tags ──────────────────────────────────────────── */
.gle-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.gle-cat {
    display: inline-block;
    padding: 0.45rem 0.75rem;
    border-radius: var(--gle-radius);
    background: var(--gle-tag);
    color: var(--gle-text);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.gle-cat:hover { background: var(--gle-ink); color: #fff; }

/* ── New arrivals shelf ─────────────────────────────────────── */
.gle-shelf {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.gle-shelf::-webkit-scrollbar { display: none; }

.gle-card {
    flex: 0 0 150px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    text-decoration: none;
}
.gle-card__cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: var(--gle-tint);
    margin-bottom: 0.75rem;
    transition: opacity .2s;
}
.gle-card:hover .gle-card__cover { opacity: 0.85; }
.gle-card__cover--placeholder { color: var(--gle-muted); }
.gle-card__title,
.gle-card__author {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gle-card__title {
    -webkit-line-clamp: 2;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--gle-ink);
}
.gle-card:hover .gle-card__title { text-decoration: underline; }
.gle-card__author {
    -webkit-line-clamp: 1;
    margin-top: 0.2rem;
    font-size: 0.85rem;
    color: var(--gle-muted);
}

/* ── Closing button ─────────────────────────────────────────── */
.gle-cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.4rem;
}

/* ── Phone width ────────────────────────────────────────────── */
@media (max-width: 560px) {
    .gle { gap: 2rem; }
    .gle-section__title { font-size: 1.3rem; }
    .gle-search__btn { padding: 0.65rem 1rem; }
    .gle-card { flex-basis: 120px; }
    .gle-nav { display: none; }
    .gle-section__link { margin-right: 0; }
    .gle-cats {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .gle-cats::-webkit-scrollbar { display: none; }
    .gle-cat { white-space: nowrap; }
}

/* ── Search bar only (?only=search) ─────────────────────────────
   Laid over the home page's hero photo, where the grey tint would
   turn pink: solid white with a soft lift instead.
   The padding is room for the shadow to fade out inside the frame;
   cut off at the frame's edge it shows as a pale box on the photo. */
.gle--bar { padding: 14px 22px 30px; }
.gle--bar .gle-search {
    background: #fff;
    box-shadow: 0 6px 20px rgba(17, 16, 19, 0.12);
}

/* ── Search bar over the hero image (?only=hero) ───────────────
   The main site's home page picture with the bar laid across it,
   a little below the middle where the open book's pages sit. */
.gle--hero {
    position: relative;
    display: block;
    padding: 0;
}
.gle-hero__img {
    display: block;
    width: 100%;
    height: auto;
}
.gle--hero .gle-search {
    position: absolute;
    left: 50%;
    top: 52%;
    width: min(460px, 90%);
    transform: translate(-50%, -50%);
}

/* Both bar-only versions: a compact bar, not the full catalogue's. */
.gle--bar .gle-search { padding: 0.25rem 0.25rem 0.25rem 0.8rem; gap: 0.45rem; }
.gle--bar .gle-search__icon svg { width: 15px; height: 15px; }
.gle--bar .gle-search__input { font-size: 0.875rem; padding: 0.4rem 0; }
.gle--bar .gle-search__btn { font-size: 0.8rem; padding: 0.5rem 0.9rem; }
