/* Arial resized to the web fonts' metrics (average width over Turkish text, ascent, descent), so text painted before
   Raleway / Open Sans arrive takes the same space and nothing below it jumps when they swap in. */
@font-face { font-family: 'Open Sans Fallback'; font-weight: 400; src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('LiberationSans-Regular');
  size-adjust: 103.93%; ascent-override: 102.84%; descent-override: 28.19%; line-gap-override: 0%; }
@font-face { font-family: 'Open Sans Fallback'; font-weight: 700; src: local('Arial Bold'), local('Arial-BoldMT'), local('Liberation Sans Bold'), local('LiberationSans-Bold');
  size-adjust: 104.93%; ascent-override: 101.87%; descent-override: 27.92%; line-gap-override: 0%; }
@font-face { font-family: 'Raleway Fallback'; font-weight: 400; src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('LiberationSans-Regular');
  size-adjust: 102.20%; ascent-override: 91.97%; descent-override: 22.90%; line-gap-override: 0%; }
@font-face { font-family: 'Raleway Fallback'; font-weight: 700; src: local('Arial Bold'), local('Arial-BoldMT'), local('Liberation Sans Bold'), local('LiberationSans-Bold');
  size-adjust: 99.28%; ascent-override: 94.68%; descent-override: 23.57%; line-gap-override: 0%; }

:root {
  --palette-1: #FFFFFF;
  --palette-2: #379777;
  --palette-3: #F26C4F;
  --palette-4: #7ED4AD;
  /* Darker than --palette-2, which only reaches 3.59:1 on white: the small text on these controls needs 4.5:1. */
  --action-green: #2B7A60;
  --board-green: #1e7840;
  --board-green-tint: #e5f3ea;
}

.navbar {
  font-family: 'Raleway', 'Raleway Fallback', sans-serif;
  font-weight: 500;
}

.navbar a:hover {
  text-decoration-line: none;
}

.header nav[aria-label="breadcrumb"] {
  border-bottom: 1px solid #e9ecef;
  background: #fff;
}

.header nav[aria-label="breadcrumb"] .breadcrumb {
  margin-bottom: 0;
  padding: 0.6rem 0;
  font-family: 'Raleway', 'Raleway Fallback', sans-serif;
  font-size: 0.95rem;
}

.header nav[aria-label="breadcrumb"] .breadcrumb-item a {
  color: var(--palette-2);
  font-weight: 600;
  text-decoration: none;
}

.header nav[aria-label="breadcrumb"] .breadcrumb-item a:hover {
  color: var(--palette-3);
}

.header nav[aria-label="breadcrumb"] .breadcrumb-item.active {
  color: var(--palette-3);
  font-weight: 700;
}

.header nav[aria-label="breadcrumb"] .breadcrumb-item + .breadcrumb-item::before {
  color: rgba(242, 108, 79, 0.75);
}

@media (max-width: 575.98px) {
  .header nav[aria-label="breadcrumb"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .header nav[aria-label="breadcrumb"] .breadcrumb {
    white-space: nowrap;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }
}

.footer {
  font-family: 'Raleway', 'Raleway Fallback', sans-serif;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--white);

  position: absolute;
  bottom: 0;
  width: 100%;
}

.footer a:hover, .footer a {
  text-decoration-line: none;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  font-family: 'Open Sans', 'Open Sans Fallback', sans-serif;
  text-rendering: optimizeLegibility;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 225px;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-family: 'Raleway', 'Raleway Fallback', sans-serif;
  font-weight: 500;
  line-height: 1.2;
  color: inherit;
}

.post-content h1, .post-content h2, .post-content h3, .post-content h4, .post-content h5, .post-content h6,
.post-content .h1, .post-content .h2, .post-content .h3, .post-content .h4, .post-content .h5, .post-content .h6 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}

h1, .h1 {
  font-weight: 700;
  font-size: 3.0rem;
}

h2, .h2 {
  font-weight: 700;
  font-size: 1.8rem;
}

h3, .h3 {
  font-weight: 600;
  font-size: 1.6rem;
}

h4, .h4 {
  font-size: 1.4rem;
}

h5, .h5 {
  font-size: 1.25rem;
}

h6, .h6 {
  font-size: 1rem;
}

.bg-site {
  background: var(--palette-1);
}

.bg-palette-1 {
  background: var(--palette-1);
}

.bg-palette-2 {
  background: var(--palette-2);
}

.bg-palette-3 {
  background: var(--palette-3);
}

.bg-palette-4 {
  background: var(--palette-4);
}

.text-palette-1 {
  color: var(--palette-1);
}

.text-palette-2 {
  color: var(--palette-2);
}

.text-palette-3 {
  color: var(--palette-3);
}

.text-palette-4 {
  color: var(--palette-4);
}

.listing-image{
  /* Keep puzzle/category cards visually consistent across breakpoints */
  display: block;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4 / 5;
  height: auto;
  object-fit: cover;
  margin-left: auto;
  margin-right: auto;
}

/* Detail hero. The cover, the title block, the downloads and the prev/next row are siblings in one grid so
   that the downloads can span both columns on a phone while sitting beside the cover on wider screens. */
.detail-hero {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  column-gap: 1rem;
  row-gap: 1rem;
  align-items: center;
  margin-top: 1.25rem;
}

.detail-hero-cover {
  grid-column: 1;
  grid-row: 1;
}

.detail-hero-cover .listing-image {
  max-width: 120px;
}

.detail-hero-body {
  grid-column: 2;
  grid-row: 1;
}

.detail-downloads,
.detail-nav {
  grid-column: 1 / -1;
}

/* Not 768px: there .col-md-8 is only 456px wide, so a 280px cover would leave the buttons 136px. */
@media (min-width: 992px) {
  .detail-hero {
    grid-template-columns: 280px minmax(0, 1fr);
    /* The cover spans every row, so without a 1fr last row its height is shared out between them and
       opens a gap under the title. */
    grid-template-rows: auto auto 1fr;
    column-gap: 2.5rem;
    row-gap: 1.25rem;
    align-items: start;
    margin-top: 2rem;
  }

  /* Across all three rows declared above, so the 1fr one takes its extra height. */
  .detail-hero-cover {
    grid-row: 1 / -1;
  }

  .detail-hero-cover .listing-image {
    max-width: 280px;
  }

  .detail-hero-body,
  .detail-downloads,
  .detail-nav {
    grid-column: 2;
  }

  .detail-downloads {
    grid-row: 2;
  }

  .detail-nav {
    grid-row: 3;
  }
}

.detail-eyebrow {
  font-family: 'Raleway', 'Raleway Fallback', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--action-green);
  text-decoration: none;
}

.detail-title {
  margin: 0.375rem 0 0.625rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #212529;
}

@media (min-width: 992px) {
  .detail-title {
    font-size: 2.5rem;
  }
}

.detail-meta {
  margin-bottom: 0;
  color: #495057;
}

.detail-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.detail-dl {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  padding: 0.75rem 1.5rem;
  text-align: left;
}

.detail-dl-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
}

/* Lines up with the label's text rather than its icon. */
.detail-dl-sub {
  padding-left: 1.875rem;
  font-size: 0.875rem;
}

.detail-dl-primary,
.detail-dl-primary:hover,
.detail-dl-primary:focus {
  background: var(--action-green);
  border-color: var(--action-green);
  color: #fff;
}

.detail-dl-secondary {
  background: #fff;
  border-color: var(--action-green);
  color: var(--action-green);
}

.detail-dl-secondary:hover,
.detail-dl-secondary:focus {
  background: var(--action-green);
  border-color: var(--action-green);
  color: #fff;
}

.detail-dl:focus {
  box-shadow: 0 0 0 .25rem rgba(43, 122, 96, .5);
}

.detail-nav {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 0.875rem;
  border-top: 1px solid #dee2e6;
}

.detail-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 44px;
  font-weight: 700;
  color: var(--action-green);
  text-decoration: none;
}

.detail-nav-link:hover {
  color: #1f5a46;
}

.detail-nav-next {
  margin-left: auto;
}

@media (max-width: 991.98px) {
  .detail-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .detail-downloads {
    flex-direction: column;
  }

  .detail-dl {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 0 1rem;
  }

  .detail-dl-sub {
    padding-left: 0;
  }
}

@media (min-width: 1600px) {
  .container {
    max-width: calc(100% - 200px);
    margin-left: 100px;
    margin-right: 100px;
  }
}

.category-icon::before {
  display: inline-block;
  content: "";
  background-image: url("../bootstrap-icons/alarm.svg");
  background-repeat: no-repeat;
  background-size: 1rem 1rem;
}

.listing-designator {
  border-left: 5px solid var(--palette-3);
  padding-left: 1rem;
}

hr {
  border: 1px solid lightgray;
}

.section-divider {
  border: 0;
  border-top: 1px solid #dee2e6;
  margin: 3rem 0 1.75rem;
  opacity: 1;
}

.section-heading {
  padding-bottom: 0.4rem;
}

.section-heading::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin: 0.5rem auto 0;
  background: var(--palette-3);
  border-radius: 2px;
}

/* Interactive Sudoku walkthrough player — shared by blog posts and the puzzle detail page. */
.swt-widget {
  margin: 1.5rem auto;
  max-width: 460px;
  text-align: center;
}

.swt-grid {
  width: 100%;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.4rem;
}

.swt-caption {
  min-height: 2.6em;
  margin-top: 0.6rem;
  color: #374151;
  font-size: 0.98rem;
  line-height: 1.35;
}

.swt-guide-link {
  display: inline-block;
  margin-top: 0.15rem;
  color: var(--board-green);
  font-size: 0.88rem;
  text-decoration: none;
}

.swt-guide-link:hover {
  text-decoration: underline;
}

.swt-guide-link[hidden] {
  display: none;
}

.swt-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.swt-btn {
  min-width: 2.4rem;
  padding: 0.25rem 0.6rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--board-green);
  background: #ffffff;
  border: 1px solid var(--board-green);
  border-radius: 0.35rem;
  cursor: pointer;
}

.swt-btn:hover:not(:disabled) {
  background: var(--board-green-tint);
}

.swt-btn:disabled {
  color: #9ca3af;
  border-color: #d1d5db;
  cursor: default;
}

.swt-counter {
  min-width: 3.5rem;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

/* Detail-page per-puzzle "adım adım" hint ladder (lazy-loaded into a collapsible row). */
.swt-hint-row > td {
  background: #ffffff;
}

/* Interactive Tents & Trees walkthrough player (see js/tents-walkthrough.js) — mirrors the Sudoku one. */
.twt-widget {
  margin: 1.5rem auto;
  max-width: 460px;
  text-align: center;
}

.twt-grid {
  width: 100%;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.4rem;
}

.twt-caption {
  min-height: 2.6em;
  margin-top: 0.6rem;
  color: #374151;
  font-size: 0.98rem;
  line-height: 1.35;
}

.twt-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.twt-btn {
  min-width: 2.4rem;
  padding: 0.25rem 0.6rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--board-green);
  background: #ffffff;
  border: 1px solid var(--board-green);
  border-radius: 0.35rem;
  cursor: pointer;
}

.twt-btn:hover:not(:disabled) {
  background: var(--board-green-tint);
}

.twt-btn:disabled {
  color: #9ca3af;
  border-color: #d1d5db;
  cursor: default;
}

.twt-counter {
  min-width: 3.5rem;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

/* Interactive Amiral Battı (Battleships) walkthrough player (see js/battleships-walkthrough.js) — mirrors
   the Tents one; the palette is the sea-blue of the puzzle art rather than the tents green. */
.bwt-widget {
  margin: 1.5rem auto;
  max-width: 460px;
  text-align: center;
}

.bwt-grid {
  width: 100%;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.4rem;
}

.bwt-fleet {
  margin-top: 0.5rem;
  color: #6b7280;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.bwt-caption {
  min-height: 2.6em;
  margin-top: 0.4rem;
  color: #374151;
  font-size: 0.98rem;
  line-height: 1.35;
}

.bwt-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.bwt-btn {
  min-width: 2.4rem;
  padding: 0.25rem 0.6rem;
  font-size: 1.1rem;
  line-height: 1;
  color: #1a5fb4;
  background: #ffffff;
  border: 1px solid #1a5fb4;
  border-radius: 0.35rem;
  cursor: pointer;
}

.bwt-btn:hover:not(:disabled) {
  background: #e2eef7;
}

.bwt-btn:disabled {
  color: #9ca3af;
  border-color: #d1d5db;
  cursor: default;
}

.bwt-counter {
  min-width: 3.5rem;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

/* Interactive Çapraz Toplama (Kakuro) walkthrough player (see js/kakuro-walkthrough.js). Same skeleton as
   the battleships one; the palette is the green of the ladder chips, and the grid gets a wider max-width
   because kakuro cells carry pencil marks and clue pairs rather than a single glyph. */
.kwt-widget {
  margin: 1.5rem auto;
  max-width: 520px;
  text-align: center;
}

.kwt-grid {
  width: 100%;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.4rem;
}

.kwt-caption {
  min-height: 2.6em;
  margin-top: 0.4rem;
  color: #374151;
  font-size: 0.98rem;
  line-height: 1.35;
}

/* The deduction chain under a kakuro frame's caption. Left-aligned inside the centred figure because
   it is read line by line, and tabular figures keep the sums from jittering between frames. No list
   markers: the lines open with their own ordinals. */
.kwt-chain {
  margin: 0.35rem auto 0;
  padding-left: 0;
  list-style: none;
  max-width: 34rem;
  color: #4b5563;
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.kwt-chain li {
  margin-bottom: 0.15rem;
}

.kwt-chain li:last-child {
  margin-bottom: 0;
  color: #1a7f37;
  font-weight: 600;
}

.kwt-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.kwt-btn {
  min-width: 2.4rem;
  padding: 0.25rem 0.6rem;
  font-size: 1.1rem;
  line-height: 1;
  color: #1a7f37;
  background: #ffffff;
  border: 1px solid #1a7f37;
  border-radius: 0.35rem;
  cursor: pointer;
}

.kwt-btn:hover:not(:disabled) {
  background: #e6f4ea;
}

.kwt-btn:disabled {
  color: #9ca3af;
  border-color: #d1d5db;
  cursor: default;
}

.kwt-counter {
  min-width: 3.5rem;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

/* Hint-ladder chips (battleships + tents + kakuro, and the sudoku play ladder): the strip is a wrapping flex row of numbers, so the
   chips are width-matched and tabular-figured to keep "1" and "10" the same size rather than ragged. */
.bwt-chip,
.twt-chip,
.kwt-chip,
.pp-chip {
  min-width: 2.6rem;
  font-variant-numeric: tabular-nums;
}

/* The open puzzle's chip stays filled. Keyed off aria-expanded rather than a class the player would have
   to toggle, so the highlight cannot drift from the state screen readers are told. #198754 is what
   btn-outline-success fills with on hover (Bootstrap 5.0 has no per-button custom properties to reuse). */
.bwt-chip[aria-expanded="true"],
.twt-chip[aria-expanded="true"],
.kwt-chip[aria-expanded="true"],
.pp-chip[aria-expanded="true"] {
  color: #fff;
  background-color: #198754;
  border-color: #198754;
}

/* Progressive enhancement: .js-only marks what does nothing without JS (the play and walkthrough sections, the
   "Çözüm" column, the play page's controls). An inline script in the shared <head> (fragments/layout.html) adds .js
   to <html> before first paint. Hiding in the no-JS state, rather than revealing under .js, leaves each element its natural display
   (block, table-cell, flex) once JS runs, and outranks rules that set it (`.pp-next-bar { display: flex }`). */
html:not(.js) .js-only {
  display: none;
}

/* detail.html draws each section's divider outside the section, so a hidden JS-only section would leave it behind. */
html:not(.js) hr.section-divider:has(+ .js-only) {
  display: none;
}

/* Shared lazy-load placeholder styling for both ladders (sudoku + tents). */
.wt-loading,
.wt-error {
  padding: 1rem;
  text-align: center;
}

.wt-retry {
  margin-left: 0.5rem;
}

/* A widget placeholder (WT.lazyMount, docs/playable-widgets-roadmap.md §4b): loading and error states sit over
   its board box, so neither changes the height the finished widget will have. */
[data-wt-board] {
  position: relative;
}

[data-wt-placeholder] button:disabled {
  opacity: 0.55;
  cursor: default;
}

.wt-host--loading [data-wt-board]::after {
  content: "Yükleniyor…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6e6e6e;
  background-image: linear-gradient(to right, #00000010 1px, transparent 1px),
    linear-gradient(to bottom, #00000010 1px, transparent 1px);
  background-size: calc(100% / 9) calc(100% / 9);
}

[data-wt-board] > .wt-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  align-content: center;
  gap: 0.5rem;
  background: #ffffffe6;
}

[data-wt-board] > .wt-error .wt-retry {
  margin-left: 0;
}

/* Category page text and level facts (category-templates/layout4.html). Links use the darker action green because
   --palette-2 reaches only 3.59:1 on white, below the 4.5:1 small text needs. */
.category-content a,
.category-techniques a,
.category-levels a {
  color: var(--action-green);
}

.category-content h2,
.category-content h3,
.category-guide-heading {
  font-weight: 700;
  color: #212529;
}

.category-content h2,
.category-guide-heading {
  font-size: 1.6rem;
  margin: 2.25rem 0 0.75rem;
}

.category-content h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
}

.category-content > :first-child {
  margin-top: 0;
}

.category-levels + .category-guide {
  margin-top: 2.25rem;
}

.category-intro {
  font-size: 1.15rem;
  max-width: 48rem;
}

.category-blurb {
  max-width: 48rem;
}

.category-blurb p {
  margin-bottom: 0.5rem;
}

.category-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.category-btn-outline {
  color: var(--action-green);
  border-color: var(--action-green);
}

.category-btn-outline:hover,
.category-btn-outline:focus {
  color: #fff;
  background: var(--action-green);
  border-color: var(--action-green);
}

.category-stat-line {
  color: #495057;
  font-size: 0.95rem;
}

.category-stat-line a {
  color: var(--action-green);
}

.category-play-callout {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 1.5rem 0 0.5rem;
  padding: 1rem 1.25rem;
  background: #f3f8f6;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
}

.category-play-board {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
}

.category-play-text {
  flex: 1 1 auto;
  min-width: 0;
}

.category-play-text h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #212529;
}

.category-play-text p {
  margin: 0;
}

.category-play-btn {
  flex: 0 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  font-weight: 700;
  color: #fff;
  background: var(--action-green);
  border-color: var(--action-green);
}

.category-play-btn:hover,
.category-play-btn:focus {
  color: #fff;
  background: #1f5a46;
  border-color: #1f5a46;
}

.category-level-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-level-nav-harder {
  margin-left: auto;
}

@media (max-width: 575.98px) {
  .category-jump .btn,
  .category-level-nav .btn {
    min-height: 44px;
  }

  .category-level-nav .btn {
    flex: 1 1 100%;
  }

  .category-play-callout {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
  }

  .category-play-board {
    width: 72px;
    height: 72px;
  }

  .category-play-text {
    flex-basis: calc(100% - 72px - 1rem);
  }

  .category-play-btn {
    flex: 1 1 100%;
    min-height: 44px;
  }
}
