/*
Theme Name: Tuscoss Apps
Description: Minimal one-page index of apps and scripts. Posts are grouped by category and ordered by the "Order" field. Light/dark follows the system.
Author: Jago
Version: 1.2.5
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: tuscoss-apps
License: GPL-2.0-or-later
*/

:root{
  --tm-bg:#fbfbfa; --tm-card:#ffffff; --tm-text:#1f2328; --tm-muted:#5b6470;
  --tm-accent:#2f6fdb; --tm-border:#e3e5e8; --tm-on-accent:#ffffff;
  --tm-font:"Inter",system-ui,-apple-system,"Segoe UI",sans-serif;
  --tm-mono:"JetBrains Mono",ui-monospace,Consolas,monospace;
  color-scheme:light dark;
}
@media (prefers-color-scheme:dark){
  :root{ --tm-bg:#15171a; --tm-card:#1c1f23; --tm-text:#e6e8eb; --tm-muted:#9aa3ad;
    --tm-accent:#7aa7ff; --tm-border:#2c3138; --tm-on-accent:#0f1115; }
}
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--tm-bg);color:var(--tm-text);font-family:var(--tm-font);font-size:19px;line-height:1.65;-webkit-text-size-adjust:100%}
.tm-page{max-width:720px;margin:0 auto;padding:0 20px}
a{color:var(--tm-accent);text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3{line-height:1.25;letter-spacing:-.01em;margin:0 0 .4em}
code{font-family:var(--tm-mono);font-size:.85em}
img{max-width:100%;height:auto}
[id]{scroll-margin-top:1rem}

/* header */
.tm-head{display:flex;flex-direction:column;align-items:center;gap:.9rem;padding:2.6rem 0 .8rem;text-align:center}
.tm-brand{font-family:var(--tm-mono);font-size:2rem;font-weight:700;letter-spacing:-.02em;color:var(--tm-text)}
.tm-brand:hover{text-decoration:none}
.tm-nav{display:flex;flex-wrap:wrap;justify-content:center;gap:.3rem 1.1rem}
.tm-nav a{font-family:var(--tm-mono);color:var(--tm-muted);font-size:.9rem}
.tm-nav a:hover{color:var(--tm-accent)}
.tm-tagline{font-family:var(--tm-mono);font-size:.95rem;color:var(--tm-muted);margin:0 0 1rem;text-align:center}

/* sections */
.tm-section{padding:6.5rem 0 4.35rem}
.tm-tagline + .tm-section{padding-top:3rem}
.tm-section .tm-item:last-child{padding-bottom:0}
.tm-section > h2{font-family:var(--tm-mono);font-size:1.4rem;font-weight:700;letter-spacing:-.02em}

/* items */
.tm-item{padding:6.5rem 0 4.35rem}
.tm-section > h2 {margin-bottom: 1.4em; /* text-align:right; */}
.tm-section > h2 + .tm-item{padding-top:1.2rem}
.tm-title{display:flex;align-items:center;gap:.7rem}
.tm-title h3,.tm-title h1{font-size:1.25rem;font-weight:600;margin:0}
.tm-single .tm-title h1{font-size:1.6rem}
.tm-icon{width:40px;height:40px;object-fit:contain;border-radius:8px;flex:none}
.tm-desc p{margin:.5rem 0 .7rem}
.tm-links{font-family:var(--tm-mono);font-size:.85rem;display:flex;flex-wrap:wrap;gap:.3rem 1.2rem}
.tm-links a{white-space:nowrap}
.tm-links i{margin-right:.3rem}
.tm-shot{display:block;max-width:100%;max-height:300px;width:auto;height:auto;margin:1rem 0 0;border:1px solid var(--tm-border);border-radius:8px}

/* edit links (only rendered for logged-in editors) */
.tm-edit{font-size:.8rem;color:var(--tm-muted)!important;margin-left:auto;padding:.1rem .4rem;border:1px dashed var(--tm-border);border-radius:6px;white-space:nowrap}
.tm-edit:hover{color:var(--tm-accent)!important;text-decoration:none}
.tm-section > h2 .tm-edit,.tm-tagline .tm-edit{margin-left:.6rem;vertical-align:middle;font-weight:400}
.tm-cat > h2{position:relative;text-align:center}
.tm-cat > h2 > i{margin-right:.55rem;color:var(--tm-accent);font-size:.85em}
.tm-cat > h2 .tm-edit{position:absolute;right:0;top:50%;transform:translateY(-50%);font-family:var(--tm-font);margin:0}

/* single */
.tm-back{display:inline-block;margin:1rem 0 0;font-size:.95rem}
.tm-hidden-note{font-size:.85rem;color:var(--tm-muted)}

/* contact form */
.tm-form{display:grid;gap:1rem;margin-top:1rem}
.tm-form label{display:block;font-size:.95rem;margin-bottom:.3rem}
.tm-form input,.tm-form textarea{width:100%;padding:.65rem .8rem;font:inherit;font-size:1rem;color:var(--tm-text);background:var(--tm-card);border:1px solid var(--tm-border);border-radius:8px}
.tm-form input:focus,.tm-form textarea:focus{outline:2px solid var(--tm-accent);outline-offset:1px}
.tm-form button{justify-self:start;padding:.6rem 1.4rem;font:inherit;font-size:1rem;font-weight:600;color:var(--tm-on-accent);background:var(--tm-accent);border:0;border-radius:8px;cursor:pointer}
.tm-hp{position:absolute!important;left:-9999px!important;width:1px;height:1px;overflow:hidden}
.tm-notice{padding:.7rem 1rem;border-radius:8px;border:1px solid var(--tm-border);background:var(--tm-card);margin-top:1rem}
.tm-notice.is-error{border-color:#d9534f}

/* analytics nav link (admins only) */
.tm-nav a.tm-nav-admin i{margin-right:.3rem}
.tm-nav a.tm-nav-admin{border-right:1px solid var(--tm-border);padding-right:1.1rem}

/* donate */
.tm-nav a.tm-nav-donate i{margin-right:.3rem;color:#d4a300}
.tm-donate{margin:6.5rem 0 0;padding:1.6rem 1.5rem;border:1px solid var(--tm-border);border-radius:12px;background:var(--tm-card);text-align:center}
.tm-donate p{margin:0 0 1rem;color:var(--tm-text)}
.tm-donate .tm-edit{margin-left:.6rem}
.tm-donate-btn{display:inline-block;padding:.6rem 1.4rem;border-radius:8px;background:#ffdd00;color:#000!important;font-weight:600}
.tm-donate-btn:hover{text-decoration:none;filter:brightness(.95)}
.tm-donate-btn i{margin-right:.45rem}

/* footer */
.tm-foot{padding:0 0 3rem;color:var(--tm-muted);font-size:.9rem;margin-top:6.5rem}
.tm-foot a{color:var(--tm-muted)}

@media (max-width:600px){
  body{font-size:17px}
  .tm-head{padding-top:1.6rem}
  .tm-item{padding:4.6rem 0 3.5rem}
  .tm-section{padding:4.6rem 0 3.5rem}
  .tm-tagline + .tm-section{padding-top:2.4rem}
  .tm-donate,.tm-foot{margin-top:4.6rem}
}
