/* Homepage */

.home-hero {
  padding: var(--space-6) 0 var(--space-7);
  background:
    radial-gradient(60% 80% at 0% 0%, color-mix(in srgb, var(--accent-500) 6%, transparent), transparent 60%),
    radial-gradient(50% 70% at 100% 20%, color-mix(in srgb, var(--slate-500) 6%, transparent), transparent 70%),
    var(--bg-page);
  border-bottom: 1px solid var(--border-default);
}

.home-hero__intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}
.home-hero__intro h1 {
  margin: 0;
  font-size: var(--fs-3xl);
  line-height: var(--lh-tight);
}
.home-hero__intro p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--fs-md);
  max-width: 60ch;
}
@media (min-width: 768px) {
  .home-hero__intro h1 { font-size: var(--fs-4xl); }
}

.home-hero__grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .home-hero__grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: var(--space-6);
  }
}

.featured-news {
  display: grid;
  gap: var(--space-4);
}
@media (min-width: 768px) {
  .featured-news { grid-template-columns: 1fr 1fr; }
  .featured-news .card--hero { grid-column: 1 / -1; }
}

.widget-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Weather widget */
.weather-widget__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.weather-widget__temp {
  font-family: var(--font-serif);
  font-size: var(--fs-5xl);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}
.weather-widget__icon {
  width: 64px;
  height: 64px;
  color: var(--accent-600);
}
.weather-widget__desc {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
}
.weather-widget__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}
.weather-widget__meta dt {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: 2px;
}
.weather-widget__meta dd {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin: 0;
}

/* Quick actions grid */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.quick-action {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
  padding: var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--trans-fast), background var(--trans-fast);
}
.quick-action:hover {
  text-decoration: none;
  border-color: var(--accent-500);
  background: var(--surface-hover);
  color: var(--text-primary);
}
.quick-action__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-50);
  color: var(--accent-600);
}
[data-theme='dark'] .quick-action__icon { background: rgba(220, 38, 38, 0.12); }
.quick-action__title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  line-height: var(--lh-snug);
}
.quick-action__desc {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* Section headers */
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--border-default);
}
.section-head h2 {
  font-family: var(--font-serif);
  font-size: var(--fs-2xl);
  margin: 0;
  line-height: var(--lh-tight);
}
@media (min-width: 768px) {
  .section-head h2 { font-size: var(--fs-3xl); }
}
.section-head__link {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-accent);
}

/* News grid */
.news-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }

/* Community section */
.community-section {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
}
.community-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 1024px) {
  .community-grid { grid-template-columns: 1fr 1.2fr; }
}
.community-intro h2 {
  font-size: var(--fs-3xl);
  margin-bottom: var(--space-3);
}
.community-intro p {
  color: var(--text-secondary);
  max-width: 52ch;
}
.community-intro .cluster { margin-top: var(--space-5); }

.messages-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.message-item {
  padding: var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent-600);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.message-item__head {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.message-item__author {
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  font-size: var(--fs-sm);
}
.message-item__text {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  margin: 0;
}

/* App download callout — full-bleed Onești panorama with overlay.
   Sits above the hero so it's the first thing visitors see. */
.app-download {
  position: relative;
  padding: var(--space-8) 0;
  color: #fff;
  background-color: var(--slate-900);
  background-image:
    linear-gradient(to bottom,
      rgba(11, 15, 26, 0.65) 0%,
      rgba(11, 15, 26, 0.55) 50%,
      rgba(11, 15, 26, 0.85) 100%),
    radial-gradient(60% 80% at 0% 0%, color-mix(in srgb, var(--accent-600) 22%, transparent), transparent 60%),
    url('/images/hero-onesti.jpg');
  background-size: cover, cover, cover;
  background-position: center, center, center center;
  background-repeat: no-repeat;
  isolation: isolate;
}
@media (min-width: 768px) {
  .app-download { padding: var(--space-9) 0; }
}

/* Transparent now — the panorama + overlay IS the card background. */
.app-download__card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  text-align: center;
  color: #fff;
}
@media (min-width: 768px) { .app-download__card { gap: var(--space-5); } }
.app-download__text h2 {
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.4);
}
.app-download__text p {
  color: #fff;
  font-weight: 500;
  font-size: var(--fs-lg);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.5);
  max-width: 44ch;
}
.app-download__text h2 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.app-download__text p {
  color: var(--text-secondary);
  max-width: 52ch;
  margin: 0 auto;
  font-size: var(--fs-md);
}

.app-download__stores {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-2);
}

/* Hero video trigger — the H2 IS visually the target, with a huge
   translucent play silhouette layered behind it so the panorama reads
   as a video poster. An invisible button overlay handles the click so
   the H2 stays a real heading. */
.hero-video-trigger {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: clamp(40px, 6vw, 70px) clamp(20px, 4vw, 60px);
  isolation: isolate;
}
.hero-video-trigger__hit {
  position: absolute;
  inset: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius-lg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}
.hero-video-trigger__hit:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}
.hero-video-trigger__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(280px, 42vw, 540px);
  height: clamp(200px, 30vw, 386px);
  transform: translate(-50%, -50%);
  color: #DC2626;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  transition: opacity 320ms ease, transform 320ms ease;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.55));
}
.hero-video-trigger__icon {
  width: 100%;
  height: 100%;
  display: block;
}
.hero-video-trigger__hit:hover ~ .hero-video-trigger__play,
.hero-video-trigger__hit:focus-visible ~ .hero-video-trigger__play,
.hero-video-trigger:hover .hero-video-trigger__play {
  opacity: 0.38;
  transform: translate(-50%, -50%) scale(1.04);
}
.hero-video-trigger__eyebrow {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(var(--fs-sm), 1.6vw, var(--fs-lg));
  letter-spacing: 0.04em;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  margin-bottom: var(--space-2);
  position: relative;
  z-index: 1;
}
.hero-video-trigger__title {
  position: relative;
  z-index: 1;
  margin: 0;
}
.hero-video-trigger .app-download__text { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .hero-video-trigger__play { transition: none; }
  .hero-video-trigger__hit:hover ~ .hero-video-trigger__play,
  .hero-video-trigger__hit:focus-visible ~ .hero-video-trigger__play,
  .hero-video-trigger:hover .hero-video-trigger__play {
    transform: translate(-50%, -50%);
  }
}

/* Video modal */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.video-modal[hidden] { display: none; }
.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 18, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: videoFadeIn 0.18s ease-out;
  cursor: pointer;
}
.video-modal__dialog {
  position: relative;
  width: min(1180px, 96vw);
  max-height: 90vh;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: videoZoomIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.video-modal__frame {
  position: absolute;
  inset: 0;
}
.video-modal__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.video-modal__close {
  position: absolute;
  top: -52px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background var(--trans-fast), transform var(--trans-fast);
}
.video-modal__close svg { width: 18px; height: 18px; }
.video-modal__close:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: rotate(90deg);
}
.video-modal__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .video-modal { padding: var(--space-3); }
  .video-modal__close {
    top: auto;
    bottom: calc(100% + 8px);
  }
}
@keyframes videoFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes videoZoomIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .video-modal__backdrop,
  .video-modal__dialog { animation: none; }
  .video-modal__close:hover { transform: none; }
}
html.video-modal-open,
html.video-modal-open body { overflow: hidden; }

/* Official badge images sit at their natural aspect ratio. */
.store-badge-img {
  display: inline-block;
  transition: transform var(--trans-fast), filter var(--trans-fast);
  line-height: 0;
}
.store-badge-img img {
  height: 52px;
  width: auto;
  display: block;
}
.store-badge-img:hover { transform: translateY(-2px); filter: brightness(1.05); }
.store-badge-img:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 6px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform var(--trans-fast), box-shadow var(--trans-fast), background var(--trans-fast);
  flex: 1 1 0;
  min-width: 0;
}
@media (min-width: 768px) {
  .store-badge { flex: 0 0 auto; padding: 12px 20px; font-size: var(--fs-base); }
}
.store-badge:hover {
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: var(--shadow-lg);
}
.store-badge--apple {
  background: #0F172A;
  color: #fff;
  border: 1px solid #0F172A;
}
.store-badge--apple:hover { background: #000; color: #fff; }
.store-badge--android {
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.store-badge--android:hover { border-color: var(--accent-500); color: var(--accent-600); }

.store-badge__text {
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Placeholder/skeleton shimmer */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-sunken) 0%,
    var(--bg-muted) 50%,
    var(--surface-sunken) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton--card { height: 360px; }
.skeleton--line { height: 14px; margin-bottom: 8px; }
.skeleton--line:last-child { width: 60%; }
