/*
Theme Name: Directory of AI
Theme URI: https://directoryofai.com
Author: Directory of AI
Author URI: https://directoryofai.com
Description: A modern AI tools directory theme — black & grey palette, Geist headings + body, silver shimmer accents.
Version: 3.1.0
License: GPL v2 or later
Text Domain: saasdir
*/

/* ============================================
   GEIST FONT — self-hostable via Google Fonts
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================
   CSS VARIABLES — Brand Tokens (black/grey + silver)
   ============================================ */
:root {
    /* Legacy --orange* tokens remapped to neutral greys so any
       leftover references keep working without orange leaking through. */
    --orange:        #111111;
    --orange-dark:   #000000;
    --orange-pale:   #f4f4f5;
    --orange-border: rgba(0,0,0,.12);

    /* New brand tokens */
    --black:         #0a0a0a;
    --grey-900:      #111111;
    --grey-800:      #1f1f1f;
    --grey-700:      #2e2e2e;
    --grey-500:      #727272;
    --grey-300:      #d4d4d4;
    --grey-200:      #e5e7eb;
    --grey-100:      #f3f4f6;
    --grey-50:       #f9fafb;
    --silver-1:      #e8e8ec;
    --silver-2:      #f5f5f7;
    --silver-3:      #fafafb;

    /* Sitewide light gradient + silver shimmer */
    --bg-gradient:   linear-gradient(135deg, #ffffff 0%, #f6f6f8 50%, #ececef 100%);
    --silver-shimmer: linear-gradient(
        110deg,
        rgba(255,255,255,0)   0%,
        rgba(255,255,255,.55) 35%,
        rgba(220,220,225,.85) 50%,
        rgba(255,255,255,.55) 65%,
        rgba(255,255,255,0)  100%
    );

    /* Ad accent: defaults to neutral; overridden per-card via inline
       --ad-accent set from advertiser logo color (see JS in addon). */
    --ad-accent:        #111111;
    --ad-accent-soft:   rgba(17,17,17,.08);
    --ad-accent-border: rgba(17,17,17,.18);

    --white:         #ffffff;
    --off-white:     #f9f9f7;
    --text-dark:     #0a0a0a;
    --text-mid:      #2e2e2e;
    --text-muted:    #727272;
    --text-light:    #a2a2a2;
    --border:        rgba(0,0,0,.08);
    --border-mid:    rgba(0,0,0,.13);
    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     16px;
    --radius-xl:     20px;
}

/* Sitewide light gradient background */
html, body {
    background: var(--bg-gradient) fixed !important;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-dark);
    background: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }

/* ============================================
   TYPOGRAPHY — Geist everywhere, extra-bold headings
   ============================================ */

h1, h2, h3, h4, h5, h6,
.font-heading,
.playfair,
.it {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif !important;
    letter-spacing: -0.025em;
    color: var(--text-dark);
    font-weight: 800 !important;
}

h1 { font-size: clamp(2.2rem, 4.5vw, 3.8rem); line-height: 1.1; font-weight: 800 !important; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.4rem); line-height: 1.2; font-weight: 800 !important; }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem);   line-height: 1.3; font-weight: 800 !important; }
h4 { font-size: 1.25rem; font-weight: 800 !important; }
h5 { font-size: 1rem;    font-weight: 800 !important; }

p, span, a, li, td, th, label,
input, textarea, select,
.font-body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
}

p  { font-size: 1.05rem; line-height: 1.75; color: var(--text-mid); }
li { font-size: 1rem;    line-height: 1.7; }
small { font-size: 0.85rem; }

.it { font-style: normal; }

/* ============================================
   GLOBAL BACKGROUND — sitewide light gradient
   ============================================ */
body, main, section, article, aside {
    background: transparent;
}
body {
    background: var(--bg-gradient) fixed !important;
}

/* Silver shimmer helper (used across cards/buttons sitewide) */
@keyframes silver-shimmer-sweep {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(120%); }
}
.silver-shimmer { position: relative; overflow: hidden; }
.silver-shimmer::after {
    content: ""; position: absolute; inset: 0;
    background: var(--silver-shimmer);
    transform: translateX(-100%);
    animation: silver-shimmer-sweep 3.2s ease-in-out infinite;
    pointer-events: none;
}

/* ============================================
   WORDPRESS REQUIRED
   ============================================ */
.alignleft  { float: left;  margin-right: 1.5rem; }
.alignright { float: right; margin-left:  1.5rem; }
.aligncenter { clear: both; display: block; margin: 0 auto; }
.wp-caption { max-width: 100%; margin-bottom: 1.5rem; }
.wp-caption-text { font-size: 0.875rem; color: var(--text-muted); text-align: center; margin-top: 0.5rem; }
.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;
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container    { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.max-w-4xl   { max-width: 56rem;  margin: 0 auto; }
.max-w-7xl   { max-width: 80rem;  margin: 0 auto; }
.mx-auto     { margin: 0 auto; }
.px-6        { padding-left: 1.5rem; padding-right: 1.5rem; }
.grid        { display: grid; }
.flex        { display: flex; }
.inline-flex { display: inline-flex; }
.block       { display: block; }
.hidden      { display: none; }
.relative    { position: relative; }
.absolute    { position: absolute; }
.sticky      { position: sticky; }
.top-0       { top: 0; }
.w-full      { width: 100%; }
.h-full      { height: 100%; }
.h-16        { height: 4rem; }
.h-11        { height: 2.75rem; }
.h-14        { height: 3.5rem; }
.h-12        { height: 3rem; }
.w-12        { width: 3rem; }
.mt-auto     { margin-top: auto; }
.z-10        { z-index: 10; }
.z-50        { z-index: 50; }
.z-\[60\]   { z-index: 60; }

/* spacing */
.pt-24 { padding-top: 6rem; }    .pb-16 { padding-bottom: 4rem; }
.py-12 { padding: 3rem 0; }      .py-20 { padding: 5rem 0; }
.pt-16 { padding-top: 4rem; }    .pb-8  { padding-bottom: 2rem; }
.pt-8  { padding-top: 2rem; }    .pt-4  { padding-top: 1rem; }
.mb-2  { margin-bottom: 0.5rem; }  .mb-3  { margin-bottom: 0.75rem; }
.mb-4  { margin-bottom: 1rem; }    .mb-6  { margin-bottom: 1.5rem; }
.mb-8  { margin-bottom: 2rem; }    .mb-12 { margin-bottom: 3rem; }
.mt-8  { margin-top: 2rem; }       .mt-12 { margin-top: 3rem; }
.p-6   { padding: 1.5rem; }        .p-8   { padding: 2rem; }
.px-2  { padding: 0 0.5rem; }      .px-3  { padding: 0 0.75rem; }
.px-4  { padding: 0 1rem; }        .px-6  { padding: 0 1.5rem; }
.py-1  { padding: 0.25rem 0; }     .py-2  { padding: 0.5rem 0; }
.py-3  { padding: 0.75rem 0; }     .py-4  { padding: 1rem 0; }
.pl-4  { padding-left: 1rem; }     .pl-12 { padding-left: 3rem; }
.pr-3  { padding-right: 0.75rem; } .pr-4  { padding-right: 1rem; }
.pr-20 { padding-right: 5rem; }
.py-1\.5 { padding: 0.375rem 0; }

/* flex/grid */
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between{ justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-col       { flex-direction: column; }
.flex-grow      { flex-grow: 1; }
.flex-shrink-0  { flex-shrink: 0; }
.gap-2  { gap: 0.5rem; }  .gap-4  { gap: 1rem; }
.gap-5  { gap: 1.25rem; } .gap-6  { gap: 1.5rem; }
.gap-8  { gap: 2rem; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0,1fr)); }

/* text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }

/* text sizes (keep tailwind-like classes working) */
.text-xs   { font-size: 0.85rem;   line-height: 1.2; }
.text-sm   { font-size: 0.95rem;   line-height: 1.35; }
.text-base { font-size: 1.05rem;     line-height: 1.75; }
.text-lg   { font-size: 1.2rem;  line-height: 1.75; }
.text-xl   { font-size: 1.3rem;   line-height: 1.75; }
.text-2xl  { font-size: 1.6rem;   line-height: 1.3; }
.text-4xl  { font-size: 2.4rem;   line-height: 1.15; }

/* font weights */
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* misc text */
.tracking-tight   { letter-spacing: -0.025em; }
.tracking-tighter { letter-spacing: -0.05em; }
.leading-\[1\.1\] { line-height: 1.1; }
.whitespace-nowrap { white-space: nowrap; }

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   COLORS — orange brand only, no brown
   ============================================ */
.text-gray-400  { color: var(--text-light); }
.text-gray-500  { color: var(--text-muted); }
.text-gray-600  { color: var(--text-mid); }
.text-gray-900  { color: var(--text-dark); }
.text-white     { color: #fff; }
.text-indigo-600{ color: var(--text-dark); }
.text-emerald-600{ color: #666666; }
.text-orange-600{ color: var(--text-dark); }
.text-amber-400 { color: var(--text-dark); }
.text-amber-500 { color: var(--text-dark); }
.text-green-500 { color: #898989; }
.text-blue-500  { color: #7a7a7a; }

.bg-gray-50  { background-color: var(--off-white); }
.bg-gray-100 { background-color: #f3f3f1; }
.bg-gray-200 { background-color: #e5e5e5; }
.bg-gray-900 { background-color: #111; }
.bg-white    { background-color: #fff; }
.bg-indigo-50  { background-color: var(--silver-2); }
.bg-emerald-50 { background-color: #f7f7f7; }
.bg-orange-50  { background-color: var(--silver-2); }
.bg-neutral-900{ background-color: #111; }

/* ============================================
   BORDERS & RADII
   ============================================ */
.border    { border: 1px solid var(--border); }
.border-b  { border-bottom: 1px solid var(--border); }
.border-t  { border-top: 1px solid var(--border); }
.rounded-lg  { border-radius: var(--radius-sm); }
.rounded-xl  { border-radius: var(--radius-md); }
.rounded-2xl { border-radius: var(--radius-lg); }
.rounded-full{ border-radius: 9999px; }
.shadow-sm   { box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.shadow-md   { box-shadow: 0 4px 12px rgba(0,0,0,.08); }

/* ============================================
   FORMS
   ============================================ */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(0,0,0,.25); }

/* ============================================
   HOVER STATES
   ============================================ */
.hover\:text-gray-900:hover  { color: var(--text-dark); }
.hover\:bg-gray-50:hover     { background-color: var(--off-white); }
.hover\:bg-gray-100:hover    { background-color: #f3f3f1; }
.hover\:bg-gray-800:hover    { background-color: #222; }
.hover\:border-gray-300:hover{ border-color: var(--border-mid); }
.hover\:shadow-md:hover      { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.group:hover .group-hover\:text-indigo-600  { color: var(--text-dark); }
.group:hover .group-hover\:text-gray-600    { color: var(--text-mid); }
.group:hover .group-hover\:text-emerald-600 { color: #666666; }
.group:hover .group-hover\:text-orange-600  { color: var(--text-dark); }

/* ============================================
   TRANSITIONS
   ============================================ */
.transition-colors { transition: color,background-color,border-color 150ms cubic-bezier(.4,0,.2,1); }
.transition-all    { transition: all 150ms cubic-bezier(.4,0,.2,1); }
.duration-200      { transition-duration: 200ms; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 640px)  { .sm\:flex { display: flex; } .sm\:block { display: block; } .sm\:hidden { display: none; } }
@media (min-width: 768px)  {
    .md\:flex { display: flex; } .md\:hidden { display: none; }
    .md\:flex-row { flex-direction: row; } .md\:mb-0 { margin-bottom: 0; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (min-width: 1024px) {
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
}
@media (min-width: 1280px) { .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 767px)  { .max-w-7xl, .max-w-4xl { padding: 0 1rem; } }

/* ============================================
   MISC
   ============================================ */
.relative { position: relative; }
.absolute { position: absolute; }
.inset-y-0 { top: 0; bottom: 0; }
.left-0  { left: 0; }  .right-0 { right: 0; }
.pointer-events-none { pointer-events: none; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.divide-y > * + * { border-top: 1px solid var(--border); }
kbd { font-family: ui-monospace, monospace; }
.font-sans { font-family: 'Inter', system-ui, sans-serif; }
@media print { .no-print { display: none !important; } }

/* ============================================
   PROSE (Article content)
   ============================================ */
.prose         { color: var(--text-mid); max-width: 65ch; font-size: 1.05rem; }
.prose p       { margin-bottom: 1.4em; }
.prose h2      { color: var(--text-dark); font-size: 1.6em; margin: 2em 0 0.8em; }
.prose h3      { color: var(--text-dark); font-size: 1.3em; margin: 1.6em 0 0.6em; }
.prose ul      { margin: 1.25em 0; list-style: disc; padding-left: 1.625em; }
.prose li      { margin-bottom: 0.5em; }
.prose-lg      { font-size: 1.125rem; line-height: 1.8; }

/* ============================================
   3-COLUMN AD LAYOUT — authoritative styles live in
   saasdir-ads-addon.php. DO NOT add !important or
   override widths/position here — it breaks sticky.
   ============================================ */
@media (max-width: 900px) {
    .saasdir-page-wrap { display: block; }
    .saasdir-ad-col    { display: none; }
}
