/* =========================================================
   Image Prompt AI — Theme layout overrides & utilities
   ========================================================= */

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.skip-link:focus {
  clip: auto !important;
  clip-path: none;
  display: block;
  height: auto;
  left: 8px;
  top: 8px;
  width: auto;
  z-index: 100000;
  background: #0f172a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
}

/* Custom logo in glass header */
.header .custom-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.header .custom-logo {
  max-height: 42px;
  width: auto;
}
.logo-text {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-main);
  text-decoration: none;
}
.logo-text strong {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Pagination (original circular style) */
.ipa-page-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: white;
  color: var(--text-main);
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: 0.3s;
  font-weight: 500;
}
.ipa-page-btn:hover {
  transform: scale(1.1);
  color: var(--primary);
}
.ipa-page-btn.is-active {
  background: var(--primary);
  color: white;
  font-weight: 700;
}

/* Card action row (matches index.php compact buttons) */
.card-footer {
  padding: 12px 15px !important;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.action-row-top {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}
.action-btn-sm {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 0;
  border: 1px solid rgba(243, 96, 114, 0.4);
  border-radius: 6px;
  background: white;
  color: #F36072;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
}
.action-btn-sm:hover {
  background: rgba(243, 96, 114, 0.05);
  border-color: #F36072;
}
.action-btn-sm.liked {
  background: #F36072;
  color: white;
}
.action-btn-full {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(to right, #ea5b6c, #70d1a4);
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.action-btn-full:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Home hero animations from original index.php */
@keyframes gradient-bg {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes float-pro {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes glow-pulse {
  0% { box-shadow: 0 0 10px rgba(243, 96, 114, 0.2); }
  50% { box-shadow: 0 0 25px rgba(243, 96, 114, 0.6); }
  100% { box-shadow: 0 0 10px rgba(243, 96, 114, 0.2); }
}
@keyframes shine {
  0% { left: -100%; }
  20% { left: 100%; }
  100% { left: 100%; }
}

.hero-title {
  background: linear-gradient(-45deg, #F36072, #EE9624, #393464, #F36072);
  background-size: 300% 300%;
  animation: gradient-bg 6s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.premium-pill {
  animation: float-pro 3s ease-in-out infinite, glow-pulse 3s infinite;
  position: relative;
  overflow: hidden;
}
.premium-pill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  animation: shine 4s infinite;
}

/* Gallery archive filter pills (coral brand from gallery.php) */
.ipa-gallery-hero .filter-pill.active {
  background: linear-gradient(135deg, #F36072, #393464);
  color: white;
  border-color: transparent;
}
.blog-card-visual a img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: unset;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.4s;
  filter: brightness(0.95);
}
.blog-card:hover .blog-card-visual a img {
  transform: scale(1.04);
  filter: brightness(1.05);
}
.blog-card-visual {
  width: 100%;
  height: auto;
  background: #f1f5f9;
  overflow: hidden;
  position: relative;
}

/* Plugin content styling inside single ai_prompt */
.ipa-entry-content .prompthub-prompt-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 35px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}
.ipa-entry-content .ph-core-copy-trigger,
.ipa-plugin-copy {
  background: linear-gradient(135deg, #02c491, #F36072) !important;
  color: #fff !important;
  border: none !important;
  padding: 10px 20px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(2, 196, 145, 0.25) !important;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ipa-entry-content .ph-core-copy-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(243, 96, 114, 0.3) !important;
}
.ipa-entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.ipa-entry-content h2 {
  color: #334155;
  font-size: 24px;
  font-weight: 800;
  margin: 1.5em 0 0.75em;
}
.ipa-entry-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.25em 0 0.5em;
  color: #1e293b;
}

/* Single prompt page title gradient */
.ipa-single-prompt .title {
  background: linear-gradient(-45deg, #F36072, #EE9624, #393464, #F36072);
  background-size: 300% 300%;
  animation: gradient-bg 5s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

/* Read layout base — desktop rules live in desktop-layout.css (loaded last).
   Do NOT use display:contents here; it collapses columns and crushes text. */
.read-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  width: 100%;
  margin: 0 auto;
  align-items: start;
}
.read-main-col,
.read-sidebar-col {
  display: block;
  width: 100%;
  min-width: 0;
}

.single-thumbnail-wrapper {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.single-thumbnail-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

.minimal-text-block {
  width: 100%;
  margin: 20px 0 40px;
  padding: 20px 25px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}
.minimal-line {
  font-size: 15px;
  color: #475569;
  line-height: 1.7;
}

.quick-links-container {
  width: 100%;
  padding: 20px;
  background: #ffffff;
  border: 1px solid rgba(2, 196, 145, 0.2);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(2, 196, 145, 0.05);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.quick-link-item {
  display: block;
  font-size: 13px;
  color: #334155;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: #f8fafc;
  border-radius: 8px;
  transition: 0.2s ease;
}
.quick-link-item:hover {
  background: rgba(2, 196, 145, 0.1);
  color: var(--primary);
}

/* 404 */
.ipa-404 {
  text-align: center;
  padding: 80px 20px;
  max-width: 560px;
  margin: 0 auto;
}
.ipa-404 h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.ipa-404 p {
  color: var(--text-sub);
  margin-bottom: 24px;
}

/* Align desktop nav items from walker */
.desktop-nav a {
  text-decoration: none;
}

/* Dynamic hero subtitle (replaces inline style on front-page) */
.hero-subtitle {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  letter-spacing: 0.3px;
  margin-top: 10px;
  color: var(--text-sub, #64748b);
  line-height: 1.6;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* Gallery archive hero (dynamic Customizer strings) */
.ipa-gallery-hero .blog-hero {
  text-align: center;
  padding: 60px 20px;
}
.ipa-gallery-hero .blog-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(243, 96, 114, 0.1);
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 800;
  color: #F36072;
  margin-bottom: 15px;
  border: 1px solid rgba(243, 96, 114, 0.2);
  box-shadow: 0 4px 15px rgba(243, 96, 114, 0.1);
}
.ipa-gallery-hero .gallery-hero-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  background: linear-gradient(-45deg, #F36072, #EE9624, #393464, #F36072);
  background-size: 300% 300%;
  animation: gradient-bg 6s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}
.ipa-gallery-hero .gallery-hero-sub {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-sub, #64748b);
  font-size: 18px;
  max-width: 600px;
  margin: 10px auto 30px;
  line-height: 1.6;
  letter-spacing: 0.3px;
}
.ipa-gallery-hero .filter-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  padding: 0 20px;
}
.ipa-gallery-hero .blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
}
.ipa-gallery-hero .blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

/* ------------------------------------------------------------------
   AD SLOTS — monetization containers (never break masonry)
------------------------------------------------------------------- */
.ipa-ad-slot {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  margin: 16px 0 24px;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.85);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-height: 90px;
}

/* Full-width row inside CSS Grid / masonry — keeps card columns aligned */
.masonry-grid > .ipa-ad-slot,
.blog-grid > .ipa-ad-slot,
.ipa-ad-slot--home-infeed,
.ipa-ad-slot--gallery-infeed {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  break-inside: avoid;
  margin: 8px 0 20px;
}

.ipa-ad-slot--header-below {
  max-width: 1280px;
  margin: 12px auto 8px;
  padding-left: 20px;
  padding-right: 20px;
}

.ipa-ad-slot--before-footer {
  max-width: 1280px;
  margin: 24px auto 8px;
  padding-left: 20px;
  padding-right: 20px;
}

.ipa-ad-slot--sidebar {
  margin-top: 20px;
  min-height: 250px;
}

.ipa-ad-slot--single-after {
  max-width: 1280px;
  margin: 32px auto;
  padding: 16px 24px;
}

.ipa-ad-slot__badge {
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.ipa-ad-slot__inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  overflow: hidden;
}

.ipa-ad-slot__inner ins,
.ipa-ad-slot__inner iframe,
.ipa-ad-slot__inner > div {
  max-width: 100%;
}

.ipa-ad-slot__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
}

.ipa-ad-slot__placeholder i {
  font-size: 22px;
  opacity: 0.55;
  color: #F36072;
}

.ipa-ad-slot__placeholder small {
  font-size: 11px;
  font-weight: 500;
  color: #cbd5e1;
  max-width: 320px;
}

html[data-theme="dark"] .ipa-ad-slot {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(148, 163, 184, 0.2);
}

html[data-theme="dark"] .ipa-ad-slot__placeholder {
  color: #64748b;
}

/* Mobile header default visibility */
.mobile-header-modern {
  display: none;
}
@media (max-width: 768px) {
  .mobile-header-modern {
    display: flex;
  }
}
