/* Main stylesheet entry point for Taras's blog */

/* Base imports */
@import url('styles.css');
@import url('theme.css');
@import url('make-post.css');
@import url('about.css');
@import url('contact.css');
@import url('login.css');
@import url('openai.css');
@import url('games.css');

/* Layout tokens */
:root {
  --border-radius-base: 0.75rem;
  --spacing-unit: 0.5rem;
}

/* Layout */
.site-main {
  padding-inline: clamp(1.25rem, 3vw, 2.5rem);
}

/* Masthead helpers */
.masthead-post {
  background-image: var(--masthead-post-hero), var(--masthead-post-fallback);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Bootstrap overrides */
:is(.btn-primary, .btn-primary:hover, .btn-primary:focus, .btn-primary:active) {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.btn-outline-light {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.8);
}

.card,
.toast,
.alert,
.form-control,
.form-select,
.navbar {
  border-radius: var(--border-radius-base);
}

.card,
.toast,
.alert {
  box-shadow: 0 24px 45px rgba(15, 23, 42, 0.08);
}

.navbar {
  padding-inline: calc(var(--spacing-unit) * 3);
}

/* Blog: layout */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  flex: 1 0 auto;
}

.content-section {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.content-section + .content-section {
  border-top: 1px solid rgba(var(--bs-secondary-rgb), 0.08);
}

/* Blog: navigation & footer */
.site-navbar {
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
  background: linear-gradient(90deg, rgba(var(--bs-primary-rgb), 0.9), rgba(var(--bs-primary-rgb), 0.75));
}

.site-navbar .nav-link,
.site-navbar .navbar-brand {
  letter-spacing: 0.01em;
}

/* Blog: post list */
body.theme-home {
  --bs-primary: #6d28d9;
  --bs-primary-rgb: 109, 40, 217;
  --brand-accent: #c084fc;
  --brand-accent-rgb: 192, 132, 252;
  --theme-primary-dark: #5b21b6;
  --theme-primary-darker: #4c1d95;
  --theme-primary-rgb: 109, 40, 217;
  --page-bg-1: rgba(109, 40, 217, 0.12);
  --page-bg-2: rgba(192, 132, 252, 0.18);
  --masthead-overlay-start: rgba(43, 15, 85, 0.92);
  --masthead-overlay-end: rgba(109, 40, 217, 0.78);
}

header.masthead.masthead-home {
  background-image: url("../assets/img/home-bg.jpg");
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.section-title {
  font-size: clamp(2rem, 2.5vw, 2.75rem);
  font-weight: 700;
  color: var(--bs-secondary);
}

.section-subtitle {
  max-width: 46rem;
  color: rgba(var(--bs-secondary-rgb), 0.65);
}

.post-card-grid > .col {
  display: flex;
}

.post-card-grid > .col > .post-card {
  flex: 1 1 auto;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--brand-surface);
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid transparent;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  animation: fadeIn 0.6s ease-in-out;
}

.post-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 40px 70px rgba(15, 23, 42, 0.12);
  border-color: rgba(var(--bs-primary-rgb), 0.3);
}

.post-card .card-body {
  padding: 1.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
}

.post-card-title,
.post-card .card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--bs-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.post-card-excerpt,
.post-card .card-text {
  color: rgba(var(--bs-secondary-rgb), 0.65);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
  flex: 1 1 auto;
}

.post-card-meta,
.post-card .card-footer {
  background: var(--brand-surface-alt);
  border-top: 1px solid var(--brand-border);
  padding: 1.25rem 1.85rem;
  color: rgba(var(--bs-secondary-rgb), 0.6);
  font-size: 0.9rem;
  margin-top: auto;
}

.post-card .card-footer a {
  color: var(--brand-accent);
  font-weight: 600;
}

.post-card .card-footer a:hover {
  color: var(--bs-primary);
}

.post-card .card-footer .text-danger {
  color: #f87171 !important;
}

.post-card-link {
  display: block;
}

.post-card-link:focus-visible {
  outline: 3px solid rgba(var(--brand-accent-rgb), 0.45);
  outline-offset: 4px;
}

.post-card-media {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  aspect-ratio: var(--post-card-media-aspect, 16 / 10);
  background: var(--brand-surface-alt);
}

.post-card-media::before {
  content: "";
  display: block;
  padding-top: var(--post-card-media-fallback, 62.5%);
  pointer-events: none;
}

@supports (aspect-ratio: 1) {
  .post-card-media::before {
    content: none;
    display: none;
    padding-top: 0;
  }
}

.post-card .card-img-top,
.post-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.post-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.25) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.post-card:hover .post-card-media::after,
.post-card-link:focus-visible .post-card-media::after {
  opacity: 1;
}

.reading-time {
  display: inline-block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--bs-secondary-rgb), 0.55);
  font-size: 0.75rem;
  margin-top: 0.35rem;
}

.reading-time-dot {
  margin: 0 0.35rem;
  color: rgba(var(--bs-secondary-rgb), 0.45);
}

.meta-updated {
  font-size: 0.85rem;
  color: rgba(var(--bs-secondary-rgb), 0.6);
  margin-top: 0.35rem;
}

.empty-state {
  background: var(--brand-surface);
  border-radius: 1.5rem;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--brand-border);
}

[data-bs-theme="dark"] .post-card {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 32px 64px rgba(2, 6, 23, 0.65);
}

[data-bs-theme="dark"] .post-card:hover {
  box-shadow: 0 40px 70px rgba(2, 6, 23, 0.75);
  border-color: rgba(var(--bs-primary-rgb), 0.45);
}

[data-bs-theme="dark"] .post-card-title,
[data-bs-theme="dark"] .post-card .card-title {
  color: rgba(var(--bs-secondary-rgb), 0.95);
}

[data-bs-theme="dark"] .post-card-excerpt,
[data-bs-theme="dark"] .post-card .card-text {
  color: rgba(var(--bs-secondary-rgb), 0.72);
}

[data-bs-theme="dark"] .post-card-meta,
[data-bs-theme="dark"] .post-card .card-footer {
  background: rgba(30, 41, 59, 0.82);
  border-color: rgba(148, 163, 184, 0.25);
  color: rgba(var(--bs-secondary-rgb), 0.7);
}

[data-bs-theme="dark"] .reading-time,
[data-bs-theme="dark"] .meta-updated {
  color: rgba(var(--bs-secondary-rgb), 0.7);
}

[data-bs-theme="dark"] .reading-time-dot {
  color: rgba(var(--bs-secondary-rgb), 0.5);
}

/* Blog: single post */
body.theme-post {
  --bs-primary: #f43f5e;
  --bs-primary-rgb: 244, 63, 94;
  --brand-accent: #fecdd3;
  --brand-accent-rgb: 254, 205, 211;
  --theme-primary-dark: #e11d48;
  --theme-primary-darker: #be123c;
  --theme-primary-rgb: 244, 63, 94;
  --page-bg-1: rgba(244, 63, 94, 0.12);
  --page-bg-2: rgba(254, 205, 211, 0.22);
  --masthead-overlay-start: rgba(107, 19, 38, 0.92);
  --masthead-overlay-end: rgba(244, 63, 94, 0.78);
}

.post-header .post-title,
.post-heading h1 {
  font-size: clamp(2.25rem, 3vw, 3.4rem);
}

.post-header .post-meta,
.post-heading .meta {
  color: rgba(var(--bs-secondary-rgb), 0.8);
}

.post-utility {
  display: grid;
  gap: clamp(1rem, 2vw, 2rem);
  margin-bottom: clamp(2rem, 4vw, 3rem);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border-radius: 1.5rem;
  border: 1px solid var(--brand-border);
  background: var(--brand-surface-alt);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.12);
}

[data-bs-theme="dark"] .post-utility {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 24px 64px rgba(2, 6, 23, 0.5);
}

@media (min-width: 992px) {
  .post-utility {
    grid-template-columns: minmax(0, 200px) 1fr minmax(0, 260px);
    align-items: center;
  }
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--bs-primary);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.post-back:hover,
.post-back:focus {
  color: var(--theme-primary-dark);
  text-decoration: none;
}

.post-back i {
  transition: transform 0.2s ease;
}

.post-back:hover i,
.post-back:focus i {
  transform: translateX(-3px);
}

.post-meta-stats {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.post-meta-stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1.1rem;
  border-radius: 1.1rem;
  background: var(--brand-surface);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

[data-bs-theme="dark"] .post-meta-stat {
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 18px 36px rgba(2, 6, 23, 0.55);
}

.post-meta-stat .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: rgba(var(--bs-secondary-rgb), 0.6);
}

[data-bs-theme="dark"] .post-meta-stat .label {
  color: rgba(var(--bs-secondary-rgb), 0.65);
}

.post-meta-stat time,
.post-meta-stat .value {
  font-weight: 600;
  color: rgba(var(--bs-secondary-rgb), 0.88);
}

[data-bs-theme="dark"] .post-meta-stat time,
[data-bs-theme="dark"] .post-meta-stat .value {
  color: rgba(var(--bs-secondary-rgb), 0.9);
}

.post-share {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.post-share__label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(var(--bs-secondary-rgb), 0.6);
}

.post-share__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.post-share__action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--bs-secondary-rgb), 0.18);
  background: var(--brand-surface);
  color: rgba(var(--bs-secondary-rgb), 0.78);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  appearance: none;
}

.post-share__action i {
  font-size: 0.95rem;
}

.post-share__action:hover,
.post-share__action:focus {
  transform: translateY(-2px);
  color: var(--bs-primary);
  border-color: rgba(var(--bs-primary-rgb), 0.35);
  box-shadow: 0 16px 32px rgba(var(--bs-primary-rgb), 0.18);
}

.post-share__action:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25), 0 16px 32px rgba(var(--bs-primary-rgb), 0.18);
}

[data-bs-theme="dark"] .post-share__action {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(148, 163, 184, 0.3);
  color: rgba(var(--bs-secondary-rgb), 0.88);
}

[data-bs-theme="dark"] .post-share__action:hover,
[data-bs-theme="dark"] .post-share__action:focus {
  color: var(--brand-accent);
  border-color: rgba(var(--brand-accent-rgb), 0.45);
  box-shadow: 0 16px 32px rgba(var(--brand-accent-rgb), 0.22);
}

.post-share__feedback {
  min-height: 1.1rem;
  font-size: 0.85rem;
  color: rgba(var(--bs-secondary-rgb), 0.55);
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.post-share__feedback.is-visible {
  opacity: 1;
  color: var(--bs-primary);
}

.post-share__feedback.is-error {
  color: var(--bs-danger);
  opacity: 1;
}

.post-hero {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.16);
}

.post-hero img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

@supports not (aspect-ratio: 1) {
  .post-hero {
    position: relative;
  }

  .post-hero::before {
    content: "";
    display: block;
    padding-top: 56.25%;
  }

  .post-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
}

.post-content {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  font-size: clamp(1rem, 0.9rem + 0.35vw, 1.15rem);
  color: rgba(var(--bs-secondary-rgb), 0.82);
}

.post-content > * {
  margin: 0;
}

.post-content figure,
.post-content .ck-widget.image {
  width: min(100%, 54rem);
  margin: clamp(1.5rem, 4vw, 3rem) auto;
  overflow: hidden;
  border-radius: 1.25rem;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.12);
}

.post-content img,
.post-content figure img,
.post-content .ck-widget.image img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
}

.post-content img {
  border-radius: 0.75rem;
}

.post-content figure img,
.post-content .ck-widget.image img {
  width: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

@supports not (aspect-ratio: 1) {
  .post-content figure,
  .post-content .ck-widget.image {
    position: relative;
  }

  .post-content figure::before,
  .post-content .ck-widget.image::before {
    content: "";
    display: block;
    padding-top: 56.25%;
  }

  .post-content figure img,
  .post-content .ck-widget.image img {
    position: absolute;
    inset: 0;
    height: 100%;
  }
}

.commentList {
  list-style: none;
  padding-left: 0;
  margin: 2.5rem 0 0;
}

.comment-item,
.commentList li {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--brand-surface);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 24px 45px rgba(15, 23, 42, 0.08);
  border: 1px solid transparent;
  animation: fadeIn 0.5s ease-in-out;
}

.commentList li + li {
  margin-top: 1rem;
}

.commenterImage img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(var(--bs-primary-rgb), 0.35);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.commentText {
  flex: 1;
  color: rgba(var(--bs-secondary-rgb), 0.8);
}

.commentText .sub-text {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(var(--bs-secondary-rgb), 0.55);
}

.pagination .page-link {
  border-radius: 999px;
  padding-inline: 0.85rem;
}
