/* =============================================
   長野市テニス協会 - Responsive Stylesheet
   Mobile-first design
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
  background-color: #f4f4f4;
  color: #333;
  line-height: 1.7;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: #cc0000;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* --- Site Wrapper --- */
#site-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 20px rgba(0,0,0,0.08);
}

/* =============================================
   HEADER
   ============================================= */
#site-header {
  background: #fff;
  border-bottom: 3px solid #cc0000;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.site-logo {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-decoration: none;
  color: #222;
}

.site-logo span.red { color: #cc0000; }
.site-logo span.black { color: #222; }

/* --- Hamburger Button (mobile only) --- */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 36px;
  height: 26px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 3px;
  background: #333;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-btn.open span:nth-child(1) {
  transform: translateY(11px) rotate(45deg);
}
.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.open span:nth-child(3) {
  transform: translateY(-11px) rotate(-45deg);
}

/* =============================================
   NAVIGATION
   ============================================= */
#global-nav {
  background: #222;
  width: 100%;
  /* Mobile: hidden by default, shown when .open */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

#global-nav.open {
  max-height: 300px;
}

#global-nav ul {
  display: flex;
  flex-direction: column;
}

#global-nav ul li a {
  display: block;
  padding: 14px 20px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 1px solid #444;
  text-decoration: none;
  transition: background 0.2s;
}

#global-nav ul li a:hover {
  background: #cc0000;
  color: #fff;
  text-decoration: none;
}

/* =============================================
   HERO SLIDESHOW
   ============================================= */
.hero-slideshow {
  position: relative;
  width: 100%;
  overflow: hidden;
  height: 220px;
}

.hero-panels {
  display: flex;
  height: 100%;
  gap: 2px;
}

.hero-panel {
  overflow: hidden;
  flex: 1;
}

.hero-panel--main {
  flex: 3;
}

.hero-panels-sub {
  display: none;           /* モバイルでは非表示 */
  flex-direction: column;
  flex: 2;
  gap: 2px;
}

.hero-panel--sub {
  flex: 1;
  overflow: hidden;
}

.hero-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.6s ease;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.50);
  padding: 10px 16px;
  text-align: center;
}

.hero-overlay__text {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0;
}

/* =============================================
   MAIN LAYOUT (Flexbox, mobile = single column)
   ============================================= */
#main-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* =============================================
   MAIN CONTENT (News / Information)
   ============================================= */
.main-content {
  padding: 20px 16px;
  min-width: 0;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #cc0000;
  border-bottom: 2px solid #cc0000;
  padding-bottom: 6px;
  margin-bottom: 16px;
}

/* --- News Badge --- */
.news-badge {
  display: inline-block;
  background: #cc0000;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 3px;
  margin-bottom: 12px;
}

/* --- News List --- */
.news-list {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 28px;
}

.news-item {
  border-bottom: 1px solid #eee;
  transition: background 0.15s;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item:hover {
  background: #fdf5f5;
}

/* リンクありアイテム：<a> をブロック全体に広げる */
.news-item > a {
  display: block;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* リンクなしアイテム：直接 span が並ぶ場合のパディング */
.news-item > .news-date,
.news-item > .news-text {
  padding: 12px 14px;
  display: inline-block;
  vertical-align: middle;
}

/* リンクあり・なし共通：日付と本文 */
.news-date {
  display: inline-block;
  font-size: 0.8rem;
  color: #888;
  font-weight: 600;
  margin-right: 8px;
  white-space: nowrap;
}

.news-diamond {
  color: #cc0000;
  margin-right: 4px;
}

.news-text {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- Perennial Notice --- */
.perennial-section {
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 16px;
  margin-top: 8px;
}

.perennial-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #6d2b5e;
  margin-bottom: 10px;
  border-left: 4px solid #6d2b5e;
  padding-left: 8px;
}

.perennial-section p {
  font-size: 0.9rem;
  margin-bottom: 8px;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  background: #f8f8f8;
  padding: 20px 16px;
  border-top: 3px solid #e0e0e0;
  min-width: 0;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-heading {
  background: #6d2b5e;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 4px 4px 0 0;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-heading a {
  color: #fff;
  text-decoration: none;
}

.sidebar-heading a:hover {
  text-decoration: underline;
}

.sidebar-list {
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  background: #fff;
  overflow: hidden;
}

.sidebar-list li {
  border-bottom: 1px solid #eee;
}

.sidebar-list li:last-child {
  border-bottom: none;
}

.sidebar-list li a {
  display: block;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: #333;
  transition: background 0.15s, color 0.15s;
}

.sidebar-list li a::before {
  content: "▷ ";
  color: #6d2b5e;
  font-size: 0.75rem;
}

.sidebar-list li a:hover {
  background: #f0e8ef;
  color: #6d2b5e;
  text-decoration: none;
}

/* ===== 公式LINE サイドバーセクション ===== */
.sidebar-line .sidebar-heading {
  background: #06C755;
}

.sidebar-line-body {
  background: #fff;
  border: 2px solid #06C755;
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: 14px 12px;
  text-align: center;
}

.sidebar-line-body p {
  font-size: 0.82rem;
  color: #444;
  margin-bottom: 10px;
  line-height: 1.5;
}

.sidebar-line-body .line-qr {
  display: block;
  width: 130px;
  height: 130px;
  margin: 0 auto 10px;
  border: 2px solid #06C755;
  border-radius: 8px;
  object-fit: cover;
}

.sidebar-line-body .line-add-btn {
  display: inline-block;
  background: #06C755;
  color: #fff;
  font-weight: bold;
  font-size: 0.9rem;
  padding: 9px 22px;
  border-radius: 24px;
  text-decoration: none;
  transition: background 0.2s;
}

.sidebar-line-body .line-add-btn:hover {
  background: #05a548;
  text-decoration: none;
  color: #fff;
}

/* =============================================
   FOOTER
   ============================================= */
#site-footer {
  background: #222;
  color: #aaa;
  text-align: center;
  padding: 16px;
  font-size: 0.78rem;
}

#site-footer a {
  color: #ccc;
  display: inline-block;
  margin-top: 6px;
  font-size: 0.82rem;
}

#site-footer a:hover {
  color: #fff;
}

/* =============================================
   RESPONSIVE: TABLET (768px+)
   ============================================= */
@media (min-width: 768px) {
  /* Header */
  #site-header {
    padding: 16px 24px;
  }

  .site-logo {
    font-size: 1.7rem;
  }

  /* Nav: show as horizontal bar, always visible */
  .hamburger-btn {
    display: none;
  }

  #global-nav {
    max-height: none;
    overflow: visible;
  }

  #global-nav ul {
    flex-direction: row;
  }

  #global-nav ul li a {
    padding: 14px 28px;
    border-bottom: none;
    border-right: 1px solid #444;
    font-size: 1rem;
  }

  #global-nav ul li:last-child a {
    border-right: none;
  }

  /* Layout: 2 columns */
  #main-wrapper {
    flex-direction: row;
    align-items: flex-start;
  }

  .main-content {
    flex: 1 1 0;
    padding: 24px 20px;
  }

  .sidebar {
    flex: 0 0 220px;
    width: 220px;
    border-top: none;
    border-left: 3px solid #e0e0e0;
    min-height: 100%;
    padding: 20px 14px;
  }

  /* Hero: show 3-panel collage on tablet+ */
  .hero-slideshow {
    height: 300px;
  }

  .hero-panels-sub {
    display: flex;
  }

  .hero-overlay__text {
    font-size: 1.2rem;
  }
}

/* =============================================
   RESPONSIVE: DESKTOP (1024px+)
   ============================================= */
@media (min-width: 1024px) {
  #site-header {
    padding: 20px 32px;
  }

  .site-logo {
    font-size: 2rem;
  }

  .main-content {
    padding: 28px 28px;
  }

  .sidebar {
    flex: 0 0 260px;
    width: 260px;
    padding: 24px 18px;
  }

  .hero-slideshow {
    height: 400px;
  }

  .hero-overlay__text {
    font-size: 1.4rem;
  }

  .news-text {
    font-size: 0.95rem;
  }
}

/* =============================================
   TOURNAMENT GRID (競技部 大会一覧)
   ============================================= */
.tournament-section {
  margin-bottom: 28px;
}

.tournament-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tournament-card {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e0d0e0;
  border-left: 4px solid #6d2b5e;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: #333;
  text-decoration: none;
  transition: background 0.15s, border-left-color 0.15s, color 0.15s;
  line-height: 1.4;
  min-height: 44px;
}

.tournament-card::before {
  content: "▷";
  color: #6d2b5e;
  font-size: 0.75rem;
  margin-right: 6px;
  flex-shrink: 0;
}

.tournament-card:hover {
  background: #f0e8ef;
  border-left-color: #cc0000;
  color: #6d2b5e;
  text-decoration: none;
}

/* --- Archive accordion (details/summary) --- */
.tournament-archive {
  border: 1px solid #e0d0e0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}

.tournament-archive > summary {
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  color: #6d2b5e;
  padding: 10px 14px;
  background: #f0e8ef;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.tournament-archive > summary::-webkit-details-marker {
  display: none;
}

.tournament-archive > summary::before {
  content: "▶";
  font-size: 0.7rem;
  color: #6d2b5e;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.tournament-archive[open] > summary::before {
  transform: rotate(90deg);
}

.tournament-archive > .tournament-grid {
  padding: 12px;
  background: #fff;
}

/* =============================================
   PDF PREVIEW (競技部 年間スケジュール)
   ============================================= */
.pdf-preview-section {
  margin-bottom: 28px;
}

.pdf-frame-wrapper {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  background: #fafafa;
  margin-bottom: 8px;
}

.pdf-frame-wrapper object,
.pdf-frame-wrapper iframe {
  width: 100%;
  height: 460px;
  display: block;
  border: none;
}

.pdf-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #aaa;
  gap: 10px;
  text-align: center;
  font-size: 0.9rem;
}

.pdf-placeholder .pdf-icon {
  font-size: 3rem;
  line-height: 1;
}

.pdf-pending {
  color: #bbb;
  font-size: 0.8rem;
}

.pdf-download-link {
  font-size: 0.88rem;
  text-align: right;
}

@media (min-width: 768px) {
  .tournament-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .pdf-frame-wrapper object,
  .pdf-frame-wrapper iframe {
    height: 560px;
  }
}
