/*
  poetry26.css (UNIFIED)
  ------------------------------------------------------------
  This file is now the single source of truth for the poetry
  section styling.

  Goal:
  - Stop CSS overrides / collisions caused by loading
    poetry26.css + poetry.css + poetrymain.css together.
  - Keep everything scoped to .poetry_page.
  - Fix HERO overlay content alignment (title + actions) to LEFT.

  Recommended include order on poetry pages:
    1) /main26.css
    2) /poetry26.css
    3) /hover-effects.css (optional)

  NOTE:
  - poetry.css and poetrymain.css can be converted to legacy
    wrappers that @import this file.
*/

/* ============================================================
   Base / layout helpers (scoped)
   ============================================================ */

.poetry_page a{
  color: inherit;
  text-decoration: none;
}

.poetry_page .poetry_wrap{
  width: 100%;
}

.poetry_page .p_section{
  margin-top: 26px;
}

.poetry_page .p_section_head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.poetry_page .p_section_title{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.poetry_page .p_section_meta{
  margin-top: 6px;
  opacity: 0.75;
  font-size: 13px;
}

.poetry_page .p_arrow{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(0,0,0,0.08);
  transition: transform 160ms ease, box-shadow 220ms ease, background 160ms ease;
}

.poetry_page .p_arrow:hover{
  background: rgba(255,255,255,0.95);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

/* Buttons (poetry-local) */
.poetry_page .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  background: rgba(255,255,255,0.95);
  color: #111;
  border: 1px solid rgba(255,255,255,0.50);
  transition: transform 160ms ease, box-shadow 220ms ease, background 160ms ease;
}

.poetry_page .btn:hover{
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(0,0,0,0.12);
}

.poetry_page .btn.btn_dark{
  background: rgba(0,0,0,0.60);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.20);
}

/* ============================================================
   HERO (random poem)
   ============================================================ */

.poetry_page .p_hero{
  background: #e9f3ff;
  border-radius: 18px;
  overflow: hidden;
  margin: 18px 0 24px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

.poetry_page .p_hero > a{
  display: block;
  width: 100%;
}

.poetry_page .p_hero_media{
  position: relative;
  width: 100%;
  /* Reduce hero height ~1/3 vs 16:9 (new ratio 16:6) */
  aspect-ratio: 16/6;
  overflow: hidden;
  background: #f0f0f0;
}

.poetry_page .p_hero_media img,
.poetry_page .p_hero_media video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poetry_page .p_hero_overlay{
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 30px 30px;
  background: linear-gradient(to top, rgba(0,0,0,0.80), rgba(0,0,0,0.30) 70%, transparent);
  color: #fff;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start !important; /* keep content on the left */
  text-align: left !important;            /* force left alignment */
  z-index: 2;
}

/* CRITICAL FIX:
   Some legacy CSS can cause the inner block to shrink and/or align right.
   This forces a full-width inner block and left text alignment.
*/
.poetry_page .p_hero_overlay > div{
  /* hard-force the content block to sit on the LEFT even if legacy CSS centers it */
  width: min(820px, 100%);
  margin: 0 auto 0 0 !important; /* right auto pushes left */
  text-align: left !important;
}

.poetry_page .p_hero_title{
  font-size: 32px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 12px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.30);
}

.poetry_page .p_hero_chips{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  justify-content: flex-start !important;
}

.poetry_page .chip{
  background: rgba(255,255,255,0.20);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}

.poetry_page .p_hero_actions{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start !important;
}

/* Ensure hero buttons never stretch full-width (was happening due to broad .p_hero a selector) */
.poetry_page .p_hero_actions .btn{
  display: inline-flex !important;
  width: auto !important;
}

body.dark_mode .poetry_page .p_hero_overlay{
  background: linear-gradient(to top, rgba(0,0,0,0.90), rgba(0,0,0,0.40) 70%, transparent);
}

body.dark_mode .poetry_page .chip{
  background: rgba(0,0,0,0.50);
  border-color: rgba(255,255,255,0.20);
}

@media (max-width: 768px){
  /* On mobile keep classic 16:9 so the overlay has enough vertical room */
  .poetry_page .p_hero_media{ aspect-ratio: 16/9; }

  .poetry_page .p_hero_overlay{
    padding: 30px 20px 20px;
  }
  .poetry_page .p_hero_title{
    font-size: 26px;
  }
  .poetry_page .btn{
    padding: 10px 18px;
    font-size: 14px;
  }
}

/* ============================================================
   SEARCH BLOCK
   ============================================================ */

.poetry_page .search_block{
  margin: 24px 0 16px;
  background: rgba(255,255,255,0.30);
  border-radius: 60px;
  border: 1px solid rgba(0,0,0,0.08);
  padding: 4px;
  display: flex;
  align-items: center;
  max-width: 720px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  flex-wrap: wrap;
}

.poetry_page .search_form{
  display: flex;
  flex: 1;
  min-width: 260px;
}

.poetry_page .search_input{
  flex: 1;
  background: transparent;
  border: none;
  padding: 14px 20px;
  font-size: 16px;
  outline: none;
  color: inherit;
  min-width: 220px;
}

.poetry_page .search_input::placeholder{
  opacity: 0.55;
  color: inherit;
}

.poetry_page .search_btn{
  background: rgba(255,255,255,0.80);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 40px;
  padding: 10px 28px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 220ms ease, background 160ms ease;
  color: #111;
  white-space: nowrap;
}

.poetry_page .search_btn:hover{
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.poetry_page .search_advanced_link{
  margin-left: 15px;
  padding: 0 6px;
}

.poetry_page .search_advanced{
  font-size: 13px;
  opacity: 0.75;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}

.poetry_page .search_advanced:hover{
  opacity: 1;
  text-decoration: underline;
}

@media (max-width: 768px){
  .poetry_page .search_block{
    flex-direction: column;
    align-items: stretch;
    border-radius: 30px;
    padding: 10px;
  }
  .poetry_page .search_form{ width: 100%; }
  .poetry_page .search_advanced_link{
    margin-left: 0;
    margin-top: 10px;
    text-align: center;
  }
}

@media (max-width: 480px){
  .poetry_page .search_form{
    flex-direction: column;
    gap: 10px;
  }
  .poetry_page .search_btn{ width: 100%; }
}

/* ============================================================
   FEATURED POEM BLOCK ("Снов Приюты")
   ============================================================ */

.poetry_page .featured_poem{
  margin: 28px 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.50) 0%, rgba(255,255,255,0.20) 100%);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 12px 30px rgba(0,0,0,0.05);
}

.poetry_page .featured_poem_grid{
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
}

.poetry_page .featured_poem_media{
  aspect-ratio: 1/1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.02);
}

.poetry_page .featured_poem_media img{
  width: 75%;
  height: 75%;
  object-fit: contain;
  display: block;
  transition: transform 0.5s ease;
}

.poetry_page .featured_poem:hover .featured_poem_media img{
  transform: scale(1.04);
}

.poetry_page .featured_poem_content{
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.poetry_page .featured_poem_label{
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.65;
  margin-bottom: 8px;
}

.poetry_page .featured_poem_title{
  font-size: 42px;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 16px;
  color: #111;
}

.poetry_page .featured_poem_excerpt{
  font-size: 18px;
  line-height: 1.5;
  opacity: 0.82;
  margin-bottom: 24px;
  max-width: 640px;
}

.poetry_page .featured_poem_btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  background: rgba(255,255,255,0.90);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 40px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  color: #111;
  width: fit-content;
  transition: transform 160ms ease, box-shadow 220ms ease, background 160ms ease;
}

.poetry_page .featured_poem_btn:hover{
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.10);
}

@media (max-width: 900px){
  .poetry_page .featured_poem_grid{ grid-template-columns: 1fr; }
  .poetry_page .featured_poem_media{ aspect-ratio: 16/9; }
  .poetry_page .featured_poem_content{ padding: 24px; }
  .poetry_page .featured_poem_title{ font-size: 32px; }
  .poetry_page .featured_poem_media img{ width: 50%; height: 50%; }
}

/* ============================================================
   SHELVES + CARDS
   ============================================================ */

.poetry_page .shelf{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 1100px){
  .poetry_page .shelf{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px){
  .poetry_page .shelf{ grid-template-columns: 1fr; }
}

.poetry_page .card{
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 160ms ease, box-shadow 240ms ease, background 160ms ease, border-color 160ms ease;
}

.poetry_page .card:hover{
  background: rgba(255,255,255,0.90);
  border-color: rgba(0,0,0,0.12);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

.poetry_page .card_media{
  position: relative;
  aspect-ratio: 16/10;
  background: #f0f0f0;
  overflow: hidden;
}

.poetry_page .card_media img,
.poetry_page .card_media video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poetry_page .card_media video::-webkit-media-controls{ display:none !important; }

.poetry_page .card_badge{
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1;
  z-index: 2;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.20);
}

.poetry_page .card_body{
  padding: 14px 14px 12px;
}

.poetry_page .card_title{
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.poetry_page .card_meta{
  margin-top: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  opacity: 0.72;
}

/* "Big" cards can span 2 columns where available */
.poetry_page .card_big{ grid-column: span 2; }
@media (max-width: 980px){ .poetry_page .card_big{ grid-column: span 1; } }

/* If no media: hide media block */
.poetry_page .card.card_no_media .card_media{ display:none; }

/* Excerpts for no-media cards */
.poetry_page .card_excerpt{
  margin: 12px 0 6px;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.85;
  border-left: 2px solid rgba(0,0,0,0.12);
  padding: 2px 0 2px 12px;
}

.poetry_page .excerpt_line{
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

.poetry_page .excerpt_line:not(:last-child){
  margin-bottom: 4px;
}

/* ============================================================
   NOVINKI (titles only)
   ============================================================ */

.poetry_page .shelf_novinki{
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

@media (max-width: 1100px){
  .poetry_page .shelf_novinki{ grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 820px){
  .poetry_page .shelf_novinki{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px){
  .poetry_page .shelf_novinki{ grid-template-columns: 1fr; }
}

.poetry_page .shelf_novinki .card{
  padding: 16px 18px;
  border-radius: 14px;
}

.poetry_page .shelf_novinki .card .card_body{ padding: 0; }
.poetry_page .shelf_novinki .card .card_title{
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 8px;
}
.poetry_page .shelf_novinki .card .card_meta{ margin-top: 0; }

/* ============================================================
   APHORISMS
   ============================================================ */

.poetry_page .aph_block{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.poetry_page .aph_quote{
  background: rgba(255,255,255,0.40);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 18px;
  padding: 24px 20px;
  position: relative;
  transition: transform 160ms ease, box-shadow 240ms ease, background 160ms ease;
  display: block;
}

.poetry_page .aph_quote:hover{
  background: rgba(255,255,255,0.80);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

.poetry_page .aph_quote::before{
  content: "\201C";
  font-size: 80px;
  position: absolute;
  top: -10px;
  left: 10px;
  opacity: 0.15;
  font-family: serif;
}

.poetry_page .aph_text{
  font-size: 17px;
  line-height: 1.5;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.poetry_page .aph_author{
  font-size: 14px;
  opacity: 0.6;
  text-align: right;
  font-style: italic;
}

.poetry_page .aph_author::before{ content: "— "; }

.poetry_page .aph_more{
  margin-top: 24px;
  text-align: center;
}

.poetry_page .aph_more_link{
  display: inline-block;
  padding: 10px 24px;
  border-radius: 40px;
  background: rgba(255,255,255,0.60);
  border: 1px solid rgba(0,0,0,0.08);
  text-decoration: none;
  color: #111;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 220ms ease, background 160ms ease;
}

.poetry_page .aph_more_link:hover{
  background: rgba(255,255,255,0.90);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

/* ============================================================
   ECHO GRID (collection list)
   ============================================================ */

.poetry_page .echo_grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.poetry_page .echo_card{
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 18px;
  padding: 16px 16px 14px;
  transition: transform 160ms ease, box-shadow 240ms ease, background 160ms ease;
}

.poetry_page .echo_card:hover{
  background: rgba(255,255,255,0.90);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

.poetry_page .echo_no{
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 8px;
}

.poetry_page .echo_meta{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  opacity: 0.75;
}

/* ============================================================
   ECHO TABLE (legacy pages)
   ============================================================ */

.poetry_page .echo_table{
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08);
}

.poetry_page .echo_table th,
.poetry_page .echo_table td{
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  text-align: left;
}

.poetry_page .echo_table th{
  opacity: 0.75;
  font-weight: 800;
  background: rgba(255,255,255,0.35);
}

/* ============================================================
   POEM PAGE TYPOGRAPHY (basic)
   ============================================================ */

.poetry_page .poem_body{
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 18px;
  padding: 18px 18px 16px;
}

.poetry_page .poem_text{
  font-size: 15px;
  line-height: 1.75;
  opacity: 0.95;
}

.poetry_page .poem_text .line{ display: block; }

@media (max-width: 640px){
  .poetry_page .poem_text{ font-size: 14px; }
}
