/*
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 — white & orange palette, Season Serif headings, Inter body.
Version: 3.0.0
License: GPL v2 or later
Text Domain: saasdir
*/

/* ============================================
   CSS VARIABLES — Brand Tokens
   ============================================ */
:root {
    --orange:        #F26419;
    --orange-dark:   #d9540e;
    --orange-pale:   #fff4ee;
    --orange-border: rgba(242,100,25,.18);
    --white:         #ffffff;
    --off-white:     #f9f9f7;
    --text-dark:     #111111;
    --text-mid:      #444444;
    --text-muted:    #6b7280;
    --text-light:    #9ca3af;
    --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;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip; /* clip prevents horiz scroll WITHOUT breaking position:sticky */
    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 — Season Serif headings, Inter body
   ============================================ */

h1, h2, h3, h4, h5, h6,
.font-heading,
.playfair,
.it {
    font-family: 'Season Serif TRIAL', 'Playfair Display', Georgia, serif;
    letter-spacing: -0.02em;
    color: var(--text-dark);
    font-weight: 400;
}

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

p, span, a, li, td, th, label,
input, textarea, select,
.font-body {
    font-family: 'Inter', -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: italic; }

/* ============================================
   GLOBAL BACKGROUND — white everywhere
   ============================================ */
body, main, section, article, aside {
    background-color: #fff;
}

/* ============================================
   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(--orange); }
.text-emerald-600{ color: #059669; }
.text-orange-600{ color: var(--orange); }
.text-amber-400 { color: var(--orange); }
.text-amber-500 { color: var(--orange); }
.text-green-500 { color: #22c55e; }
.text-blue-500  { color: #3b82f6; }

.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(--orange-pale); }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-orange-50  { background-color: var(--orange-pale); }
.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(242,100,25,.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(--orange); }
.group:hover .group-hover\:text-gray-600    { color: var(--text-mid); }
.group:hover .group-hover\:text-emerald-600 { color: #059669; }
.group:hover .group-hover\:text-orange-600  { color: var(--orange); }

/* ============================================
   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; }
}
