﻿/* ==========================================================================
   1. RESET & DEFAULTS
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.65;
}

/* Prevent accidental horizontal scroll (mobile tables / long strings) */
body { overflow-x: hidden; }

.skip-link{
  position:absolute;
  left:-9999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.skip-link:focus{
  left:10px;
  top:10px;
  width:auto;
  height:auto;
  padding:10px 12px;
  background:#fff;
  border:2px solid #007bff;
  border-radius:8px;
  z-index:9999;
}




/* Main page container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Base text */
p {
    margin-bottom: 10px;
    font-size: 1rem;
    line-height: 1.65;
}

li {
    margin-bottom: 5px;
    font-size: 1rem;
    line-height: 1.65;
}

/* Base links */
a {
    display: inline;
    text-decoration: none;
    color: #333;
    font-size: 1rem;
    font-family: "Helvetica Neue", sans-serif;
    font-weight: bold;
}

a:hover { color: #0070c0; }
a:active { color: #002060; }
a:visited { color: #551a8b; }

/* Keep inline text links same size as surrounding text */
h1 a, h2 a, h3 a {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}
h1 a:hover, h2 a:hover, h3 a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   2. HEADINGS / TYPOGRAPHY
   ========================================================================== */
h1 {
    font-size: 1.7rem;
    line-height: 1.2;
    margin: 0 0 1rem 0;
    text-align: center;
}

h2 {
    font-size: 1.3rem;
    line-height: 1.3;
    margin: 1.2rem 0 0.8rem 0;
    text-align: center;
}

details summary,
details p {
    font-size: 1.1rem;
    line-height: 1.55;
}

/* Slight boost on tablets/desktop */
@media (min-width: 912px) { html { font-size: 18px; } }
@media (min-width: 1280px) { html { font-size: 18px; } }

/* ==========================================================================
   3. GENERIC LISTS
   ========================================================================== */

/* Default UL behaves normally */
ul {
    display: block;
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 20px;
}

/* Opt-in grid list */
ul.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.grid-list > li {
    padding: 10px;
    background-color: #f2f2f2;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 0;
}

/* Border style (your classic grid list tiles) */
ul.border-style {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 10px;
    padding-inline-start: 0; /* iOS */
}

ul.border-style > li {
    padding: 10px;
    background-color: #f2f2f2;
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

ul.border-style > li:hover {
    background-color: #ececec;
    transform: translateY(-1px);
}

/* ==========================================================================
   4. COMPONENTS (Buttons, Footer, Tactics)
   ========================================================================== */
.myButton {
    display: inline-block;
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    font-size: 1rem;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 5px;
}
.myButton:hover { background-color: #3e8e41; }

footer {
    border-top: 1px solid #ddd;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tactic {
    background-color: #f5f5f5;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    padding: 16px;
}

/* ==========================================================================
   5. MOBILE & iOS TWEAKS (Consolidated)
   ========================================================================== */

/* Prevent iOS input zooming */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 600px) {
        input, select, textarea { font-size: 16px; }
    }
}

/* Big Readability Mode */
@media (max-width: 600px) {
    html { font-size: 20px !important; }
    body { line-height: 1.75 !important; }
    p, li { font-size: 1.15rem !important; line-height: 1.75 !important; }
    h1 { font-size: 1.6rem !important; line-height: 1.25 !important; margin-bottom: 0.9rem; }
    h2 { font-size: 1.35rem !important; line-height: 1.3 !important; margin-top: 1.3rem; margin-bottom: 0.7rem; }
    a { font-size: 1.12rem !important; }
    details { font-size: 1.15rem !important; }
    details summary { font-size: 1.2rem !important; line-height: 1.45 !important; }
    details p { font-size: 1.15rem !important; line-height: 1.7 !important; }
}

/* ==========================================================================
   6. SHARED HELPERS (Checklists, FAQ, Course Buttons)
   ========================================================================== */
/* Lead paragraph directly after the main H1 */
.page-intro{
  max-width: 720px;
  margin: 0.75rem auto 1.5rem;
  font-size: 1.05rem;
  line-height: 1.6;
  text-align: center;
}

/* Lead paragraph directly after a section H2 */
.section-intro {
  max-width: 720px;
  margin: 0.75rem auto 1rem;
  font-size: 1rem;
  line-height: 1.6;
  text-align: center;
}







@media (max-width: 600px){
  .page-intro{ font-size: 1.15rem; }
}


   .hub-intro {
    margin: 12px auto 18px auto;
    line-height: 1.6;
    font-size: 1.05rem;
}

.hub-cta {
    margin: 18px 0 6px 0;
    padding: 14px 14px;
    background: #fff3cd;
    border: 1px solid #f0c36d;
    border-radius: 10px;
    line-height: 1.55;
}

.hub-cta strong { color: #6b3b00; }
.micro-note { font-size: 0.95rem; color: #444; margin-top: 8px; }

.section-title {
    margin-top: 18px;
    font-size: 1.25rem;
    color: #800000;
    text-align: left;
}

.opening-checklist, .mid-checklist, .checklist {
    margin: 10px 0 0 0;
    padding: 12px 12px;
    background: #f9f6f2;
    border: 1px solid #eadfce;
    border-radius: 10px;
    line-height: 1.55;
}

.opening-checklist ul, .mid-checklist ul, .checklist ul { margin: 8px 0 0 18px; }
.opening-checklist li, .mid-checklist li, .checklist li { margin: 6px 0; }

details.faq {
    background: #fff;
    border: 1px solid #e9e2d7;
    border-radius: 10px;
    padding: 12px 12px;
    margin: 10px 0;
}

details.faq summary {
    cursor: pointer;
    font-weight: 700;
    color: #222;            /* neutral dark text */
    text-decoration: none; /* safety */
}


a.create-account-btn, a.secondary-course-btn { text-decoration: none; }

a.create-account-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem;
    margin-top: 0.5rem;
    background-color: #ffffff;
    color: #2e7d32;
    border: 2px solid #2e7d32;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}
a.create-account-btn:hover { background-color: #e8f5e9; }

a.secondary-course-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem;
    margin-top: 0.4rem;
    background-color: #ffffff;
    color: #2e7d32;
    border: 2px dashed #2e7d32;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, border-style 0.2s;
}
a.secondary-course-btn:hover { background-color: #f4fbf5; border-style: solid; }

@media (max-width: 420px){
    a.create-account-btn, a.secondary-course-btn { font-size: 0.95rem; padding: 0.65rem; }
}


/* ==========================================================================
   Pro Tip / GM Insight Box (Sleek Edition)
   ========================================================================== */

.pro-tip-box {
    background: #f9fafb;                 /* near-white, softer than grey */
    border-left: 4px solid #2e7d32;       /* confident but not loud */
    padding: 1.1rem 1.2rem;
    margin: 1.4rem 0;
    font-size: 1.02rem;
    line-height: 1.55;
    border-radius: 0 6px 6px 0;
}

/* Header emphasis (GM Insight label) */
.pro-tip-box strong {
    color: #1f7a3a;
    font-weight: 700;
}

/* Paragraph spacing control */
.pro-tip-box p {
    margin: 0.4rem 0;
}

/* Last paragraph tighter to CTA */
.pro-tip-box .create-account-btn {
    margin-top: 0.5rem;
}

/* Links inside pro-tip (non-salesy, clean) */
.pro-tip-box {
    background: #f9fafb;
    border-left: 4px solid #2e7d32;
    border-bottom: 1px solid rgba(0,0,0,0.06); /* subtle grounding line */
    padding: 1.1rem 1.2rem 0.9rem;
    margin: 1.4rem 0;
    font-size: 1.02rem;
    line-height: 1.55;
    border-radius: 0 6px 6px 0;
}



.pro-tip-box a:hover {
    color: #084298;
    border-bottom-color: currentColor;
}


.pro-tip-box .create-account-btn + div {
    margin-top: 0.15rem;
}




/* ==========================================================================
   7. TOPICS PORTAL FINAL STYLES (Mainindex.asp)
   ========================================================================== */

/* Utility classes */
.text-center { text-align: center; }
.mb-15 { margin-bottom: 15px; }
.mt-30 { margin-top: 30px; }
.max-650 { max-width: 650px; margin-left: auto; margin-right: auto; }

/* Keep the hub clean (no purple visited links) */
.hub-container a:visited { color: #333; }
.hub-container .game-card:visited { color: #333; }
.hub-container a:hover { color: #0056b3; }

/* Prose links should still look like links even when visited */
.container p a:visited,
.container li a:visited,
.container .hub-intro a:visited { color: #0b5ed7; }


/* Feature card grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 30px;
}

.game-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #28a745;
}

/* Accessibility focus states */
.game-card:focus,
.game-card:focus-visible {
    outline: 3px solid #007bff;
    outline-offset: 3px;
}

.card-icon { font-size: 32px; margin-bottom: 10px; display: block; }
.card-title { font-size: 1.1rem; font-weight: bold; margin-bottom: 5px; color: #0056b3; display: block; }
.card-desc { font-size: 0.95rem; color: #666; margin-bottom: 15px; line-height: 1.4; }
.card-btn {
    background-color: #f8f9fa;
    color: #333;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    display: inline-block;
}
.game-card:hover .card-btn { background-color: #28a745; color: white; border-color: #28a745; }

/* Hub lists (rounded card style) */
.hub-list {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    margin-bottom: 25px;
}

.hub-list li {
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.hub-list li:hover {
    border-color: #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.hub-list a {
    font-weight: 700;
    color: #0056b3;
    text-decoration: none;
    display: block;
}

.hub-desc {
    display: block;
    font-size: 0.95rem;
    color: #555;
    margin-top: 3px;
    line-height: 1.4;
}

/* Details blocks */
details.hub-details {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 5px 15px;
    margin-bottom: 25px;
    transition: all 0.2s ease;
}
details.hub-details[open] {
    background: #fdfdfd;
    border-color: #ccc;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding-bottom: 15px;
}
details.hub-details summary {
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
    padding: 10px 0;
    outline: none;
}

/* Panels */
.hub-panel {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.hub-panel h2 { margin-top: 0; color: #333; }
.hub-panel p { color: #555; }

.hub-primary-btn {
  display: inline-block;
  background: #0d6efd;       /* blue */
  color: #ffffff !important; /* force white text */
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 10px;
  line-height: 1.2;
}

.hub-primary-btn:hover,
.hub-primary-btn:focus {
  background: #0b5ed7;
  color: #ffffff !important;
  text-decoration: none;
}



.gym-intro{ margin:10px auto; }

/* Brain gym chip list */
.gym-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.gym-list li {
    background: white;
    border: 1px solid #ccc;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    transition: transform 0.2s, background-color 0.2s, border-color 0.2s;
}

.gym-list li a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

.gym-list li:hover {
    background: #f0f8ff;
    border-color: #007bff;
    transform: translateY(-2px);
}

/* Responsive section images (default: no forced crop) */
.section-hero-img{
  width: 100%;
  max-width: 800px;
  height: auto;
  display: block;
  margin: 14px auto;
  border-radius: 10px;
  border: 1px solid #e6e6e6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Smaller section images */
.section-hero-small{ max-width: 500px; }




/* Breadcrumb centering */
.breadcrumbs p { text-align: center; margin-top: 0.6rem; }



/* Featured gym chips (replaces inline styles in mainindex.asp) */
.chip {
  border: 2px solid #ccc;
  background: #fff;
}

.chip-green {
  border-color: #28a745;
  background: #e8f5e9;
}

.chip-blue {
  border-color: #007bff;
  background: #e3f2fd;
}

.chip-link { color: #333; }
.chip-link-green { color: #2e7d32; }
.chip-link-blue { color: #0056b3; }



/* Top hub image: shallow banner (desktop) */
.hub-hero-thumb{
  width: 100%;
  max-width: 560px;
  height: 120px;        /* <-- key */
  object-fit: cover;
  object-position: center 35%; /* moves crop up a bit */
  display: block;
  margin: 10px auto 18px auto;
  border-radius: 10px;
  border: 1px solid #e6e6e6;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Mobile: allow a bit more height */
@media (max-width: 600px){
  .hub-hero-thumb{
    max-width: 100%;
    height: 170px;
  }
}


.panel-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.panel-link:hover strong {
  text-decoration: underline;
}

/* =========================================================
   HUB IMAGE SYSTEM (Chess Topics & Guides)
   ========================================================= */

/* Main hub decorative ribbon (wide, compact) */
.hub-hero-compact {
  display: block;
  width: 100%;
  max-width: 1200px;
  height: 120px;
  margin: 16px auto 22px auto;

  object-fit: cover;
  object-position: center;
  border-radius: 14px;
}

/* Section support images (non-dominant, editorial) */
.hub-section-img {
  display: block;
  width: 100%;
  max-width: 760px;
  height: 220px;

  margin: 12px auto 16px auto;
  border-radius: 12px;

  object-fit: cover;
}

@media (max-width: 640px) {
  .hub-hero-compact {
    height: 90px;
    border-radius: 10px;
  }

  .hub-section-img {
    height: 160px;
    border-radius: 10px;
  }
}

/* ==========================================================================
   8. SAFE IMPROVEMENTS (Overrides only — no class renames, no removals)
   ========================================================================== */


/* Course cards (override global inline <a>) */
.course-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

a.course-card{
  display: block;
  padding: 12px 14px;
  background: #f9f7f3;        /* warm off-white */
  border-radius: 8px;
  text-decoration: none;
  color: #1f5fbf;             /* softer blue */
  font-weight: 700;
  line-height: 1.4;
}
a.course-card:hover{
  background: #f2efe9;
  transform: translateY(-1px);
}






/* --- 8.1 Inline links in article content (prose only)
   Clean colour-based links without underlines */
.container p a,
.container li a,
.container .hub-intro a {
  color: #0b5ed7;              /* calm, accessible blue */
  text-decoration: none;      /* no underline */
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: normal;        /* allow wrap in text blocks */
}

.container p a:hover,
.container li a:hover,
.container .hub-intro a:hover {
  color: #084298;              /* darker on hover */
  border-bottom-color: currentColor;
}




/* Don’t underline “UI links” that look like buttons/tiles/chips */
.gym-list a,
ul.border-style a,
ul.grid-list a,
.game-card,
.game-card a,
.hub-list a,
.panel-link,
.panel-link a {
  text-decoration: none !important;
}



/* Preserve “no underline” look for button-style links and cards */
a.create-account-btn,
a.secondary-course-btn,
.hub-primary-btn,
.game-card,
.hub-list a {
  text-decoration: none !important;
}

/* --- 8.2 Consistent keyboard focus across interactive elements */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.hub-primary-btn:focus-visible,
.create-account-btn:focus-visible,
.secondary-course-btn:focus-visible,
.hub-list a:focus-visible,
.gym-list li a:focus-visible,
.panel-link:focus-visible {
  outline: 3px solid #007bff;
  outline-offset: 3px;
  border-radius: 8px;
}

/* --- 8.3 Improve long-word wrapping (prevents mobile overflow from URLs/FEN/etc.) */
p, li, h1, h2, .hub-desc, .card-desc {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* --- 8.4 Make container padding slightly friendlier on narrow screens */
@media (max-width: 420px) {
  .container { padding: 16px; }
  footer { padding: 16px; }
}

/* --- 8.5 Smooth heading scaling on modern browsers (falls back safely) */
h1 { font-size: clamp(1.55rem, 2.2vw + 1rem, 1.7rem); }
h2 { font-size: clamp(1.2rem, 1.2vw + 1rem, 1.3rem); }

/* Keep your mobile “Big Readability Mode” intact, but reduce accidental layout issues */
@media (max-width: 600px) {
  /* allow links inside text to wrap even if other rules set nowrap */
  .container p a, .container li a { white-space: normal; }

  /* chips/grids shouldn’t force overflow */
  .games-grid { grid-template-columns: 1fr; }
  ul.grid-list, ul.border-style { grid-template-columns: 1fr; }
}


/* === Guide membership cards === */
.cw-guide-membership {
  margin: 14px 0;
  padding: 14px 16px;
  background: #fffaf2;
  border: 1px solid #e6d9bf;
  border-radius: 8px;
}

.cw-guide-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.cw-guide-desc {
  font-size: 16px;
  line-height: 1.45;
}

.cw-guide-compact {
  margin-top: 8px;
  font-size: 15px;
  opacity: 0.9;
}









