/*
Theme Name: Pudgy Theme
Theme URI: https://pudgycat.io
Author: Pudgy Cat
Author URI: https://liminalmanifold.com
Description: Minimal custom theme for Pudgy Cat magazine
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pudgy-theme
*/

/* ==========================================================================
   0. Fallback Font Metrics (CLS Prevention)
   ========================================================================== */

@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.49%;
  descent-override: 22.56%;
  line-gap-override: 0%;
  size-adjust: 107.64%;
}

@font-face {
  font-family: "Playfair Fallback";
  src: local("Georgia");
  ascent-override: 97.25%;
  descent-override: 25.43%;
  line-gap-override: 0%;
  size-adjust: 112.56%;
}

/* ==========================================================================
   1. CSS Variables
   ========================================================================== */

:root {
  --accent: #fb5fab;
  --accent-secondary: #ff3e82;
  --bg: #140610;
  --card-bg: #12121e;
  --elevated: #1e1e30;
  --text-primary: #f0f0f8;
  --text-secondary: #a0a0b8;
  --text-muted: #606080;
  --border: rgba(255, 255, 255, 0.06);
  --font-body: Inter, "Inter Fallback", system-ui, sans-serif;
  --font-heading: "Playfair Display", "Playfair Fallback", Georgia, serif;
  --header-height: 96px;
  --social-bar-height: 40px;
  --main-bar-height: 56px;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

/* Playfair Display only for article titles and content headings */
.entry-title,
.entry-content h2,
.entry-content h3 {
  font-family: var(--font-heading);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }

p {
  margin-bottom: 1em;
  color: var(--text-secondary);
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ==========================================================================
   3. Progress Bar (Reading Progress)
   ========================================================================== */

.pudgy-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ==========================================================================
   4. Header
   ========================================================================== */

.site-header {
  position: relative;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background: var(--bg);
  margin-bottom: 10px;
}

/* --- Social Bar (Row 1) --- */

.social-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: var(--social-bar-height);
  background: #0a0a12;
  padding: 0 max(24px, calc((100% - 1200px) / 2));
  transition: height 0.3s ease, opacity 0.3s ease;
}

.social-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 8px;
  font-size: 14px;
  color: var(--text-primary);
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-bar a:hover {
  transform: scale(1.15);
  color: var(--accent, #fb5fab);
}

/* --- Main Bar (Row 2) --- */

.main-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--main-bar-height);
  background: var(--bg);
  padding: 0 max(24px, calc((100% - 1200px) / 2));
  border-bottom: 1px solid var(--border);
}

.main-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.site-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.site-brand-link:hover {
  color: inherit;
}

.site-logo {
  width: 66px;
  height: 66px;
  flex-shrink: 0;
}

.site-logo img {
  width: 100%;
  height: 100%;
  max-width: 66px;
  max-height: 66px;
  object-fit: contain;
  border-radius: 50%;
}

.site-branding {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.site-title {
  font-family: "Inter", "Inter Fallback", system-ui, sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
}

.site-title a {
  color: inherit;
}

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

.site-tagline {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  line-height: 1.2;
}

.main-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Desktop Navigation --- */

.pudgy-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pudgy-nav li {
  position: relative;
}

.pudgy-nav > li > a {
  display: block;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.pudgy-nav > li > a:hover,
.pudgy-nav > li.current-menu-item > a,
.pudgy-nav > li.current_page_item > a {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Dropdown / Sub-menu */

.pudgy-nav li .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.pudgy-nav li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pudgy-nav .sub-menu li a {
  display: block;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.pudgy-nav .sub-menu li a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Nested sub-menu (depth 2+) */
.pudgy-nav .sub-menu .sub-menu {
  top: 0;
  left: 100%;
}

/* --- WooCommerce Cart Icon --- */

.pudgy-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
}

.pudgy-cart:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.pudgy-cart svg {
  width: 20px;
  height: 20px;
}

.pudgy-cart .cart-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
}

.pudgy-cart .cart-count:empty {
  display: none;
}


/* ==========================================================================
   5. Mobile Menu (CSS-Only)
   ========================================================================== */

#menu-toggle {
  display: none;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  gap: 5px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  background: none;
  border: none;
  padding: 0;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.05);
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger to X animation */
.menu-open .hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-open .hamburger span:nth-child(2) {
  opacity: 0;
}

.menu-open .hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Panel */
.mobile-menu-panel {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  background: rgba(10, 10, 18, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999;
  transition: max-height 0.4s ease;
}

.menu-open .mobile-menu-panel {
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

.mobile-menu-panel ul {
  padding: 16px 24px;
}

.mobile-menu-panel li {
  border-bottom: 1px solid var(--border);
}

.mobile-menu-panel li:last-child {
  border-bottom: none;
}

.mobile-menu-panel a {
  display: block;
  padding: 14px 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.mobile-menu-panel a:hover {
  color: var(--accent);
}

.mobile-menu-panel .sub-menu {
  padding-left: 16px;
}

.mobile-menu-panel .sub-menu a {
  font-size: 0.95rem;
  padding: 10px 0;
}

/* ==========================================================================
   6. Content Layout
   ========================================================================== */

#page {
  margin-top: 0;
}

.pmag {
  margin-top: 0;
}

/* Space between category bar and content below */
.pcbar {
  margin-bottom: 15px;
}

/* --- Font consistency: prevent snippet overrides on header --- */
.site-title, .site-header .site-title {
  font-family: "Inter", "Inter Fallback", system-ui, sans-serif !important;
  font-weight: 800;
}
.site-tagline, .site-header .site-tagline {
  font-family: "Inter", "Inter Fallback", system-ui, sans-serif !important;
}

.site-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.pudgy-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

.content-area {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
}

/* Single post/page content */
.entry-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin: 1.8em 0 0.6em;
}

.entry-content p {
  margin-bottom: 1.2em;
}

.entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(251, 95, 171, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s ease;
}

.entry-content a:hover {
  text-decoration-color: var(--accent);
}

.entry-content img {
  border-radius: 8px;
  margin: 1.5em 0;
}

.entry-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: var(--card-bg);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.entry-content pre,
.entry-content code {
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

.entry-content pre {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.entry-content code {
  background: var(--card-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.entry-content pre code {
  background: none;
  padding: 0;
}

.entry-content ul,
.entry-content ol {
  margin: 1em 0;
  padding-left: 1.5em;
}

.entry-content ul {
  list-style: disc;
}

.entry-content ol {
  list-style: decimal;
}

.entry-content li {
  margin-bottom: 0.4em;
  color: var(--text-secondary);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.entry-content th,
.entry-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.entry-content th {
  background: var(--card-bg);
  font-weight: 600;
  color: var(--text-primary);
}

/* --- Entry Meta --- */

.entry-meta {
  margin-top: 12px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.entry-meta a {
  color: var(--text-secondary);
  text-decoration: none;
}

.entry-meta a:hover {
  color: var(--accent);
}

/* --- Dividers / Separators --- */

.entry-content hr {
  border: none;
  border-top: 1px solid rgba(251, 95, 171, 0.5);
  margin: 30px 0;
}

.pudgy-related {
  border-top: 1px solid var(--accent, #fb5fab);
  padding-top: 24px;
  margin-top: 30px;
}

/* ==========================================================================
   7. Footer
   ========================================================================== */

.site-footer,
body.home .site-footer,
body.single .site-footer,
body.page .site-footer,
body.archive .site-footer {
  background: #140610 !important;
  color: var(--text-primary) !important;
  border-top: 2px solid var(--accent);
  margin-top: 40px;
  padding: 0;
}

.site-footer a {
  color: var(--text-primary) !important;
}
.site-footer a:hover {
  color: var(--accent) !important;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.footer-legal {
  margin-top: -2px;
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-legal {
  font-size: 0.8em;
  opacity: 0.7;
}
.footer-legal a {
  text-decoration: underline;
  letter-spacing: -0.01em;
}

.footer-legal a {
  color: inherit !important;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-primary);
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.footer-social a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent, #fb5fab);
}

/* ==========================================================================
   8. Engagement: Share Buttons
   ========================================================================== */

.pudgy-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  margin-bottom: 2em;
  padding-top: 20px;
  border-top: 1px solid rgba(251, 95, 171, 0.5);
}

.pudgy-share-label {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 4px;
}

.pudgy-share-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pudgy-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pudgy-share-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(251, 95, 171, 0.2);
}

.pudgy-share-btn svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   9. Engagement: Scroll to Top
   ========================================================================== */

.scroll-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
  z-index: 900;
  box-shadow: 0 4px 12px rgba(251, 95, 171, 0.3);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: var(--accent-secondary);
}

.scroll-to-top svg {
  width: 18px;
  height: 18px;
}

/* --- Ticker Speed Override (snippet #34 default is 55s) --- */

.ptick-items {
  animation-duration: 27s !important;
}

/* ==========================================================================
   10. Card Hover Effects (for Code Snippets cards)
   ========================================================================== */

.pc-card,
.phero-card {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.pc-card:hover,
.phero-card:hover {
  box-shadow: 0 0 20px rgba(251, 95, 171, 0.15);
}

/* ==========================================================================
   11. WooCommerce Dark Theme Overrides
   ========================================================================== */

.pudgy-woo .products,
.woocommerce ul.products,
.woocommerce ul.products[class*="columns-"] {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 24px !important;
  padding: 0 !important;
  list-style: none !important;
  width: 100% !important;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after {
  display: none !important;
}
.woocommerce ul.products li.product {
  width: 100% !important;
  margin: 0 !important;
  padding: 16px !important;
  float: none !important;
  clear: none !important;
  background: var(--card-bg, #12121e);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.pudgy-woo {
  color: var(--text-primary);
  display: block !important;
  grid-template-columns: none !important;
}

/* Inputs */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce input[type="text"],
.woocommerce input[type="email"],
.woocommerce input[type="password"],
.woocommerce input[type="number"],
.woocommerce input[type="tel"],
.woocommerce input[type="url"],
.woocommerce input[type="search"],
.woocommerce textarea,
.woocommerce select {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 10px 14px;
  transition: border-color 0.2s ease;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce input[type="text"]:focus,
.woocommerce input[type="email"]:focus,
.woocommerce input[type="password"]:focus,
.woocommerce textarea:focus,
.woocommerce select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(251, 95, 171, 0.15);
}

/* Buttons */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
  background: var(--accent-secondary);
  box-shadow: 0 4px 12px rgba(251, 95, 171, 0.3);
}

/* Tables */
.woocommerce table.shop_table {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  border-collapse: separate;
}

.woocommerce table.shop_table th {
  background: var(--elevated);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  font-weight: 600;
}

.woocommerce table.shop_table td {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  color: var(--text-secondary);
}

/* Notices */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info {
  background: var(--card-bg);
  border-top-color: var(--accent);
  color: var(--text-primary);
}

.woocommerce .woocommerce-error {
  background: var(--card-bg);
  border-top-color: #e74c3c;
  color: var(--text-primary);
}

.woocommerce .woocommerce-message::before,
.woocommerce .woocommerce-info::before {
  color: var(--accent);
}

/* Product cards - styling (layout overrides are above with the grid) */

.woocommerce ul.products li.product img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 12px;
}

.woocommerce ul.products li.product:hover {
  box-shadow: 0 0 20px rgba(251, 95, 171, 0.15);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  color: var(--text-primary);
  font-family: var(--font-body);
  padding: 8px 12px 0;
}

.woocommerce ul.products li.product .price {
  color: var(--accent, #fb5fab);
  font-weight: 700;
  padding: 4px 12px 12px;
}

.woocommerce ul.products li.product a.button {
  background: var(--accent, #fb5fab);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 600;
}

/* Star ratings */
.woocommerce .star-rating span::before {
  color: var(--accent);
}

/* Mini cart widget */
.woocommerce .widget_shopping_cart .cart_list li {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.woocommerce .widget_shopping_cart .cart_list li a {
  color: var(--text-primary);
}

.woocommerce .widget_shopping_cart .total {
  border-top: 1px solid var(--border);
  color: var(--text-primary);
}

/* Quantity input */
.woocommerce .quantity .qty {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 60px;
  text-align: center;
  border-radius: 4px;
}

/* Breadcrumbs */
.woocommerce .woocommerce-breadcrumb {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1em;
}

.woocommerce .woocommerce-breadcrumb a {
  color: var(--text-secondary);
}

/* Sale badge */
.woocommerce span.onsale {
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  font-weight: 600;
}

/* ==========================================================================
   12. WordPress Utilities
   ========================================================================== */

/* Alignment */
.alignleft   { float: left;  margin: 0 1.5em 1em 0; }
.alignright  { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin: 1em auto; }

/* WordPress block alignment */
.wp-block-image.alignwide,
.wp-block-image.alignfull {
  max-width: 100vw;
}

/* Screen reader text */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  clip: auto !important;
  display: block;
  height: auto;
  width: auto;
  z-index: 100000;
  background: var(--elevated);
  color: var(--text-primary);
  padding: 12px 20px;
  font-size: 0.9rem;
}

/* Sticky post */
.sticky .entry-content::before {
  content: "";
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 1.5em 0;
}

/* WordPress captions */
.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 6px 0;
  text-align: center;
}

/* Pagination */
.navigation.pagination {
  margin: 2em 0;
  text-align: center;
}

.nav-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-links a,
.nav-links span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--border);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.nav-links .current {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* Comments */
.comments-area,
h3#comments {
  margin-top: 2em;
  padding-top: 2em;
  border-top: 1px solid rgba(251, 95, 171, 0.3);
}

.comment-list {
  list-style: none;
  padding: 0;
}

.comment-body {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.comment-author {
  font-weight: 600;
  color: var(--text-primary);
}

.comment-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.comment-reply-link {
  font-size: 0.85rem;
  color: var(--accent);
}

.comment-respond {
  margin-top: 2em;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text-primary);
  transition: border-color 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.comment-form .form-submit input {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.comment-form .form-submit input:hover {
  background: var(--accent-secondary);
}

/* ==========================================================================
   13. Complianz Cookie Banner Dark Theme
   ========================================================================== */

.cmplz-cookiebanner {
  background: var(--card-bg, #12121e) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
}

.cmplz-cookiebanner .cmplz-message {
  color: var(--text-secondary) !important;
}

.cmplz-cookiebanner .cmplz-btn {
  border-radius: 6px !important;
  font-family: var(--font-body) !important;
  font-weight: 600 !important;
}

.cmplz-cookiebanner .cmplz-btn.cmplz-accept {
  background: var(--accent, #fb5fab) !important;
  color: #fff !important;
  border: none !important;
}

.cmplz-cookiebanner .cmplz-btn.cmplz-deny {
  background: transparent !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
}

.cmplz-cookiebanner .cmplz-btn.cmplz-deny:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

.cmplz-cookiebanner .cmplz-btn.cmplz-view-preferences,
.cmplz-cookiebanner .cmplz-btn.cmplz-manage {
  background: transparent !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
}

.cmplz-cookiebanner a {
  color: var(--accent) !important;
}

/* Banner open: "Manage consent" text and close button */
.cmplz-cookiebanner .cmplz-header,
.cmplz-cookiebanner .cmplz-title,
.cmplz-cookiebanner .cmplz-close,
.cmplz-cookiebanner .cmplz-close svg,
.cmplz-cookiebanner .cmplz-close path {
  color: var(--text-primary) !important;
  fill: var(--text-primary) !important;
  stroke: var(--text-primary) !important;
}

/* Small tab/widget when banner is dismissed */
.cmplz-manage-consent,
.cmplz-manage-consent-container,
.cmplz-manage-consent a,
#cmplz-manage-consent {
  background: var(--card-bg, #12121e) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
}
.cmplz-manage-consent a:hover,
#cmplz-manage-consent:hover {
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* Complianz categories/toggles */
.cmplz-categories .cmplz-category {
  background: var(--elevated, #1e1e30) !important;
  border-color: var(--border) !important;
}

.cmplz-categories .cmplz-category .cmplz-category-header {
  color: var(--text-primary) !important;
}

.cmplz-categories .cmplz-category .cmplz-description {
  color: var(--text-secondary) !important;
}

/* Category titles (Functional, Preference, Statistics, Marketing) */
.cmplz-categories .cmplz-category .cmplz-category-title,
.cmplz-categories .cmplz-category label,
.cmplz-categories .cmplz-category .cmplz-always-active {
  color: var(--text-primary) !important;
}

/* Toggle switches: override Complianz CSS variables */
.cmplz-cookiebanner {
  --cmplz_slider_active_color: #fb5fab !important;
  --cmplz_slider_inactive_color: #606080 !important;
  --cmplz_slider_bullet_color: #ffffff !important;
  --cmplz_category_header_always_active_color: #fb5fab !important;
  --cmplz_hyperlink_color: #fb5fab !important;
}

/* Fallback direct overrides for toggle :before (the track) */
.cmplz-cookiebanner .cmplz-banner-checkbox .cmplz-label:before {
  background-color: var(--cmplz_slider_inactive_color, #606080) !important;
}
.cmplz-cookiebanner .cmplz-banner-checkbox input:checked + .cmplz-label:before {
  background-color: var(--cmplz_slider_active_color, #fb5fab) !important;
}
/* Toggle knob */
.cmplz-cookiebanner .cmplz-banner-checkbox .cmplz-label:after {
  background: #fff !important;
}

/* Expandable description text */
.cmplz-categories .cmplz-category p,
.cmplz-categories .cmplz-category span,
.cmplz-categories .cmplz-cookies-overview td,
.cmplz-categories .cmplz-cookies-overview th {
  color: var(--text-secondary) !important;
}

.cmplz-categories .cmplz-cookies-overview {
  border-color: var(--border) !important;
}

.cmplz-categories .cmplz-cookies-overview td,
.cmplz-categories .cmplz-cookies-overview th {
  border-color: var(--border) !important;
}

/* ==========================================================================
   14. Media Queries
   ========================================================================== */

/* Tablets and mobile */
@media (max-width: 921px) {

  :root {
    --header-height: 56px;
  }

  /* Hide social bar */
  .social-bar {
    display: none;
  }

  /* Hide sidebar ads on mobile (they stack below content and look bad) */
  .pside .pudgy-sidebar-ad {
    display: none;
  }

  /* Show hamburger */
  .hamburger {
    display: flex;
  }

  /* Hide desktop nav */
  .pudgy-nav {
    display: none;
  }

  /* Single column layout */
  .pudgy-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  /* Shop single column on mobile */
  .woocommerce ul.products,
  .woocommerce ul.products[class*="columns-"] {
    grid-template-columns: 1fr !important;
  }

  /* Footer stacked centered */
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .footer-left {
    align-items: center;
  }

  .footer-social {
    justify-content: center;
    width: 100%;
  }

  .footer-legal a {
    margin: 0 6px;
  }

  /* Shrink branding */
  .site-logo {
    width: 42px;
    height: 42px;
  }

  .site-logo,
  .site-logo img,
  img.custom-logo {
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
  }

  .main-bar {
    height: 56px;
    overflow: hidden;
  }

  .site-brand-link {
    gap: 8px;
  }

  .site-title {
    font-size: 1rem;
  }

  .site-tagline {
    font-size: 0.6rem;
  }

  /* Adjust content padding for smaller header */
  .site-content {
    padding-top: 16px;
  }

  /* Share buttons wrap */
  .pudgy-share {
    justify-content: center;
  }
}

/* Small mobile */
@media (max-width: 480px) {

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.15rem; }

  .site-content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .entry-content {
    font-size: 1rem;
  }

  .pudgy-share-btn {
    width: 32px;
    height: 32px;
  }

  .pudgy-share-btn svg {
    width: 16px;
    height: 16px;
  }

  .scroll-to-top {
    bottom: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
  }
}
