/*
Theme Name: Perpetly
Theme URI: https://perpetly.com/
Author: Perpetly
Description: Gutenberg-friendly custom theme for the Perpetly marketing site. Add or edit pages with the block editor — all custom styles (cards, pricing, hero, CTA) are available as block additional CSS classes.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: perpetly
*/

/* Perpetly Marketing Site — CSS */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-dark: #0f172a;
  --text: #1e293b;
  --text-light: #64748b;
  --text-white: #f1f5f9;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.10);
  --transition: 0.25s ease;
  --max-w: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
h1,h2,h3,h4 { line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h3 { font-size: 1.3rem; }

/* Layout */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--bg-dark); color: var(--text-white); }
.text-center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* Nav */
.nav { position: sticky; top: 0; background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); z-index: 100; padding: 16px 0; }
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 0; }
.nav-logo img { height: 32px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a { color: var(--text); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 28px; border-radius: 8px; font-weight: 600; font-size: 0.95rem; border: none; cursor: pointer; transition: all var(--transition); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.35); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: #f1f5f9; color: var(--primary-dark); }
.btn-sm { padding: 8px 20px; font-size: 0.875rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }

/* Hero */
.hero { padding: 100px 0 80px; background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #f5f3ff 100%); }
.hero h1 { margin-bottom: 20px; }
.hero p { font-size: 1.15rem; color: var(--text-light); margin-bottom: 32px; max-width: 560px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-img { border-radius: var(--radius); box-shadow: var(--shadow-lg); }

/* Cards */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; transition: all var(--transition); }
.card:hover { box-shadow: var(--shadow); transform: translateY(-4px); border-color: var(--primary-light); }
.card-icon { width: 48px; height: 48px; background: #eef2ff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 16px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-light); font-size: 0.95rem; }

/* Pricing */
.pricing-card { background: var(--bg); border: 2px solid var(--border); border-radius: 16px; padding: 40px 32px; text-align: center; transition: all var(--transition); position: relative; }
.pricing-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-lg); }
.pricing-card.featured { border-color: var(--primary); transform: scale(1.04); }
.pricing-card.featured::before { content: 'Most Popular'; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 4px 20px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.pricing-price { font-size: 2.8rem; font-weight: 800; color: var(--text); margin: 16px 0 8px; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-light); }
.pricing-features { list-style: none; text-align: left; margin: 24px 0; }
.pricing-features li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; color: var(--text-light); }
.pricing-features li::before { content: '✓'; color: var(--primary); font-weight: 700; margin-right: 10px; }

/* Stats */
.stat { text-align: center; padding: 24px; }
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.9rem; color: var(--text-light); margin-top: 4px; }

/* Testimonial */
.testimonial { background: var(--bg); border-radius: var(--radius); padding: 32px; border: 1px solid var(--border); }
.testimonial blockquote { font-style: italic; color: var(--text-light); font-size: 1.05rem; margin-bottom: 16px; line-height: 1.7; }
.testimonial-author { font-weight: 600; }
.testimonial-role { font-size: 0.875rem; color: var(--text-light); }

/* CTA Section */
.cta { padding: 80px 0; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; text-align: center; }
.cta h2 { color: #fff; margin-bottom: 16px; }
.cta p { color: rgba(255,255,255,0.85); font-size: 1.1rem; margin-bottom: 32px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* Footer */
.footer { background: var(--bg-dark); color: var(--text-white); padding: 60px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand p { color: #94a3b8; margin-top: 12px; font-size: 0.9rem; line-height: 1.7; }
.footer h4 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; color: #94a3b8; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #cbd5e1; font-size: 0.9rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e293b; padding-top: 24px; display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: #64748b; }

/* Breadcrumb */
.breadcrumb { padding: 20px 0; font-size: 0.9rem; color: var(--text-light); }
.breadcrumb a { color: var(--primary); }

/* Page Header */
.page-header { padding: 60px 0 40px; background: var(--bg-alt); }
.page-header h1 { margin-bottom: 12px; }
.page-header p { color: var(--text-light); font-size: 1.1rem; max-width: 640px; }

/* Blog */
.blog-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); transition: all var(--transition); background: var(--bg); }
.blog-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.blog-card-img { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-alt); }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-body { padding: 24px; }
.blog-card-meta { font-size: 0.8rem; color: var(--text-light); margin-bottom: 8px; }
.blog-card-body h3 { margin-bottom: 8px; }
.blog-card-body h3 a { color: var(--text); }
.blog-card-body h3 a:hover { color: var(--primary); }
.blog-card-body p { color: var(--text-light); font-size: 0.9rem; }

/* Contact Form */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; font-family: inherit; transition: border-color var(--transition); background: var(--bg); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-group textarea { min-height: 140px; resize: vertical; }

/* Badge */
.badge { display: inline-block; padding: 4px 12px; background: #eef2ff; color: var(--primary); border-radius: 20px; font-size: 0.8rem; font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 0 40px; }
  .section { padding: 60px 0; }
  .nav-links { display: none; }
  .pricing-card.featured { transform: none; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .btn-lg { width: 100%; }
}

/* --- WordPress core required classes --- */
.alignleft { float: left; margin-right: 1.5em; }
.alignright { float: right; margin-left: 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.875rem; color: var(--text-light); text-align: center; margin-top: 8px; }
.screen-reader-text { position: absolute !important; clip: rect(1px, 1px, 1px, 1px); height: 1px; width: 1px; overflow: hidden; }

/* Sticky nav under WP admin bar */
.admin-bar .nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .nav { top: 46px; } }

/* --- Gutenberg content rendering --- */
/* When you paste a normal Gutenberg page (no full-bleed sections), wrap it in our container width */
.gb-page-content { padding: 60px 0; }
.gb-page-content > .wp-block-group:not(.alignfull):not(.alignwide),
.gb-page-content > p,
.gb-page-content > h1, .gb-page-content > h2, .gb-page-content > h3,
.gb-page-content > ul, .gb-page-content > ol,
.gb-page-content > .wp-block-image:not(.alignfull):not(.alignwide),
.gb-page-content > .wp-block-quote,
.gb-page-content > .wp-block-buttons {
    max-width: var(--max-w);
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* Make alignfull Gutenberg blocks span edge-to-edge */
.gb-page-content > .alignfull { width: 100%; max-width: 100%; margin-left: 0; margin-right: 0; }

/* Single post / page content typography (when using vanilla Gutenberg blocks) */
.entry-content h2 { margin: 32px 0 16px; }
.entry-content h3 { margin: 24px 0 12px; }
.entry-content p, .entry-content ul, .entry-content ol { margin-bottom: 16px; line-height: 1.8; }
.entry-content ul, .entry-content ol { padding-left: 24px; }
.entry-content img { border-radius: var(--radius); margin: 24px 0; }
.entry-content blockquote { border-left: 4px solid var(--primary); padding: 8px 20px; margin: 24px 0; color: var(--text-light); font-style: italic; background: var(--bg-alt); border-radius: 0 8px 8px 0; }
.entry-meta { color: var(--text-light); font-size: 0.9rem; margin-bottom: 24px; }

/* Gutenberg button blocks adopt the .btn look when given the right additional CSS class */
.wp-block-button.is-style-btn-primary .wp-block-button__link { background: var(--primary); color: #fff; border-radius: 8px; padding: 12px 28px; font-weight: 600; }
.wp-block-button.is-style-btn-primary .wp-block-button__link:hover { background: var(--primary-dark); box-shadow: 0 4px 16px rgba(99,102,241,0.35); }
.wp-block-button.is-style-btn-outline .wp-block-button__link { background: transparent; color: var(--primary); border: 2px solid var(--primary); border-radius: 8px; padding: 10px 26px; font-weight: 600; }
.wp-block-button.is-style-btn-outline .wp-block-button__link:hover { background: var(--primary); color: #fff; }
.wp-block-button.is-style-btn-white .wp-block-button__link { background: #fff; color: var(--primary); border-radius: 8px; padding: 12px 28px; font-weight: 600; }
