/* ==========================================================================
   Astah Online Store (FastSpring Classic) — Main.css
   Rewritten: 2026-08-26
   Replaces the 2014 astah.net stylesheet.

   Scope
     This file styles ONLY the FastSpring store. It must not contain
     layout rules for astah.net.

   Rules for editing
     1. Never use a bare `*` selector. FastSpring's base.css supplies
        borders, spacing and font sizes for its own widgets; a universal
        reset wipes them out and the store renders unstyled.
     2. Use the tokens in :root. Do not hard-code hex values below.
     3. Use unitless line-height. Fixed px line-height breaks at every
        other font size.
     4. Class names prefixed `store-`, `core-` and `fsc-` belong to
        FastSpring. Treat them as a third-party API: style them, don't
        rename them.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Tokens
   Palette is taken from the astah brand marks and the astah.net pricing
   page, so the store reads as the same product after the domain handoff.
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --astah-navy:        #253b7d;   /* headings, logo dark */
  --astah-navy-deep:   #1b2c5e;   /* hover / pressed */
  --astah-sky:         #4a9dd4;   /* logo light blue, accents */

  /* Action — matches the "Buy Now" pill on astah.net/pricing */
  --astah-cta:         #1a73e8;
  --astah-cta-hover:   #1257b8;
  --astah-cta-ring:    rgba(26, 115, 232, 0.35);

  /* Text */
  --ink:               #2c2c2c;
  --ink-muted:         #626262;
  --ink-faint:         #8a8a8a;

  /* Surfaces */
  --surface:           #ffffff;
  --surface-sunken:    #f7f8fa;
  --rule:              #e0e0e0;
  --rule-strong:       #c8ccd4;

  /* Status */
  --ok:                #2e7d32;
  --warn:              #b45309;
  --error:             #c62828;

  /* Type */
  --font-body: "Assistant", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Rhythm */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --radius:      6px;
  --radius-pill: 999px;

  --shell-max:   960px;
}


/* --------------------------------------------------------------------------
   2. Base
   A gentle reset. Deliberately does NOT touch border, font-size or
   vertical-align globally.
   -------------------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
}

a {
  color: var(--astah-cta);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover,
a:focus {
  color: var(--astah-cta-hover);
}

/* Visible keyboard focus everywhere. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--astah-cta);
  outline-offset: 2px;
}


/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  color: var(--astah-navy);
  line-height: 1.25;
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}

h1 { font-size: 2rem;    font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: 1.5rem;  font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.175rem;font-weight: 600; }
h4 { font-size: 1rem;    font-weight: 600; }
h5 { font-size: 0.8125rem; font-weight: 700; text-transform: uppercase;
     letter-spacing: 0.06em; color: var(--ink-muted); }

p {
  margin: 0 0 var(--space-4);
  line-height: 1.6;
  color: var(--ink-muted);
}

ul, ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.25em;
}

li { margin-bottom: var(--space-1); }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--space-5) 0;
}


/* --------------------------------------------------------------------------
   4. Page chrome
   -------------------------------------------------------------------------- */
.astah-shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.astah-header {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: var(--space-4) 0;
}

.astah-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.astah-header__logo img {
  display: block;
  width: 132px;
}

.astah-main {
  padding: var(--space-6) 0 var(--space-7);
  min-height: 45vh;
}

.astah-footer {
  background: #333333;
  color: #d6d6d6;
  padding: var(--space-6) 0;
  font-size: 0.875rem;
  line-height: 1.7;
}

.astah-footer p {
  color: inherit;
  margin: 0 0 var(--space-3);
  text-align: center;
}

.astah-footer a {
  color: #ffffff;
  text-decoration: underline;
}

.astah-footer a:hover {
  color: var(--astah-sky);
}

.astah-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
}

.astah-footer__nav li { margin: 0; }

.astah-footer__fine {
  font-size: 0.8125rem;
  color: #a9a9a9;
  max-width: 640px;
  margin-inline: auto;
}

.astah-footer__mark {
  text-align: center;
  margin: var(--space-5) 0 0;
}

.astah-footer__mark img { width: 150px; opacity: 0.85; }


/* --------------------------------------------------------------------------
   5. Product detail
   Class names below are FastSpring's own (see their template sample).
   -------------------------------------------------------------------------- */
.store-product-detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--astah-navy);
  margin-bottom: var(--space-2);
}

.store-product-detail-description-short {
  font-size: 1.0625rem;
  color: var(--ink-muted);
  line-height: 1.65;
  margin-bottom: var(--space-5);
  max-width: 62ch;
}

/* The price is the decision moment — give it weight. */
.store-product-detail-pricing {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--astah-navy);
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-2);
}

.core-section {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  background: var(--surface);
}

.core-section-header {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--astah-navy);
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--rule);
}

.core-section-body { color: var(--ink-muted); }

.core-form-field-group-header {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  margin: var(--space-6) 0 var(--space-3);
}


/* --------------------------------------------------------------------------
   6. Buttons
   The most consequential rules in this file. The previous stylesheet
   rendered every submit control as a 1px grey box, so the primary
   purchase action looked disabled.
   -------------------------------------------------------------------------- */
input[type="submit"],
button[type="submit"],
.core-js-disabled-inline {
  display: inline-block;
  background-color: var(--astah-cta);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 14px 32px;
  min-height: 46px;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

input[type="submit"]:hover,
button[type="submit"]:hover,
.core-js-disabled-inline:hover {
  background-color: var(--astah-cta-hover);
  color: #ffffff;
}

input[type="submit"]:active,
button[type="submit"]:active {
  transform: translateY(1px);
}

input[type="submit"]:disabled,
button[type="submit"]:disabled {
  background-color: var(--rule-strong);
  cursor: not-allowed;
}

/* Secondary actions: Continue Shopping, Update Coupon, Update Quantity.
   Quiet, so they never compete with the purchase action. */
input[type="button"],
button {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: 9px 18px;
  min-height: 40px;
  background-color: var(--surface);
  color: var(--astah-navy);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  cursor: pointer;
}

input[type="button"]:hover,
button:hover {
  background-color: var(--surface-sunken);
  border-color: var(--astah-navy);
}

/* "Add to Order" is rendered as a link, not a button. */
a.astah-cta,
a[href*="/add/"] {
  display: inline-block;
  background-color: var(--astah-cta);
  color: #ffffff;
  font-weight: 700;
  padding: 14px 32px;
  min-height: 46px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  text-align: center;
}

a.astah-cta:hover,
a[href*="/add/"]:hover {
  background-color: var(--astah-cta-hover);
  color: #ffffff;
}

/* FastSpring が span.store-action-title に背景画像でカートアイコンを
   差し込むため打ち消す。cart_add.png / cart_go.png の両方が使われる。 */
input[type="submit"] .store-action-title,
.core-js-disabled-inline .store-action-title,
a.store-action-command .store-action-title,
.astah-prod .button a .store-action-title {
  background-image: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
  color: inherit;
}

/* 単品購入ページ（販社向けなど）の Order Now。
   実際に表示されるのは a.store-action-command。
   同名の input[type=submit].core-js-disabled-inline も存在するが、
   JavaScript 無効時の代替要素で display:none のため触らないこと。
   display を指定すると二重に表示される。 */
a.store-action-command {
  background-color: var(--astah-cta) !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: var(--radius-pill) !important;
  padding: 14px 32px !important;
  height: auto !important;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
}

a.store-action-command:hover,
a.store-action-command:focus {
  background-color: var(--astah-cta-hover) !important;
  color: #ffffff !important;
}


/* --------------------------------------------------------------------------
   7. Forms
   44px minimum target height — the old 2px padding was unusable on touch.
   -------------------------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
select,
textarea {
  font-family: var(--font-body);
  font-size: 1rem;              /* 16px stops iOS auto-zoom on focus */
  color: var(--ink);
  background-color: var(--surface);
  padding: 11px 12px;
  min-height: 44px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-sizing: border-box;
  max-width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--astah-cta);
  box-shadow: 0 0 0 3px var(--astah-cta-ring);
  outline: none;
}

/* Quantity and coupon fields ship narrow from FastSpring. */
.store-action-input {
  width: 84px;
  min-width: 84px;
  text-align: center;
}

label {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-1);
}

/* 数量フィールド。FastSpring の base.css が padding: 1px 3px を
   指定してくるため打ち消すが、汎用の min-height:44px と二重に
   効かないよう height を明示する。 */
input[name="product:quantity"],
input.store-action-input {
  height: 44px;
  min-height: 0;
  padding: 0 8px !important;
  line-height: 44px;
  text-align: center;
  width: 64px;
  min-width: 64px;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   8. Order summary
   The old rules centred every cell in every table, including the
   checkout summary. Money reads right-aligned; labels read left.
   -------------------------------------------------------------------------- */
table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--space-4) 0;
}

th {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--rule);
}

td {
  text-align: left;
  padding: var(--space-3);
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

th:last-child,
td:last-child { text-align: right; }


/* --------------------------------------------------------------------------
   9. Responsive
   The store was fixed at 900–950px, so every phone got a zoomed-out page.
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  body { font-size: 15px; }

  .astah-shell { padding: 0 var(--space-4); }

  .astah-header__inner { justify-content: center; }
  .astah-header__logo img { width: 116px; }

  .astah-main { padding: var(--space-5) 0 var(--space-6); }

  h1 { font-size: 1.625rem; }
  h2 { font-size: 1.3125rem; }
  .store-product-detail-title { font-size: 1.375rem; }
  .store-product-detail-pricing { font-size: 1.625rem; }

  .core-section { padding: var(--space-4); }

  /* Full-width CTA is easier to hit one-handed. */
  input[type="submit"],
  button[type="submit"],
  a.astah-cta,
  a[href*="/add/"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  /* Let long order tables scroll rather than overflow the viewport. */
  table { display: block; overflow-x: auto; }
}

/* --------------------------------------------------------------------------
   9.5 商品リスト（ストアページ内の .astah-prod ブロック）

   各ストアページのテンプレートに <style> を書かず、必ずここで管理する。
   セレクタの詳細度を .astah-prod .button a のまま保つこと。
   弱めると FastSpring の base.css に負ける。
   -------------------------------------------------------------------------- */
.astah-prod {
  font-size: 1rem;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

.astah-prod ul li {
  list-style: disc;
}

.astah-prod .button {
  float: right;
  margin-left: 25px;
  text-align: center;
}

.astah-prod .button a {
  display: inline-block;
  background-color: var(--astah-cta);
  background-image: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  padding: 13px 28px;
  min-height: 44px;
  box-sizing: border-box;
  border: 0;
  border-radius: var(--radius-pill);
  text-decoration: none;
  white-space: nowrap;
  margin: 0;
  transition: background-color 0.15s ease;
}

.astah-prod .button a:hover,
.astah-prod .button a:focus {
  background-color: var(--astah-cta-hover);
  color: #ffffff;
}

/* FastSpring が span.store-action-title に背景画像で差し込む
   カートアイコン（silk/cart_add.png）を消す。 */
.astah-prod .button a img {
  display: none !important;
}

.astah-prod .button a .store-action-title {
  background-image: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.astah-prod .button a strong,
.astah-prod .button .store-action-title {
  font-size: 1rem;
  font-weight: 700;
  color: inherit;
}

.astah-prod .button .price {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--astah-navy);
}

@media (max-width: 720px) {
  .astah-prod {
    margin-bottom: 24px;
    padding-bottom: 24px;
  }

  .astah-prod .button {
    float: none;
    margin: 0 0 16px;
  }

  .astah-prod .button a {
    display: block;
    width: 100%;
  }
}


/* --------------------------------------------------------------------------
   10. Accessibility
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.astah-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
