/* IK RSS Calculator - uploaded style.css */

/* Page background */
body.page-id-211 #content {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 181, 56, 0.18), transparent 24%),
    linear-gradient(180deg, #f7f5ef 0%, #f3f1ec 100%) !important;
}

/* Make Astra container wider only on RSS Calculator page */
body.page-id-211 #content .ast-container {
  width: 100% !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
}

/* Desktop width */
@media (min-width: 922px) {
  body.page-id-211 #content .ast-container {
    width: 95vw !important;
    max-width: 1400px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.page-id-211 #primary,
  body.page-id-211 .site-main,
  body.page-id-211 article.page,
  body.page-id-211 .entry-content,
  body.page-id-211 .ikcalc {
    width: 100% !important;
    max-width: none !important;
  }

  body.page-id-211 .ikcalc-total {
    width: min(95vw, 1400px) !important;
  }
}

/* Main calculator wrapper */
.ikcalc {
  --bg: #f3f1ec;
  --card: #ffffff;
  --card-soft: #f7f3ea;
  --text: #181818;
  --muted: #6f6f6f;
  --line: #ded8cb;
  --accent: #ffb538;
  --accent-dark: #c47a12;
  --danger: #991b1b;
  --danger-bg: #fee2e2;
  --table-head: #161616;

  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0 0 175px 0;
  color: var(--text);
  font-family: Arial, sans-serif;
}

.ikcalc,
.ikcalc *,
.ikcalc-total,
.ikcalc-total * {
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  max-width:100% !important;
}

/* Hero */
.ikcalc__hero {
  width: 100%;
  margin: 28px 0 24px;
}

.ikcalc__hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-weight: 600;
}

.ikcalc__hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 820px;
  font-size: 1rem;
}

/* Preset card */
.ikcalc__preset-card {
  width: 100%;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 18px 45px rgba(24, 24, 24, 0.08);
  position: relative;
  overflow: hidden;
}

.ikcalc__preset-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.ikcalc__preset-text {
  min-width: 260px;
}

.ikcalc__preset-text strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

.ikcalc__preset-text span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.ikcalc__preset-controls {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.ikcalc__control-group label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 6px;
  font-weight: 700;
}

/* Selects */
.ikcalc__level-select,
.ikcalc__preset-select {
  width: 64px;
  height: 48px;
  min-width: 64px;
  max-width: 64px;
  border: 1px solid #cfc7b8;
  border-radius: 12px;
  padding: 10px 30px 10px 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #161616 50%),
    linear-gradient(135deg, #161616 50%, transparent 50%),
    linear-gradient(180deg, #ffffff, #f4eee2);
  background-position:
    calc(100% - 16px) 21px,
    calc(100% - 11px) 21px,
    0 0;
  background-size: 5px 5px, 5px 5px, 100% 100%;
  background-repeat: no-repeat;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: 0 3px 0 #d0c6b5;
  cursor: pointer;
  text-align: left;
  line-height: 1;
}

.ikcalc__level-select:focus,
.ikcalc__preset-select:focus {
  outline: 3px solid rgba(255, 181, 56, 0.28);
  border-color: var(--accent-dark);
}

/* Buttons */
.ikcalc__action {
  min-height: 48px;
  min-width: 128px;
  border: 0 !important;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  color: #161616;
  background: linear-gradient(180deg, #ffd37a, var(--accent));
  box-shadow: 0 4px 0 var(--accent-dark), 0 10px 20px rgba(196, 122, 18, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  white-space: nowrap;
  line-height: 1;
}

.ikcalc__action:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.ikcalc__action:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--accent-dark), 0 6px 14px rgba(196, 122, 18, 0.18);
}

/* Error */
.ikcalc__error {
  display: none;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Table */
.ikcalc__table-card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow-x: hidden;
  overflow-y: visible;
  box-shadow: 0 24px 70px rgba(24, 24, 24, 0.1);
}

.ikcalc__table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.ikcalc__table {
  width: 100%;
  min-width: 1360px;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
}

.ikcalc__col-building {
  width: 27%;
}

.ikcalc__col-level {
  width: 6.5%;
}

.ikcalc__col-resource {
  width: 10.7%;
}

.ikcalc__col-resource-small {
  width: 10.2%;
}

.ikcalc__table th,
.ikcalc__table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid rgba(222, 216, 203, 0.9);
  padding: 12px;
  text-align: right;
  white-space: nowrap;
  background: var(--card);
  vertical-align: middle;
  line-height: 1.25;
}

.ikcalc__table th:last-child,
.ikcalc__table td:last-child {
  border-right: 0;
}

.ikcalc__table th {
  background: var(--table-head);
  color: #fff7e8;
  font-size: 0.88rem;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
  overflow: hidden;
}

.ikcalc__table th:first-child,
.ikcalc__table td:first-child {
  text-align: left;
}

.ikcalc__table tr:hover td {
  background: rgba(255, 181, 56, 0.08);
}

/* Building cell */
.ikcalc__building-name {
  font-weight: 600;
}

.ikcalc__building-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.ikcalc__building-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.ikcalc__building-info {
  min-width: 0;
  overflow: hidden;
}

.ikcalc__building-title {
  display: block;
  white-space: normal;
  line-height: 1.2;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.ikcalc__building-subnote {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 400;
  margin-top: 4px;
}

/* Checkbox */
.ikcalc__building-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.ikcalc__building-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ikcalc__checkmark {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid #c9b171;
  background: #fff;
  flex: 0 0 auto;
}

.ikcalc__building-toggle input:checked + .ikcalc__checkmark {
  background: linear-gradient(180deg, #ffd37a, var(--accent));
  border-color: var(--accent-dark);
}

.ikcalc__building-toggle input:checked + .ikcalc__checkmark::after {
  content: "✓";
  color: #161616;
  font-size: 0.9rem;
  font-weight: 900;
}

.ikcalc__row--disabled,
.ikcalc__table tr.is-disabled {
  opacity: 0.42;
}

.ikcalc__row--disabled td,
.ikcalc__table tr.is-disabled td {
  background: #efede7;
}

/* Quantity controls */
.ikcalc__quantity-stepper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #cfc7b8;
  border-radius: 12px;
  padding: 5px;
  margin-left: auto;
  flex: 0 0 auto;
  box-shadow: 0 3px 0 #d0c6b5;
}

.ikcalc__quantity-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border: 0 !important;
  border-radius: 8px;
  cursor: pointer;
  color: #161616;
  background: linear-gradient(180deg, #ffd37a, var(--accent));
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 2px 0 var(--accent-dark);
  line-height: 1;
  padding: 0 !important;
  display: inline-grid;
  place-items: center;
}

.ikcalc__quantity-btn:hover {
  filter: brightness(1.04);
}

.ikcalc__quantity-value {
  min-width: 24px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Resource labels/icons */
.ikcalc__resource-label {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: normal;
  line-height: 1.1;
  max-width: 100%;
  font-size: 0.88rem;
  font-weight: 600;
}

.ikcalc__resource-icon {
  width: 21px;
  height: 21px;
  display: inline-block;
  object-fit: contain;
  vertical-align: middle;
  flex: 0 0 auto;
}

/* Number cells */
.ikcalc__number-cell {
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.025em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ikcalc__zero {
  color: var(--muted);
  font-weight: 600;
}

/* Sticky total */
.ikcalc-total {
  --bg: #f3f1ec;
  --card: #ffffff;
  --card-soft: #f7f3ea;
  --text: #181818;
  --muted: #6f6f6f;
  --line: #ded8cb;

  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(95vw, 1800px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(24, 24, 24, 0.18);
  padding: 14px 16px;
  z-index: 9999;
  backdrop-filter: blur(12px);
  color: var(--text);
}

.ikcalc-total__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.ikcalc-total__header strong {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.ikcalc-total__header span {
  color: var(--muted);
  font-size: 0.85rem;
}

.ikcalc-total__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.ikcalc-total__item {
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  min-width: 0;
}

.ikcalc-total__label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
  white-space: nowrap;
  font-weight: 600;
}

.ikcalc-total__icon {
  width: 24px;
  height: 24px;
}

.ikcalc-total__item strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Very wide screens */
@media (min-width: 1500px) {
  .ikcalc__table {
    min-width: 100%;
  }

  .ikcalc__col-building {
    width: 24%;
  }

  .ikcalc__col-level {
    width: 6%;
  }

  .ikcalc__col-resource {
    width: 11.2%;
  }

  .ikcalc__col-resource-small {
    width: 10.6%;
  }
}

/* Mobile / smaller than table minimum width */
@media (max-width: 1180px) {
  body.page-id-211 #content .ast-container {
    width: 100% !important;
    max-width: none !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .ikcalc {
    width: 100%;
    padding-bottom: 375px;
  }

  .ikcalc__preset-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .ikcalc__preset-text {
    min-width: 0;
  }

  .ikcalc__preset-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ikcalc__control-group {
    width: 100%;
  }

  .ikcalc__preset-select {
    width: 100%;
    max-width: none;
  }

  .ikcalc__action {
    grid-column: 1 / -1;
    width: 100%;
  }

  .ikcalc__table-card {
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .ikcalc__table-wrap {
    overflow: visible;
  }

  .ikcalc__table,
  .ikcalc__table thead,
  .ikcalc__table tbody,
  .ikcalc__table tr,
  .ikcalc__table th,
  .ikcalc__table td,
  .ikcalc__table colgroup,
  .ikcalc__table col {
    display: block;
    width: auto;
    min-width: 0;
  }

  .ikcalc__table {
    width: 100%;
    min-width: 0;
  }

  .ikcalc__table thead,
  .ikcalc__table colgroup {
    display: none;
  }

  .ikcalc__table tr {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 12px 28px rgba(24, 24, 24, 0.08);
  }

  .ikcalc__table td {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 0;
    padding: 9px 0;
    text-align: right;
    white-space: normal;
    background: transparent;
  }

  .ikcalc__table td:first-child {
    display: block;
    padding-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(222, 216, 203, 0.9);
  }

  .ikcalc__table td::before {
    content: attr(data-label);
    color: var(--muted);
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
  }

  .ikcalc__table td:first-child::before {
    display: none;
  }

  .ikcalc__table td[data-resource]::before {
    min-height: 24px;
    display: flex;
    align-items: center;
    padding-left: 30px;
    background-repeat: no-repeat;
    background-size: 22px 22px;
    background-position: left center;
  }

  .ikcalc__table td[data-resource="food"]::before {
    background-image: url("img/food.webp");
  }

  .ikcalc__table td[data-resource="wood"]::before {
    background-image: url("img/wood.webp");
  }

  .ikcalc__table td[data-resource="stone"]::before {
    background-image: url("img/stone.webp");
  }

  .ikcalc__table td[data-resource="iron"]::before {
    background-image: url("img/iron.webp");
  }

  .ikcalc__table td[data-resource="aether"]::before {
    background-image: url("img/aether.webp");
  }

  .ikcalc__table td[data-resource="azure"]::before {
    background-image: url("img/azure.webp");
  }

  .ikcalc__building-cell {
    width: 100%;i
    flex-direction: row;
    align-items: center;
  }

  .ikcalc__building-left {
    flex: 1 1 auto;
  }

  .ikcalc__building-info {
    overflow: hidden;
  }

  .ikcalc__quantity-stepper {
    margin-left: auto;
  }

  .ikcalc__level-select {
    justify-self: end;
  }

  .ikcalc__number-cell {
    font-size: 0.95rem;
    overflow: visible;
  }

  .ikcalc-total {
    bottom: 10px;
    width: calc(100% - 20px);
  }

  .ikcalc-total__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ikcalc-total__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Mobile total bar compact header */
@media (max-width: 1180px) {
  .ikcalc-total__header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-bottom: 8px !important;
  }

  .ikcalc-total__header strong {
    font-size: 0.95rem !important;
    white-space: nowrap !important;
  }

  .ikcalc-total__header span {
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    text-align: right !important;
  }

  .ikcalc-total {
    padding: 10px 12px !important;
  }

  .ikcalc-total__grid {
    gap: 8px !important;
  }

  .ikcalc-total__item {
    padding: 8px !important;
  }

  .ikcalc-total__label {
    font-size: 0.72rem !important;
    margin-bottom: 2px !important;
  }

  .ikcalc-total__item strong {
    font-size: 0.82rem !important;
  }

  .ikcalc-total__icon {
    width: 20px !important;
    height: 20px !important;
  }
}