/*
Theme Name: Sandbox World Newspaper — Friendly
Author: Sandbox World
Description: A classic WordPress newspaper theme with a friendly Astra-like customization model. Header and footer areas accept WordPress blocks through Appearance → Widgets.
Version: 3.0
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: sandbox-world-newspaper
*/


/* 2.01 — Bundle the Sandbox World Bungee Shade font locally so the
   custom HTML logo renders consistently on desktop and mobile. */
@font-face {
  font-family: "Bungee Shade";
  src: url("BungeeShade-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sandbox Bungee";
  src: url("BungeeShade-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html { scroll-behavior: smooth; }
body { margin: 0; color: #151515; background: #fff; font-family: Arial, Helvetica, sans-serif; line-height: 1.55; }
a { color: inherit; }
.sw-site-header { border-bottom: 0; }
.sw-header-inner { max-width: 1280px; margin: 0 auto; padding: 24px 32px 16px; text-align: center; }
.sw-site-logo img { width: auto; max-width: 650px; max-height: 300px; height: auto; display: inline-block; }
.sw-text-logo { font: 700 48px/1 Georgia, 'Times New Roman', serif; text-decoration: none; }
.sw-header-blocks { margin: 12px auto 4px; max-width: 900px; text-align: left; }
.sw-header-blocks:empty { display:none; }
.sw-header-blocks .sw-widget { margin: 0; }
.sw-primary-nav ul { list-style: none; margin: 12px 0 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 26px; }
.sw-primary-nav li { margin: 0; }
.sw-primary-nav a { text-decoration: none; }
.sw-main-wrap { max-width: 1280px; margin: 0 auto; padding: 36px 32px 56px; }
.sw-landing-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); column-gap: 34px; row-gap: 0; align-items: start; }
.sw-landing-grid > .sw-content-column { grid-column: 2; grid-row: 1; min-width: 0; }
.sw-landing-grid > .sw-sidebar { grid-column: 1; grid-row: 1; min-width: 0; }
.sw-content-column > .sw-main-column { min-width: 0; }
.sw-content-column > .sw-builder-output-frontpage { min-width: 0; margin-top: 0; }
.sw-single-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 42px; align-items: start; }
.sw-main-column h1, .sw-archive > h1 { font: 700 40px/1.15 Georgia, 'Times New Roman', serif; margin: 0 0 22px; }
.sw-rule { height: 2px; background: #151515; margin-bottom: 18px; }
.sw-sidebar h2 { font: 700 23px/1.2 Georgia, 'Times New Roman', serif; margin: 0 0 24px; }
.sw-sidebar-story { margin: 0 0 34px; }
.sw-sidebar-image-link { display: block; }
.sw-sidebar-image { width: 100%; height: 200px; aspect-ratio: auto; object-fit: cover; display: block; margin-bottom: 12px; }
.sw-sidebar-story-content h2 { font: 700 22px/1.25 Georgia, 'Times New Roman', serif; margin: 0 0 9px; }
.sw-sidebar-story-content h2 a, .sw-story-title a { text-decoration: none; }
.sw-sidebar-story-content p { margin: 0; font-size: 16px; }
.sw-story-row { display: flex; gap: 26px; align-items: flex-start; margin-bottom: 34px; }
.sw-story-image-column { flex: 0 0 280px; }
.sw-story-image { width: 100%; height: 200px; aspect-ratio: auto; object-fit: cover; display: block; }
.sw-story-content { min-width: 0; flex: 1; }
.sw-story-title { font: 700 38px/1.12 Georgia, 'Times New Roman', serif; margin: 0 0 18px; }
.sw-story-content p { margin: 0 0 18px; font-size: 17px; }
.sw-read-more { margin-top: 14px !important; }
.sw-read-more a { text-decoration: underline; }
.sw-single { min-width: 0; }
.sw-single-featured img { width: 100%; height: auto; display: block; margin-bottom: 28px; }
.sw-single-title { font: 700 48px/1.15 Georgia, 'Times New Roman', serif; margin: 0 0 30px; }
.sw-entry-content { font-size: 18px; }
.sw-entry-content img { max-width: 100%; height: auto; }
.sw-page, .sw-archive { max-width: 1000px; margin: 0 auto; }
.sw-site-footer { border-top: 1px solid #151515; margin-top: 24px; }
.sw-footer-main { max-width: 1280px; margin: 0 auto; padding: 38px 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 42px; }
.sw-footer-column { min-width: 0; }
.sw-widget-title { font: 700 21px/1.2 Georgia, 'Times New Roman', serif; margin: 0 0 14px; }
.sw-widget { margin: 0 0 18px; }
.sw-widget ul { margin: 0; padding-left: 20px; }
.sw-footer-bottom { border-top: 1px solid #ddd; max-width: 1280px; margin: 0 auto; padding: 16px 32px; font-size: 14px; }
.sw-footer-main .wp-block-group, .sw-header-blocks .wp-block-group { margin-block-start: 0; }

@media (max-width: 1050px) {
  .sw-landing-grid { grid-template-columns: 220px minmax(0,1fr); gap: 24px; }
  .sw-single-grid { grid-template-columns: minmax(0,1fr) 220px; gap: 28px; }
} 
@media (max-width: 900px) {
  .sw-landing-grid { grid-template-columns: 220px minmax(0,1fr); gap: 24px; }
  .sw-single-grid { grid-template-columns: minmax(0,1fr); }
  .sw-single-grid > .sw-sidebar { order: 2; }

  .sw-story-row { display: block; }
  .sw-story-image-column { display:block; width:100%; max-width: 520px; margin-bottom: 18px; }
  .sw-story-title { font-size: 34px; }
  .sw-footer-main { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .sw-header-inner, .sw-main-wrap, .sw-footer-main, .sw-footer-bottom { padding-left: 20px; padding-right: 20px; }
  .sw-landing-grid { display: flex; flex-direction: column; gap: 0; }
  .sw-landing-grid > .sw-content-column { order: 1; width: 100%; }
  .sw-content-column > .sw-builder-output-frontpage { margin-top: 10px; margin-bottom: 40px; }
  .sw-landing-grid > .sw-sidebar { order: 2; width: 100%; margin-bottom: 40px; }
  .sw-single-grid { display: block; }
  .sw-single-grid > .sw-sidebar { margin-top: 44px; }
  .sw-main-column h1, .sw-archive > h1 { font-size: 34px; }
  .sw-single-title { font-size: 38px; }
  .sw-text-logo { font-size: 38px; }
}

/* 1.06: automatic newest-post Feature Story above the 12 latest stories. */
.sw-feature-post { margin: 0 0 42px; }
.sw-feature-image-link { display: block; }
.sw-feature-image { width: 100%; height: 390px; object-fit: cover; display: block; margin-bottom: 22px; }
.sw-feature-content { max-width: 900px; }
.sw-feature-label { font: 700 14px/1.2 Arial, Helvetica, sans-serif; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
.sw-feature-title { font: 700 52px/1.08 Georgia, 'Times New Roman', serif; margin: 0 0 16px; }
.sw-feature-title a { text-decoration: none; }
.sw-feature-content > p:not(.sw-feature-label):not(.sw-read-more) { font-size: 19px; margin: 0 0 18px; }

@media (max-width: 900px) {
  .sw-feature-image { height: 320px; }
  .sw-feature-title { font-size: 44px; }
}
@media (max-width: 650px) {
  .sw-feature-post { margin-bottom: 34px; }
  .sw-feature-image { height: auto; }
  .sw-feature-title { font-size: 38px; }
}

/* Legacy slot builder styles retained for compatibility. */
.sw-header-row { border-bottom: 1px solid transparent; }
.sw-header-row-inner { max-width: 1280px; margin: 0 auto; padding: 10px 32px; display:grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:24px; }
.sw-header-row-left { justify-self:start; text-align:left; }
.sw-header-row-center { justify-self:center; text-align:center; }
.sw-header-row-right { justify-self:end; text-align:right; }
.sw-header-row .sw-header-element { min-width:0; }
.sw-header-row .sw-widget { margin:0; }
.sw-header-row .sw-site-logo img { max-width:650px; max-height:300px; width:auto; height:auto; }
.sw-header-builder-menu ul { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; justify-content:center; gap:26px; }
.sw-header-builder-menu li { margin:0; }
.sw-header-builder-menu a { text-decoration:none; }
.sw-header-search form { margin:0; }
.sw-header-search input[type=search] { max-width:220px; }
.sw-footer-row { max-width:1280px; margin:0 auto; padding:38px 32px; }
.sw-footer-builder { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:42px; }
.sw-footer-builder .sw-widget { margin:0 0 18px; }
@media (max-width:900px){ .sw-header-row-inner{grid-template-columns:1fr; text-align:center;} .sw-header-row-left,.sw-header-row-center,.sw-header-row-right{justify-self:center;text-align:center;} .sw-footer-builder{grid-template-columns:1fr;} }
@media (max-width:650px){ .sw-header-row-inner,.sw-footer-row{padding-left:20px;padding-right:20px;} }


/* 0.87 Full Block Builder output */
.sw-builder-output { width: 100%; }
.sw-builder-output > * { box-sizing: border-box; }
.sw-builder-output .wp-block-image img { max-width: 100%; height: auto; }
.sw-builder-output .wp-block-group,
.sw-builder-output .wp-block-columns { box-sizing: border-box; }
.sw-site-header .sw-builder-output { border-bottom: 0; }
.sw-site-footer .sw-builder-output { border-top: 0; }
.sw-builder-output > .wp-block-group.alignfull,
.sw-builder-output > .wp-block-cover.alignfull,
.sw-builder-output > .wp-block-columns.alignfull { width: 100%; max-width: none; }


/* 0.88 — block-builder presentation */
.sw-builder-output-header > .wp-block-group,
.sw-builder-output-header > .wp-block-columns,
.sw-builder-output-header > .wp-block-cover,
.sw-builder-output-header > .wp-block-image,
.sw-builder-output-header > .wp-block-navigation { margin-top: 0; margin-bottom: 0; }
.sw-builder-output-footer { width: 100%; }
.sw-builder-output-footer > .wp-block-group,
.sw-builder-output-footer > .wp-block-columns { margin-top: 0; margin-bottom: 0; }
.sw-builder-output .wp-block-image { margin-left: auto; margin-right: auto; }
.sw-builder-output .wp-block-button,
.sw-builder-output .wp-block-navigation { margin-block-start: 0; }

/* 0.90: optional full-width Front Page Builder area */
.sw-builder-output-frontpage { width: 100%; margin-top: 0; }
.sw-builder-output-frontpage > *:first-child { margin-top: 0; }

/* 0.93: eliminate structural gap before Front Page Builder */
.front-page-builder,.sw-front-page-builder,#front-page-builder,.sw-front-page-wrap {
  margin-top:0!important;
  margin-block-start:0!important;
  padding-top:0!important;
  min-height:0!important;
  align-self:start!important;
}
.sw-main-posts + .front-page-builder,
.sw-main-posts + .sw-front-page-builder,
.sw-main-posts + #front-page-builder,
.sw-main-posts + .sw-front-page-wrap {
  margin-top:0!important;
  margin-block-start:0!important;
  padding-top:0!important;
}

/* 1.04: Front page uses one left sidebar showing posts 25–36; single posts use the same 25–36 sidebar. */


/* 1.09 — Sandbox World header/menu border standard */
.sandbox-header {
    border-bottom: 1px solid #111111;
}
.sandbox-main-menu {
    border-top: 2.5px solid #111111;
    border-bottom: 1px solid #111111;
}


/* 2.0 — Optional Single Post Builder, directly below article content. */
.sw-builder-output-singlepost {
    width: 100%;
    margin-top: 42px;
    margin-bottom: 10px;
}
.sw-builder-output-singlepost > *:first-child { margin-top: 0; }

@media (max-width: 650px) {
    .sw-builder-output-singlepost {
        margin-top: 34px;
    }
}


/* 2.02 — Keep the HTML/CSS Sandbox World logo fully visible on narrow screens. */
.sandbox-logo-wrap {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.sandbox-logo {
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
}

@media (max-width: 700px) {
    .sandbox-logo {
        font-size: 7.2vw !important;
        letter-spacing: 0 !important;
        line-height: 1 !important;
    }

    .sandbox-logo-wrap {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
}

/* 2.04 — Add clear homepage pagination beneath Latest Stories. */
.sw-pagination {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid #ddd;
  text-align: center;
}
.sw-pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.sw-pagination a,
.sw-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 6px 11px;
  border: 1px solid #151515;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  line-height: 1;
}
.sw-pagination .current {
  background: #151515;
  color: #fff;
}
.sw-pagination .dots {
  border-color: transparent;
}
.sw-pagination a:hover {
  background: #f2f2f2;
}


/* 2.04 — Front Page Slider Builder */
.sw-frontpage-slider {
  grid-column: 1 / -1;
  position: relative;
  margin: 0 0 28px;
  overflow: hidden;
  border-radius: 14px;
  background: #111;
}
.sw-slider-viewport { width: 100%; overflow: hidden; }
.sw-slider-track { display: flex; width: 100%; transition: transform .45s ease; will-change: transform; }
.sw-slider-slide { flex: 0 0 100%; width: 100%; min-width: 100%; box-sizing: border-box; position: relative; }
.sw-slider-slide > *:first-child { margin-top: 0; }
.sw-slider-slide > *:last-child { margin-bottom: 0; }
.sw-slider-slide img { max-width: 100%; height: auto; }
.sw-slider-button { position: absolute; top: 50%; z-index: 3; width: 42px; height: 42px; margin-top: -21px; padding: 0; border: 1px solid rgba(255,255,255,.7); border-radius: 50%; background: rgba(17,17,17,.78); color: #fff; font-size: 30px; line-height: 36px; cursor: pointer; }
.sw-slider-button:hover, .sw-slider-button:focus-visible { background: #111; }
.sw-slider-prev { left: 14px; }
.sw-slider-next { right: 14px; }
.sw-slider-dots { position: absolute; left: 50%; bottom: 12px; z-index: 3; display: flex; gap: 7px; transform: translateX(-50%); }
.sw-slider-dot { width: 9px; height: 9px; padding: 0; border: 1px solid #fff; border-radius: 50%; background: rgba(255,255,255,.45); cursor: pointer; }
.sw-slider-dot.is-active { background: #151515; }
@media (prefers-reduced-motion: reduce) { .sw-slider-track { transition: none; } }
@media (max-width: 600px) {
  .sw-frontpage-slider { margin-bottom: 22px; border-radius: 10px; }
  .sw-slider-button { width: 36px; height: 36px; margin-top: -18px; font-size: 26px; line-height: 30px; }
  .sw-slider-prev { left: 8px; }
  .sw-slider-next { right: 8px; }
}

/* Customizer Builder elements */
.sw-customizer-builder { width:100%; box-sizing:border-box; }
.sw-customizer-builder > *:first-child { margin-top:0; }
.sw-customizer-builder > *:last-child { margin-bottom:0; }
.sw-customizer-builder-text { margin:0 0 18px; }
.sw-customizer-builder-heading { margin:0 0 18px; }
.sw-customizer-builder-button-wrap { margin:0 0 18px; }
.sw-customizer-builder-button { display:inline-block; padding:10px 18px; text-decoration:none; border:1px solid currentColor; }
.sw-customizer-builder-image { margin:0 0 18px; }
.sw-customizer-builder-image img { display:block; max-width:100%; height:auto; }
