/*
Theme Name: Loft Journal
Theme URI: https://thepigeongame.com
Author: The Pigeon Game
Description: A black-and-white editorial WordPress theme for racing pigeon fanciers. Race-clock inspired post meta, category color strips, and a two-column broadsheet layout.
Version: 1.0.0
Requires at least: 6.0
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: pigeon-game
Tags: black-and-white, editorial, blog, two-columns, custom-logo, custom-menu, featured-images, post-formats, sticky-post, threaded-comments, translation-ready
*/

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

:root {
  --black: #0a0a0a;
  --off-black: #1a1a1a;
  --dark: #2a2a2a;
  --mid: #5c5c5c;
  --muted: #8a8a85;
  --light: #c9c7c0;
  --pale: #e7e4dc;
  --cream: #f6f3ea;      /* warm newsprint cream, not flat white */
  --white: #ffffff;
  --clock: #7a2e2e;      /* oxblood accent — race-clock seal ink, used sparingly */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-data: 'IBM Plex Mono', 'Courier New', monospace; /* race times, ring numbers, stats */
}

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--black);
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--black); text-decoration: none; }
a:hover { color: var(--mid); }

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,400&family=Source+Serif+4:wght@300;400;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

/* ===========================
   SITE HEADER
=========================== */
.site-header { background: var(--black); overflow: hidden; position: relative; }
.header-inner { padding: 2rem 2rem 0; position: relative; max-width: 1200px; margin: 0 auto; }

.nav-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2.5rem; border-bottom: 1px solid rgba(255,255,255,0.12); padding-bottom: 1.2rem;
}
.logo-wrap, .logo-wrap a { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.logo-svg { flex-shrink: 0; }
.site-name-text { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -0.5px; line-height: 1.1; }
.site-tagline-text { font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-top: 2px; }

.main-navigation ul { display: flex; gap: 1.5rem; list-style: none; flex-wrap: wrap; }
.main-navigation a { color: rgba(255,255,255,0.55); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; transition: color 0.15s; }
.main-navigation a:hover, .main-navigation .current-menu-item a { color: #fff; }

/* ===========================
   HERO
=========================== */
.hero-area { padding: 1.5rem 0 3rem; text-align: center; position: relative; }
.hero-rule { width: 40px; height: 2px; background: #fff; margin: 0 auto 1.5rem; }
.hero-headline { font-family: var(--font-display); font-size: 52px; font-weight: 700; color: #fff; line-height: 1; margin-bottom: 0.4rem; letter-spacing: -1px; }
.hero-subheadline { font-family: var(--font-display); font-style: italic; font-size: 17px; color: rgba(255,255,255,0.45); }

/* ===========================
   TICKER BAR (live race feed — pulls from a "Race Ticker" custom field)
=========================== */
.ticker-bar { background: var(--off-black); border-top: 1px solid rgba(255,255,255,0.08); padding: 0.65rem 2rem; display: flex; align-items: center; gap: 0.75rem; }
.ticker-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--clock); flex-shrink: 0; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.ticker-label { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.ticker-text { font-size: 12px; color: rgba(255,255,255,0.45); }

/* ===========================
   MAIN LAYOUT
=========================== */
.site-main-wrap { display: grid; grid-template-columns: 1fr 300px; max-width: 1200px; margin: 0 auto; }
.site-content { padding: 2.5rem 2rem; border-right: 1px solid var(--pale); }

.section-label { font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 1.2rem; display: flex; align-items: center; gap: 10px; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--pale); }

/* ===========================
   RACE-CLOCK BADGE — signature element
   A circular rotated stamp echoing the sealed verification clocks
   fanciers use to certify race arrival times. Carries the read time.
=========================== */
.clock-badge {
  position: absolute; top: 0; right: 0;
  width: 54px; height: 54px; border-radius: 50%;
  border: 1.5px solid var(--clock);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  transform: rotate(-8deg);
  font-family: var(--font-data);
  color: var(--clock);
  background: var(--cream);
}
.clock-badge .cb-num { font-size: 14px; font-weight: 600; line-height: 1; }
.clock-badge .cb-unit { font-size: 6px; letter-spacing: 1px; text-transform: uppercase; margin-top: 1px; }
.site-header .clock-badge { background: var(--black); }

/* ===========================
   FEATURED POST
=========================== */
.featured-post { margin-bottom: 2.5rem; position: relative; }
.feat-rule { width: 24px; height: 3px; background: var(--black); margin-bottom: 1rem; }
.post-category-label { display: inline-block; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; border: 1px solid var(--black); padding: 2px 8px; margin-bottom: 0.75rem; color: var(--black); }
.featured-post .post-featured-image { margin-bottom: 1.25rem; overflow: hidden; }
.featured-post .post-featured-image img { width: 100%; height: 340px; object-fit: cover; }
.featured-post .post-title { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.2; margin-bottom: 0.6rem; padding-right: 70px; }
.featured-post .post-title a { color: var(--black); }
.featured-post .post-title a:hover { color: var(--mid); }
.post-meta { font-size: 11px; color: var(--muted); margin-bottom: 0.75rem; display: flex; gap: 1rem; flex-wrap: wrap; font-family: var(--font-data); }
.post-excerpt { font-size: 14px; line-height: 1.8; color: var(--dark); margin-bottom: 1rem; }
.read-more-link { font-size: 11px; color: var(--black); letter-spacing: 1px; text-transform: uppercase; font-weight: 600; border-bottom: 1px solid var(--black); padding-bottom: 1px; }
.read-more-link:hover { color: var(--mid); border-color: var(--mid); }

.section-divider { border: none; border-top: 1px solid var(--pale); margin: 2rem 0; }

/* ===========================
   POST GRID
=========================== */
.post-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
.post-card { cursor: pointer; position: relative; }
.post-card-strip { height: 6px; margin-bottom: -1px; border-radius: 2px 2px 0 0; }
.post-card-thumb { height: 130px; background: var(--black); margin-bottom: 0.75rem; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.2s; }
.post-card-thumb:hover img { opacity: 0.85; }
.post-card-thumb .thumb-placeholder { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: rgba(255,255,255,0.14); letter-spacing: -1px; user-select: none; }
.post-card .post-category-label { font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); border: none; padding: 0; margin-bottom: 0.4rem; display: inline-block; }
.post-card .card-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; line-height: 1.3; margin-bottom: 0.3rem; }
.post-card .card-title a { color: var(--black); }
.post-card .card-title a:hover { color: var(--mid); }
.post-card .card-meta { font-size: 11px; color: var(--mid); font-family: var(--font-data); }

/* ===========================
   SIDEBAR
=========================== */
.sidebar { padding: 2rem 1.5rem; background: var(--cream); }
.widget { margin-bottom: 2rem; }
.widget-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--black); }

.race-results-list { list-style: none; }
.race-results-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--pale); font-size: 12px; line-height: 1.4; display: flex; gap: 6px; align-items: baseline; font-family: var(--font-data); }
.race-position { font-weight: 700; color: var(--clock); min-width: 28px; }
.race-note { font-size: 10px; color: var(--muted); margin-top: 0.5rem; font-family: var(--font-body); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat-box { background: var(--white); padding: 0.7rem; text-align: center; border: 1px solid var(--pale); }
.stat-number { font-family: var(--font-data); font-size: 19px; font-weight: 600; color: var(--black); display: block; }
.stat-label { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

.tag-cloud-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-cloud-wrap a, .tag-item { font-size: 10px; padding: 3px 8px; border: 1px solid var(--light); color: var(--muted); text-decoration: none; transition: all 0.15s; }
.tag-cloud-wrap a:hover, .tag-item:hover { background: var(--black); color: var(--white); border-color: var(--black); }

.widget_search .search-field { width: 100%; font-size: 12px; border: 1px solid var(--light); padding: 8px; font-family: inherit; background: var(--white); color: var(--black); outline: none; margin-bottom: 6px; }
.widget_search .search-submit { width: 100%; background: var(--black); color: var(--white); border: none; padding: 9px; font-size: 11px; cursor: pointer; font-family: inherit; letter-spacing: 1px; text-transform: uppercase; }
.widget_search .search-submit:hover { background: var(--dark); }

.newsletter-text { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 0.75rem; }
.newsletter-form input[type="email"] { width: 100%; margin-bottom: 6px; font-size: 12px; border: 1px solid var(--light); padding: 8px; font-family: inherit; background: var(--white); color: var(--black); outline: none; }
.newsletter-form input[type="email"]:focus { border-color: var(--black); }
.newsletter-form button, .newsletter-form input[type="submit"] { width: 100%; background: var(--black); color: var(--white); border: none; padding: 9px; font-size: 11px; cursor: pointer; font-family: inherit; letter-spacing: 1px; text-transform: uppercase; transition: background 0.15s; }
.newsletter-form button:hover, .newsletter-form input[type="submit"]:hover { background: var(--dark); }

/* ===========================
   SINGLE POST
=========================== */
.single-post-header { margin-bottom: 2rem; }
.single-post-header .post-category-label { margin-bottom: 1rem; }
.single-post-header .post-title { font-family: var(--font-display); font-size: 36px; font-weight: 700; line-height: 1.15; margin-bottom: 0.75rem; }
.post-content { font-size: 15px; line-height: 1.9; color: var(--dark); }
.post-content p { margin-bottom: 1.25rem; }
.post-content h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 2rem 0 0.75rem; }
.post-content h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.post-content blockquote { border-left: 3px solid var(--clock); padding-left: 1.25rem; margin: 1.5rem 0; font-style: italic; color: var(--mid); }
.post-content img { margin: 1.5rem 0; }
.post-featured-image { margin-bottom: 2rem; }
.post-featured-image img { width: 100%; height: auto; max-height: 480px; object-fit: cover; }
.post-tags-row { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.author-box { display: flex; gap: 1rem; align-items: center; margin-top: 2.5rem; padding: 1.25rem; background: var(--white); border: 1px solid var(--pale); }
.author-box img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-box .author-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.author-box .author-bio { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ===========================
   PAGINATION
=========================== */
.pagination { display: flex; gap: 0.5rem; justify-content: center; padding: 2rem 0; }
.pagination a, .pagination span { font-size: 12px; padding: 6px 12px; border: 1px solid var(--light); color: var(--muted); text-decoration: none; font-family: var(--font-data); }
.pagination a:hover { background: var(--black); color: var(--white); border-color: var(--black); }
.pagination .current { background: var(--black); color: var(--white); border-color: var(--black); }

/* ===========================
   COMMENTS
=========================== */
.comments-area { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--pale); }
.comments-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-bottom: 1.5rem; }
.comment-body { border-bottom: 1px solid var(--pale); padding: 1rem 0; }
.comment-author { font-weight: 600; font-size: 13px; margin-bottom: 0.25rem; }
.comment-content { font-size: 14px; line-height: 1.7; color: var(--dark); }

/* ===========================
   NO RESULTS / EMPTY STATE
=========================== */
.no-results { padding: 3rem 0; text-align: center; }
.no-results h2 { font-family: var(--font-display); font-size: 22px; margin-bottom: 0.75rem; }
.no-results p { color: var(--muted); font-size: 13px; }

/* ===========================
   FOOTER
=========================== */
.site-footer { background: var(--off-black); color: rgba(255,255,255,0.35); text-align: center; padding: 1.5rem; font-size: 11px; letter-spacing: 0.5px; }
.site-footer strong, .site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: var(--white); }

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
  .site-main-wrap { grid-template-columns: 1fr; }
  .site-content { border-right: none; }
  .sidebar { border-top: 1px solid var(--pale); }
  .post-grid { grid-template-columns: 1fr; }
  .hero-headline { font-size: 36px; }
  .nav-bar { flex-direction: column; gap: 1rem; align-items: flex-start; }
  .main-navigation ul { flex-wrap: wrap; gap: 0.75rem; }
  .featured-post .post-title { padding-right: 0; }
  .clock-badge { position: static; transform: rotate(-4deg); margin-bottom: 0.75rem; }
}

@media (max-width: 480px) {
  .hero-headline { font-size: 28px; }
  .featured-post .post-title { font-size: 22px; }
  .header-inner { padding: 1.25rem 1rem 0; }
  .site-content { padding: 1.5rem 1rem; }
}

/* Accessibility */
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--clock); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .ticker-dot { animation: none; }
}
