/*
Theme Name: ZiGoats
Author: Theo Nga
Author URI: https://zigoats.com
Theme URI: https://clouditate.com
Tags: full-site-editing, block-patterns, blog, news, minimal, clean
Text Domain: zigoats
Requires at least: 6.4
Requires PHP: 7.4
Tested up to: 6.4
Version: 2.0

License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* ========================================
   GOOGLE FONTS IMPORT
======================================== */
@import url("https://fonts.googleapis.com/css2?family=Google+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&family=Nunito+Sans:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900&display=swap");

/* ========================================
   BASE STYLES - MODERN & MINIMAL
======================================== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media screen and (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background-color: #ffffff;
  color: #1a1a1a;
  font-size: 1.0625rem;
  line-height: 1.7;
  font-weight: 400;
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
}

/* ========================================
   TYPOGRAPHY - CLEAN & READABLE
======================================== */
h1,
h2,
h3,
h4,
h5,
h6,
.wp-block-heading,
.wp-block-post-title,
.wp-block-query-title,
.wp-block-site-title {
  font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  font-weight: 700;
}
======================================== */ h1,
h2,
h3,
h4,
h5,
h6,
.wp-block-heading,
.wp-block-site-title,
.wp-block-post-title,
.wp-block-query-title {
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

h1,
.wp-block-post-title {
  font-size: clamp(2rem, 5vw, 2.5rem);
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #0ea5e9;
}

/* ========================================
   HEADER - MINIMAL & CLEAN
======================================== */
.site-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
  transition: box-shadow 0.2s ease;
}

.site-header-wrapper.scrolled {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.site-logo-elegant {
  transition: opacity 0.2s ease;
}

.site-logo-elegant:hover {
  opacity: 0.8;
}

.wp-block-site-title a {
  text-decoration: none;
  color: #1a1a1a;
  transition: color 0.2s ease;
}

.wp-block-site-title a:hover {
  color: #2563eb;
}

.site-tagline {
  color: #64748b;
}

/* Navigation - Clean & Simple */
.main-navigation .wp-block-navigation-item a {
  font-weight: 500;
  font-size: 0.9375rem;
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 0.5rem 0;
}

.main-navigation .wp-block-navigation-item a:hover {
  color: #2563eb;
}

.main-navigation .wp-block-navigation-item.current-menu-item a,
.main-navigation .wp-block-navigation-item.current_page_item a {
  color: #2563eb;
  font-weight: 600;
}

/* Search - Minimal styling */
.header-search-desktop .wp-block-search__input,
.header-search-mobile .wp-block-search__input {
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px;
  background: #f8fafc;
  transition: all 0.2s ease;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
}

.header-search-desktop .wp-block-search__input:focus,
.header-search-mobile .wp-block-search__input:focus {
  border-color: #2563eb !important;
  background: #ffffff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.header-search-desktop .wp-block-search__button,
.header-search-mobile .wp-block-search__button {
  background: transparent;
  color: #64748b;
  transition: color 0.2s ease;
}

.header-search-desktop .wp-block-search__button:hover,
.header-search-mobile .wp-block-search__button:hover {
  color: #2563eb;
}

/* ========================================
   POST CARDS - 4 COLUMN GRID
======================================== */
.wp-block-post-template {
  display: grid;
  gap: 1.5rem;
  padding: 0;
}

/* 4 columns on desktop (>1024px) */
@media (min-width: 1024px) {
  .wp-block-post-template.is-flex-container.columns-2,
  .wp-block-post-template.is-flex-container.columns-3,
  .wp-block-post-template {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* 2 columns on tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .wp-block-post-template.is-flex-container.columns-2,
  .wp-block-post-template.is-flex-container.columns-3,
  .wp-block-post-template {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* 1 column on mobile (<768px) */
@media (max-width: 767px) {
  .wp-block-post-template.is-flex-container.columns-2,
  .wp-block-post-template.is-flex-container.columns-3,
  .wp-block-post-template {
    grid-template-columns: 1fr !important;
  }
}

/* Post Card Styling - Minimal & Clean */
.wp-block-post,
.post-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.wp-block-post:hover,
.post-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* Featured Image */
.wp-block-post-featured-image {
  overflow: hidden;
  margin-bottom: 0;
}

.wp-block-post-featured-image img {
  transition: transform 0.3s ease;
  width: 100%;
  height: auto;
  display: block;
}

.wp-block-post:hover .wp-block-post-featured-image img {
  transform: scale(1.03);
}

/* Post Title */
.wp-block-post-title {
  margin: 0;
  line-height: 1.4;
}

.wp-block-post-title a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.wp-block-post-title a:hover {
  color: #2563eb;
}

/* Post Meta */
.wp-block-post-date,
.wp-block-post-author-name,
.wp-block-post-terms {
  font-size: 0.875rem;
  color: #64748b;
}

.wp-block-post-terms a {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  background: #f1f5f9;
  color: #2563eb;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.wp-block-post-terms a:hover {
  background: #2563eb;
  color: #ffffff;
}

/* Post Excerpt */
.wp-block-post-excerpt__excerpt {
  color: #475569;
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ========================================
   FEATURED SECTION
======================================== */
.featured-section {
  position: relative;
  background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
}

/* Featured section query container to use full width */
.featured-section .wp-block-query.alignwide {
  max-width: 100%;
}

.featured-post-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.featured-post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px 0 rgba(0, 0, 0, 0.12) !important;
}

/* Featured image hover effect */
.featured-post-card .wp-block-post-featured-image img {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-post-card:hover .wp-block-post-featured-image img {
  transform: scale(1.05);
}

/* Category badge styling */
.featured-post-card .wp-block-post-terms {
  display: inline-block;
  transition: all 0.2s ease;
}

.featured-post-card:hover .wp-block-post-terms {
  transform: translateY(-2px);
}

/* Title hover effect */
.featured-post-card .wp-block-post-title a {
  transition: color 0.2s ease;
}

.featured-post-card:hover .wp-block-post-title a {
  color: #2563eb;
}

/* Avatar styling */
.featured-post-card .wp-block-avatar img {
  transition: border-color 0.2s ease;
}

.featured-post-card:hover .wp-block-avatar img {
  border-color: #2563eb !important;
}

/* Featured Main Card Enhancements */
.featured-main-card .wp-block-cover {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.featured-main-card:hover .wp-block-cover {
  transform: scale(1.02);
}

.featured-main-card .wp-block-post-title {
  display: inline-block;
  padding-bottom: 0.5rem;
  border-bottom-style: solid !important;
}

.featured-main-card .wp-block-post-title:hover {
  border-bottom-color: #2563eb !important;
}

/* Featured posts - 3 columns on desktop, 2 on tablet, 1 on mobile */
.featured-section .wp-block-post-template {
  display: grid;
  gap: 1.75rem;
}

/* First column - single featured post should take full width */
.featured-section
  .wp-block-columns
  > .wp-block-column:first-child
  .wp-block-post-template {
  display: block !important;
  grid-template-columns: none !important;
}

/* Second column - list items display in flow */
.featured-section
  .wp-block-columns
  > .wp-block-column:last-child
  .wp-block-post-template {
  display: block !important;
  grid-template-columns: none !important;
}

.featured-section .wp-block-post-template.is-flex-container.columns-3 {
  grid-template-columns: repeat(3, 1fr) !important;
  max-width: 100%;
}

@media (max-width: 1023px) {
  .featured-section .wp-block-post-template.is-flex-container.columns-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 767px) {
  .featured-section .wp-block-post-template.is-flex-container.columns-3 {
    grid-template-columns: 1fr !important;
  }

  .featured-post-card:hover {
    transform: translateY(-3px);
  }
}

/* ========================================
   SINGLE POST PAGE
======================================== */
.single .wp-block-post-content {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.single .wp-block-post-content p {
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: #374151;
}

.single .wp-block-post-content h2,
.single .wp-block-post-content h3,
.single .wp-block-post-content h4 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #1a1a1a;
}

.single .wp-block-post-content img,
.single .wp-block-post-content figure {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.single .wp-block-post-content blockquote {
  border-left: 3px solid #2563eb;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #475569;
}

/* ========================================
   BUTTONS - HIGH CONTRAST
======================================== */
.wp-element-button,
.wp-block-button__link {
  background: #1a1a1a !important;
  color: #ffffff !important;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
}

.wp-element-button:hover,
.wp-block-button__link:hover {
  background: #2563eb !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* View All Buttons */
.view-all-button .wp-block-button__link {
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
}

/* ========================================
   PAGINATION
======================================== */
.wp-block-query-pagination {
  margin-top: 3rem;
  gap: 0.5rem;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem 0.875rem;
  background: #ffffff;
  color: #1a1a1a;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.wp-block-query-pagination a:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.wp-block-query-pagination .current {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

/* Previous/Next buttons with subtle background */
.wp-block-query-pagination-previous a,
.wp-block-query-pagination-next a {
  background: #f8fafc;
  border-color: #e2e8f0;
  padding: 0.625rem 1.25rem;
  font-weight: 600;
}

.wp-block-query-pagination-previous a:hover,
.wp-block-query-pagination-next a:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* Dots separator */
.wp-block-query-pagination .dots {
  border: none;
  background: transparent;
  color: #64748b;
  pointer-events: none;
}

/* ========================================
   FOOTER
======================================== */
.site-footer {
  background: #1a1a1a;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 4rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: #ffffff;
}

/* ========================================
   SEPARATOR STYLING
======================================== */
.wp-block-separator {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 2rem 0;
}

hr.has-secondary-background-color {
  border-top-color: #cbd5e1;
  border-top-width: 1px;
  height: 0;
}

/* ========================================
   COMMENTS
======================================== */
.wp-block-comments {
  margin-top: 3rem;
}

.wp-block-comment-template li {
  border-left: 2px solid #e2e8f0;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.wp-block-post-comments-form {
  background: #f8fafc;
  padding: 2rem;
  border-radius: 8px;
  margin-top: 2rem;
  border: 1px solid #e2e8f0;
}

.wp-block-post-comments-form textarea,
.wp-block-post-comments-form input[type="text"],
.wp-block-post-comments-form input[type="email"],
.wp-block-post-comments-form input[type="url"] {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem;
  background: #ffffff;
  transition: border-color 0.2s ease;
}

.wp-block-post-comments-form textarea:focus,
.wp-block-post-comments-form input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========================================
   RESPONSIVE MOBILE MENU
======================================== */
.header-search-mobile {
  display: none;
}

@media (max-width: 767px) {
  .header-search-desktop {
    display: none !important;
  }

  .header-search-mobile {
    display: block !important;
    width: 100%;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
  }

  .site-header {
    padding: 1rem !important;
  }

  .wp-block-navigation__responsive-container.is-menu-open {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
  }

  .wp-block-navigation__responsive-container .wp-block-navigation-item {
    border-bottom: 1px solid #e2e8f0;
  }

  .wp-block-navigation__responsive-container .wp-block-navigation-item a {
    padding: 1rem 0 !important;
    display: block;
  }
}

/* ========================================
   ACCESSIBILITY
======================================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #2563eb;
  color: #ffffff;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ========================================
   UTILITY CLASSES
======================================== */
.has-base-background-color {
  background-color: #ffffff;
  color: #1a1a1a;
}

.has-contrast-color {
  color: #1a1a1a;
}

.has-primary-color {
  color: #2563eb;
}

.has-secondary-color {
  color: #64748b;
}

/* ========================================
   ARCHIVE & CATEGORY PAGES
======================================== */
/* Archive Hero Section */
.archive .wp-block-group.alignfull.has-background-subtle-background-color {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.archive .wp-block-query-title,
.category .wp-block-query-title,
.tag .wp-block-query-title,
.author .wp-block-query-title,
.date .wp-block-query-title {
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  animation: fadeInUp 0.6s ease-out;
}

.archive .wp-block-term-description,
.category .wp-block-term-description {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 0.8s ease-out;
}

/* Archive animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Archive post grid enhancement */
.archive .wp-block-post-template,
.category .wp-block-post-template,
.tag .wp-block-post-template {
  animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
  .site-header,
  .site-footer,
  .wp-block-navigation,
  .wp-block-search,
  .wp-block-social-links,
  .comment-form,
  .post-navigation {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  a {
    text-decoration: underline;
  }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
======================================== */
img {
  max-width: 100%;
  height: auto;
}

.wp-block-image img {
  display: block;
}

/* Lazy loading placeholder */
img[loading="lazy"] {
  background: #f1f5f9;
}
