/*
Theme Name: FishM Grid
Theme URI: https://fish-m.com/
Description: Лёгкая светлая тема-сетка для галерейного блога. Адаптивные карточки постов, hover-зум, быстрая отдача. Структура URL не меняется.
Author: fish-m
Version: 1.1
*/

:root{
  --bg:#f3f4f6;
  --bg2:#ffffff;
  --card:#ffffff;
  --card2:#eceef1;
  --txt:#16171c;
  --muted:#6b6c78;
  --line:#e3e5ea;
  --accent:#f2541b;
  --accent2:#d8430f;
  --radius:14px;
  --maxw:1500px;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--txt);
  font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto;display:block}

/* ---------- header ---------- */
.site-header{
  position:sticky;top:0;z-index:50;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
}
.hwrap{
  max-width:var(--maxw);margin:0 auto;padding:14px 20px;
  display:flex;align-items:center;gap:18px;
}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:20px;letter-spacing:.2px;white-space:nowrap}
.brand .dot{color:var(--accent)}
.brand img{width:28px;height:28px}
.site-desc{color:var(--muted);font-size:12.5px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.searchform{margin-left:auto;display:flex;align-items:center;flex:1;max-width:420px}
.searchform input[type=search]{
  width:100%;background:var(--bg);border:1px solid var(--line);color:var(--txt);
  padding:10px 16px;border-radius:999px;font-size:14px;outline:none;transition:border-color .15s;
}
.searchform input[type=search]:focus{border-color:var(--accent)}

/* ---------- navigation (потолще) ---------- */
.nav{background:var(--accent);border-bottom:1px solid var(--accent2)}
.nav .hwrap{padding:0 20px;gap:2px;overflow-x:auto;flex-wrap:nowrap}
.nav a{
  padding:16px 18px;color:rgba(255,255,255,.9);font-weight:700;font-size:15px;white-space:nowrap;
  border-bottom:3px solid transparent;transition:background .15s,border-color .15s,color .15s;
}
.nav a:hover,.nav a.active{color:#fff;background:rgba(0,0,0,.12);border-color:#fff}

/* ---------- layout ---------- */
.container{max-width:var(--maxw);margin:0 auto;padding:22px 20px 48px}
.page-title{font-size:22px;font-weight:800;margin:6px 2px 18px}
.page-title span{color:var(--accent)}

/* ---------- grid ---------- */
.grid{
  display:grid;gap:16px;
  grid-template-columns:repeat(auto-fill,minmax(230px,1fr));
}
.card{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  overflow:hidden;display:flex;flex-direction:column;
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}
.card:hover{transform:translateY(-4px);border-color:var(--accent);box-shadow:0 10px 26px rgba(20,22,30,.14)}
.thumb{position:relative;display:block;aspect-ratio:3/4;overflow:hidden;background:var(--card2)}
.thumb img{width:100%;height:100%;object-fit:cover;transition:transform .35s ease}
.card:hover .thumb img{transform:scale(1.06)}
.badge{
  position:absolute;right:8px;bottom:8px;
  background:rgba(0,0,0,.72);color:#fff;font-size:12px;font-weight:700;
  padding:4px 9px;border-radius:999px;backdrop-filter:blur(3px);
  display:flex;align-items:center;gap:5px;
}
.badge svg{width:13px;height:13px;fill:var(--accent)}
.thumb.noimg{display:flex;align-items:center;justify-content:center;color:var(--line)}
.thumb.noimg svg{width:54px;height:54px;fill:currentColor}
.card .meta{padding:11px 12px 13px}
.card .ttl{
  font-size:13.5px;font-weight:600;line-height:1.35;color:var(--txt);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
  min-height:2.7em;
}
.card:hover .ttl{color:var(--accent2)}

/* ---------- pagination ---------- */
.pager{display:flex;justify-content:center;gap:8px;margin:34px 0 0;flex-wrap:wrap}
.pager a,.pager span{
  min-width:40px;text-align:center;padding:9px 13px;border-radius:10px;
  background:var(--card);border:1px solid var(--line);color:var(--txt);font-weight:600;font-size:14px;
  transition:background .15s,border-color .15s;
}
.pager a:hover{border-color:var(--accent)}
.pager .current{background:var(--accent);border-color:var(--accent);color:#fff}
.pager .dots{background:none;border:none;color:var(--muted)}

/* ---------- single ---------- */
.single{max-width:900px;margin:0 auto}
.single h1.entry-title{font-size:26px;font-weight:800;line-height:1.25;margin:4px 0 6px}
.entry-sub{color:var(--muted);font-size:13px;margin-bottom:22px;display:flex;gap:14px;flex-wrap:wrap}
.entry-sub a{color:var(--accent2)}
.entry-content{font-size:15px}
.entry-content p{margin:0 0 14px}
.entry-content img{
  width:100%;height:auto;border-radius:12px;margin:0 auto 14px;border:1px solid var(--line);
}
.entry-content a{color:var(--accent2);text-decoration:underline}
.related{margin-top:40px}
.related h2{font-size:18px;font-weight:800;margin:0 0 16px}

/* ---------- footer ---------- */
.site-footer{
  border-top:1px solid var(--line);background:var(--bg2);
  padding:28px 20px;margin-top:40px;color:var(--muted);font-size:13px;
}
.fwrap{max-width:var(--maxw);margin:0 auto;display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap}
.site-footer a:hover{color:var(--txt)}

/* ---------- responsive ---------- */
@media(max-width:1100px){.grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}}
@media(max-width:760px){
  .grid{grid-template-columns:repeat(2,1fr);gap:11px}
  .hwrap{flex-wrap:wrap;gap:10px}
  .searchform{order:3;max-width:none;margin-left:0}
  .site-desc{display:none}
  /* меню «таблетками» с переносом: все пункты видны сразу */
  .nav .hwrap{flex-wrap:wrap;justify-content:center;gap:5px;padding:8px 6px;overflow:visible}
  .nav a{padding:5px 8px;font-size:11.5px;line-height:1.2;border:0;border-radius:999px;background:rgba(0,0,0,.14)}
  .nav a:hover,.nav a.active{background:#fff;color:var(--accent)}
  .card .ttl{font-size:12.5px}
  .single h1.entry-title{font-size:22px}
}
