/*
Theme Name: Truyen - DailyFeed Stories Style
Theme URI: https://mystoryhaven.click
Author: My Story Haven
Description: Simple, clean English story magazine theme inspired by DailyFeed / Flatsome.
Version: 2.0.0
Text Domain: truyen
*/

/* CSS Variables */
:root {
  --primary-color: #1490fc;
  --primary-hover: #0b7de0;
  --bg-page: #f5f5f5;
  --bg-card: #ffffff;
  --text-main: #222222;
  --text-heading: #333333;
  --text-muted: #777777;
  --border-color: #e5e5e5;
  --border-light: #f0f0f0;
  --font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --container-width: 1260px;
}

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

html, body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ==================== HEADER ==================== */
.header-wrapper {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-light);
}

.masthead {
  padding: 24px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo-text {
  font-size: 32px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo-text span {
  color: var(--primary-color);
}

.site-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Blue Wide Nav Bar */
.nav-bar-blue {
  background-color: var(--primary-color);
  color: #ffffff;
  min-height: 50px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.nav-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
}

.nav-links-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2px;
}

.nav-item-link {
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 18px;
  display: block;
  line-height: 1;
  transition: background 0.15s ease;
}

.nav-item-link:hover, .nav-item-link.active {
  background-color: rgba(0, 0, 0, 0.12);
  color: #ffffff !important;
}

/* Header Search */
.nav-search-form {
  position: relative;
  display: flex;
  align-items: center;
  width: 260px;
}

.nav-search-input {
  width: 100%;
  padding: 7px 36px 7px 14px;
  border-radius: 4px;
  border: none;
  font-size: 13px;
  background-color: #ffffff;
  color: #333333;
  outline: none;
}

.nav-search-submit {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #888888;
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* ==================== SECTION TITLES (Flatsome Style) ==================== */
.section-title-wrap {
  display: flex;
  align-items: center;
  margin: 32px 0 20px;
  text-align: center;
}

.section-title-wrap::before,
.section-title-wrap::after {
  content: "";
  flex: 1;
  border-bottom: 2px solid #e0e0e0;
}

.section-title-wrap::before {
  margin-right: 20px;
}

.section-title-wrap::after {
  margin-left: 20px;
}

.section-title-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ==================== FEATURED POST (LARGE CARD) ==================== */
.featured-post-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease;
}

.featured-post-box:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.featured-post-box.has-thumb {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
}

@media (min-width: 768px) {
  .featured-post-box.has-thumb {
    grid-template-columns: 460px 1fr;
    gap: 32px;
  }
}

.featured-post-thumb-wrap {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 4px;
  overflow: hidden;
  background-color: #eee;
}

.featured-post-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.featured-post-box:hover .featured-post-thumb {
  transform: scale(1.03);
}

.featured-post-content {
  display: flex;
  flex-direction: column;
}

.post-cat-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary-color);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.featured-post-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-heading);
  margin-bottom: 12px;
}

.featured-post-excerpt {
  font-size: 15px;
  color: #555555;
  line-height: 1.7;
  margin-bottom: 20px;
}

/* Author Box */
.author-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

.author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #ddd;
  overflow: hidden;
  flex-shrink: 0;
}

.author-name {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #333333;
}

.post-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==================== RECENT POSTS GRID ==================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.post-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.post-card-thumb-wrap {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background-color: #eee;
}

.post-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-card-thumb {
  transform: scale(1.05);
}

.post-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.post-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-heading);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-excerpt {
  font-size: 13px;
  color: #666666;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.post-card-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==================== SINGLE POST / STORY READING ==================== */
.single-post-wrapper {
  padding: 30px 0 60px;
}

.single-post-container {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 36px 44px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.single-breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.single-breadcrumbs a {
  color: var(--text-muted);
}

.single-breadcrumbs a:hover {
  color: var(--primary-color);
}

.single-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  color: #222222;
  margin-bottom: 12px;
}

.single-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.single-content {
  font-size: 17px;
  line-height: 1.85;
  color: #222222;
}

.single-content p {
  margin-bottom: 1.6em;
}

.single-content h2, .single-content h3 {
  margin: 1.4em 0 0.6em;
  color: #111111;
  font-weight: 800;
}

/* ==================== STATIC PAGES (About / Contact) ==================== */
.static-page .single-title {
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.single-content ul,
.single-content ol {
  margin: 0 0 1.6em 1.4em;
}

.single-content li {
  margin-bottom: 0.5em;
}

.single-content a {
  color: var(--primary-color);
  font-weight: 700;
}

.page-lead {
  font-size: 19px;
  color: #444444;
}

.page-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 0 0 1.8em;
}

.page-card {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  border-radius: 4px;
  padding: 18px 20px;
}

.page-card h3 {
  margin: 0 0 6px !important;
  font-size: 17px;
}

.page-card p {
  margin: 0 !important;
  font-size: 15px;
  line-height: 1.65;
  color: #555555;
}

.contact-box {
  background-color: #f0f7ff;
  border: 1px solid #cfe5ff;
  border-radius: 6px;
  padding: 22px 26px;
  margin: 0 0 1.8em;
}

.contact-box p {
  margin-bottom: 0.6em !important;
}

.contact-box p:last-child {
  margin-bottom: 0 !important;
}

@media (max-width: 640px) {
  .single-post-container {
    padding: 24px 20px;
  }
  .single-title {
    font-size: 26px;
  }
}

/* Multi-Page Pagination (Part 1, 2, 3...) */
.page-links {
  margin: 36px 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-numbers, .post-page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-size: 14px;
  font-weight: 700;
  color: #444444;
  background-color: #ffffff;
  transition: all 0.15s ease;
}

.page-numbers:hover, .post-page-numbers:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.page-numbers.current, .post-page-numbers.current {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
}

/* ==================== MULTI-PAGE STORY PAGINATION (<!--nextpage-->) ==================== */
.post-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 35px 0 25px;
  padding: 16px 20px;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.post-pagination-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 8px;
}

.post-pagination a,
.post-pagination > span:not(.post-pagination-label) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Other page links */
.post-pagination a {
  background-color: #ffffff;
  color: #444444;
  border: 1px solid var(--border-color);
}

.post-pagination a:hover {
  background-color: var(--primary-color);
  color: #ffffff !important;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(20, 144, 252, 0.3);
}

/* Active / Current page */
.post-pagination > span:not(.post-pagination-label) {
  background-color: var(--primary-color);
  color: #ffffff;
  border: 1px solid var(--primary-color);
  box-shadow: 0 2px 6px rgba(20, 144, 252, 0.35);
}

/* Post Navigation (Prev/Next Post) */
.single-post-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  gap: 16px;
}

.single-post-nav a {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-color);
}

/* ==================== FOOTER ==================== */
.site-footer-simple {
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 30px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: auto;
}

.site-footer-simple a {
  color: var(--text-muted);
}

.site-footer-simple a:hover {
  color: var(--primary-color);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .nav-bar-inner {
    flex-direction: column;
    height: auto;
    padding: 8px 0;
    gap: 8px;
  }
  .nav-search-form {
    width: 100%;
  }
  .nav-links-menu {
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-item-link {
    padding: 8px 12px;
    font-size: 13px;
  }
  .single-post-container {
    padding: 24px 18px;
  }
  .single-title {
    font-size: 24px;
  }
  .featured-post-title {
    font-size: 20px;
  }
}
