/*
Theme Name: GeneratePress Ghibli Child
Theme URI: https://example.com
Description: Studio Ghibli inspired child theme for GeneratePress
Author: Your Name
Author URI: https://example.com
Template: generatepress
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 8.1
Text Domain: generatepress-ghibli-child
*/

/* =====================================================
   DESIGN TOKENS
===================================================== */
:root {
  --bg: #fdf6e3;
  --paper: #fffaf0;
  --text: #4b3f2f;
  --accent: #88b04b;
  --accent-soft: #a6c96a;
  --accent-dark: #6a9338;
  --header-bg: #f4ecd8;
  --footer-bg: #f2e9d7;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-soft: 0 6px 20px rgba(0,0,0,.06);
  --shadow-hover: 0 12px 28px rgba(0,0,0,.12);
  --transition-base: .25s ease;
  --content-max: 1100px;
}

/* =====================================================
   BASE STYLES
===================================================== */
body {
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-base);
}

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

/* =====================================================
   LAYOUT
===================================================== */
.site-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Homepage-specific layout fixes */
.home .content-area,
.home .site-main {
  width: 100%;
  float: none;
  margin: 0 auto;
}

.home .inside-article,
.home .ts-homepage {
  margin: 0 auto;
}

.home .widget-area {
  display: none;
}

/* =====================================================
   HEADER
===================================================== */
.site-header {
  background: var(--header-bg);
  border-bottom: 2px solid var(--accent-soft);
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
}

.site-title a {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

/* =====================================================
   NAVIGATION
===================================================== */
.main-navigation {
  background: transparent;
}

.main-navigation .menu > li > a {
  color: var(--text);
  font-weight: 600;
  padding: .6rem .9rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-base), color var(--transition-base);
}

.main-navigation .menu > li > a:hover,
.main-navigation .menu > li.current-menu-item > a {
  background: #fff6dc;
  color: var(--accent-dark);
}

.main-navigation ul ul {
  background: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.main-navigation ul ul li a {
  color: var(--text);
  transition: background var(--transition-base);
}

.main-navigation ul ul li a:hover {
  background: #fff6dc;
}

/* =====================================================
   BUTTONS
===================================================== */
button,
input[type="submit"],
.wp-block-button__link,
.ts-read-more {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: .6rem 1.4rem;
  border: none;
  text-decoration: none;
  transition: background var(--transition-base), transform .2s ease;
  cursor: pointer;
}

button:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover,
.ts-read-more:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

/* =====================================================
   WIDGETS / SIDEBAR
===================================================== */
.widget {
  background: var(--paper);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
}

.widget-title {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1rem;
}

/* =====================================================
   FOOTER
===================================================== */
.site-footer {
  background: var(--footer-bg);
  border-top: 2px solid var(--accent-soft);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text);
}

.site-footer a {
  color: var(--accent);
}

.site-footer a:hover {
  color: var(--accent-dark);
}

/* =====================================================
   HOMEPAGE HERO GRID
===================================================== */
.ts-homepage {
  max-width: var(--content-max);
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}

.ts-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.ts-post-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform .3s ease, box-shadow .3s ease;
  overflow: hidden;
  will-change: transform;
}

.ts-post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.ts-post-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform .3s ease;
}

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

.ts-post-content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ts-post-title {
  margin: 0 0 .5rem;
  color: var(--accent);
  font-size: 1.25rem;
}

.ts-post-excerpt {
  color: var(--text);
  font-size: .95rem;
  flex: 1;
  margin-bottom: .8rem;
}

.ts-read-more {
  align-self: flex-start;
  padding: .5rem 1rem;
  margin-top: auto;
}

/* =====================================================
   RESPONSIVE DESIGN
===================================================== */
@media (max-width: 768px) {
  .site-content,
  .ts-homepage {
    padding: 1.5rem 1rem;
  }
  
  .ts-post-grid {
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  
  .site-title a {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .ts-post-grid {
    grid-template-columns: 1fr;
  }
  
  .main-navigation .menu > li > a {
    padding: .5rem .7rem;
  }
}