/*
Theme Name: OnlyFans Grid Theme
Theme URI: https://example.com
Author: Custom Theme
Author URI: https://example.com
Description: A grid-based theme for displaying OnlyFans profiles with featured images, FREE badges, and custom CTA links.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: of-grid-theme
Tags: grid, custom-fields, featured-images
*/

/* ===========================
   CSS Variables & Reset
   =========================== */
:root {
  --cyan: #00b4d8;
  --cyan-dark: #0096c7;
  --cyan-light: #90e0ef;
  --white: #ffffff;
  --off-white: #f0f9ff;
  --text-dark: #1a1a2e;
  --text-mid: #333;
  --text-light: #555;
  --badge-bg: #00b4d8;
  --badge-text: #fff;
  --btn-bg: #5a9fd4;
  --btn-bg-hover: #3a7fbf;
  --shadow: 0 4px 18px rgba(0,0,0,0.10);
  --radius: 14px;
  --font-main: 'Poppins', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background: var(--off-white);
  color: var(--text-dark);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ===========================
   Typography (Google Fonts loaded via functions.php)
   =========================== */

/* ===========================
   Site Header
   =========================== */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--cyan);
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,180,216,0.08);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cyan-dark);
  letter-spacing: -0.5px;
}

.site-description {
  font-size: 0.8rem;
  color: var(--text-light);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
}

.site-nav a {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-mid);
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--cyan-dark);
}

/* ===========================
   Container
   =========================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===========================
   Archive / Home Page Hero
   =========================== */
.archive-hero {
  background: linear-gradient(135deg, var(--cyan-dark) 0%, var(--cyan) 100%);
  color: var(--white);
  text-align: center;
  padding: 52px 20px 44px;
}

.archive-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -1px;
}

.archive-hero p {
  font-size: 1rem;
  opacity: 0.9;
  max-width: 560px;
  margin: 0 auto;
}

/* ===========================
   Grid Layout
   =========================== */
.posts-grid-section {
  padding: 44px 0 60px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

/* ===========================
   Post Card
   =========================== */
.post-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 2px solid var(--cyan);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0,180,216,0.18);
}

/* --- Card Image Wrapper --- */
.post-card__image-wrap {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #cde;
}

.post-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.35s ease;
}

.post-card:hover .post-card__image-wrap img {
  transform: scale(1.04);
}

.post-card__image-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* No featured image placeholder */
.post-card__no-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--cyan-light), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 3rem;
}

/* --- FREE Badge --- */
.free-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 1.5px;
  padding: 5px 16px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  text-transform: uppercase;
  z-index: 2;
}

/* --- Card Body --- */
.post-card__body {
  background: var(--cyan);
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-card__handle {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}

.post-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
}

.post-card__cta {
  display: block;
  background: var(--btn-bg);
  color: var(--white);
  text-align: center;
  padding: 11px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.2s;
  margin-top: auto;
}

.post-card__cta:hover {
  background: var(--btn-bg-hover);
}

/* ===========================
   Single Post Page
   =========================== */
.single-post-wrap {
  padding: 48px 0 80px;
}

.single-post-inner {
  max-width: 820px;
  margin: 0 auto;
}

.single-post-featured {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
  position: relative;
  aspect-ratio: 16/9;
  background: #cde;
  box-shadow: var(--shadow);
}

.single-post-featured img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.single-post-featured .free-badge {
  font-size: 1rem;
  padding: 7px 22px;
  top: 18px;
  right: 18px;
}

.single-post-header {
  margin-bottom: 28px;
}

.single-post-header h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.single-post-header .post-handle {
  color: var(--cyan-dark);
  font-weight: 600;
  font-size: 0.95rem;
}

/* FREE ONLYFANS CTA Box */
.of-cta-box {
  background: linear-gradient(135deg, var(--cyan-dark) 0%, var(--cyan) 100%);
  border-radius: var(--radius);
  padding: 28px 32px;
  text-align: center;
  margin-bottom: 36px;
  box-shadow: 0 6px 24px rgba(0,180,216,0.20);
}

.of-cta-box__label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 6px;
}

.of-cta-box__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.of-cta-box__btn {
  display: inline-block;
  background: var(--white);
  color: var(--cyan-dark);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 14px 38px;
  border-radius: 10px;
  transition: transform 0.18s, box-shadow 0.18s;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.of-cta-box__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  color: var(--cyan-dark);
}

/* Post Content */
.single-post-content {
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.8;
}

.single-post-content h2,
.single-post-content h3 {
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.single-post-content p {
  margin-bottom: 16px;
}

/* ===========================
   Pagination
   =========================== */
.pagination-wrap {
  text-align: center;
  padding: 32px 0 0;
}

.pagination-wrap .page-numbers {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-wrap .page-numbers a,
.pagination-wrap .page-numbers span {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 2px solid var(--cyan);
  color: var(--cyan-dark);
  transition: background 0.18s, color 0.18s;
}

.pagination-wrap .page-numbers .current,
.pagination-wrap .page-numbers a:hover {
  background: var(--cyan);
  color: var(--white);
}

/* ===========================
   Site Footer
   =========================== */
.site-footer {
  background: var(--text-dark);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 28px 20px;
  font-size: 0.85rem;
}

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

/* ===========================
   Page Template (page.php)
   =========================== */
.page-wrap {
  padding: 52px 0 80px;
}

.page-inner {
  max-width: 820px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 3px solid var(--cyan);
}

.page-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
}

.page-content {
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.8;
}

.page-content h2,
.page-content h3 {
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.page-content p {
  margin-bottom: 16px;
}

.page-content a {
  color: var(--cyan-dark);
  text-decoration: underline;
}

/* CF7 basic styling so it doesn't look naked */
.page-content .wpcf7-form p {
  margin-bottom: 14px;
}

.page-content .wpcf7-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.page-content .wpcf7-form input[type="text"],
.page-content .wpcf7-form input[type="email"],
.page-content .wpcf7-form input[type="tel"],
.page-content .wpcf7-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #d0e8f5;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color 0.2s;
}

.page-content .wpcf7-form input:focus,
.page-content .wpcf7-form textarea:focus {
  outline: none;
  border-color: var(--cyan);
}

.page-content .wpcf7-form textarea {
  min-height: 140px;
  resize: vertical;
}

.page-content .wpcf7-form input[type="submit"] {
  background: var(--cyan-dark);
  color: var(--white);
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.page-content .wpcf7-form input[type="submit"]:hover {
  background: var(--btn-bg-hover);
  transform: translateY(-1px);
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 640px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .archive-hero {
    padding: 36px 16px 30px;
  }

  .of-cta-box {
    padding: 22px 18px;
  }

  .single-post-featured {
    aspect-ratio: 4/3;
  }
}

@media (max-width: 400px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   Search Bar (in hero)
   =========================== */
.of-search-form {
  margin-top: 28px;
}

.of-search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}

.of-search-input {
  width: 100%;
  padding: 14px 54px 14px 20px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--text-dark);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  outline: none;
  transition: box-shadow 0.2s;
}

.of-search-input:focus {
  box-shadow: 0 4px 24px rgba(0,0,0,0.20);
  background: #fff;
}

.of-search-input::placeholder {
  color: #aaa;
}

.of-search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--cyan-dark);
  border: none;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.of-search-btn:hover {
  background: #007ba8;
}

.of-search-status {
  margin-top: 14px;
  font-size: 0.9rem;
  opacity: 0.9;
}

.of-clear-search {
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.18s;
}

.of-clear-search:hover {
  background: rgba(255,255,255,0.35);
}

/* ===========================
   Live Search Dropdown
   =========================== */
.of-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  overflow: hidden;
  z-index: 200;
  max-height: 380px;
  overflow-y: auto;
}

.of-search-results.is-open {
  display: block;
}

.of-sr-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-dark);
  transition: background 0.15s;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
}

.of-sr-item:last-child {
  border-bottom: none;
}

.of-sr-item:hover {
  background: var(--off-white);
}

.of-sr-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
}

.of-sr-thumb--empty {
  background: var(--cyan-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border-radius: 8px;
}

.of-sr-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.of-sr-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.of-sr-slug {
  font-size: 0.78rem;
  color: var(--cyan-dark);
  font-weight: 500;
}

.of-sr-none {
  padding: 18px;
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
}
