/* ==========================================================================
   ProgramBlocker Classic Theme - Responsive & SEO-friendly
   Preserves the original Times New Roman + gray background classic look
   while adding modern responsive layout, accessibility, and SEO hooks.
   ========================================================================== */

/* --- Reset & base ------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  /* Classic look preserved: gray background + Times New Roman serif */
  background-color: #CCCCCC;
  color: #000000;
  font-family: "Times New Roman", Times, "Noto Serif", Georgia, serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
}

/* --- Typography --------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: "Times New Roman", Times, "Noto Serif", Georgia, serif;
  font-weight: bold;
  margin: 0.6em 0 0.4em;
  line-height: 1.25;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }

p {
  margin: 0.5em 0 0.85em;
}

/* --- Links (classic blue/red behaviour preserved) ---------------------- */
a:link    { color: #0000FF; text-decoration: none; }
a:visited { color: #0000FF; text-decoration: none; }
a:hover   { color: #FF0000; text-decoration: underline; }
a:active  { color: #0000FF; text-decoration: none; }

a:focus-visible {
  outline: 2px solid #0000FF;
  outline-offset: 2px;
}

/* --- Layout shell ------------------------------------------------------- */
.page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px;
}

.layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main"
    "sidebar footer";
  gap: 8px;
}

/* --- Header / Title bar ------------------------------------------------- */
.site-header {
  grid-area: header;
  background: #FFFFFF;
  border: 1px solid #666666;
  padding: 10px 16px;
  text-align: center;
  font-style: italic;
}

.site-header .title-main {
  font-size: 1.15rem;
  font-weight: bold;
}

.site-header .tagline {
  display: inline;
  font-style: italic;
}

.site-header .anti-bypass {
  color: #FF0000;
  font-weight: bold;
}

/* --- Sidebar / Quick Links --------------------------------------------- */
.sidebar {
  grid-area: sidebar;
  background: #FFFFFF;
  border: 1px solid #666666;
  padding: 8px;
  align-self: start;
  position: sticky;
  top: 8px;
}

.sidebar__logo {
  display: block;
  text-align: center;
  margin-bottom: 8px;
}

.sidebar__logo img {
  width: 48px;
  height: 48px;
  border: 0;
  image-rendering: auto;
}

.sidebar__title {
  text-align: center;
  font-weight: bold;
  font-size: 1rem;
  margin: 8px 0 4px;
}

.sidebar__title::after {
  content: "";
  display: block;
  border-bottom: 1px solid #666666;
  margin-top: 4px;
}

.sidebar__nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar__nav li {
  text-align: center;
  padding: 6px 4px;
  border-bottom: 1px dotted #CCCCCC;
  font-size: 0.92rem;
}

.sidebar__nav li:last-child {
  border-bottom: 0;
}

.sidebar__nav li.active {
  background: #FFFFCC;
  font-weight: bold;
}

.sidebar__nav a {
  display: block;
  padding: 2px 4px;
}

/* --- Main content ------------------------------------------------------- */
.main {
  grid-area: main;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: start;
}

.main__content {
  background: #FFFFFF;
  border: 1px solid #666666;
  padding: 16px 20px;
  min-width: 0; /* prevents grid blowout */
}

.main__sidebar {
  background: #FFFFFF;
  border: 1px solid #666666;
  padding: 8px;
}

/* --- Buy / download box (right column) -------------------------------- */
.buy-box {
  text-align: center;
  font-size: 0.92rem;
}

.buy-box__paypal {
  margin: 0 0 12px;
  /* PayPal SDK renders an iframe into #paypal-container-YNRGE27VV8EHS;
     give it some breathing room and center it. */
  min-height: 55px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.buy-box__paypal > div {
  width: 100%;
}

.buy-box__paypal iframe {
  width: 100% !important;
  max-width: 100%;
}

.buy-box__download-title {
  background: #FFFFCC;
  font-weight: bold;
  font-size: 1.05rem;
  padding: 6px;
  border: 1px solid #CCCC99;
  margin-top: 12px;
}

.buy-box__download-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  background: #FFFFFF;
  padding: 6px;
  border: 1px solid #CCCC99;
}

.buy-box__download-meta a {
  font-weight: bold;
}

.buy-box__payment-title {
  font-weight: bold;
  margin: 12px 0 4px;
}

.buy-box__payment-text {
  font-size: 0.88rem;
  text-align: left;
  line-height: 1.45;
}

/* --- Content blocks ---------------------------------------------------- */
.article-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin: 0.2em 0 0.6em;
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 12px 0;
}

.intro-grid h2 {
  text-decoration: underline;
  font-size: 1.05rem;
  margin-top: 0;
}

.intro-grid ul {
  padding-left: 18px;
  margin: 6px 0;
}

.intro-grid li {
  margin-bottom: 6px;
}

/* --- Screenshot row ---------------------------------------------------- */
.screenshot-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
  align-items: start;
}

.screenshot-row figure {
  margin: 0;
  text-align: center;
}

.screenshot-row img {
  max-width: 100%;
  height: auto;
  border: 1px solid #999999;
  display: block;
  margin: 0 auto;
}

.screenshot-row figcaption {
  font-style: italic;
  font-size: 0.88rem;
  margin-top: 6px;
  text-align: left;
  line-height: 1.45;
}

/* --- Comparison table (Trial vs Pro) ----------------------------------- */
.compare-table-wrap {
  overflow-x: auto;
  margin: 12px 0;
  -webkit-overflow-scrolling: touch;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: #FFFFFF;
  font-size: 0.92rem;
  min-width: 520px;
}

.compare-table th,
.compare-table td {
  border: 1px solid #000000;
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
}

.compare-table th {
  font-weight: bold;
}

.compare-table th.feature-col { background: #FFFFFF; }
.compare-table th.trial-col   { background: #FFFF66; color: #FF0000; }
.compare-table th.pro-col     { background: #00FFFF; color: #0099FF; }

.compare-table td.feature-col { background: #FFFFCC; text-align: left; font-weight: bold; }
.compare-table td.trial-col   { background: #FFFF00; color: #FF0000; }
.compare-table td.trial-no    { background: #FF0000; color: #FFFFFF; }
.compare-table td.pro-col     { background: #99FF66; color: #0099FF; }
.compare-table td.pro-no      { background: #FF0000; color: #FFFFFF; }

/* --- Step lists -------------------------------------------------------- */
ol.steps {
  padding-left: 22px;
  margin: 8px 0 12px;
}

ol.steps > li {
  margin-bottom: 6px;
}

ol.steps ul {
  margin: 4px 0 6px;
  padding-left: 18px;
}

.content-block ul,
.content-block ol {
  padding-left: 22px;
  margin: 6px 0 10px;
}

.content-block li {
  margin-bottom: 4px;
}

blockquote {
  margin: 6px 0 10px 16px;
  padding: 6px 12px;
  border-left: 3px solid #CCCCCC;
  background: #F7F7F7;
}

.note,
.warning {
  background: #FFFFCC;
  border: 1px solid #CCCC99;
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 0.92rem;
}

.warning {
  background: #FFF0F0;
  border-color: #CC9999;
}

.warning strong {
  color: #FF0000;
}

/* --- Pagination (prev / next) ----------------------------------------- */
.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px dotted #999999;
  gap: 8px;
}

.pagination__next {
  text-align: right;
}

/* --- Footer ------------------------------------------------------------ */
.site-footer {
  grid-area: footer;
  background: #FFFFFF;
  border: 1px solid #666666;
  padding: 8px 12px;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 8px;
}

/* --- Visually-hidden helper (for screen readers) ---------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Mobile nav toggle (hidden on desktop) ---------------------------- */
.nav-toggle {
  display: none;
}

/* --- Restricted / private content notice ----------------------------- */
.private-notice {
  text-align: center;
  font-size: 1.3rem;
  font-style: italic;
  margin: 24px 8px;
  padding: 16px;
  background: #FFFFCC;
  border: 1px solid #CCCC99;
}

.private-notice a {
  font-weight: bold;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 180px 1fr;
  }

  .main {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .intro-grid,
  .screenshot-row {
    grid-template-columns: 1fr;
  }

  .screenshot-row img {
    max-width: 480px;
  }
}

/* Mobile: < 768px - sidebar moves to top (collapsible) */
@media (max-width: 768px) {
  .page {
    padding: 4px;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main"
      "footer";
    gap: 6px;
  }

  /* Sidebar becomes a collapsible panel above the main content */
  .sidebar {
    position: static;
    border: 1px solid #666666;
  }

  .nav-toggle {
    display: block;
    width: 100%;
    background: #FFFFCC;
    border: 1px solid #CCCC99;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    text-align: left;
    cursor: pointer;
    color: #000000;
  }

  .nav-toggle::after {
    content: " \25BC"; /* down arrow */
    float: right;
  }

  .nav-toggle[aria-expanded="true"]::after {
    content: " \25B2"; /* up arrow */
  }

  .sidebar__nav {
    display: none;
  }

  .sidebar.is-open .sidebar__nav {
    display: block;
  }

  .main {
    grid-template-columns: 1fr;
  }

  .main__sidebar {
    order: 2; /* buy box appears below content on mobile */
  }

  .site-header {
    font-size: 0.95rem;
    padding: 8px 10px;
  }

  .site-header .title-main {
    font-size: 1rem;
    display: block;
  }

  .site-header .tagline {
    display: block;
    font-size: 0.85rem;
  }

  .main__content {
    padding: 12px 14px;
  }

  .article-title {
    font-size: 1.15rem;
  }

  .compare-table {
    font-size: 0.85rem;
  }

  .pagination {
    flex-direction: column;
  }

  .pagination__next {
    text-align: left;
  }

  .private-notice {
    font-size: 1.1rem;
  }
}

/* Small mobile: < 480px */
@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .site-header .title-main {
    font-size: 0.95rem;
  }

  .buy-box__download-meta {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .buy-box__download-meta > * {
    text-align: center;
    padding: 4px;
  }

  .compare-table {
    font-size: 0.8rem;
  }

  .compare-table th,
  .compare-table td {
    padding: 4px 6px;
  }

  .sidebar__logo img {
    width: 40px;
    height: 40px;
  }
}

/* --- Print -------------------------------------------------------------- */
@media print {
  body { background: #FFFFFF; }
  .sidebar,
  .main__sidebar,
  .nav-toggle,
  .site-footer { display: none; }
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "main";
  }
  .main__content {
    border: 0;
    padding: 0;
  }
  a:link, a:visited { color: #000000; }
}

/* --- Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
