/*
 Theme Name:   ABTdomain
 Theme URI:    https://abtdomain.com
 Description:  Domain Intelligence Platform, lightweight SEO-optimized WordPress theme for abtdomain.com.
 Author:       ABTdomain
 Author URI:   https://abtdomain.com
 Version:      2.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  abtdomain
 Requires at least: 6.0
 Tested up to: 6.5
 Requires PHP: 7.4
*/

/* ==========================================================================
   Design Tokens (single source of truth)
   ========================================================================== */

:root {
  /* Color palette */
  --paper: #fefefd;
  --paper-deep: #f4f1ec;
  --ink: #1a1612;
  --ink-soft: #3d3630;
  --muted: #9e948a;
  --rule: #e8e4de;
  --white: #ffffff;
  --signal: #c23a22;
  --accent-blue: #2a6496;

  /* Typography */
  --sans: 'Inter', 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', 'Source Code Pro', 'Menlo', monospace;

  /* Font size scale (8 steps) */
  --fs-9:  9px;
  --fs-11: 11px;
  --fs-13: 13px;
  --fs-15: 15px;
  --fs-18: 18px;
  --fs-22: 22px;
  --fs-28: 28px;
  --fs-34: 34px;

  /* Border radius scale */
  --radius-0:    0;
  --radius-sm:   3px;
  --radius-md:   6px;
  --radius-lg:   10px;
  --radius-full: 50%;

  /* Letter spacing scale */
  --tracking-wide:  2px;
  --tracking-wider: 3px;

  /* Layout */
  --max-width:   1080px;
  --section-gap: 64px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-15);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--signal);
}

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.eyebrow {
  font-size: var(--fs-9);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--muted);
}

.animate-in {
  opacity: 0;
  transform: translateY(20px);
  animation: rise-in 0.7s ease forwards;
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.delay-1 { animation-delay: 0.08s; }

.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;
}

.screen-reader-text:focus {
  background-color: var(--paper-deep);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.1);
  clip: auto;
  clip-path: none;
  color: var(--ink);
  display: block;
  font-size: var(--fs-13);
  font-weight: 600;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* ==========================================================================
   Buttons (single source, all pages use these)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--sans);
  font-size: var(--fs-13);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  line-height: 1.4;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: var(--signal);
  color: var(--white);
  border-color: var(--signal);
}

.btn-secondary {
  background: transparent;
  color: currentColor;
  border-color: currentColor;
}

/* ==========================================================================
   Search form (used by front-page and 404)
   ========================================================================== */

.search-form {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
}

.search-form-input {
  flex: 1;
  padding: 13px 20px;
  font-size: var(--fs-13);
  font-family: var(--sans);
  border: 1px solid var(--rule);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}

.search-form-input:focus {
  border-color: var(--ink);
}

.search-form-input::placeholder {
  color: var(--muted);
}

.search-form-btn {
  padding: 13px 24px;
  font-size: var(--fs-13);
  font-weight: 600;
  font-family: var(--sans);
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.search-form-btn:hover {
  background: var(--ink-soft);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.site-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: none;
}

.site-logo-bold {
  font-family: var(--sans);
  font-weight: 800;
  font-size: var(--fs-22);
  color: var(--ink);
}

.site-logo-light {
  font-family: var(--sans);
  font-weight: 300;
  font-size: var(--fs-22);
  color: var(--ink-soft);
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links .current-menu-item a {
  color: var(--signal);
}

.nav-links > li {
  position: relative;
}

.nav-links .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  list-style: none;
  margin: 0;
  padding: 12px 0 8px;
  min-width: 200px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(26, 22, 18, 0.1);
  border: 1px solid var(--rule);
  z-index: 200;
}

.nav-links .sub-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-links > li:hover > .sub-menu {
  display: block;
}

.nav-links .sub-menu li {
  padding: 0;
}

.nav-links .sub-menu a {
  display: block;
  padding: 8px 20px;
  font-size: var(--fs-13);
  white-space: nowrap;
  color: var(--ink-soft);
}

.nav-links .sub-menu a:hover {
  background: var(--paper);
  color: var(--signal);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: var(--fs-22);
  cursor: pointer;
  color: var(--ink);
  padding: 4px 8px;
  line-height: 1;
}

@media (max-width: 768px) {
  .site-nav {
    position: relative;
    padding: 16px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    flex-direction: column;
    padding: 16px;
    gap: 14px;
    border-bottom: 1px solid var(--rule);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(26, 22, 18, 0.06);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links .sub-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    min-width: 0;
    margin: 4px 0 0;
    padding: 0 0 0 16px;
    display: block;
  }

  .nav-links .sub-menu a {
    padding: 4px 0;
    font-size: var(--fs-11);
  }

  .nav-toggle {
    display: block;
  }
}

/* ==========================================================================
   Section primitives
   ========================================================================== */

.section-eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.section-eyebrow-line {
  height: 1px;
  width: 40px;
  background: var(--signal);
}

.section-eyebrow-text {
  font-size: var(--fs-9);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--signal);
}

/* ==========================================================================
   Reports list (cross-page: front-page, archive, search)
   ========================================================================== */

.reports-list {
  border-top: 1px solid var(--rule);
  text-align: left;
}

.report-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
}

.report-row:not(:last-child) {
  border-bottom: 1px solid var(--rule);
}

.report-row:hover {
  background: var(--paper-deep);
  color: inherit;
}

.report-tag {
  font-size: var(--fs-9);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--white);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  min-width: 72px;
  text-align: center;
  flex-shrink: 0;
}

.report-tag-tld     { background: var(--ink); }
.report-tag-expired { background: var(--signal); }
.report-tag-nrd     { background: var(--accent-blue); }

.report-content {
  flex: 1;
  min-width: 0;
}

.report-content h3 {
  font-size: var(--fs-15);
  font-weight: 600;
  margin: 0 0 3px;
  color: var(--ink);
}

.report-content p {
  font-size: var(--fs-11);
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-date {
  font-family: var(--mono);
  font-size: var(--fs-11);
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .report-row {
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
  }

  .report-date {
    display: none;
  }

  .report-content p {
    white-space: normal;
  }
}

/* ==========================================================================
   Capabilities grid (cross-page)
   ========================================================================== */

.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.capability {
  padding: 24px 20px;
  border-top: 2px solid var(--ink);
  text-decoration: none;
  color: inherit;
  text-align: left;
  transition: background 0.2s;
}

.capability:hover {
  background: var(--paper-deep);
  color: inherit;
}

.capability h3 {
  font-size: var(--fs-15);
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
}

.capability p {
  font-size: var(--fs-13);
  color: var(--ink-soft);
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 768px) {
  .capabilities-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 48px;
  border-top: 1px solid var(--rule);
}

.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-brand p {
  font-size: var(--fs-11);
  color: var(--muted);
  max-width: 280px;
  line-height: 1.6;
  margin: 8px 0 0;
}

.footer-columns {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}

.footer-col-title {
  font-size: var(--fs-9);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  font-size: var(--fs-13);
  color: var(--ink-soft);
  margin-bottom: 6px;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--signal);
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: var(--fs-11);
  color: var(--muted);
}

.footer-legal a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 20px;
}

.footer-legal a:first-child {
  margin-left: 0;
}

.footer-legal a:hover {
  color: var(--signal);
}

@media (max-width: 768px) {
  .site-footer {
    padding: 24px 16px 40px;
  }

  .footer-columns {
    gap: 32px;
  }
}

/* ==========================================================================
   Single post / article content
   ========================================================================== */

.article-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 0;
}

.article-breadcrumb {
  font-size: var(--fs-11);
  color: var(--muted);
  margin-bottom: 16px;
}

.article-breadcrumb a {
  color: var(--muted);
}

.article-breadcrumb a:hover {
  color: var(--signal);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.article-header h1 {
  font-size: var(--fs-34);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
}

.article-date {
  font-family: var(--mono);
  font-size: var(--fs-11);
  color: var(--muted);
}

.article-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  font-size: var(--fs-15);
  line-height: 1.75;
  color: var(--ink-soft);
}

.article-content h2 {
  font-size: var(--fs-22);
  font-weight: 700;
  margin: 40px 0 16px;
  color: var(--ink);
}

.article-content h3 {
  font-size: var(--fs-18);
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--ink);
}

.article-content p {
  margin: 0 0 20px;
}

.article-content a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content a:hover {
  color: var(--signal);
}

.article-content ul,
.article-content ol {
  margin: 0 0 20px 24px;
}

.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }

.article-content li {
  margin-bottom: 8px;
}

.article-content blockquote {
  border-left: 3px solid var(--signal);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-style: italic;
}

.article-content pre {
  background: var(--ink);
  color: var(--paper);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: var(--fs-13);
  line-height: 1.6;
  margin: 0 0 20px;
}

.article-content code {
  font-family: var(--mono);
  font-size: var(--fs-13);
  background: var(--paper-deep);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

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

.article-content img {
  border-radius: var(--radius-md);
  margin: 24px 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: var(--fs-13);
}

.article-content .established-section,
.article-content .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-content table th {
  padding: 12px 16px;
  text-align: left;
  font-size: var(--fs-9);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--ink);
}

.article-content table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: var(--fs-13);
}

.article-content table tbody tr:first-child {
  background: var(--paper-deep);
}

/* Related posts */
.related-posts {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  border-top: 1px solid var(--rule);
}

.related-posts h2 {
  font-size: var(--fs-18);
  font-weight: 700;
  margin-bottom: 20px;
}

/* ==========================================================================
   Archive pages
   ========================================================================== */

.archive-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 32px;
}

.archive-header h1 {
  font-size: var(--fs-28);
  font-weight: 800;
  margin-bottom: 8px;
}

.archive-header p {
  font-size: var(--fs-13);
  color: var(--ink-soft);
  max-width: 560px;
  line-height: 1.7;
}

.archive-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 40px 0 48px;
  font-size: var(--fs-13);
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 500;
  font-family: var(--mono);
  transition: all 0.2s;
}

.pagination a {
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 1px solid var(--rule);
}

.pagination a:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.pagination .current {
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--ink);
}

/* ==========================================================================
   Static pages
   ========================================================================== */

.page-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 0;
}

.page-header h1 {
  font-size: var(--fs-28);
  font-weight: 800;
}

.page-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  font-size: var(--fs-15);
  line-height: 1.75;
  color: var(--ink-soft);
}

.page-content h2 {
  font-size: var(--fs-22);
  font-weight: 700;
  margin: 40px 0 16px;
  color: var(--ink);
}

.page-content h3 {
  font-size: var(--fs-18);
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--ink);
}

.page-content p {
  margin: 0 0 20px;
}

.page-content ul,
.page-content ol {
  margin: 0 0 20px 24px;
}

.page-content ul { list-style: disc; }
.page-content ol { list-style: decimal; }

.page-content li {
  margin-bottom: 8px;
}

/* ==========================================================================
   404 page
   ========================================================================== */

.error-404 {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}

.error-404-compact {
  padding: 48px 24px;
}

.error-404 h1 {
  font-family: var(--mono);
  font-size: var(--fs-34);
  font-weight: 700;
  color: var(--rule);
  margin-bottom: 16px;
}

.error-404 h2 {
  font-size: var(--fs-22);
  font-weight: 700;
  margin-bottom: 12px;
}

.error-404 p {
  font-size: var(--fs-13);
  color: var(--ink-soft);
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.error-404 .error-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.error-404 .error-links a {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--accent-blue);
}

/* ==========================================================================
   Search results
   ========================================================================== */

.search-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 32px;
}

.search-header h1 {
  font-size: var(--fs-22);
  font-weight: 700;
}

.search-header h1 span {
  color: var(--signal);
}

/* ==========================================================================
   Gutenberg block support (for single posts, not dequeued)
   ========================================================================== */

.wp-block-image {
  margin: 24px 0;
}

.wp-block-table {
  margin: 24px 0;
}

.wp-block-separator {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
}

.wp-block-quote {
  border-left: 3px solid var(--signal);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--paper-deep);
}

.alignwide {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  max-width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}
