/* Фотогалерея в оформлении темы «Тираж».
   Токены (цвет, рамки, шрифты) приходят из основной темы сайта. */

/* полоса навигации приложения: видна на всех ширинах, т.к. это основные разделы галереи */
.subnav-strip.app-strip--photos{display:block;border-bottom:var(--stroke) solid var(--line);background:var(--color-base-100);padding-block:.35rem}
.subnav-strip.app-strip--photos .desktop-subnav{width:min(992px,100%);margin-inline:auto;padding-inline:clamp(16px,4vw,32px)}
.subnav-strip.app-strip--photos ul{list-style:none;display:flex;flex-wrap:wrap;gap:18px;margin:0;padding:0;font-size:13.5px}
.subnav-strip.app-strip--photos a{display:inline-flex;align-items:center;min-height:34px;opacity:.8;text-decoration:none;color:inherit}
.subnav-strip.app-strip--photos a:hover{opacity:1;text-decoration:underline;text-underline-offset:.25em}
.subnav-strip.app-strip--photos a[aria-current="page"]{opacity:1;text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:.25em}

main /* навигация приложения «Фото» внутри контента: «Все фотографии», «Избранное», страницы */

.page-photos{max-width:1180px;margin-inline:auto;padding-inline:clamp(16px,4vw,32px)}

/* заголовки разделов */
.photos-title{font-family:var(--display,inherit);letter-spacing:-.01em;text-transform:none;margin:1.6rem 0 1rem;font-size:clamp(1.5rem,3vw,2.25rem);line-height:1.15}
.photos-title:first-child{margin-top:0}
.photos-head{margin-bottom:1.5rem}
.photos-note{opacity:.75;margin:.25rem 0 .75rem;font-style:italic}
.photos-description{margin:0 0 1rem;max-width:70ch}

/* альбомы */
.photos-albums{list-style:none;margin:0 0 2.5rem;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:26px 22px}
/* стопка обложек альбома: daisyUI .stack (первый ребёнок — верхняя карточка) */
.photos-album-stack{width:100%;aspect-ratio:4/3;display:inline-grid}
.photos-album-stack > *{width:100%;height:100%}
.photos-album-layer{border:var(--stroke) solid var(--line);background:var(--color-base-200,transparent)}
.photos-album-stack .photos-album-cover{width:100%;height:100%}
.photos-album-stack .photos-album-cover img{width:100%!important;height:100%!important;max-width:none;object-fit:cover}

.photos-album{position:relative}
.photos-album-cover{display:block;position:relative;border:var(--stroke) solid var(--line);overflow:hidden;aspect-ratio:4/3;background:var(--color-base-200,transparent);text-decoration:none;transition:box-shadow .15s,transform .15s}
.photos-album-cover:hover,.photos-album-cover:focus-visible{transform:translateY(-2px);box-shadow:var(--offset,4px) var(--offset,4px) 0 var(--line)}
.photos-album-cover img{width:100%!important;height:100%!important;max-width:none;object-fit:cover;display:block}
.photos-album-name{margin:.6rem 0 .1rem;font-weight:700;line-height:1.3}
.photos-album-name a{color:inherit;text-decoration:none}
.photos-album-name a:hover{color:var(--color-primary);text-decoration:underline;text-underline-offset:.2em}
.photos-album-name.is-private{opacity:.7}
.photos-album-count{margin:0;font-size:.85rem;opacity:.65}
.photos-subalbums{margin-bottom:2rem}

/* сетка эскизов: три раскладки */
.photos-grid{list-style:none;margin:0;padding:0}
.photos-item{margin:0}
.photos-item-link{display:block;position:relative;border:var(--stroke) solid var(--line);overflow:hidden;background:var(--color-base-200,transparent);transition:transform .15s,box-shadow .15s}
.photos-item-link:hover,.photos-item-link:focus-visible{transform:translateY(-2px);box-shadow:var(--offset,4px) var(--offset,4px) 0 var(--line)}
.photos-item-link img{width:100%;display:block}

/* 1. masonry — 3 колонки, натуральная высота кадров */
.photos-grid--masonry{columns:3;column-gap:14px}
.photos-grid--masonry .photos-item{break-inside:avoid;margin:0 0 14px}
.photos-grid--masonry .photos-item-link img{height:auto;object-fit:cover}

/* альбом: максимум три фотографии в ряд */
.photos-grid--album.photos-grid--grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.photos-grid--album.photos-grid--featured{grid-template-columns:repeat(3,minmax(0,1fr))}

/* 2. ровная сетка квадратов */
.photos-grid--grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.photos-grid--grid .photos-item-link{aspect-ratio:1/1}
.photos-grid--grid .photos-item-link img{height:100%;object-fit:cover}

/* 3. крупное фото и ряд из пяти */
.photos-featured{margin:0 0 14px}
.photos-featured-link{display:block;position:relative;border:var(--stroke) solid var(--line);overflow:hidden;transition:box-shadow .15s}
.photos-featured-link:hover{box-shadow:var(--offset,4px) var(--offset,4px) 0 var(--line)}
.photos-featured-link img{width:100%;height:auto;display:block}
.photos-grid--featured{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}
.photos-grid--featured .photos-item-link{aspect-ratio:1/1}
.photos-grid--featured .photos-item-link img{height:100%;object-fit:cover}

/* мобильные */
@media (max-width:1023px){
  .photos-grid--masonry{columns:3}
  .photos-grid--grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .photos-grid--featured{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media (max-width:767px){
  .photos-albums{grid-template-columns:repeat(2,minmax(0,1fr))}
  /* как в базовой теме: на телефоне по одной фотографии в ряд */
  .photos-grid--masonry{columns:1}
  .photos-grid--grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .photos-grid--featured{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* простой список */
.photos-plain{display:grid;gap:2rem}
.photos-figure{margin:0}
.photos-figure-text{margin:0 0 .5rem;opacity:.8;max-width:70ch}
.photos-figure-image{position:relative;border:var(--stroke) solid var(--line);background:var(--color-base-200,transparent)}
.photos-figure-image img{display:block;width:100%;height:auto;object-fit:cover}
.photos-stack{position:absolute;left:8px;bottom:8px;z-index:3}

/* страница фотографии */
.photos-photo-link{display:block}
.photos-exif,.photos-meta{font-size:.85rem;opacity:.7;line-height:1.6}
.photos-tags a{color:inherit}

/* пустые состояния */
.photos-empty{padding:2rem 0;max-width:60ch}
.photos-empty h1{margin:0 0 .75rem}

/* пагинация */
.photos-paging{margin:2rem 0 0;display:flex;justify-content:center}
.photos-pagination{list-style:none;display:flex;gap:.35rem;padding:0;margin:0}
.photos-pagination li a,.photos-pagination li span{display:inline-flex;align-items:center;justify-content:center;min-width:38px;min-height:38px;border:var(--stroke) solid var(--line);text-decoration:none;color:inherit;font-size:.9rem}
.photos-pagination li.is-selected span{background:var(--color-primary);color:var(--color-primary-content,#111);font-weight:700}

@media (max-width:639px){
  .photos-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px}
}

@media (max-width:479px){
  .photos-albums{grid-template-columns:1fr}
}

/* --- страница одной фотографии: карточка --- */
.photo-view{margin-inline:auto}
.photo-view__crumbs{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:12px;opacity:.72;margin:0 0 16px}
.photo-view__crumbs a{color:inherit;text-decoration:none}
.photo-view__crumbs a:hover{text-decoration:underline;text-underline-offset:.2em}
.photo-view__crumbs span{opacity:.5}
.photo-view__stage{position:relative;display:flex;align-items:center;justify-content:center;gap:10px;width:100%;max-width:100%;box-sizing:border-box}
.photo-view__figure{position:relative;margin:0;padding:10px;box-sizing:border-box;max-width:100%;border:var(--stroke) solid var(--line);background:var(--color-base-200,transparent);box-shadow:var(--offset,5px) var(--offset,5px) 0 var(--line);max-width:100%}
.photo-view__figure .photos-photo-link{display:block}
.photo-view__image,#photo{display:block;max-width:100%;max-height:64vh;width:auto;height:auto;margin:0 auto}
.photo-view__arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:5;display:grid;place-items:center;width:46px;height:46px;border:var(--stroke) solid var(--line);background:var(--color-base-100,transparent);color:inherit;font-size:26px;line-height:1;text-decoration:none;opacity:.92;transition:background .15s,color .15s,transform .15s,opacity .15s}
.photo-view__arrow--prev{left:2px}
.photo-view__arrow--next{right:2px}
.photo-view__arrow:hover,.photo-view__arrow:focus-visible{background:var(--color-primary);color:var(--color-primary-content);transform:translateY(-50%) scale(1.06)}
.photo-view__meta{margin:20px 0 0;padding-top:18px;border-top:var(--stroke) solid var(--line);display:flex;flex-direction:column;gap:8px;max-width:72ch}
.photo-view__title{font-family:var(--font-display,inherit);font-size:clamp(1.2rem,2.2vw,1.7rem);line-height:1.2;margin:0}
.photo-view__description{margin:0;opacity:.9}
.photo-view__facts{display:flex;flex-wrap:wrap;gap:6px 20px;margin:0;font-size:12.5px;opacity:.75}
.photo-view__facts>span{display:inline-flex;align-items:center;gap:6px}
.photo-view__facts a{color:inherit;text-decoration:underline;text-underline-offset:.2em}
.photo-view__stream{margin-top:18px;padding-top:0;border-top:0}
.photo-view__stream .photostream{display:flex;align-items:center;gap:10px;list-style:none;margin:0;padding:0}
.photo-view__stream .stream-wrapper{flex:1 1 auto;min-width:0;overflow-x:auto;scrollbar-width:thin;order:2}
.photo-view__stream .stream-wrapper>.photostream{display:flex;gap:10px;align-items:center}
.photo-view__stream .stream-nav{display:block;flex:0 0 auto}
.photo-view__stream .stream-nav.rewind{order:1}
.photo-view__stream .stream-nav.ff{order:3}
.photo-view__stream .stream-nav a{display:grid;place-items:center;width:36px;height:36px;border:var(--stroke) solid var(--line);color:inherit;text-decoration:none;background:var(--color-base-100,transparent)}
.photo-view__stream .stream-nav a:hover{background:var(--color-primary);color:var(--color-primary-content)}
.photo-view__stream .stream-nav i{display:block;width:8px;height:8px;border-top:2px solid currentColor;border-right:2px solid currentColor;transform:rotate(45deg)}
.photo-view__stream .stream-nav.rewind i{transform:rotate(-135deg)}
.photo-view__stream .dummy{display:none!important}
.photo-view__stream .photostream-end{display:none}
.photo-view__stream li[data-photo-id] a{display:block;line-height:0}
.photo-view__stream li[data-photo-id] img{width:88px;height:88px;object-fit:cover;display:block;border:var(--stroke) solid var(--line);opacity:.75;transition:opacity .15s,transform .15s}
.photo-view__stream li[data-photo-id] a:hover img{opacity:1;transform:translateY(-2px)}
.photo-view__stream li.selected img{opacity:1;border-color:var(--accent,var(--color-primary));box-shadow:0 0 0 3px var(--color-primary)}
@media (max-width:639px){
  .photo-view__stage{flex-wrap:wrap}
  .photo-view__arrow{width:40px;height:40px}
  .photo-view__arrow--prev{left:0}
  .photo-view__arrow--next{right:0}
  .photo-view__figure{order:1;flex:1 1 100%}
  .photo-view__image,#photo{max-height:52vh}
  .photo-view__stream li[data-photo-id] img{width:64px;height:64px}
}

/* --- кадр: приложение ставит inline width/height, поэтому перебиваем !important,
   иначе max-height ломает пропорции (фото сплющивается) --- */
.photo-view__figure img.photo_img,
.photo-view__figure #photo{width:auto!important;height:auto!important;max-width:100%;max-height:min(68vh,760px);object-fit:contain}

/* --- лента миниатюр: элементы не должны сжиматься в полоски --- */
.photo-view__stream{max-width:100%}
.photo-view__stream .photostream{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;min-width:0;list-style:none;margin:0;padding:0}
.photo-view__stream .stream-wrapper{display:block;grid-column:2;min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
.photo-view__stream .stream-wrapper>.photostream{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;width:max-content;min-width:0}
.photo-view__stream .stream-nav.rewind{grid-column:1}
.photo-view__stream .stream-nav.ff{grid-column:3}
.photo-view__stream li[data-photo-id]{flex:0 0 auto;width:88px;height:88px;display:block}
.photo-view__stream li[data-photo-id] a{display:block;width:100%;height:100%;line-height:0}
.photo-view__stream li[data-photo-id] img{width:88px!important;height:88px!important;max-width:none;object-fit:cover;display:block;border:var(--stroke) solid var(--line);opacity:.75;transition:opacity .15s,transform .15s}
.photo-view__stream li[data-photo-id] a:hover img{opacity:1;transform:translateY(-2px)}
.photo-view__stream li.selected img{opacity:1;border-color:var(--accent,var(--color-primary));box-shadow:0 0 0 3px var(--color-primary)}
@media (max-width:639px){
  .photo-view__stream li[data-photo-id]{width:68px;height:68px}
  .photo-view__stream li[data-photo-id] img{width:68px!important;height:68px!important}
  .photo-view__figure img.photo_img,
  .photo-view__figure #photo{max-height:52vh}
}

/* --- косметика: мягкая рамка и скругление у фотографий --- */
.photo-radius,
.photos-album-cover,
.photos-album-layer,
.photos-item-link,
.photos-featured-link,
.photos-figure-image,
.photo-view__figure {
    border-radius: 12px;
}

.photos-album-cover,
.photos-album-layer,
.photos-item-link,
.photos-featured-link,
.photos-figure-image,
.photo-view__figure {
    border-width: 1px;
    border-color: var(--color-base-300);
    box-shadow: 0 1px 2px rgb(0 0 0 / 6%);
}

.photos-album-cover img,
.photos-item-link img,
.photos-featured-link img,
.photos-figure-image img,
.photos-thumb img,
.photo-view__figure img,
.photo-view__figure #photo {
    border-radius: 10px;
}

.photo-view__figure {
    padding: 8px;
    box-shadow: none;
}

.photo-view__arrow {
    border-radius: 50%;
    border-width: 1px;
    border-color: var(--color-base-300);
}

.photos-pagination li a,
.photos-pagination li span {
    border-radius: 8px;
    border-width: 1px;
    border-color: var(--color-base-300);
}

[data-theme^=comic] .photos-album-cover,
[data-theme^=comic] .photos-item-link,
[data-theme^=comic] .photos-featured-link,
[data-theme^=comic] .photos-figure-image,
[data-theme^=comic] .photo-view__figure {
    box-shadow: 0 2px 0 rgb(0 0 0 / 12%);
}

/* --- альбомы: собственная стопка вместо daisyUI .stack (слои схлопывались в полоску) --- */
.photos-album-stack {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
}

.photos-album-stack > .photos-album-cover {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
}

.photos-album-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    border: 1px solid var(--color-base-300);
    border-radius: 12px;
    background: var(--color-base-200);
    box-shadow: none;
}

.photos-album-layer:nth-of-type(1) {
    transform: translate(5px, 5px);
}

.photos-album-layer:nth-of-type(2) {
    transform: translate(10px, 10px);
    opacity: .75;
}

/* --- страница фото: без стрелок у большого кадра --- */
.photo-view__arrow {
    display: none !important;
}

/* --- карусель миниатюр: та же мягкая рамка и скругление --- */
.photo-view__stream .thumb {
    display: inline-block;
    border: 1px solid var(--color-base-300);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-base-100);
    box-shadow: 0 1px 2px rgb(0 0 0 / 6%);
}

.photo-view__stream .thumb img {
    display: block;
    border-radius: 7px;
}

.photo-view__stream .thumb.is-current,
.photo-view__stream .thumb[aria-current="true"] {
    border-color: var(--color-base-content);
}

.photo-view__stream .stream-nav a {
    border-radius: 50%;
    border-width: 1px;
    border-color: var(--color-base-300);
}

/* навигация плагинов приложения */
.photos-plugin-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    font-size: 13.5px;
}

.photos-plugin-nav a {
    color: inherit;
    opacity: .8;
    text-decoration: none;
}

.photos-plugin-nav a:hover {
    opacity: 1;
    text-underline-offset: .25em;
    text-decoration: underline;
}
