
/*
Theme Name: CADTB Win98 Desktop Exams
Theme URI: https://controlaltdeletetechbits.co.uk/
Author: Mark Oldham (Control Alt Delete Tech Bits)
Author URI: https://www.linkedin.com/in/markoldham365/
Description: Windows 98 style homepage with Start menu, Exams desktop folder, and Exams page support. Standard templates for posts, pages, and archives.
Version: 2.1.0
Text Domain: cadtb98-exams
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* Base tweaks shared across the site */
:root{
  --cadtb-primary:#007FFF;
  --taskbar-height: 42px;
  --desktop-bg: #0e7c80; /* teal-ish */
}

/* Typography inherits from browser/98.css on front page; keep body readable on posts */
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fff;
  margin: 0;
  overflow-x: hidden;
}

*, *::before, *::after{ box-sizing: border-box; }

a, button, input, select, textarea{ font: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible{
  outline: 3px solid #ffbf00;
  outline-offset: 2px;
}

.cadtb-skip-link{
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 2147483647;
  padding: 8px 12px;
  background: #000080;
  color: #fff;
  transform: translateY(-160%);
}
.cadtb-skip-link:focus{ transform: translateY(0); }

/* Simple content layout for posts/archives */
.cadtb-container{
  width: min(1100px, 92vw);
  margin: 2rem auto;
}

.cadtb-post-title{ margin: 0 0 1rem; }

.cadtb-post-meta{
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1.25rem;
}

.cadtb-content img{ max-width: 100%; height: auto; }
.cadtb-content iframe{ max-width: 100%; }
.cadtb-content p,
.cadtb-content li{ max-width: 78ch; }
.cadtb-content{ overflow-wrap: anywhere; }

/* Basic archive grid */
.cadtb-archive ul{ list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); }
.cadtb-archive li{ border: 1px solid #e5e5e5; padding: 1rem; border-radius: 8px; background: #fff; }
.cadtb-archive h2{ font-size: 1.1rem; margin: 0 0 0.5rem; }

/* Comments */
.cadtb-comments{ margin-top: 2rem; }


/* Back to Desktop button (posts/pages) */
.cadtb-return{ margin: 0 auto; width:min(1100px,92vw); padding: 8px 0 0; }
.cadtb-start-link{
  display:inline-flex; align-items:center; gap:8px;
  border:1px solid #7d7d7d; background:#c0c0c0; padding:6px 10px; text-decoration:none; color:#000;
  box-shadow: inset 1px 1px #fff, inset -1px -1px #808080;
  border-radius:4px; font-weight:600;
}
.cadtb-start-link:active{ box-shadow: inset -1px -1px #fff, inset 1px 1px #808080; }
@media (max-width:700px){ .cadtb-return{ padding: 8px 12px 0; } }
@media print{ .cadtb-return{ display:none; } }

/* Exams fallback page */
.cadtb-exams-theme-page{
  width: min(1180px, 94vw);
}
.cadtb-exams-window{
  max-width: 1120px;
  margin: 18px auto 48px;
}
.cadtb-exams-window .window-body{
  max-height: none;
  overflow: visible;
}
.cadtb-exams-window .cadtb-exams-shell{
  padding: 16px;
}


/* Accessibility utility: visually hidden but accessible */
.visually-hidden{
  position:absolute !important;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0);
  white-space:nowrap; border:0;
}


.brand-home-link{ text-decoration: none; color: inherit; }
.brand-home-link:focus{ outline: 1px dotted; }


/* SEO-visible but visually offscreen H1 */
.sr-only{
  position:absolute !important;
  left:-10000px !important;
  top:auto !important;
  width:1px !important;
  height:1px !important;
  overflow:hidden !important;
  white-space:nowrap !important;
}

/* Article indexes and search */
.cadtb-listing-page{ padding-bottom: 3rem; }
.cadtb-listing-header{
  margin: 1.5rem 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #7d7d7d;
  background: #f4f4f4;
  box-shadow: inset 1px 1px #fff, inset -1px -1px #808080;
}
.cadtb-listing-header h1{ margin: .15rem 0 .5rem; line-height: 1.15; }
.cadtb-kicker{
  margin: 0;
  color: #555;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.cadtb-search-form{ margin-top: 1.25rem; }
.cadtb-search-form > label{ display: block; margin-bottom: .35rem; font-weight: 700; }
.cadtb-search-row,
.cadtb-search-filters{
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: end;
}
.cadtb-search-form input[type="search"]{
  min-width: min(420px, 100%);
  min-height: 44px;
  padding: .55rem .7rem;
}
.cadtb-search-form select,
.cadtb-search-form button{
  min-height: 44px;
  padding: .5rem .75rem;
}
.cadtb-search-filters label{ font-weight: 700; }
.cadtb-category-links{
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}
.cadtb-category-links a,
.cadtb-read-more{
  display: inline-flex;
  padding: .45rem .7rem;
  border: 1px solid #7d7d7d;
  background: #c0c0c0;
  color: #000;
  text-decoration: none;
  box-shadow: inset 1px 1px #fff, inset -1px -1px #808080;
}
.cadtb-results-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cadtb-result-card{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid #d0d0d0;
  background: #fff;
}
.cadtb-result-card h2{ margin: 0 0 .65rem; font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.25; }
.cadtb-result-card .cadtb-post-meta{ margin-bottom: .5rem; }
.cadtb-result-excerpt{ flex: 1; }
.cadtb-read-more{ margin-top: auto; }
.pagination{ margin-top: 2rem; }
.nav-links{ display: flex; flex-wrap: wrap; gap: .4rem; }
.page-numbers{ display: inline-flex; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; padding: .35rem .55rem; }
.cadtb-empty-state{ padding: 2rem; border: 1px solid #d0d0d0; }

/* About page */
.cadtb-about-page{ padding-bottom: 3rem; }
.cadtb-about-header{
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  margin: 1.5rem 0;
  padding: clamp(1rem, 4vw, 2rem);
  background: #f4f4f4;
  border: 1px solid #d0d0d0;
}
.cadtb-about-header h1{ margin: .15rem 0 .5rem; }
.cadtb-author-image img{ width: 160px; height: 160px; object-fit: cover; }
.cadtb-about-grid{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.cadtb-about-grid section,
.cadtb-about-actions,
.cadtb-editorial-note{ padding: 1.25rem; border: 1px solid #d0d0d0; }
.cadtb-dialog-actions{ display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
.cadtb-editorial-note{ margin-top: 1rem; background: #f8f8f8; }

/* Missing page */
.cadtb-404-page{ display: grid; min-height: 70vh; place-items: center; }
.cadtb-system-dialog{
  width: min(680px, 100%);
  border: 2px solid #000;
  background: #c0c0c0;
  box-shadow: inset 1px 1px #fff, inset -1px -1px #808080, 6px 6px 0 rgba(0,0,0,.25);
}
.cadtb-system-title{ padding: 5px 8px; background: #000080; color: #fff; font-weight: 700; }
.cadtb-system-body{ padding: clamp(1rem, 4vw, 2rem); }
.cadtb-system-body h1{ margin-top: 0; }

/* Keep Google anchor ads from covering tutorial content. Inline adverts remain available. */
ins.adsbygoogle[data-anchor-status]{ display: none !important; }

@media (max-width: 700px){
  .cadtb-container{ width: min(100% - 24px, 1100px); margin: 1rem auto; }
  .cadtb-search-row,
  .cadtb-search-filters{ display: grid; grid-template-columns: 1fr; }
  .cadtb-search-form input[type="search"]{ min-width: 0; width: 100%; }
  .cadtb-about-header,
  .cadtb-about-grid{ grid-template-columns: 1fr; }
  .cadtb-author-image img{ width: 120px; height: 120px; }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
