/* ===================================================================
   Naregatsi Art Institute — base site styles
   Bootstrap 5 handles layout/grid/components; this file only covers
   the custom bits Bootstrap doesn't (StellarNav host styling, the
   event-detail split overlay, card hover states).
   =================================================================== */

.site-header {
    border-bottom: 1px solid #eee;
}

.lang-toggle {
    font-size: 0.85rem;
    text-decoration: none;
    color: #333;
    white-space: nowrap;
}

.search-toggle {
    color: #333;
}

.search-toggle:hover {
    color: #000;
}

.site-search-bar {
    background: #fafafa;
}

/* Event/Publication/etc. detail "overlay" layout — full-bleed split
   screen matching the old site's click-to-expand pattern. */
.event-detail {
    min-height: 100vh;
}

.event-detail__image {
    min-height: 40vh;
}

.event-detail__image img {
    max-height: 90vh;
    object-fit: contain;
}

.event-detail__content {
    position: relative;
    max-height: 100vh;
    overflow-y: auto;
}

.event-detail__close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    line-height: 1;
    color: #333;
    text-decoration: none;
}

.event-detail__close:hover {
    color: #000;
}

.event-detail__description {
    /* No longer needs white-space handling — content is now real HTML
       with <p>/<br> controlling spacing explicitly, since the
       normalization cleanup. The old pre-line rule caused the stray
       whitespace/indentation in the template source itself to render
       as a visible extra line break above the actual content. */
}

/* Read more — fade truncation. The button decision (show it or not)
   is made server-side by word count; this is purely the visual clip,
   never touches the actual HTML so nothing can break mid-tag. */
.event-detail__description.is-truncated {
    position: relative;
    max-height: 8em;
    overflow: hidden;
}

.event-detail__description.is-truncated::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.5em;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
}

/* Detail page gallery — square thumbnails in the content column,
   right after the description. Responsive grid (not a fixed pixel
   size), each cell at least 130px — noticeably larger than the
   original ~150-160px Bootstrap-grid thumbnails, per request. */
.detail-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin: 1rem 0;
}

.detail-thumbs__item {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.detail-thumbs__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-thumbs__item:hover {
    border-color: #212529;
    transform: scale(1.05);
}

/* Social platform icon links, in related content */
.detail-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f1f1;
    color: #333;
    transition: background 0.2s ease, color 0.2s ease;
}

.detail-social-icon:hover {
    background: #212529;
    color: #fff;
}

/* Year-grouped internal links (e.g. Groups often accumulate many
   naregatsi.org links over the years) — collapsible via Bootstrap's
   own collapse component, no custom JS needed. */
.detail-year-links__group {
    border-bottom: 1px solid #eee;
}

.detail-year-links__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    padding: 10px 0;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.detail-year-links__chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* Bootstrap adds .collapsed to the toggle when its target is HIDDEN,
   and removes it when expanded — using that directly, no extra JS. */
.detail-year-links__toggle:not(.collapsed) .detail-year-links__chevron {
    transform: rotate(90deg);
}

.detail-year-links__list {
    list-style: none;
    padding: 0 0 10px 22px;
    margin: 0;
}

.detail-year-links__list li {
    padding: 4px 0;
}

.event-card img {
    transition: transform 0.2s ease;
}

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

.support-culture {
    background: #fafafa;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

/* Standalone featured block (e.g. "Hand in hand with the physically
   challenged") — single centered card, sized to roughly match a
   Groups card's typical rendered width, not a slider. */
.featured-block {
    width: 100%;
    max-width: 320px;
}

/* ---------------------------------------------------------------
   Horizontal scroll slider — reusable for Artistic Groups, Events,
   Publications, Collaborations sections. Item count per row grows
   with viewport width via the basis percentages below, rather than
   Bootstrap's 12-col grid (which doesn't fit a scrolling row well).
   --------------------------------------------------------------- */
.hscroll {
    position: relative;
}

.hscroll__track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.hscroll__track::-webkit-scrollbar {
    display: none;
}

.hscroll__item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: 62%;
}

@media (min-width: 480px) {
    .hscroll__item { width: 42%; }
}
@media (min-width: 768px) {
    .hscroll__item { width: 28%; }
}
@media (min-width: 992px) {
    .hscroll__item { width: 20%; }
}
@media (min-width: 1200px) {
    .hscroll__item { width: 15.5%; }
}
@media (min-width: 1600px) {
    .hscroll__item { width: 12.5%; }
}

.hscroll__arrow {
    position: absolute;
    top: 0;
    bottom: 3.75rem;
    width: 52px;
    z-index: 2;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.hscroll__arrow--prev {
    left: 0;
    background: rgba(0, 0, 0, 0.45);
}

.hscroll__arrow--next {
    right: 0;
    background: rgba(0, 0, 0, 0.45);
}

.hscroll__arrow-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.hscroll__arrow:hover .hscroll__arrow-icon {
    background: rgba(0, 0, 0, 0.75);
}

/* Events cards have an extra date line above the title (unlike
   Groups' single-line caption), so they need more reserved space
   below the arrow block to avoid overlapping the text. */
.hscroll--events .hscroll__arrow {
    bottom: 5.5rem;
}

/* Collaborations use the same date+title two-line card layout as
   Events (reusing .event-card styling directly), so needs the same
   reserved space below the arrow block. */
.hscroll--collaborations .hscroll__arrow {
    bottom: 5.5rem;
}

.hscroll__item--inactive {
    filter: grayscale(1);
    opacity: 0.55;
}

.hscroll__item--loadmore {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px dashed #ddd;
    border-radius: 10px;
    align-self: flex-start;
    aspect-ratio: 1 / 1;
}

/* Publications cards are 16:9 (matching Groups), not square like
   Events — the Load More card needs to match, or it ends up taller
   than the row it sits in. */
.hscroll--publications .hscroll__item--loadmore {
    aspect-ratio: 16 / 9;
}

.hscroll__loadmore-btn {
    border: none;
    background: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: #212529;
    padding: 1rem;
    cursor: pointer;
}

.hscroll__loadmore-btn:hover {
    text-decoration: underline;
}

/* Group card — rounded image corners, decorative underline on hover
   (not text-decoration — a positioned bar, consistent with the nav
   hover style). */
.group-card__image {
    border-radius: 10px;
    overflow: hidden;
}

.group-card__title {
    position: relative;
    display: inline-block;
    padding-bottom: 3px;
}

.group-card__title::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.group-card-link:hover .group-card__title::after {
    transform: scaleX(1);
}

/* Artistic Groups — noticeably larger cards than the shared default,
   trading off items-per-row for actual card size, on large screens. */
@media (min-width: 992px) {
    .hscroll--groups .hscroll__item { width: 30%; }
}
@media (min-width: 1200px) {
    .hscroll--groups .hscroll__item { width: 24%; }
}
@media (min-width: 1600px) {
    .hscroll--groups .hscroll__item { width: 18%; }
}

/* ---------------------------------------------------------------
   StellarNav overrides — the plugin's own defaults (40px horizontal
   padding per item) are sized for a menu with far fewer items than
   ours (8 top-level items + language toggle). Tightening padding and
   font-size here, without touching the vendor file itself, so a
   future StellarNav update doesn't wipe out custom changes.
   --------------------------------------------------------------- */
.stellarnav.desktop > ul > li > a {
    padding: 15px 14px;
    font-size: 1rem;
    white-space: nowrap;
    position: relative;
}

.stellarnav.desktop > ul > li > a::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 10px;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.stellarnav.desktop > ul > li > a:hover::after,
.stellarnav.desktop > ul > li > a.active::after {
    transform: scaleX(1);
}

.stellarnav.desktop > ul {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
}

/* ---------------------------------------------------------------
   Mobile nav fix — StellarNav's mobile dropdown expects to span the
   full viewport width, but our header's d-flex row was squeezing it
   into the leftover space between the logo and the search/Donate/
   language group, truncating every menu label. Forcing it onto its
   own full-width row below the header solves it.
   --------------------------------------------------------------- */
@media (max-width: 991px) {
    .site-header .container-fluid {
        flex-wrap: wrap;
    }

    .stellarnav.mobile {
        flex: 0 0 100%;
        max-width: 100%;
        order: 10;
    }

    .stellarnav.mobile > ul {
        width: 100%;
    }

    .site-logo {
        height: 41px; /* ~85% of the 48px desktop size */
    }
}

/* Homepage Events section — category tabs and month filter tabs */
.event-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.event-tabs__item {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.event-tabs__item:hover {
    border-color: #999;
}

.event-tabs__item.active {
    background: #212529;
    color: #fff;
    border-color: #212529;
}

.month-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.month-tabs__item {
    border: none;
    background: #f1f1f1;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.month-tabs__item:hover {
    background: #e2e2e2;
}

.month-tabs__item.active {
    background: #212529;
    color: #fff;
}

/* Events listing page — year chips and month chips (a row of visible
   clickable chips rather than a hidden dropdown, since browsing by
   year IS the point of this page). */
.year-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.year-chips__label {
    font-size: 0.85rem;
    color: #666;
    margin-right: 0.25rem;
}

.year-chips__year,
.year-chips__month {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.year-chips__year:hover,
.year-chips__month:hover {
    border-color: #999;
}

.year-chips__year.active,
.year-chips__month.active {
    background: #212529;
    color: #fff;
    border-color: #212529;
}
.hero-banner .carousel-item {
    position: relative;
}

.hero-banner img {
    max-height: 60vh;
    width: 100%;
    object-fit: cover;
}

/* Push the prev/next arrow icons toward the true edge, within their
   existing (wide, touch-friendly) clickable zone — Bootstrap centers
   them by default, which can land right under edge-positioned
   captions (center-left, top-left, etc). */
.hero-banner .carousel-control-prev {
    justify-content: flex-start;
    padding-left: 12px;
}

.hero-banner .carousel-control-next {
    justify-content: flex-end;
    padding-right: 12px;
}

.hero-banner__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-banner .carousel-caption {
    z-index: 2;
    color: #fff;
}

.hero-banner__empty {
    height: 30vh;
}

/* Press page — date sits as its own column via flex, so a wrapped
   title's second line aligns under the first instead of falling back
   to the far-left edge under the date. Safe for detail-view's
   single-link year-groups too (a lone flex item behaves the same as
   a normal block). */
.detail-year-links__list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.press-list__date {
    flex-shrink: 0;
}

/* Library A-Z filter — small pill buttons, wraps naturally */
.alpha-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.alpha-filter__btn {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.85rem;
    line-height: 1.6;
    cursor: pointer;
    color: #212529;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.alpha-filter__btn:hover {
    border-color: #212529;
}

.alpha-filter__btn.active {
    background: #212529;
    border-color: #212529;
    color: #fff;
}

/* Search results */
.search-group-heading {
    border-bottom: 2px solid #212529;
    padding-bottom: 6px;
}

.search-result-card {
    background: #fff;
    transition: box-shadow 0.15s ease;
}

.search-result-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.search-result-card__excerpt {
    color: #444;
    line-height: 1.5;
}

.search-result-card__excerpt mark {
    background: #fff3a3;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-card__link {
    color: #0d6efd;
    word-break: break-all;
}

/* Search bar — wraps with gaps on small screens (default), becomes a
   single-line joined input-group style (like Bootstrap's .input-group)
   on large screens and up. */
.site-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (min-width: 992px) {
    .site-search-form {
        flex-wrap: nowrap;
        gap: 0;
    }

    .site-search-form > .form-control,
    .site-search-form > .form-select,
    .site-search-form > .btn {
        border-radius: 0;
        margin-left: -1px;
        position: relative;
    }

    .site-search-form > .form-control {
        flex: 1 1 auto;
        min-width: 0;
    }

    .site-search-form > .form-select {
        flex: 0 0 auto;
        width: auto;
    }

    .site-search-form > :first-child {
        border-top-left-radius: 0.375rem;
        border-bottom-left-radius: 0.375rem;
        margin-left: 0;
    }

    .site-search-form > :last-child {
        border-top-right-radius: 0.375rem;
        border-bottom-right-radius: 0.375rem;
    }

    .site-search-form > *:focus {
        z-index: 3;
    }
}

/* Logo preloader — small, subtle, gently pulsing. mix-blend-mode
   removes the white background from the source JPG without needing a
   true transparent PNG. */
.preloader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 0;
    min-height: 100px;
}

.preloader__logo {
    width: 36px;
    height: 36px;
    mix-blend-mode: multiply;
    animation: preloader-flash 1.3s ease-in-out infinite;
}

@keyframes preloader-flash {
    0%, 100% { opacity: 0.12; }
    50% { opacity: 0.45; }
}

/* Detail-view file attachments (PDF/Word) */
.detail-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    color: #212529;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.detail-attachment:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #212529;
}

/* Hero slide caption — selectable position (3x3 grid), color, size */
.hero-caption {
    position: absolute;
    z-index: 2;
    max-width: 90%;
}

.hero-caption--top-left      { top: 10%; left: 5%; text-align: left; }
.hero-caption--top-center    { top: 10%; left: 50%; transform: translateX(-50%); text-align: center; }
.hero-caption--top-right     { top: 10%; right: 5%; left: auto; text-align: right; }
.hero-caption--center-left   { top: 50%; left: 5%; transform: translateY(-50%); text-align: left; }
.hero-caption--center        { top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.hero-caption--center-right  { top: 50%; right: 5%; left: auto; transform: translateY(-50%); text-align: right; }
.hero-caption--bottom-left   { bottom: 10%; left: 5%; text-align: left; }
.hero-caption--bottom-center { bottom: 10%; left: 50%; transform: translateX(-50%); text-align: center; }
.hero-caption--bottom-right  { bottom: 10%; right: 5%; left: auto; text-align: right; }

.hero-caption--small h2  { font-size: 1.25rem; }
.hero-caption--medium h2 { font-size: 2rem; }
.hero-caption--large h2  { font-size: 2.75rem; }
.hero-caption--xlarge h2 { font-size: 3.5rem; }

@media (max-width: 576px) {
    .hero-caption--small h2  { font-size: 0.85rem; }
    .hero-caption--medium h2 { font-size: 1.15rem; }
    .hero-caption--large h2  { font-size: 1.4rem; }
    .hero-caption--xlarge h2 { font-size: 1.75rem; }
}

/* Text shadow intensity is applied inline (variable per-slide, per-language
   opacity from the admin slider), not via a fixed CSS class here. */

/* Faint logo watermark shown behind content images while they load —
   covers every card/gallery image site-wide via the .ratio wrapper
   Bootstrap classes already use consistently, plus the hero banner
   separately. background-blend-mode removes the source JPG's white
   background so only the mark itself shows, small and unobtrusive.
   Disappears naturally once the real photo renders on top.
   The flash animates background-color (not opacity) specifically so
   it can never affect the actual photo once it's loaded — opacity
   would apply to the whole element, background-color only to the
   background layer sitting behind the (eventually opaque) image. */
.ratio img,
.hero-banner img {
    background-image: url('../img/logo-preloader-gray.jpg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 15% auto;
    background-blend-mode: multiply;
    animation: watermark-flash 1.6s ease-in-out infinite;
}

@keyframes watermark-flash {
    0%, 100% { background-color: #f4f4f4; }
    50%      { background-color: #e2e2e2; }
}

/* Header Donate button — Armenian text ("Նվիրաբերել") is longer than
   English and can wrap to a second line on mobile next to the
   language switcher. Shrink it slightly on small screens only. */
@media (max-width: 576px) {
    .header-donate-btn {
        font-size: 0.8rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        white-space: nowrap;
    }
}
