/* =========================
   edu-app-portal
   UI: 落ち着いた教育ポータル風
   ========================= */

.eap-wrap{
  --base:#ffffff;
  --base-light:#fafafa;
  --base-dark:#f5f5f5;

  --main:#1e3a5f;
  --main-light:#2d5a8f;
  --main-dark:#0f1e3a;

  --accent:#d4af37;
  --accent-light:#f4cf5f;

  --text:#2c3e50;
  --text-light:#7f8c8d;

  --border:#e8e8e8;

  --shadow: 0 4px 18px rgba(30,58,95,.10);
  --shadow-hover: 0 10px 26px rgba(30,58,95,.16);

  --radius-xl: 24px;
  --radius-lg: 18px;

  --gap: 24px;
  --maxw: 1200px;

  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 14px 40px;
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--text);
}

.eap-wrap *{ box-sizing: border-box; }

/* Controls */
.eap-controls{
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

/* Tabs bar */
.eap-tabs{
  display:flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(232,232,232,.9);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(30,58,95,.07);
  scrollbar-width: thin;
}
.eap-tabs::-webkit-scrollbar { height: 8px; }
.eap-tabs::-webkit-scrollbar-thumb { background: rgba(30,58,95,.25); border-radius: 999px; }

.eap-tab{
  flex: 0 0 auto;
  height: 54px;
  padding: 0 14px;
  border-radius: 14px;
  border: 2px solid rgba(30,58,95,.20);
  background: #fff;
  color: var(--main);
  font-weight: 900;
  letter-spacing: .02em;
  cursor: pointer;
  display:flex;
  align-items:center;
  gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  user-select: none;
  white-space: nowrap;
}
.eap-tab:active{ transform: translateY(1px); }
.eap-tab:hover{
  box-shadow: 0 10px 18px rgba(30,58,95,.12);
  transform: translateY(-1px);
}
.eap-tab.is-active{
  background: var(--main);
  border-color: var(--main);
  color: var(--accent);
  box-shadow: 0 12px 22px rgba(30,58,95,.25);
}

/* Search + count row */
.eap-row{
  display:flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(232,232,232,.9);
  box-shadow: 0 6px 18px rgba(30,58,95,.07);
}

.eap-search{
  flex: 1 1 280px;
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid var(--border);
}

.eap-search input{
  width: 100%;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  background: transparent;
}


.eap-select,
.eap-view-toggle{
  flex: 0 0 auto;
  height: 44px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--main);
  font-weight: 700;
  padding: 0 12px;
}

.eap-view-toggle{
  cursor: pointer;
}

.screen-reader-text{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.eap-chip{
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--base);
  border: 2px solid var(--border);
  color: var(--main);
  white-space: nowrap;
}

.eap-note{
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
}

/* Grid */
.eap-grid{
  margin-top: 16px;
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(3, 1fr);
}


.eap-grid.list-mode{
  display: block;
}

.eap-grid.list-mode .eap-card{
  display: flex;
  flex-direction: row;
  align-items: center;
  min-height: 120px;
  margin-bottom: 16px;
}

.eap-grid.list-mode .eap-thumb{
  width: 160px;
  height: 90px;
  flex: 0 0 160px;
  overflow: hidden;
  border-radius: 8px;
}

.eap-grid.list-mode .eap-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eap-grid.list-mode .eap-card-body{
  flex: 1;
}

.eap-grid.list-mode .eap-card-actions{
  width: 180px;
  justify-content: center;
  border-left: 1px solid rgba(232,232,232,.9);
}

/* 電子黒板など大画面 = 4列 */
@media (min-width: 1600px){
  .eap-wrap{ max-width: 1540px; }
  .eap-grid{ grid-template-columns: repeat(4, 1fr); }
}

/* スマホ = 1列 */
@media (max-width: 600px){
  .eap-grid{ grid-template-columns: 1fr; }
  .eap-tab{ height: 56px; }
}

/* Card */
.eap-card{
  border-radius: var(--radius-xl);
  background: var(--base);
  border: 1px solid rgba(232,232,232,.9);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  transform: translateY(0);
  transition: transform .18s ease, box-shadow .18s ease;
  display:flex;
  flex-direction: column;
  min-height: 260px;
}
.eap-card:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.eap-card::before{
  content:"";
  position:absolute;
  left:0; right:0; top:0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
  opacity: .95;
}

.eap-thumb{
  height: 150px;
  background: linear-gradient(135deg, rgba(30,58,95,.10), rgba(212,175,55,.08));
  display:flex;
  align-items:center;
  justify-content:center;
}

.eap-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}

.eap-thumb-ph{
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  border: 1px dashed rgba(30,58,95,.25);
  color: rgba(30,58,95,.78);
  font-weight: 900;
  font-size: 13px;
}

.eap-card-body{
  padding: 14px 14px 12px;
  display:flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.eap-card-title{
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: var(--main);
  line-height: 1.25;
}

.eap-card-desc{
  margin: 0;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
  min-height: 2.6em;
}

.eap-card-meta{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.eap-tag{
  font-size: 11px;
  font-weight: 900;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--base-dark);
  border: 1px solid var(--border);
  color: var(--main);
  white-space: nowrap;
}

.eap-card-actions{
  padding: 0 14px 14px;
  display:flex;
  justify-content: flex-end;
}

.eap-btn{
  height: 44px;
  border: none;
  border-radius: 14px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .02em;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  user-select: none;
  text-decoration: none;
  background: linear-gradient(135deg, var(--main-light), var(--main));
  color: #fff;
  box-shadow: 0 8px 18px rgba(30,58,95,.20);
  transition: transform .15s ease, box-shadow .15s ease;
}

.eap-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(30,58,95,.26);
}

.eap-btn:active{ transform: translateY(0); }

.eap-empty{
  margin-top: 18px;
  padding: 18px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.75);
  border: 1px dashed rgba(30,58,95,.25);
  color: rgba(30,58,95,.8);
  font-weight: 900;
  text-align: center;
  display:none;
}

.eap-ic{ width: 18px; height: 18px; display:inline-block; }
.eap-ic svg{ width: 18px; height: 18px; display:block; }