/*
Theme Name: Kora Blog
Theme URI: https://koraconnect.com
Author: Kora Financial
Author URI: https://koraconnect.com
Description: Clean blog theme for Kora Financial matching brand guidelines. Features auto-updating post list, category badges, featured posts, and full single post layout.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: Proprietary
Text Domain: kora-blog
*/

/* =========================================
   CSS VARIABLES & RESET
   ========================================= */
:root {
  --color-accent: #7752f9;
  --color-accent-dark: #4827bb;
  --color-fg-primary: #000000;
  --color-fg-secondary: #717188;
  --color-fg-muted: #cacbd4;
  --color-fg-inverse: #ffffff;
  --color-bg-primary: #ffffff;
  --color-bg-muted: #ffffff;
  --color-bg-accent: #7752f9;
  --color-bg-accent-muted: #F4F4F8;
  --color-border: #e3e4eb;
  --color-border-accent: #7752f9;

  --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --spacing-1: 4px;
  --spacing-2: 8px;
  --spacing-3: 12px;
  --spacing-4: 16px;
  --spacing-5: 20px;
  --spacing-6: 24px;
  --spacing-8: 32px;
  --spacing-10: 40px;
  --spacing-12: 48px;
  --spacing-16: 64px;

  --border-radius-sm: 6px;
  --border-radius-md: 12px;
  --border-radius-full: 9999px;
}

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

html, body {
  font-family: var(--font-family);
  color: var(--color-fg-primary);
  background: var(--color-bg-primary);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* =========================================
   TOP NAVIGATION
   ========================================= */
.site-header-wrap{
  background: var(--color-bg-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
    
}
.site-header {
  padding: var(--spacing-5) var(--spacing-16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1660px;
  margin: auto;
  width: 100%;
}

.site-logo img {
  height: 23px;
  width: auto;
}

.site-logo .logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: -0.5px;
}

.nav-pages {
  display: flex;
  gap: var(--spacing-2);
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 400;
  font-family: var(--font-family);
  color: var(--color-fg-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  transition: color 0.15s ease;
  white-space: nowrap;
}

.nav-trigger:hover,
.nav-trigger.is-open {
  color: var(--color-accent);
}

.nav-chevron {
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.nav-trigger.is-open .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: var(--spacing-3);
  min-width: 220px;
  z-index: 200;
  flex-direction: column;
  gap: 2px;
}

.nav-dropdown.is-open {
  display: flex;
}

.nav-dropdown a {
  font-size: 15px;
  font-weight: 400;
  color: var(--color-fg-primary);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  white-space: nowrap;
  transition: background 0.1s ease, color 0.1s ease;
}

.nav-dropdown a:hover {
  background: var(--color-bg-accent-muted);
  color: var(--color-accent);
}

.nav-actions {
  display: flex;
  gap: var(--spacing-4);
  align-items: center;
}

.nav-login {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-accent);
  padding: 8px 16px;
}

.nav-login:hover {
  opacity: 0.75;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  padding: 8px 24px;
  border-radius: var(--border-radius-sm);
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  line-height: 1.5;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

.btn:hover { opacity: 0.85; }

.btn-ghost {
  background: transparent;
  color: var(--color-accent);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-fg-inverse);
  border-radius: var(--border-radius-full);
}

/* =========================================
   HERO / FEATURED POST
   ========================================= */
.hero-section {
  padding: 32px var(--spacing-16) 48px;
  background: var(--color-bg-primary);
  position: relative;
  overflow: hidden;
}

.hero-page-title {
  font-size: 24px;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: 24px;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 1312px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
}

@media (max-width: 1080px) {
    .hero-columns {
        display: grid;
        grid-template-columns: 1fr; /* single column instead of two */
    }

    .hero-image {
        display: block !important;
        width: 100%;
    }

    .hero-image img {
        width: 100%;
        height: auto;
    }
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
}

.hero-category {
  font-size: 20px;
  font-weight: 500;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: 48px;
  font-weight: 400;
  color: var(--color-fg-primary);
  line-height: 1.5;
}

.hero-title a {
  color: inherit;
}

.hero-subtitle {
  font-size: 20px;
  font-weight: 400;
  color: var(--color-fg-secondary);
  line-height: 1.5;
}

.hero-meta {
  display: flex;
  gap: var(--spacing-5);
  align-items: center;
  font-size: 16px;
  color: var(--color-fg-secondary);
  flex-wrap: wrap;
}

.hero-meta .meta-date {
  flex: 1;
}

.hero-meta .meta-tag {
  white-space: nowrap;
}

.hero-image {
  aspect-ratio: 16/10;
  background: #d9d9d9;
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Wavy background decoration */
.hero-bg-decoration {
  position: absolute;
  bottom: -100px;
  width: 900px;
  height: 700px;
  opacity: 0.15;
  background: radial-gradient(ellipse at center, var(--color-accent) 0%, transparent 70%);
  pointer-events: none;
}

/* =========================================
   BLOG LIST
   ========================================= */
.blog-list-section {
  padding: var(--spacing-12) var(--spacing-16);
  max-width: 1440px;
  margin: 0 auto;
}

.blog-page-title {
  font-size: 30px;
  font-weight: 500;
  color: var(--color-fg-primary);
  margin-bottom: var(--spacing-10);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 48px;
  z-index: 2;
}

/* =========================================
   POST CARD (List view - horizontal)
   ========================================= */
.post-card {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--spacing-10);
  align-items: center;
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: var(--color-bg-primary);
  transition: opacity 0.15s ease;
  opacity: 0.85;
}

.post-card:first-child {
  border-top: 1px solid var(--color-border);
}

.post-card:hover {
  background-color: var(--color-bg-muted) !important;
}

.post-card-content {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.post-card-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-1) var(--spacing-3);
  border-radius: var(--border-radius-full);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
  width: fit-content;
}

/* Category color variants */
.badge-insights {
  background: #e8f0ff;
  color: #1e5ccc;
}

.badge-product-updates {
  background: var(--color-bg-accent-muted);
  color: var(--color-accent);
}

.badge-announcement {
  background: #e3fff2;
  color: #087a47;
}

.badge-featured {
  background: var(--color-bg-accent-muted);
  color: var(--color-accent);
}

.badge-default {
  background: #f0f0f5;
  color: var(--color-fg-secondary);
}

.post-card-title {
  font-size: 24px;
  font-weight: 500;
  color: var(--color-fg-primary);
  line-height: 1.5;
}

.post-card-excerpt {
  font-size: 16px;
  font-weight: 400;
  color: var(--color-fg-secondary);
  line-height: 1.5;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1px;
  height: 32px;
  font-size: 14px;
  color: #a8a9b2;
  font-weight: 400;
}

.post-card-image {
  aspect-ratio: 16/9;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background: linear-gradient(157.93deg, #7752f9 0%, #6e56c1 50%, #4827bb 100%);
  position: relative;
}

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

/* Gradient overlay when no image */
.post-card-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(157.93deg, #7752f9 0%, #6e56c1 50%, #4827bb 100%);
}

/* =========================================
   PAGINATION
   ========================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  padding: var(--spacing-10) 0;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  font-size: 16px;
  font-weight: 400;
  color: var(--color-fg-secondary);
  border: 1px solid var(--color-border);
  transition: all 0.15s ease;
}

.page-numbers:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.page-numbers.current {
  background: var(--color-accent);
  color: var(--color-fg-inverse);
  border-color: var(--color-accent);
}

.page-numbers.next,
.page-numbers.prev {
  width: auto;
  padding: 0 12px;
}

/* =========================================
   SINGLE POST
   ========================================= */
.single-post-header {
  padding: var(--spacing-12) var(--spacing-16);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-10);
  max-width: 1128px;
  margin: auto;
  width: 100%;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  color: var(--color-accent);
  font-size: 16px;
  font-weight: 500;
  width: fit-content;
  transition: opacity 0.15s ease;
}

.back-btn:hover { opacity: 0.75; }

.back-btn svg {
  width: 20px;
  height: 20px;
}

.post-hero-image {
  width: 100%;
  height: 461px;
  background: #d9d9d9;
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

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

.post-header-text {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
}

.post-header-category {
  font-size: 20px;
  font-weight: 500;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.post-header-title {
  font-size: 48px;
  font-weight: 400;
  color: var(--color-fg-primary);
  line-height: 1.5;
}

.post-header-subtitle {
  font-size: 20px;
  font-weight: 400;
  color: var(--color-fg-secondary);
  line-height: 1.5;
}

.post-header-meta {
  display: flex;
  gap: var(--spacing-5);
  align-items: center;
  font-size: 16px;
  color: var(--color-fg-secondary);
}

.post-header-meta .meta-date { flex: 1; }

/* =========================================
   SINGLE POST CONTENT
   ========================================= */
.post-content-section {
  border-top: 2px solid var(--color-border);
  border-bottom: 2px solid var(--color-border);
  padding: var(--spacing-16);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  align-items: center;
}

.post-content-inner {
  width: 100%;
  max-width: 1000px;
}

.post-content-inner p,
.post-content-inner .wp-block-paragraph {
  font-size: 18px;
  font-weight: 400;
  color: var(--color-fg-secondary);
  line-height: 1.5;
  margin-bottom: var(--spacing-4);
}

.post-content-inner h2,
.post-content-inner h2.wp-block-heading {
  font-size: 32px;
  font-weight: 600;
  color: var(--color-fg-primary);
  line-height: 1.5;
  margin: 96px 0 var(--spacing-4) 0;
}

.post-content-inner h2:first-of-type,
.post-content-inner h2.wp-block-heading:first-of-type {
    margin-top: var(--spacing-8); /* 32px, adjust to taste */
}

.post-content-inner h3,
.post-content-inner h3.wp-block-heading {
  font-size: 24px;
  font-weight: 500;
  color: var(--color-fg-primary);
  line-height: 1.5;
  margin-top: var(--spacing-8);
  margin-bottom: var(--spacing-3);
}

.post-content-inner blockquote,
.post-content-inner .wp-block-quote {
  border-left: 4px solid var(--color-border-accent);
  padding-left: var(--spacing-8);
  padding-top: var(--spacing-1);
  padding-bottom: var(--spacing-1);
  margin: var(--spacing-6) 0;
}

.post-content-inner blockquote p,
.post-content-inner .wp-block-quote p {
  font-size: 18px;
  color: var(--color-primary);
  line-height: 1.5;
  margin: 0;
}

.post-content-inner figure,
.post-content-inner .wp-block-image {
  margin: var(--spacing-6) 0;
}

.post-content-inner figure img,
.post-content-inner .wp-block-image img {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius-md);
}

.post-content-inner ul,
.post-content-inner ol {
  padding-left: var(--spacing-6);
  margin-bottom: var(--spacing-4);
}

.post-content-inner li {
  font-size: 18px;
  color: var(--color-fg-secondary);
  line-height: 1.5;
  margin-bottom: var(--spacing-2);
}

/* =========================================
   RELATED POSTS
   ========================================= */
.related-section {
  padding: var(--spacing-16);
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1128px;
  margin: auto;
  width: 100%;
}

.related-title {
  font-size: 30px;
  font-weight: 500;
  color: var(--color-fg-primary);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.related-card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease;
  padding: 1px;
}

.related-card:hover {
  box-shadow: 0 4px 20px rgba(119, 82, 249, 0.12);
}

.related-card-image {
  height: 170px;
  background: linear-gradient(157.93deg, #7752f9 0%, #6e56c1 50%, #4827bb 100%);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card-body {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 20px;
}

.related-card-title {
  font-size: 24px;
  font-weight: 500;
  color: var(--color-fg-primary);
  line-height: 1.5;
}

.related-card-excerpt {
  font-size: 16px;
  font-weight: 400;
  color: var(--color-fg-secondary);
  line-height: 1.5;
}

.related-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  padding-top: 1px;
  height: 32px;
  font-size: 14px;
  color: #a8a9b2;
  line-height: 20px;
  white-space: nowrap;
}

/* =========================================
   FOOTER
   ========================================= */
@media (max-width: 1080px) {
    .footer-top {
        flex-direction: column;
        gap: var(--spacing-8);
    }

    .footer-left {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center;
        width: 100%;
        text-align: left !important;
    }

    .site-logo,
    .footer-social {
        flex: 0 0 auto;
        text-align: left !important;
    }

    .footer-social {
        margin-left: auto !important;
    }

    .footer-pages {
        flex-wrap: nowrap; /* keep columns side by side */
        width: 100%;
        gap: var(--spacing-8);
    }
}

.site-footer {
  background: var(--color-bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-navigation {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-10);
  max-width: 1660px;
  width: 100%;
  padding: 100px var(--spacing-16);
}


.footer-top {
    display: flex;
    align-items: stretch; /* make columns full height */
    gap: var(--spacing-16);
}

.footer-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* pushes logo to top, social to bottom */
    flex: 1; /* add this - grows to fill remaining space */
}

.footer-logo {
  height: 56px;
  width: auto;
}

.footer-logo-text {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-accent);
}

.footer-pages {
    display: flex;
    gap: var(--spacing-16);
    flex: 1;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
}

.footer-col-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.footer-col-links {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-5);
}

.footer-col-links a {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-fg-primary);
  white-space: nowrap;
}

.footer-col-links a:hover {
  color: var(--color-accent);
}

.footer-social {
  display: flex;
  gap: var(--spacing-4);
  align-items: center;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--border-radius-sm);
  color: var(--color-fg-muted);
  transition: color 0.15s ease;
}

.footer-social-link:hover {
  color: var(--color-fg-secondary);
}

.footer-divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
}

.footer-disclaimer {
  max-width: 1660px;
  width: 100%;
  padding: 56px var(--spacing-16) var(--spacing-16);
}

.footer-disclaimer p,
.footer-disclaimer a {
  font-size: 14px;
  color: var(--color-fg-secondary);
  line-height: 1.5;
  font-weight: 400;
}

.footer-disclaimer a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-image {
    display: none;
  }

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

  .post-card-image {
    order: -1;
    height: 220px;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-pages {
    flex-wrap: wrap;
    gap: var(--spacing-10);
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: var(--spacing-4) var(--spacing-5);
  }

  .nav-pages {
    display: none;
  }

  .hero-section,
  .blog-list-section,
  .single-post-header,
  .post-content-section,
  .related-section,
  .footer-navigation,
  .footer-disclaimer {
    padding-left: var(--spacing-5);
    padding-right: var(--spacing-5);
  }

  .hero-title,
  .post-header-title {
    font-size: 32px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-10);
  }

  .footer-pages {
    flex-direction: column;
  }
}

/* =========================================
   WORDPRESS CORE OVERRIDES
   ========================================= */
.wp-caption {
  max-width: 100%;
}

.aligncenter {
  display: block;
  margin: 0 auto;
}

.wp-block-image.alignfull img {
  border-radius: 0;
}

/* Hide default WordPress stuff we don't need */
.entry-meta,
.entry-footer,
.comments-area {
  display: none;
}
