/* MotoEtkinlik — sitegenel centralized frontend shell.
   Change the values below rather than adding page-specific margin patches.
   The class is present in frontend templates; admin is unaffected. */
:root {
  --sitegenel-width: 1248px;
  --sitegenel-top: 30px;
  --sitegenel-bottom: 30px;
  --sitegenel-hero-gap: 15px;
  --sitegenel-hero-inset: 15px;
  --sitegenel-hero-radius: 16px;
  --sitegenel-editorial-top: 20px;
  --sitegenel-race-top: 20px;
  --sitegenel-results-hero-gap: 30px;
  --sitegenel-youtube-top: var(--sitegenel-race-top);
  --sitegenel-youtube-width: var(--sitegenel-width);
  --sitegenel-youtube-hero-gap: var(--sitegenel-hero-gap);
}
/* Common sizing contract: do not alter internal cards or grid columns. */
body:not(.wp-admin) .sitegenel {
  --me-layout-max: var(--sitegenel-width);
  box-sizing: border-box;
}
body:not(.wp-admin) main.sitegenel.content-page {
  padding-top: var(--sitegenel-editorial-top) !important;
  padding-bottom: var(--sitegenel-bottom);
}
body:not(.wp-admin) main.sitegenel.content-page > .container {
  max-width: var(--sitegenel-width);
}
/* Keep the approved homepage placement, but allow one width control. */
body.home main.sitegenel#primary { max-width: var(--sitegenel-width); }
/* MotoGP and WorldSBK shell top spacing. */
body:not(.wp-admin) .sitegenel.motocal-wrapper {
  margin-top: var(--sitegenel-race-top) !important;
}
/* Shared hero dimensions on race pages. */
body:not(.wp-admin) .sitegenel.motocal-wrapper :is(
  .results-hub-race-hero,.standings-hero,.riders-page-hero,.me-calendar-hero
) {
  width: calc(100% - 2 * var(--sitegenel-hero-inset)) !important;
  max-width: calc(100% - 2 * var(--sitegenel-hero-inset)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: var(--sitegenel-hero-gap) !important;
  border-radius: var(--sitegenel-hero-radius) !important;
  box-sizing: border-box;
}
/* Preserve user's intentional 30px results hero spacing. */
body:not(.wp-admin) .motocol-results-hub--motogp .sitegenel.motocal-wrapper .results-hub-race-hero {
  margin-top: var(--sitegenel-results-hero-gap) !important;
}
/* YouTube: outer gap and inner shell have separate controls. */
body.moto-youtube-page main.sitegenel.me-youtube-archive {
  padding-top: var(--sitegenel-youtube-top) !important;
}
body.moto-youtube-page main.sitegenel.me-youtube-archive > .me-youtube-shell {
  max-width: var(--sitegenel-youtube-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body.moto-youtube-page main.sitegenel .me-youtube-results-hero {
  width: calc(100% - 2 * var(--sitegenel-hero-inset)) !important;
  max-width: calc(100% - 2 * var(--sitegenel-hero-inset)) !important;
  margin: var(--sitegenel-youtube-hero-gap) auto 26px !important;
  border-radius: var(--sitegenel-hero-radius) !important;
}
@media (max-width:767px) {
  body.moto-youtube-page main.sitegenel.me-youtube-archive {
    padding-top: var(--sitegenel-youtube-top) !important;
  }
}

/* YouTube follows the same outer container contract as the race pages. */
body.moto-youtube-page main.sitegenel.me-youtube-archive {
  width: 100%;
  max-width: none;
  margin-top: 0 !important;
  padding-left: 15px;
  padding-right: 15px;
  box-sizing: border-box;
}
body.moto-youtube-page main.sitegenel.me-youtube-archive > .me-youtube-shell {
  width: 100%;
  max-width: var(--sitegenel-width) !important;
  box-sizing: border-box;
}
body.moto-youtube-page main.sitegenel .me-youtube-results-hero {
  margin-top: var(--sitegenel-hero-gap) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border-radius: var(--sitegenel-hero-radius) !important;
}

/* Approved old ZIP: retain existing outer widths, align only heroes. */
body:not(.wp-admin) .sitegenel.motocal-wrapper :is(.results-hub-race-hero,.standings-hero,.riders-page-hero,.me-calendar-hero) {
  box-sizing: border-box !important;
  width: calc(100% - 30px) !important;
  max-width: calc(100% - 30px) !important;
  margin: 15px auto 24px !important;
  border-radius: 16px !important;
}
body:not(.wp-admin) .motocol-results-hub--motogp .sitegenel.motocal-wrapper .results-hub-race-hero {
  margin-top: 15px !important;
}
body.moto-youtube-page main.me-youtube-archive.sitegenel {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  padding-left: 15px !important;
  padding-right: 15px !important;
}
body.moto-youtube-page main.me-youtube-archive.sitegenel > .me-youtube-shell {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 1248px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body.moto-youtube-page main.me-youtube-archive.sitegenel .me-youtube-results-hero {
  box-sizing: border-box !important;
  width: calc(100% - 30px) !important;
  max-width: calc(100% - 30px) !important;
  margin: 15px auto 24px !important;
  border-radius: 16px !important;
}

/* Targeted final adjustment: only results-page hero vertical positions. */
body:not(.wp-admin) .motocol-results-hub--motogp .sitegenel.motocal-wrapper .results-hub-race-hero {
  margin-top: 27px !important; /* locked MotoGP results hero top alignment */
}
body:not(.wp-admin) .motocol-results-hub--worldsbk .sitegenel.motocal-wrapper .results-hub-race-hero {
  margin-top: 2px !important; /* 3px further up */
}

/* Approved footer spacing adjustment (2026-10-12).
   Only homepage and MotoGP/WorldSBK results pages.
   Locked header and hero top alignments are untouched. */
body.home main#primary.sitegenel {
  margin-bottom: 30px !important;
  padding-bottom: 0 !important;
}
body:not(.wp-admin) .motocol-results-hub--motogp > .motocal-wrapper.sitegenel,
body:not(.wp-admin) .motocol-results-hub--worldsbk > .motocal-wrapper.sitegenel {
  margin-bottom: 30px !important;
  padding-bottom: 0 !important;
}

/* Results footer gap: remove 40px padding from the OUTER race-single-page.
   Keep the inner wrapper's approved 20px bottom margin. */
body:not(.wp-admin) .motocol-results-hub.race-single-page:is(.motocol-results-hub--motogp,.motocol-results-hub--worldsbk) {
  padding-bottom: 0 !important;
}

/* Only MotoGP and WorldSBK race results: 15px between final results panel and shell bottom.
   Preserve the approved 30px combined outer bottom spacing. */
body:not(.wp-admin) .motocol-results-hub--motogp > .motocal-wrapper.sitegenel,
body:not(.wp-admin) .motocol-results-hub--worldsbk > .motocal-wrapper.sitegenel {
  box-sizing: border-box !important;
  padding-bottom: 15px !important;
  margin-bottom: 15px !important;
}


/* Editorial background fix: layout.css sets .content-page to #f5f5f5,
   covering the WordPress body photo. Category/single already override this.
   Only the three affected templates, only light mode. */
html[data-me-theme="light"] body:is(.author,.search,.error404) main.content-page {
  background: transparent !important;
}

/* YouTube archive only: fixed 1248px outer width and visible WordPress
   background in both themes. Keep inner video panels and grids intact. */
html[data-me-theme="light"] body.moto-youtube-page,
html[data-me-theme="dark"] body.moto-youtube-page {
  background-color: #0d1014 !important;
}
html[data-me-theme="light"] body.moto-youtube-page main.me-youtube-archive.sitegenel,
html[data-me-theme="dark"] body.moto-youtube-page main.me-youtube-archive.sitegenel {
  background: transparent !important;
  width: calc(100% - 30px) !important;
  max-width: 1248px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
html[data-me-theme="light"] body.moto-youtube-page main.me-youtube-archive.sitegenel > .me-youtube-shell,
html[data-me-theme="dark"] body.moto-youtube-page main.me-youtube-archive.sitegenel > .me-youtube-shell {
  width: 100% !important;
  max-width: 1248px !important;
}
