/*
Theme Name: Giddy301
Theme URI: https://301labs.co
Author: Gideon Owolabi for 301Labs
Author URI: https://www.301labs.co
Description: Ghost-identical theme with listen button, dark mode, claps, animations, and full responsiveness.
Version: 1.2
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: giddy301
Tags: blog, clean, minimal, ghost, editorial, custom-colors, custom-fonts, google-fonts, animated
*/

:root {
  --gp-bg: #ffffff;
  --gp-bg-secondary: #f9f9f9;
  --gp-text: #15171a;
  --gp-text-secondary: #738a94;
  --gp-text-muted: #a0adb4;
  --gp-accent: #ff0095;
  --gp-accent-hover: #d4007c;
  --gp-border: #e2ecf0;
  --gp-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --gp-font-serif: Georgia, 'Times New Roman', serif;
  --gp-font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --gp-content-width: 740px;
  --gp-wide-width: 1200px;
  --gp-header-height: 64px;
  --gp-radius: 5px;
  --gp-radius-lg: 10px;
  --gp-transition: 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}
.gp-dark {
  --gp-bg: #15171a;
  --gp-bg-secondary: #1c1f23;
  --gp-text: #ffffff;
  --gp-text-secondary: #9db2bf;
  --gp-text-muted: #6c7a84;
  --gp-border: #2c3338;
  --gp-accent: #ff0095;
  --gp-accent-hover: #d4007c;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 62.5%; scroll-behavior: smooth; }
body {
  font-family: var(--gp-font-body, var(--gp-font-sans));
  font-size: var(--gp-body-font-size, 1.6rem);
  line-height: 1.7;
  color: var(--gp-text);
  background: var(--gp-bg);
  transition: background var(--gp-transition), color var(--gp-transition);
  opacity: 0;
  animation: fadeInBody 0.6s ease forwards;
}
@keyframes fadeInBody { to { opacity: 1; } }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--gp-font-heading, var(--gp-font-sans));
  font-weight: 800;
  line-height: 1.2;
}
h1 { font-size: var(--gp-h1-size, 4rem); }
h2 { font-size: var(--gp-h2-size, 3.2rem); }
h3 { font-size: var(--gp-h3-size, 2.6rem); }

.gh-head {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--gp-bg);
  border-bottom: 1px solid var(--gp-border);
  height: var(--gp-header-height, 64px);
  display: flex;
  align-items: center;
  backdrop-filter: saturate(180%) blur(20px);
}
.gh-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--gp-wide-width);
  margin: 0 auto;
  padding: 0 4vmin;
}
.gh-head-brand { font-size: 2rem; font-weight: 800; color: var(--gp-text); text-decoration: none; }
.gh-head-brand img { height: 32px; width: auto; }
.gh-head-menu { display: flex; align-items: center; gap: 2.4rem; list-style: none; }
.gh-head-menu a {
  font-size: 1.45rem; font-weight: 500; color: var(--gp-text); opacity: 0.8;
  text-decoration: none; transition: opacity 0.2s, transform 0.2s;
}
.gh-head-menu a:hover { opacity: 1; transform: translateY(-1px); }
.gh-head-actions { display: flex; gap: 1.6rem; }
.gh-head-btn {
  padding: 0.8rem 1.6rem; background: var(--gp-accent); color: #fff !important;
  border-radius: var(--gp-radius); text-decoration: none; transition: all 0.2s;
}
.gh-head-btn:hover { background: var(--gp-accent-hover); transform: translateY(-2px); }
.gh-burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; }
.gh-burger span {
  width: 24px; height: 2px; background: var(--gp-text);
  transition: transform 0.3s ease, opacity 0.2s;
}
body.nav-open .gh-burger span:first-child { transform: translateY(7px) rotate(45deg); }
body.nav-open .gh-burger span:nth-child(2) { opacity: 0; }
body.nav-open .gh-burger span:last-child { transform: translateY(-7px) rotate(-45deg); }

.gh-feed { max-width: var(--gp-wide-width); margin: 0 auto; padding: 4vmin; }
.gh-feed-grid {
  display: grid;
  gap: 4rem;
  animation: fadeUp 0.5s ease backwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.layout-grid-3 { grid-template-columns: repeat(3, 1fr); }

.gh-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--gp-radius-lg);
  transition: transform 0.3s var(--gp-transition), box-shadow 0.3s;
}
.gh-card:hover { transform: translateY(-5px); box-shadow: 0 12px 28px rgba(0,0,0,0.08); }
.gh-card-image-link {
  display: block;
  border-radius: var(--gp-radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  margin-bottom: 2rem;
}
.gh-card-image {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.gh-card:hover .gh-card-image { transform: scale(1.05); }
.gh-card-tag {
  font-size: 1.25rem; font-weight: 700; color: var(--gp-accent);
  text-transform: uppercase; text-decoration: none;
}
.gh-card-title { font-size: 1.8rem; font-weight: 800; margin: 0.8rem 0; }
.gh-card-title a {
  color: var(--gp-text);
  text-decoration: none;
  background: linear-gradient(to right, var(--gp-accent), var(--gp-accent));
  background-size: 0 2px;
  background-repeat: no-repeat;
  background-position: bottom left;
  transition: background-size 0.3s ease;
}
.gh-card-title a:hover { background-size: 100% 2px; }
.gh-card-excerpt { font-size: 1.5rem; color: var(--gp-text-secondary); }
.gh-card-footer { display: flex; gap: 1rem; margin-top: 1rem; font-size: 1.3rem; color: var(--gp-text-muted); }

.gh-article-header { max-width: var(--gp-content-width); margin: 0 auto; padding: 6vmin 4vmin 2vmin; }
.gh-article-title { font-size: clamp(2.8rem, 5vw, 5.2rem); font-weight: 800; line-height: 1.1; }
.gh-content { max-width: var(--gp-content-width); margin: 0 auto; padding: 0 4vmin 4vmin; font-size: 1.8rem; line-height: 1.8; }
.gh-subscribe {
  background: var(--gp-bg-secondary);
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-lg);
  padding: 4rem;
  text-align: center;
  max-width: var(--gp-content-width);
  margin: 4vmin auto;
}
.gh-subscribe-form { display: flex; gap: 1rem; max-width: 420px; margin: 0 auto; }
.gh-subscribe-form input[type="email"] {
  flex: 1; padding: 1.2rem; border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius); background: var(--gp-bg); color: var(--gp-text);
}
.gh-subscribe-form button {
  padding: 1.2rem 2.4rem; background: var(--gp-accent); color: #fff;
  border: none; border-radius: var(--gp-radius); cursor: pointer;
  transition: all 0.2s;
}
.gh-subscribe-form button.loading {
  background: var(--gp-text-muted);
  cursor: wait;
  position: relative;
}
.gh-subscribe-form button.loading::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  left: calc(50% - 9px);
  top: calc(50% - 9px);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gh-clap {
  display: inline-flex; align-items: center; gap: 0.8rem;
  background: var(--gp-bg-secondary); border: 1px solid var(--gp-border);
  border-radius: 100px; padding: 0.6rem 1.6rem; cursor: pointer;
  transition: all 0.2s; margin: 2rem 0;
}
.gh-clap:hover { background: var(--gp-accent); color: #fff; border-color: var(--gp-accent); transform: scale(1.02); }
.gh-clap.clapped { opacity: 0.6; cursor: default; background: var(--gp-accent); transform: none; }

.gh-dark-toggle {
  position: fixed; bottom: 2rem; right: 2rem; background: var(--gp-bg-secondary);
  border: 1px solid var(--gp-border); border-radius: 50%; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  z-index: 9999; transition: transform 0.2s;
}
.gh-dark-toggle:hover { transform: scale(1.1); background: var(--gp-accent); color: #fff; }

.gh-toc { background: var(--gp-bg-secondary); border: 1px solid var(--gp-border); border-radius: var(--gp-radius-lg); padding: 2rem; margin: 2rem 0; }
.gh-toc-list { list-style: none; padding-left: 0; }
.gh-toc-list a { transition: color 0.2s, padding-left 0.2s; }
.gh-toc-list a:hover { color: var(--gp-accent); padding-left: 4px; }

.gh-share { display: flex; gap: 1rem; margin: 3rem auto; justify-content: center; }
.gh-share-btn {
  padding: 0.6rem 1.2rem; border: 1px solid var(--gp-border); border-radius: var(--gp-radius);
  text-decoration: none; color: var(--gp-text); transition: all 0.2s;
}
.gh-share-btn:hover { border-color: var(--gp-accent); color: var(--gp-accent); transform: translateY(-2px); }

.gh-related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 2rem; margin-top: 2rem; }

.gh-progress {
  position: fixed; top: 0; left: 0; height: 3px; background: var(--gp-accent);
  z-index: 9999; width: 0%; transition: width 0.1s linear;
}

.gh-404 { text-align: center; padding: 8vmin 4vmin; max-width: 600px; margin: 0 auto; animation: fadeUp 0.5s; }
.gh-404-title { font-size: 8rem; font-weight: 800; color: var(--gp-accent); margin-bottom: 2rem; }

/* Listen button */
.gh-listen-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gp-bg-secondary);
    border: 1px solid var(--gp-border);
    border-radius: 40px;
    padding: 8px 16px;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--gp-text);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 16px;
}
.gh-listen-btn:hover {
    background: var(--gp-accent);
    color: #fff;
    border-color: var(--gp-accent);
    transform: scale(1.02);
}
.gh-listen-btn.playing {
    background: var(--gp-accent);
    color: #fff;
    border-color: var(--gp-accent);
}
.listen-icon {
    font-size: 1.6rem;
}

@media (max-width: 1100px) { .layout-grid-3 { grid-template-columns: repeat(2,1fr); } .gh-related-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px) {
  .gh-head-menu, .gh-head-actions { display: none; }
  .gh-burger { display: flex; }
  body.nav-open .gh-head-menu, body.nav-open .gh-head-actions {
    display: flex; flex-direction: column; position: fixed; top: var(--gp-header-height);
    left: 0; right: 0; background: var(--gp-bg); padding: 2rem; border-bottom: 1px solid var(--gp-border);
    z-index: 999; gap: 1.5rem;
  }
  .gh-subscribe-form { flex-direction: column; }
  .layout-grid-3, .gh-related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
  :root { --gp-header-height: 56px; }
  .gh-feed { padding: 2rem; }
  .gh-article-header { padding: 4vmin 2vmin; }
  .gh-listen-btn { padding: 6px 12px; font-size: 1.2rem; }
}
