/* File: /public/assets/css/main.css */
:root {
  --max: 960px;
  --gap: 1rem;
  --radius: 12px;
  --border: #eaeaea;
  --bg: #ffffff;
  --bg-soft: #f7f7f7;
  --text: #111111;
  --muted: #555555;
  --link: #1a73e8;
}

/* --- Basic reset --- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif; line-height: 1.6; color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; }

/* --- Layout --- */
.container { max-width: var(--max); margin-inline: auto; padding: 1rem; }
main.container { padding-top: 1rem; padding-bottom: 2rem; }

/* --- Header --- */
.site-header { background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.logo { font-weight: 700; text-decoration: none; color: inherit; padding: .25rem .5rem; border-radius: 8px; }
.logo:focus-visible { outline: 2px dashed var(--link); outline-offset: 2px; }

.main-nav { display: flex; gap: .75rem; flex-wrap: wrap; }
.main-nav a { text-decoration: none; color: inherit; padding: .5rem .75rem; border-radius: 10px; border: 1px solid transparent; }
.main-nav a:hover { background: #fff; border-color: var(--border); }
.main-nav a:focus-visible { outline: 2px dashed var(--link); outline-offset: 2px; }



/* --- Footer --- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); }
.site-footer p { margin: 0; color: var(--muted); }

/* --- Typography --- */
h1 { font-size: clamp(1.6rem, 3vw + 1rem, 2.25rem); margin: 0.5rem 0 0.75rem; }
h2 { font-size: clamp(1.25rem, 2vw + 0.75rem, 1.5rem); margin: 1.25rem 0 0.5rem; }
.lede { color: var(--muted); }

/* --- Links --- */
a { color: var(--link); }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px dashed var(--link); outline-offset: 2px; }

/* --- Cards / lists --- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); padding: 0; list-style: none; }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; background: #fff; }

/* --- Forms (for future converters) --- */
label { display: block; font-weight: 600; margin-bottom: .25rem; }
input[type="number"], input[type="text"], input[type="email"], input[type="search"] {
  width: 100%; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 1rem; background: #fff;
}
input:focus-visible { outline: 2px dashed var(--link); outline-offset: 2px; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .65rem .9rem; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; color: inherit; cursor: pointer; }
button:hover, .btn:hover { background: var(--bg-soft); }
button:focus-visible { outline: 2px dashed var(--link); outline-offset: 2px; }

/* Converter form grid (when you add it) */
.converter-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: .75rem; align-items: end; margin: 1rem 0; }
@media (max-width: 720px) {
  .converter-form { grid-template-columns: 1fr; }
}

/* --- Utilities --- */
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

/* --- Prefer reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
/* === Wide cards & bright backgrounds (for /speed) === */
:root {
  --card-a: #fff7c2; /* light yellow */
  --card-b: #e6f2ff; /* light blue */
  --card-c: #e8ffe6; /* light green */
  --card-d: #ffe6f0; /* light pink */
  --card-border: rgba(0,0,0,.06);
}

/* two-per-row on larger screens, one-per-row on mobile */
.grid--two { grid-template-columns: 1fr; }
@media (min-width: 760px){
  .grid--two { grid-template-columns: 1fr 1fr; }
}

/* list reset for card grids */
.cards { list-style: none; padding: 0; margin: 0; }

/* brighter cards */
.card {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 6px 18px rgba(0,0,0,.05);
}
.grid .card { background: var(--card-a); }
.grid .card:nth-child(4n+2){ background: var(--card-b); }
.grid .card:nth-child(4n+3){ background: var(--card-c); }
.grid .card:nth-child(4n+4){ background: var(--card-d); }

.card h3 { margin-top: 0; margin-bottom: .5rem; }
.card .lede { margin: 0 0 .5rem; }

/* Utilities used by converter subpages (no inline CSS) */
.mx-auto { margin-inline: auto; }
.card--narrow { max-width: 820px; }

/* Breadcrumb */
.breadcrumb { margin: .25rem 0 1rem; font-size: .95rem; }
.breadcrumb a { text-decoration: none; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); text-align: left; }
.table thead th { font-weight: 700; }

/* Home hero + search */
.hero { margin: 0 0 1rem; }
.site-search { margin: .75rem 0 1.25rem; }
.site-search input[type="search"] {
  width: 100%;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}

/* Narrow centered content blocks */
.mx-auto { margin-inline: auto; }
.card--narrow { max-width: 820px; }

/* Home category grid wider on desktop: 3 per row */
.home-cats { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ===== Header (stacked: logo on top, menu under) ===== */
.site-header { padding: .75rem 0; }
.site-header .logo { display: inline-block; }
.site-header .logo img { display: block; height: 44px; width: auto; }

.site-nav { margin-top: .5rem; }
.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
}
.menu li a {
  display: inline-block;
  text-decoration: none;
  color: inherit;
  padding: .4rem .6rem;
  border-radius: .5rem;
}
.menu li a:hover { text-decoration: underline; }
.menu li.active a,
.menu li a[aria-current="page"] {
  background: rgba(0,0,0,.06);
  font-weight: 600;
  text-decoration: none;
}
.titleinmenu {
    font-weight: bold;
    margin: 6px;
}
