/*
Theme Name: Svetlana
Theme URI: https://example.com/svetlana
Author: Local Team
Description: Lightweight and modern WordPress theme with a clean homepage slider and stylish news/posts layout.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: svetlana
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-muted: #f9fafe;
  --text: #1f2a44;
  --text-soft: #5f6f93;
  --accent: #2f67ff;
  --accent-strong: #1d4fe0;
  --radius: 16px;
  --shadow: 0 16px 40px rgba(26, 45, 95, 0.12);
  --container: 1180px;
}

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

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #e7ecfb;
}

.site-header.is-overlay {
  position: fixed;
  left: 0;
  right: 0;
  background: transparent;
  backdrop-filter: none;
  border-bottom: none;
  transition: background-color 0.28s ease, backdrop-filter 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  margin: 0;
  font-size: 1.35rem;
}

.site-title a { color: var(--text); }
.site-description { margin: 0.2rem 0 0; color: var(--text-soft); font-size: 0.88rem; }

.main-navigation .menu { margin: 0; padding: 0; list-style: none; display: flex; gap: 0.8rem; }
.main-navigation a {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a { background: #edf2ff; color: var(--accent-strong); }

.menu-toggle {
  border: 1px solid #d6e0ff;
  background: #fff;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
  display: none;
}

.header-search {
  display: flex;
  align-items: center;
  margin-left: 0.35rem;
  position: relative;
}
.header-search-toggle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid #d6e0ff;
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.header-search-form {
  width: 0;
  opacity: 0;
  overflow: hidden;
  transition: width 0.22s ease, opacity 0.22s ease, margin 0.22s ease;
  margin-left: 0;
}
.header-search-form input[type="search"] {
  width: 100%;
  min-width: 220px;
  border: 1px solid #d6e0ff;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.92rem;
}
.header-search.is-open .header-search-form {
  width: 240px;
  opacity: 1;
  margin-left: 0.5rem;
}

.site-header.is-overlay .site-title a,
.site-header.is-overlay .site-description,
.site-header.is-overlay .main-navigation a {
  color: #ffffff;
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.site-header.is-overlay .main-navigation a:hover,
.site-header.is-overlay .main-navigation .current-menu-item > a {
  background: rgba(255, 255, 255, 0.17);
  color: #ffffff;
}

.site-header.is-overlay .menu-toggle {
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}
.site-header.is-overlay .header-search-toggle {
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
.site-header.is-overlay .header-search-form input[type="search"] {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.95);
}

.site-header.is-overlay.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #e7ecfb;
  box-shadow: 0 8px 24px rgba(15, 31, 68, 0.08);
}

.site-header.is-overlay.is-scrolled .site-title a,
.site-header.is-overlay.is-scrolled .site-description,
.site-header.is-overlay.is-scrolled .main-navigation a {
  color: var(--text);
  text-shadow: none;
}

.site-header.is-overlay.is-scrolled .main-navigation a:hover,
.site-header.is-overlay.is-scrolled .main-navigation .current-menu-item > a {
  background: #edf2ff;
  color: var(--accent-strong);
}

.site-header.is-overlay.is-scrolled .menu-toggle {
  background: #fff;
  color: var(--text);
  border-color: #d6e0ff;
}
.site-header.is-overlay.is-scrolled .header-search-toggle {
  background: #fff;
  color: var(--text);
  border-color: #d6e0ff;
}

.hero-slider {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow: hidden;
  margin-top: 0;
  margin-bottom: 0;
  box-shadow: none;
  position: relative;
  background: #0f1f44;
  transform: translate3d(0, var(--hero-shift, 0px), 0);
  opacity: var(--hero-fade, 1);
  transition: transform 0.18s linear, opacity 0.18s linear;
}

.slides { margin: 0; padding: 0; list-style: none; }
.slide {
  min-height: 100vh;
  display: none;
  position: relative;
  background-size: cover;
  background-position: center;
}
.slide.is-active { display: block; }
.slide::before {
  content: none;
}
.slide-content {
  position: relative;
  z-index: 1;
  max-width: 100%;
  min-height: 100vh;
  padding: 2rem;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  color: #fff;
  overflow: hidden;
}
.slide-content::after {
  content: none;
}
.slide-title {
  font-size: clamp(4.4rem, 16vw, 15rem);
  line-height: 0.9;
  margin: 0 0 1rem;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  white-space: nowrap;
  will-change: opacity, transform, font-size;
  opacity: 0;
  transform-origin: right bottom;
  width: 100%;
  text-align: right;
  position: relative;
  letter-spacing: 0.02em;
  --title-shift: 0px;
}

.slide-title-top,
.slide-title-bottom {
  display: block;
}

.slide-title-top {
  color: #ffffff;
}

.slide-title-bottom {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
  color: transparent;
  background-image: var(--slide-image);
  background-size: cover;
  background-position: center right;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 2px #ffffff;
  filter: contrast(1.1) saturate(1.1);
}

.slide.is-active .slide-title {
  animation: title-fade-zoom 1.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes title-fade-zoom {
  0% {
    opacity: 0;
    transform: translateY(calc(var(--title-shift) + 26px)) scale(0.96);
    font-size: clamp(4rem, 15.2vw, 14rem);
  }
  100% {
    opacity: 1;
    transform: translateY(var(--title-shift)) scale(1);
    font-size: clamp(4.4rem, 16vw, 15rem);
  }
}

.front-news {
  margin-top: -26px;
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(42px);
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.front-news.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  margin: 0 0 1.1rem;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
}

.post-grid {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 2rem;
}

.post-card {
  display: block;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px rgba(26, 45, 95, 0.18);
}
.post-card-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.post-card-thumb {
  position: relative;
  display: block;
}
.post-card-thumb-link {
  display: block;
}
.post-card-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  pointer-events: auto;
}
.post-badge {
  display: inline-block;
  padding: 0.24rem 0.56rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(15, 31, 68, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(3px);
  text-decoration: none;
}
.post-badge-category {
  background: rgba(47, 103, 255, 0.86);
}
.post-badge-tag {
  background: rgba(24, 32, 64, 0.75);
}
.post-badge:hover {
  color: #fff;
  transform: translateY(-1px);
  opacity: 0.92;
}
.post-card-body {
  padding: 1rem 1.1rem 1.2rem;
}
.post-meta { color: var(--text-soft); font-size: 0.85rem; margin-bottom: 0.45rem; }
.post-card-title { margin: 0 0 0.55rem; font-size: 1.35rem; line-height: 1.25; }
.post-excerpt { margin: 0; color: #445273; }

.news-header,
.page-header {
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  margin: 1.2rem 0;
}

.content-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.single-post {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}
.single-post .entry-title { margin-top: 0; }
.single-post .post-thumbnail img { border-radius: 12px; width: 100%; height: auto; }
.single-post-news {
  margin-top: -48px;
  position: relative;
  z-index: 2;
}
.single-post-news .entry-content {
  font-size: 1.08rem;
  color: #2e3d62;
}
.single-post-news .entry-content p {
  margin: 0 0 1.2rem;
}

.comments-area {
  margin-top: 1rem;
}
.comments-title {
  margin-bottom: 1rem;
}
.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.comment-list > li {
  border: 1px solid #e4ebff;
  border-radius: 14px;
  background: #f8faff;
  padding: 0.9rem 1rem;
  margin-bottom: 0.8rem;
}
.comment-body {
  color: #2d3a5f;
}
.comment-meta {
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
  color: #5f6f93;
}
.comment-author .avatar {
  border-radius: 50%;
  margin-right: 0.55rem;
  vertical-align: middle;
}
.comment-author .fn {
  font-weight: 700;
  color: #1f2a44;
}
.comment-list .reply a,
.comment-edit-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
}
.comment-form-svetlana p {
  margin-bottom: 0.75rem;
}
.comment-form-svetlana label {
  display: block;
  margin-bottom: 0.25rem;
  color: #334671;
  font-size: 0.9rem;
  font-weight: 600;
}
.comment-form-svetlana input[type="text"],
.comment-form-svetlana input[type="email"],
.comment-form-svetlana input[type="url"],
.comment-form-svetlana textarea {
  width: 100%;
  border: 1px solid #d6e0ff;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: #fff;
  color: #1f2a44;
}
.comment-form-svetlana textarea {
  min-height: 130px;
  resize: vertical;
}
.comment-form-svetlana .submit {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 0.62rem 1.1rem;
  font-weight: 700;
}
.comment-form-svetlana .submit:hover {
  background: var(--accent-strong);
}

/* Stylish quotes */
.entry-content blockquote,
.single-post blockquote,
.page blockquote,
.wp-block-quote,
.wp-block-pullquote {
  position: relative;
  margin: 1.3rem 0;
  padding: 1rem 1.2rem 1rem 1.35rem;
  border-radius: 14px;
  border-left: 4px solid var(--accent);
  background: linear-gradient(130deg, rgba(47, 103, 255, 0.08), rgba(47, 103, 255, 0.02));
  box-shadow: 0 10px 26px rgba(31, 42, 68, 0.08);
}
.entry-content blockquote::before,
.single-post blockquote::before,
.page blockquote::before,
.wp-block-quote::before,
.wp-block-pullquote::before {
  content: "“";
  position: absolute;
  top: -0.2rem;
  left: 0.55rem;
  font-size: 2.2rem;
  line-height: 1;
  color: rgba(47, 103, 255, 0.35);
  font-weight: 700;
}
.entry-content blockquote p,
.single-post blockquote p,
.page blockquote p,
.wp-block-quote p,
.wp-block-pullquote p {
  margin: 0;
  color: #2a3a60;
  font-size: 1.05rem;
  line-height: 1.7;
  font-style: italic;
}
.entry-content blockquote cite,
.single-post blockquote cite,
.page blockquote cite,
.wp-block-quote cite,
.wp-block-pullquote cite {
  display: block;
  margin-top: 0.65rem;
  color: #4f6291;
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 600;
}

.news-hero {
  min-height: 58vh;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: #21335f;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-start;
}
.news-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 16, 35, 0.12) 18%, rgba(9, 16, 35, 0.46) 100%);
}
.news-hero-inner {
  position: relative;
  z-index: 1;
  color: #fff;
  width: 100%;
  padding: 7.8rem clamp(1.2rem, 4vw, 3.2rem) 2.4rem;
}
.news-hero-meta {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  opacity: 0.9;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
}
.hero-post-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.news-hero-title {
  margin: 0;
  font-size: clamp(2rem, 5.2vw, 3.6rem);
  line-height: 1.1;
  width: 100%;
  max-width: 100%;
  text-wrap: balance;
}

.pagination .nav-links { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pagination .page-numbers {
  background: var(--surface);
  border: 1px solid #dfe7ff;
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
}
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

.infinite-news-status {
  min-height: 2rem;
  margin: 0.3rem 0 1.4rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  text-align: center;
}

/* Gallery cards + lightbox */
.single-post .gallery,
.single-post .wp-block-gallery,
.page .gallery,
.page .wp-block-gallery,
.entry-content .gallery,
.entry-content .wp-block-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.single-post .gallery .gallery-item,
.single-post .wp-block-gallery .wp-block-image,
.page .gallery .gallery-item,
.page .wp-block-gallery .wp-block-image,
.entry-content .gallery .gallery-item,
.entry-content .wp-block-gallery .wp-block-image {
  margin: 0;
  width: 100% !important;
  max-width: none !important;
  float: none !important;
}
.single-post .gallery .gallery-item a,
.single-post .wp-block-gallery .wp-block-image a,
.single-post .gallery .gallery-item img,
.single-post .wp-block-gallery .wp-block-image img,
.page .gallery .gallery-item a,
.page .wp-block-gallery .wp-block-image a,
.page .gallery .gallery-item img,
.page .wp-block-gallery .wp-block-image img,
.entry-content .gallery .gallery-item a,
.entry-content .wp-block-gallery .wp-block-image a,
.entry-content .gallery .gallery-item img,
.entry-content .wp-block-gallery .wp-block-image img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  overflow: hidden;
}
.single-post .gallery .gallery-item a,
.single-post .wp-block-gallery .wp-block-image a,
.page .gallery .gallery-item a,
.page .wp-block-gallery .wp-block-image a,
.entry-content .gallery .gallery-item a,
.entry-content .wp-block-gallery .wp-block-image a {
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  min-height: 180px;
}
.single-post .gallery .gallery-item a:hover,
.single-post .wp-block-gallery .wp-block-image a:hover,
.page .gallery .gallery-item a:hover,
.page .wp-block-gallery .wp-block-image a:hover,
.entry-content .gallery .gallery-item a:hover,
.entry-content .wp-block-gallery .wp-block-image a:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(26, 45, 95, 0.18);
}
.single-post .gallery .gallery-caption,
.page .gallery .gallery-caption,
.entry-content .gallery .gallery-caption {
  margin-top: 0.45rem;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.sv-gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 30, 0.92);
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}
.sv-gallery-lightbox[hidden] {
  display: none;
}
.sv-gallery-lightbox img {
  max-width: min(92vw, 1300px);
  max-height: 90vh;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.sv-gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.17);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(3px);
}
.sv-gallery-lightbox-prev { left: 14px; }
.sv-gallery-lightbox-next { right: 14px; }
.sv-gallery-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}
.sv-gallery-lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.site-footer {
  margin-top: 2rem;
  background: #101b3d;
  color: #c2cae8;
}
.footer-inner {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

@media (max-width: 991px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .single-post .gallery,
  .single-post .wp-block-gallery,
  .page .gallery,
  .page .wp-block-gallery,
  .entry-content .gallery,
  .entry-content .wp-block-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .menu-toggle { display: inline-block; }
  .main-navigation { display: none; width: 100%; }
  .main-navigation.is-open { display: block; }
  .main-navigation .menu { flex-direction: column; padding-bottom: 0.8rem; }
  .header-inner { flex-wrap: wrap; padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .header-search { width: 100%; justify-content: flex-end; }
  .header-search.is-open .header-search-form {
    width: min(100%, 320px);
  }
  .post-grid { grid-template-columns: 1fr; }
  .single-post .gallery,
  .single-post .wp-block-gallery,
  .page .gallery,
  .page .wp-block-gallery,
  .entry-content .gallery,
  .entry-content .wp-block-gallery {
    grid-template-columns: 1fr;
  }
  .slide { min-height: 100svh; }
  .slide-content { min-height: 100svh; }
  .slide-title {
    margin-bottom: 1.4rem;
    white-space: normal;
    font-size: clamp(2.2rem, 15vw, 5rem);
    line-height: 1;
  }
  .news-hero {
    min-height: 48svh;
  }
  .news-hero-title {
    max-width: 100%;
  }
  .single-post-news {
    margin-top: -22px;
  }
  .sv-gallery-lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 28px;
  }
  .sv-gallery-lightbox-prev { left: 8px; }
  .sv-gallery-lightbox-next { right: 8px; }
  .sv-gallery-lightbox-close {
    top: 8px;
    right: 8px;
  }
}
