/*
Theme Name: Mick Appleby Racing
Theme URI: https://mickappleby.com
Author: Mick Appleby Racing
Author URI: https://mickappleby.com
Description: Premium custom WordPress theme for Mick Appleby Racing — a world-class thoroughbred racing stable based in Langham, Rutland. Built for Elementor Free + Contact Form 7.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mar
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, full-width-template, editor-style, block-patterns
*/

/* =========================================================
   CSS CUSTOM PROPERTIES
   ========================================================= */
:root {
  --black: #0a0a0a;
  --charcoal: #141414;
  --dark: #1c1c1c;
  --red: #CC0000;
  --red-bright: #e00000;
  --white: #ffffff;
  --muted: #ffffff;
  --display: 'Cormorant Garamond', Georgia, serif;
  --condensed: 'Barlow Condensed', Arial Narrow, sans-serif;
  --body: 'Barlow', Arial, sans-serif;
  --nav-h: 80px;
  --section-pad: clamp(64px, 8vw, 120px);
  --text-min: 14px;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--white);
  font-family: var(--body);
  font-size: 16px;
  font-weight: 400;
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul, ol { list-style: none; }
button { cursor: none; }
input, textarea, select, button { font-family: inherit; }

/* =========================================================
   CUSTOM SCROLLBAR
   ========================================================= */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--red); }
* { scrollbar-width: thin; scrollbar-color: var(--red) var(--black); }

/* =========================================================
   TYPOGRAPHY BASE
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
p { line-height: 1.75; }
strong { font-weight: 600; }
em { font-style: italic; }

/* =========================================================
   CUSTOM CURSOR
   ========================================================= */
.cursor {
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.15s;
}
.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(204, 0, 0, 0.5);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
}
.cursor.hover { transform: translate(-50%, -50%) scale(2); }
.cursor-ring.hover {
  transform: translate(-50%, -50%) scale(1.5);
  border-color: rgba(204, 0, 0, 0.8);
}

/* =========================================================
   SCROLL REVEAL ANIMATIONS
   ========================================================= */
.reveal, .rv {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible, .rv.visible { opacity: 1; transform: translateY(0); }

.reveal-left, .rl {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-left.visible, .rl.visible { opacity: 1; transform: translateX(0); }

.reveal-right, .rr {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-right.visible, .rr.visible { opacity: 1; transform: translateX(0); }

/* =========================================================
   @KEYFRAMES
   ========================================================= */
@keyframes heroZoom {
  from { transform: scale(1.04); }
  to { transform: scale(1.0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes scrollSlide {
  0% { top: -40%; }
  100% { top: 140%; }
}

/* =========================================================
   MARQUEE STRIP
   ========================================================= */
.marquee-strip {
  background: var(--red);
  padding: 13px 0;
  overflow: hidden;
  white-space: nowrap;
}
.marquee-inner {
  display: inline-flex;
  animation: marquee 22s linear infinite;
}
.marquee-item {
  font-family: var(--condensed);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--white);
  padding: 0 36px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.marquee-item::before { content: '★'; font-size: 8px; opacity: 0.7; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn-primary {
  font-family: var(--condensed);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--red);
  padding: 15px 34px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  display: inline-block;
}
.btn-primary:hover { background: var(--red-bright); transform: translateY(-2px); color: var(--white); }

.btn-outline {
  font-family: var(--condensed);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  background: transparent;
  padding: 14px 34px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: all 0.3s;
  display: inline-block;
}
.btn-outline:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
  color: var(--white);
}

.btn-red-outline {
  font-family: var(--condensed);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  background: transparent;
  padding: 14px 34px;
  text-decoration: none;
  border: 1px solid var(--red);
  transition: all 0.3s;
  display: inline-block;
}
.btn-red-outline:hover { background: var(--red); color: var(--white); transform: translateY(-2px); }

.btn-white {
  font-family: var(--condensed);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--black);
  background: var(--white);
  padding: 15px 34px;
  text-decoration: none;
  border: none;
  transition: all 0.3s;
  display: inline-block;
}
.btn-white:hover { background: rgba(255,255,255,0.88); transform: translateY(-2px); color: var(--black); }

/* =========================================================
   SECTION LABELS & TITLES
   ========================================================= */
.section-label {
  font-family: var(--condensed);
  font-size: 14px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::before { content: ''; width: 30px; height: 1px; background: var(--red); }

.section-title {
  font-family: var(--display);
  font-size: clamp(34px, 4.5vw, 60px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.section-title em { font-style: italic; color: var(--red); }

.section-link {
  font-family: var(--condensed);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 2px;
  transition: all 0.3s;
  white-space: nowrap;
}
.section-link:hover { color: var(--red); border-color: var(--red); }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: clamp(30px, 4vw, 52px);
  flex-wrap: wrap;
  gap: 16px;
}

/* =========================================================
   PAGE HERO (inner pages)
   ========================================================= */
.page-hero {
  position: relative;
  height: 55vh;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin-top: calc(var(--nav-h) + 34px);
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  animation: heroZoom 8s ease forwards;
}
.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(10,10,10,0.88) 0%, rgba(10,10,10,0.5) 60%, rgba(10,10,10,0.2) 100%);
}
.page-hero-overlay-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(10,10,10,1) 0%, transparent 100%);
}
.page-hero-content {
  position: relative;
  z-index: 2;
  padding: clamp(40px, 5vw, 70px) clamp(24px, 6vw, 80px);
}
.page-hero-eyebrow {
  font-family: var(--condensed);
  font-size: 14px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-hero-eyebrow::before { content: ''; width: 30px; height: 1px; background: var(--red); }
.page-hero-title {
  font-family: var(--display);
  font-size: clamp(42px, 7vw, 90px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.page-hero-title em { font-style: italic; color: var(--red); }

/* =========================================================
   HORSE CARDS (archive / listing)
   ========================================================= */
.horses-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}
.horse-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: var(--white);
}
.horse-card-img {
  position: relative;
  overflow: hidden;
  height: clamp(380px, 45vw, 580px);
}
.horse-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s ease, filter 0.5s;
  filter: brightness(0.82) saturate(0.85);
}
.horse-card:hover .horse-card-img img { transform: scale(1.05); filter: brightness(1) saturate(1); }
.horse-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,10,0.92) 0%, rgba(10,10,10,0.4) 45%, transparent 100%);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: background 0.4s;
}
.horse-card:hover .horse-card-overlay {
  background: linear-gradient(to top, rgba(10,10,10,0.97) 0%, rgba(10,10,10,0.5) 55%, transparent 100%);
}
.horse-card-line {
  width: 28px;
  height: 2px;
  background: var(--red);
  margin-bottom: 12px;
  transition: width 0.4s ease;
}
.horse-card:hover .horse-card-line { width: 40px; }
.horse-card-type {
  font-family: var(--condensed);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}
.horse-card-name {
  font-family: var(--display);
  font-size: clamp(24px, 3.2vw, 42px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.0;
  margin-bottom: 10px;
}
.horse-card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.horse-card-meta-item {
  font-family: var(--condensed);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffffff;
}
.horse-card-meta-item span { color: #ffffff; margin-left: 4px; }
.horse-form-mini {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}
.fd {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--condensed);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.fw { background: rgba(34,197,94,0.3); color: #4ade80; border: 1px solid rgba(34,197,94,0.4); }
.fp { background: rgba(234,179,8,0.3); color: #fbbf24; border: 1px solid rgba(234,179,8,0.4); }
.fu { background: rgba(107,101,96,0.3); color: var(--muted); border: 1px solid rgba(107,101,96,0.3); }
.fl { background: rgba(239,68,68,0.3); color: #f87171; border: 1px solid rgba(239,68,68,0.4); }

.horse-card-cta {
  font-family: var(--condensed);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
}
.horse-card:hover .horse-card-cta { opacity: 1; transform: translateY(0); }
.horse-card-cta::after { content: '→'; color: var(--red); }

/* =========================================================
   NEWS / POST CARDS
   ========================================================= */
.post-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: var(--white);
  background: var(--charcoal);
  transition: background 0.3s;
}
.post-card:hover { background: rgba(22,20,20,1); }
.post-card-img {
  overflow: hidden;
  position: relative;
}
.post-card-img img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.7s ease, filter 0.4s;
  filter: brightness(0.85) saturate(0.85);
}
.post-card:hover .post-card-img img { transform: scale(1.06); filter: brightness(1) saturate(1); }
.post-card-body { padding: 22px 22px 26px; }
.pc-cat {
  font-family: var(--condensed);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pc-cat::before { content: ''; width: 14px; height: 1px; background: var(--red); }
.pc-title {
  font-family: var(--display);
  font-size: clamp(17px, 1.9vw, 22px);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 10px;
  transition: color 0.3s;
}
.post-card:hover .pc-title { color: #ffffff; }
.pc-date {
  font-family: var(--condensed);
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.4s ease;
}
.post-card:hover::after { width: 100%; }

/* =========================================================
   WORDPRESS CORE ALIGNMENTS & POST IMAGE
   ========================================================= */
.wp-post-image { max-width: 100%; height: auto; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.alignwide { margin-left: -40px; margin-right: -40px; max-width: calc(100% + 80px); }
.alignfull { margin-left: calc(-1 * clamp(24px, 6vw, 80px)); margin-right: calc(-1 * clamp(24px, 6vw, 80px)); max-width: calc(100% + clamp(48px, 12vw, 160px)); }

/* Post content typography */
.entry-content p { margin-bottom: 1.5em; color: #ffffff; font-size: 16px; line-height: 1.85; }
.entry-content h2 { font-family: var(--display); font-size: clamp(24px, 3vw, 36px); font-weight: 600; margin: 2em 0 0.75em; color: var(--white); }
.entry-content h3 { font-family: var(--condensed); font-size: 18px; font-weight: 700; letter-spacing: 0.05em; margin: 1.8em 0 0.6em; color: var(--white); }
.entry-content ul, .entry-content ol { margin: 0 0 1.5em 1.5em; color: #ffffff; font-size: 16px; line-height: 1.85; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content blockquote {
  margin: 2em 0;
  padding: 24px 28px;
  border-left: 3px solid var(--red);
  background: rgba(255,255,255,0.03);
}
.entry-content blockquote p {
  font-family: var(--display);
  font-size: clamp(18px, 2.2vw, 26px);
  font-style: italic;
  color: #ffffff;
  margin: 0;
  line-height: 1.5;
}
.entry-content img { margin: 2em 0; border-radius: 0; }
.entry-content a { color: var(--red); text-decoration: underline; }
.entry-content a:hover { color: var(--red-bright); }

/* =========================================================
   OWNERSHIP CTA STRIP
   ========================================================= */
.ownership-strip {
  background: var(--red);
  padding: clamp(40px, 6vw, 70px) clamp(24px, 6vw, 80px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}
.ownership-strip-text { font-family: var(--display); font-size: clamp(24px, 3.5vw, 48px); font-weight: 600; line-height: 1.1; }
.ownership-strip-text em { font-style: italic; }

/* =========================================================
   UTILITY
   ========================================================= */
.text-red { color: var(--red); }
.text-muted { color: var(--muted); }
.condensed { font-family: var(--condensed); }
.display { font-family: var(--display); }
.uppercase { text-transform: uppercase; }
.no-margin { margin: 0; }
.pad-section { padding: var(--section-pad) clamp(24px, 6vw, 80px); }

/* skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--red);
  color: var(--white);
  padding: 8px;
  z-index: 100000;
}
.skip-link:focus { top: 0; }

/* =========================================================
   ELEMENTOR COMPATIBILITY
   ========================================================= */
.elementor-page .site-main { padding-top: 0; }
body.elementor-page header.site-header { position: fixed; }
.e-con, .elementor-section { max-width: 100%; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
  body { cursor: auto; }
  .cursor, .cursor-ring { display: none; }
  .horses-grid { grid-template-columns: 1fr; }
  .page-hero { min-height: 340px; }
}
@media (max-width: 480px) {
  .section-header { flex-direction: column; align-items: flex-start; }
  .ownership-strip { flex-direction: column; text-align: center; }
}
