/*
Theme Name: sv-theme
Theme URI: https://surveee.org/
Description: A fast, clean, mobile-first WordPress theme for Surveee-style stories, quizzes, videos, articles, and news.
Version: 1.0.0
Author: Surveee
Text Domain: sv-theme
*/

:root {
  --sv-bg: #f6f5f1;
  --sv-surface: #ffffff;
  --sv-text: #232323;
  --sv-muted: #6a625d;
  --sv-border: #e5dfd7;
  --sv-brand: #2458b8;
  --sv-brand-dark: #1f4590;
  --sv-hero: #171717;
  --sv-shadow: 0 14px 40px rgba(25, 22, 18, .08);
  --sv-radius: 18px;
  --sv-content: 760px;
  --sv-wide: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--sv-bg);
  color: var(--sv-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img, video, iframe, embed, object {
  max-width: 100%;
}

img {
  height: auto;
  display: block;
}

a {
  color: var(--sv-brand);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover { color: var(--sv-brand-dark); }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  width: auto;
  height: auto;
  clip: auto;
  overflow: visible;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 12px;
  background: #fff;
  color: #000;
  border-radius: 8px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--sv-border);
  backdrop-filter: saturate(140%) blur(10px);
}

.header-container {
  width: min(var(--sv-wide), calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  line-height: 1;
  letter-spacing: -.02em;
}

.site-title a {
  color: var(--sv-text);
  text-decoration: none;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid var(--sv-border);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--sv-surface);
  color: var(--sv-text);
  font: inherit;
  font-size: .92rem;
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  content: "";
}

.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before { position: absolute; transform: translateY(-6px); }
.nav-toggle-bars::after { position: absolute; transform: translateY(6px); }

.main-navigation {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: none;
  background: #fff;
  border-bottom: 1px solid var(--sv-border);
  box-shadow: var(--sv-shadow);
}

.main-navigation.is-open { display: block; }

.main-navigation ul {
  width: min(var(--sv-wide), calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0;
  list-style: none;
}

.main-navigation li { margin: 0; }

.main-navigation a {
  display: block;
  padding: 13px 0;
  color: var(--sv-text);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: .01em;
  text-decoration: none;
  border-bottom: 1px solid #f0ece8;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
  color: var(--sv-brand);
}

.site-main {
  width: min(var(--sv-wide), calc(100% - 28px));
  margin: 0 auto;
}

.home-intro {
  margin: 22px 0 28px;
  padding: clamp(28px, 6vw, 62px) 18px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #1169d7, #0c268a);
  border-radius: var(--sv-radius);
}

.home-intro h1 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 5vw, 3rem);
  line-height: 1.1;
}

.home-intro p {
  max-width: 720px;
  margin: 0 auto;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
}

.archive-header {
  max-width: var(--sv-content);
  margin: 28px auto 24px;
  text-align: center;
}

.archive-header h1,
.page-hero .entry-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.08;
}

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 24px 0 44px;
}

.post-card {
  overflow: hidden;
  background: var(--sv-surface);
  border: 1px solid var(--sv-border);
  border-radius: var(--sv-radius);
  box-shadow: var(--sv-shadow);
}

.post-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.post-thumbnail {
  overflow: hidden;
  background: #e8e2da;
  aspect-ratio: 16 / 10;
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  padding: 18px;
}

.post-card .entry-title {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 4.5vw, 1.85rem);
  line-height: 1.16;
  letter-spacing: -.015em;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--sv-muted);
  font-size: .88rem;
  font-weight: 700;
}

.card-meta { margin-bottom: 12px; }
.meta-dot { opacity: .55; }
.entry-summary {
  color: var(--sv-muted);
  font-size: 1rem;
}
.entry-summary p { margin: 0; }

.post-hero {
  position: relative;
  margin-left: calc(50% - 50vw);
  width: 100vw;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(circle at 50% 0%, #3b3b3b, var(--sv-hero));
}

.post-hero-media {
  position: absolute;
  inset: 0;
  opacity: .22;
}

.post-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%) contrast(110%);
}

.post-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.52), rgba(0,0,0,.78));
}

.post-hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--sv-content), calc(100% - 30px));
  margin: 0 auto;
  padding: clamp(44px, 9vw, 88px) 0;
  text-align: center;
}

.post-kicker {
  min-height: 1px;
  margin-bottom: 10px;
  color: rgba(255,255,255,.72);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
}

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

.post-hero .entry-title {
  margin: 0 auto 18px;
  max-width: 900px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.025em;
}

.single-meta {
  justify-content: center;
  color: rgba(255,255,255,.86);
}

.authorbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.author-avatar,
.avatar {
  border-radius: 999px;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 22px;
  padding: 12px 18px;
  color: #fff;
  background: var(--sv-brand);
  border-radius: 999px;
  font-size: .94rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(36, 88, 184, .24);
}

.share-button:hover { color: #fff; background: var(--sv-brand-dark); }
.share-button-secondary { margin-top: 0; }

.content-card {
  width: min(var(--sv-content), 100%);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 42px);
  background: var(--sv-surface);
  border: 1px solid var(--sv-border);
  border-radius: 0 0 var(--sv-radius) var(--sv-radius);
  box-shadow: var(--sv-shadow);
}

.single-article .content-card {
  margin-top: 0;
}

.entry-content {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2.2vw, 1.2rem);
  line-height: 1.78;
}

.entry-content > *:first-child { margin-top: 0; }
.entry-content > *:last-child { margin-bottom: 0; }

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote {
  margin: 0 0 1.35em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin: 1.5em 0 .55em;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.18;
  letter-spacing: -.02em;
}

.entry-content h2 { font-size: clamp(1.55rem, 4vw, 2.2rem); }
.entry-content h3 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
.entry-content h4 { font-size: 1.18rem; }

.entry-content a { font-weight: 700; }

.entry-content img,
.entry-content .wp-caption,
.entry-content figure,
.entry-content iframe {
  border-radius: 14px;
}

.entry-content .wp-block-embed,
.entry-content .wp-video,
.entry-content iframe {
  margin: 28px 0;
}

.entry-content iframe {
  width: 100%;
}

.wp-caption { max-width: 100%; }
.wp-caption-text {
  margin-top: 8px;
  color: var(--sv-muted);
  font: .9rem/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.post-share-row,
.ad-slot,
.post-navigation,
.comments-area {
  width: min(var(--sv-content), 100%);
  margin-left: auto;
  margin-right: auto;
}

.post-share-row {
  margin-top: 24px;
  text-align: center;
}

.ad-slot {
  margin-top: 24px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--sv-border);
  border-radius: 14px;
  overflow: hidden;
}

.ad-slot > span {
  display: block;
  margin-bottom: 6px;
  color: var(--sv-muted);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.post-navigation {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.post-navigation a {
  display: block;
  min-height: 58px;
  padding: 14px 16px;
  background: #fff;
  color: var(--sv-text);
  border: 1px solid var(--sv-border);
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(25, 22, 18, .06);
}

.post-navigation span {
  display: block;
  margin-bottom: 2px;
  color: var(--sv-muted);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.pagination,
.nav-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 50px;
}

.page-numbers {
  min-width: 42px;
  padding: 9px 12px;
  background: #fff;
  color: var(--sv-text);
  border: 1px solid var(--sv-border);
  border-radius: 10px;
  text-align: center;
  font-weight: 800;
  text-decoration: none;
}

.page-numbers.current,
.page-numbers:hover {
  background: var(--sv-text);
  color: #fff;
}

.page-main { margin-top: 24px; }
.page-hero {
  width: min(var(--sv-content), 100%);
  margin: 0 auto;
  padding: 34px 0 18px;
  text-align: center;
}

.comments-area {
  margin-top: 30px;
  border-radius: var(--sv-radius);
}

.comment-list {
  padding-left: 0;
  list-style: none;
}

.comment-body {
  margin-bottom: 16px;
  padding: 16px;
  background: #fbfaf7;
  border: 1px solid var(--sv-border);
  border-radius: 14px;
}

.comment-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.comment-form input:not([type="submit"]),
.comment-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 12px 13px;
  border: 1px solid var(--sv-border);
  border-radius: 10px;
  font: inherit;
}

.comment-form input[type="submit"],
button,
.button {
  min-height: 44px;
}

.comment-form input[type="submit"] {
  padding: 12px 18px;
  color: #fff;
  background: var(--sv-text);
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.site-footer {
  margin-top: 58px;
  padding: 34px 16px;
  color: #e8e8e8;
  background: #171717;
  text-align: center;
}

.site-footer p { margin: 0; }

.alignleft { float: left; margin: .35em 1.2em 1em 0; }
.alignright { float: right; margin: .35em 0 1em 1.2em; }
.aligncenter { margin-left: auto; margin-right: auto; text-align: center; }

:focus-visible {
  outline: 3px solid #7aa7ff;
  outline-offset: 3px;
}

@media (min-width: 680px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .post-navigation {
    grid-template-columns: 1fr 1fr;
  }

  .nav-next { text-align: right; }
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }

  .main-navigation {
    position: static;
    display: block;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .main-navigation ul {
    width: auto;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0;
  }

  .main-navigation a {
    padding: 22px 0;
    border-bottom: 3px solid transparent;
    font-size: .95rem;
  }

  .main-navigation a:hover,
  .main-navigation .current-menu-item > a,
  .main-navigation .current_page_item > a {
    border-bottom-color: var(--sv-brand);
  }
}

@media (min-width: 1100px) {
  .post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body { font-size: 17px; }
  .header-container { width: min(100% - 22px, var(--sv-wide)); min-height: 62px; }
  .content-card { padding: 21px 17px; }
  .post-hero-inner { width: min(100% - 26px, var(--sv-content)); }
  .single-meta { font-size: .82rem; }
  .post-card-body { padding: 16px; }
  .entry-content { line-height: 1.72; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
