/* Sizes are in rem and keep the 1440px design up to 1440px wide; past that the whole page
   grows with the screen, so wide and 4K monitors get the same layout, just bigger. */
html { font-size: 100%; }
@media (min-width: 1441px) { html { font-size: 1.1111vw; } }

/* One centred 74rem column with 3rem gutters, shared by the nav, hero, sections and footer.
   Phones keep each element's own padding. */
@media (min-width: 861px) {
  .mil-gutter { padding-left: max(3rem, calc((100% - 74rem) / 2)) !important; padding-right: max(3rem, calc((100% - 74rem) / 2)) !important; }
}

/* Additions for the dynamic lists (lawyers carousel, organization grid). */
.mil-status { color: rgba(251, 243, 234, 0.82); font-size: 0.9375rem; margin: 0; padding: 2.5rem 0; }
.mil-status-dark { color: #5b6b73; }

.mil-counsel-card { text-align: left; }
.mil-counsel-avatar { overflow: hidden; color: #ffffff; font-weight: 700; }
.mil-counsel-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mil-counsel-name { margin-bottom: 0.75rem; overflow-wrap: anywhere; }
.mil-counsel-card.active .mil-counsel-name { color: #222222; }
.mil-counsel-areas { font-size: 0.75rem; line-height: 1.5; margin: 0 0 1.5rem; min-height: 2.25rem; color: rgba(251, 243, 234, 0.65); }
.mil-counsel-card.active .mil-counsel-areas { color: #6b6b6b; }
.mil-counsel-book { display: block; }

.org-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(11.25rem, 1fr)); gap: 1.5rem; align-items: stretch; }
.org-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.875rem; padding: 1.5rem 1rem; min-height: 10rem; border-radius: 0.875rem; background: #f7ede4; color: #102d37; text-align: center; font-weight: 600; font-size: 0.9375rem; transition: opacity .15s ease; }
a.org-card:hover { opacity: .85; }
.org-logo { width: 5.5rem; height: 5.5rem; object-fit: contain; display: block; }
.org-initial { width: 4.5rem; height: 4.5rem; border-radius: 50%; background: #102d37; color: #f7ede4; display: flex; align-items: center; justify-content: center; font-size: 1.75rem; font-weight: 700; }
.org-name { overflow-wrap: anywhere; }
.org-grid .mil-status { grid-column: 1 / -1; text-align: center; }

/* Skeleton loading: placeholders sized to match the real cards */
.mil-skel { --skel-base: #ece3da; --skel-shine: #f7f1ea; background: linear-gradient(90deg, var(--skel-base) 25%, var(--skel-shine) 50%, var(--skel-base) 75%); background-size: 200% 100%; animation: mil-shimmer 1.4s ease-in-out infinite; border-radius: 0.375rem; }
.mil-skel-card:not(.active) .mil-skel { --skel-base: rgba(255, 255, 255, 0.10); --skel-shine: rgba(255, 255, 255, 0.18); }
@keyframes mil-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.mil-skel-line { height: 0.75rem; width: 90%; margin: 0 0 0.625rem; }
.mil-skel-name { height: 1.125rem; width: 70%; margin-bottom: 1.375rem; }
.mil-skel-short { width: 55%; margin-bottom: 1.625rem; }
.mil-skel-btn { height: 2.375rem; border-radius: 0.5rem; }
.mil-skel-org { aspect-ratio: 1; box-sizing: border-box; }
.mil-skel-org .mil-skel { --skel-base: #ece0d4; --skel-shine: #fbf5ef; }
.mil-skel-logo { width: 4.5rem; height: 4.5rem; border-radius: 0.625rem; }
.mil-skel-org .mil-skel-line { width: 60%; height: 0.875rem; margin: 0; }
@media (prefers-reduced-motion: reduce) { .mil-skel { animation: none; } }

.mil-hamburger { display: none; background: none; border: 0; padding: 0.5rem; cursor: pointer; }
.mil-hamburger span { display: block; width: 1.5rem; height: 2px; margin: 0.3125rem 0; background: #fff; transition: transform .2s, opacity .2s; }
.mil-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(0.4375rem) rotate(45deg); }
.mil-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mil-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-0.4375rem) rotate(-45deg); }

/* Nav: current page marker, Directory dropdown */
.mil-nav-links { align-items: center; }
.mil-nav-links [aria-current="page"], .mil-dropdown-toggle.is-current { border-bottom: 2px solid #ffffff; padding-bottom: 0.25rem; }
/* Home is never underlined, even on the home page. */
.mil-nav-links .mil-nav-home { border-bottom: 0; padding-bottom: 0; text-decoration: none; }
.mil-nav-close { display: none; }
.mil-dropdown { position: relative; }
.mil-dropdown-toggle { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 0.375rem; }
.mil-caret { font-size: .7em; transition: transform .2s; }
.mil-dropdown.open .mil-caret { transform: rotate(180deg); }
.mil-dropdown-menu { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); padding-top: 0.75rem; min-width: 11.25rem; z-index: 10; }
.mil-dropdown-menu a { display: block; background: #ffffff; color: #102d37; font-size: 0.9375rem; font-weight: 600; padding: 0.75rem 1.125rem; white-space: nowrap; }
.mil-dropdown-menu a:first-child { border-radius: 0.5rem 0.5rem 0 0; }
.mil-dropdown-menu a:last-child { border-radius: 0 0 0.5rem 0.5rem; }
.mil-dropdown-menu a + a { border-top: 1px solid #eee5dc; }
.mil-dropdown-menu a:hover, .mil-dropdown-menu a:focus-visible, .mil-dropdown-menu a[aria-current="page"] { background: #f7ede4; }
.mil-dropdown-menu a[aria-current="page"] { border-bottom: 0; padding-bottom: 0.75rem; }
.mil-dropdown.open .mil-dropdown-menu { display: block; }
.mil-dropdown-menu { filter: drop-shadow(0 0.75rem 1.5rem rgba(16, 45, 55, 0.25)); }
@media (hover: hover) and (min-width: 701px) {
  .mil-dropdown:hover .mil-dropdown-menu { display: block; }
}

/* Mobile: links become a slide-in sidebar; Directory becomes an accordion */
@media (max-width: 700px) {
  .mil-hamburger { display: block; }
  .mil-nav-backdrop:not([hidden]) { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 20; }
  .mil-nav-links {
    display: flex !important; flex-direction: column; align-items: flex-start; gap: 1.375rem !important;
    position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; width: min(17.5rem, 80vw); box-sizing: border-box;
    padding: 4.75rem 1.75rem 1.75rem; background: #102d37; box-shadow: -0.5rem 0 1.5rem rgba(0, 0, 0, 0.3); overflow-y: auto;
    font-size: 1.0625rem !important; z-index: 21; transform: translateX(100%); visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s;
  }
  .mil-nav-links.open { transform: none; visibility: visible; transition: transform .25s ease; }
  .mil-nav-close { display: block; position: absolute; top: 1.125rem; right: 1.125rem; background: none; border: 0; color: #ffffff; font-size: 2rem; line-height: 1; padding: 0.25rem 0.5rem; cursor: pointer; }
  .mil-dropdown-menu { position: static; transform: none; padding: 0.625rem 0 0 0.875rem; min-width: 0; filter: none; }
  .mil-dropdown-menu a, .mil-dropdown-menu a + a { background: none; color: rgba(251, 243, 234, 0.85); border: 0; border-radius: 0; padding: 0.5rem 0; font-size: 0.9375rem; }
  .mil-dropdown-menu a:hover, .mil-dropdown-menu a:focus-visible { background: none; color: #ffffff; }
  .mil-dropdown-menu a[aria-current="page"] { background: none; color: #ffffff; text-decoration: underline; text-underline-offset: 0.25rem; }
  body.mil-nav-locked { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .mil-nav-links, .mil-nav-links.open, .mil-caret { transition: none !important; }
}

@media (max-width: 560px) {
  .mil-hero p,
  .mil-section p { font-size: 0.6875rem !important; }
}

/* About page */
.mil-photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; color: #5f6f75; font-size: 0.875rem; font-weight: 600; text-align: center; box-sizing: border-box; padding: 1.5rem; }
.mil-photo:has(img) { padding: 0; overflow: hidden; }
.mil-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mil-photo-tall { height: 32.5rem; }
.mil-photo-short { height: 23.75rem; }

@media (max-width: 860px) {
  .mil-rack { padding: 3rem 1.5rem 0 !important; }
  .mil-photo-tall, .mil-photo-short { height: 17.5rem; }
  .mil-heading { font-size: 2.25rem !important; }
}

@media (max-width: 560px) {
  .mil-heading { font-size: 1.875rem !important; }
}

/* "Get the Android app" badge (same look as the AutoDrafter landing footer) */
.mil-android-badge { display: inline-flex; align-items: center; gap: 0.875rem; min-height: 4rem; padding: 0.5rem 1.625rem 0.5rem 1.25rem; box-sizing: border-box; border-radius: 1.125rem; background: #000; color: #fff; border: 1px solid rgba(255,255,255,.4); text-align: left; text-decoration: none; transition: transform 160ms ease, border-color 160ms ease; }
.mil-android-badge:hover { transform: translateY(-2px) scale(1.1); }
.mil-android-badge:focus-visible { outline: 2px solid #102d37; outline-offset: 2px; }
.mil-android-badge-text { display: flex; flex-direction: column; gap: 2px; }
.mil-android-badge-small { font-size: 0.8rem; font-weight: 500; line-height: 1; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.mil-android-badge-big { font-size: 1.5rem; font-weight: 600; line-height: 1.1; letter-spacing: -.005em; }
@media (max-width: 700px) { .mil-android-badge { min-height: 4.5rem; } .mil-android-badge-big { font-size: 1.625rem; } }
@media (prefers-reduced-motion: reduce) { .mil-android-badge { transition: none; } .mil-android-badge:hover { transform: none; } }
/* Download page, before data/release.json has a url. */
.mil-android-badge.is-disabled { opacity: .45; cursor: default; pointer-events: none; }

/* Mobile: every button sits centred on its own line, whatever its section's alignment. */
@media (max-width: 860px) {
  .mil-btn { display: table !important; margin-left: auto !important; margin-right: auto !important; }
  .mil-android-badge { display: flex; width: fit-content; margin-left: auto; margin-right: auto; }}

/* Get the apps (MoreInLaw - Online / MoreInLaw - Offline) */
/* Kept compact (~40% of a 1080px-tall screen on desktop). Both cards share 4 rows (kind, name, text,
   button) through subgrid, so the buttons line up whatever the text length. */
.mil-app-card { background: #f7ede4; border-radius: 1.125rem; padding: 1.25rem 1.75rem; display: grid; grid-row: span 4; grid-template-rows: subgrid; justify-items: start; align-items: start; gap: 0.5rem; box-sizing: border-box; min-width: 0; }
.mil-app-kind { font-size: 0.75rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #8c5c46; }
.mil-app-name { font-family: 'Playfair Display', serif; font-size: 1.375rem; font-weight: 700; color: #102d37; margin: 0; }
.mil-app-text { font-size: 0.9375rem; line-height: 1.5; color: #1c2e36; margin: 0 0 0.25rem; }
.mil-app-btn { background: #102d37; color: #ffffff; font-weight: 700; font-size: 0.9375rem; padding: 0.75rem 1.75rem; border-radius: 0.875rem; }
.mil-app-btn.is-disabled { background: #e3dbd3; color: #5b6b73; cursor: default; pointer-events: none; }
.mil-apk-details { width: 100%; font-size: 0.875rem; color: #1c2e36; }
.mil-apk-details[hidden] { display: none; }
.mil-apk-details dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.375rem 1rem; margin: 0; }
.mil-apk-details dt { font-weight: 600; color: #5b6b73; }
.mil-apk-details dd { margin: 0; }
.mil-apk-details code { font-size: 0.7812rem; word-break: break-all; }
.mil-apk-details p { line-height: 1.6; margin: 0; }
@media (max-width: 860px) {
  .mil-apps { padding: 2.5rem 1.5rem !important; }
}

/* Download page: current version card + install steps */
.mil-dl-card { background: #f7ede4; border-radius: 1.125rem; padding: 2rem 1.75rem; display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; box-sizing: border-box; min-width: 0; }
.mil-steps { margin: 0; padding-left: 1.5rem; display: flex; flex-direction: column; gap: 1rem; font-size: 1rem; line-height: 1.6; color: #1c2e36; }
.mil-steps li::marker { font-weight: 700; color: #8c5c46; }
.mil-steps-note { font-size: 0.9375rem; line-height: 1.6; color: #1c2e36; margin: 0; }
.mil-cmds { margin-top: 0.75rem; padding-left: 1.25rem; }
.mil-cmds code { font-size: 0.8125rem; background: #f7ede4; padding: 0.125rem 0.375rem; border-radius: 0.375rem; word-break: break-all; }

/* Directory pages */
.mil-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.625rem; }
.mil-chips[hidden] { display: none; }
.mil-chip { background: #f7ede4; color: #102d37; border: 1px solid #e3d6ca; border-radius: 62.4375rem; padding: 0.5rem 1rem; font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.mil-chip:hover { border-color: #8c5c46; }
.mil-chip[aria-pressed="true"] { background: #102d37; color: #ffffff; border-color: #102d37; }
.mil-directory-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(13.75rem, 1fr)); gap: 1.5rem; }
.mil-directory-grid .mil-counsel-card { width: auto; box-shadow: 0 0.5rem 1.5rem rgba(16, 45, 55, 0.12); border: 1px solid #efe6dd; border-top: 0.1875rem solid #C9A24F; }
.mil-directory-grid .mil-status { grid-column: 1 / -1; text-align: center; }

/* Services page */
.mil-svc-card { background: #ffffff; border-radius: 1.75rem; padding: 2rem 1.75rem 2.25rem; box-sizing: border-box; box-shadow: 0 0.5rem 0.875rem rgba(16, 45, 55, 0.28); display: flex; flex-direction: column; }
.mil-svc-title { font-size: 1.625rem; font-weight: 700; color: #102d37; line-height: 1.2; margin: 0 0 1.125rem; }
.mil-svc-desc { font-size: 1rem; line-height: 1.45; color: #14202a; margin: 0 0 0.875rem; min-height: 2.875rem; }
.mil-svc-art { display: flex; justify-content: center; margin: 2px 0 1.25rem; }
.mil-svc-get { align-self: center; width: 12.5rem; text-align: center; color: #ffffff; font-weight: 600; font-size: 1.25rem; letter-spacing: .5px; padding: 0.625rem 0; border-radius: 0.75rem; margin: 0 0 1.5rem; }
.mil-svc-soon { display: block; cursor: default; }
.mil-svc-feat-label { font-size: 0.8125rem; color: #14202a; margin: 0 0 0.875rem; }
.mil-svc-feats { margin: 0; padding-left: 1.25rem; font-size: 0.8438rem; line-height: 1.45; color: #14202a; }
.mil-svc-feats li { margin: 0 0 0.25rem; }
@media (max-width: 1100px) {
  .mil-svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 860px) {
  .mil-svc-band { padding: 4rem 1.5rem !important; }
}
@media (max-width: 560px) {
  .mil-svc-grid { grid-template-columns: minmax(0, 1fr) !important; }
}
