:root{
  --max-width: 1100px;
  --pad: 12px;
  --gap: 12px;
  --border: #cfcfcf;
  --bg: #f7f7f7;
  --card: #ffffff;
  --rule: #808080;
}

*{ box-sizing: border-box; }

html, body{
  height: 100%;
}

body{
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: #111;
}

a{ color: inherit; }

del {
	text-decoration: line-through;
	text-decoration-color: red;
	text-decoration-thickness: 2px;
}

/* Page becomes a 3-row grid so Content can be fixed-height */
.page{
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--pad);
  min-height: 100dvh;
  height: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--gap);
}

/* Header: image - centered text - image (desktop).
   Mobile: logos row above title. */
header{
  background: #000;
  color: #fff;
  border-radius: 10px;
  padding: 12px;
}

.header-inner{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.header-left,
.header-right{
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-left img,
.header-right img{
  width: 150px;
  height: auto;
  display: block;
}

.header-title{
  text-align: center;
  line-height: 1.2;
  font-size: clamp(18px, 2.2vw, 30px);
  padding: 2px 0;
}

@media (max-width: 700px){
  .header-inner{
	grid-template-columns: 1fr;
	grid-template-rows: auto auto;
	justify-items: center;
  }
  .header-left img,
  .header-right img{
	width: min(180px, 44vw);
  }
  .header-left,
  .header-right{
	display: inline-flex;
  }
  .header-logos{
	display: flex;
	gap: 12px;
	justify-content: center;
	align-items: center;
  }
}

/* Content layout:
   Mobile: aside first, then main
   Desktop: main left, aside right */
.content{
  min-height: 0; /* critical for nested scrolling */
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
	"aside"
	"main";
  gap: var(--gap);
  align-items: stretch;
}

main{ grid-area: main; }
aside{ grid-area: aside; }

@media (min-width: 900px){
  .content{
	grid-template-columns: 2fr 1fr;
	grid-template-areas: "main aside";
  }
}

/* Main + Aside panels */
main, aside{
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: var(--pad);
  min-height: 0;     /* critical */
  overflow: hidden;  /* prevents panel from growing */
}

main{
  background: var(--card);
  display: flex;
  flex-direction: column;
}

aside{
  background: #eee;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Each panel gets its own internal scroller */
.main-scroll{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 2px;
}

.aside-scroll{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Day cards */
.day-list{
  display: flex;
  flex-direction: column;
  gap: 0;
}

.day-rule{
  border: 0;
  border-top: 2px solid var(--rule);
  margin: 0;
}

.day-card{
  display: grid;
  grid-template-columns: 1fr; /* mobile stacks */
  gap: 12px;
  padding: 14px 8px;
  align-items: center;
}

/* Desktop: 40/60 split */
@media (min-width: 900px){
  .day-card{
	grid-template-columns: minmax(180px, 40%) 1fr;
	column-gap: 20px;
	padding: 16px 10px;
  }
}

.day-media{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.day-media a{
  display: inline-block;
  text-decoration: none;
  font-size: 0;
  line-height: 0;
}

/* Scale images down about half by capping max-width */
.day-media img{
  width: 100%;
  max-width: 220px; /* key control; adjust 200–240 to taste */
  height: auto;
  display: block;
}

@media (max-width: 700px){
  .day-media img{
	max-width: 190px;
  }
}

.day-text{
  text-align: center;
  font-weight: 400;
  line-height: 1.3;
  font-size: 0.85rem;
}

.day-title{
  font-size: 0.95rem;
  margin: 0 0 6px 0;
}

.day-link a{
  color: #00f;
  text-decoration: underline;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Sidebar media */
.responsive-img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.map-embed iframe{
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  border: 0;
  display: block;
  border-radius: 8px;
  background: #ddd;
}

.table-section{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.table-section h3{
  margin: 0 0 8px 0;
  font-size: 1rem;
}

.table-wrap{ overflow-x: auto; }

table{
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  /* remove hard min-width that can cause squashing */
  min-width: 0;
}

th, td{
  border: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

th{
  background: #f0f0f0;
  font-weight: bold;
}

.log-block{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.log-header h3{
  margin: 0;
}

.log-header button{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
}

textarea{
  width: 100%;
  padding: 10px;
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
  background: #fff;
  height: clamp(140px, 16vh, 220px);
}

.log-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.log-modal[hidden]{
  display: none;
}

.log-modal-inner{
  width: min(1000px, 100%);
  height: min(90dvh, 100%);
  background: #f7f7f7;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

#dailyLogFull{
  flex: 1 1 auto;
  height: auto;
  font-size: 14px;
}

aside h3{
  margin: 6px 0 6px;
  font-size: 1.1rem;
}


@media (min-width: 900px){
  .page{
	height: 100dvh;
  }
}

@media (max-width: 899px){
  .page{
	display: block;
	min-height: auto;
  }

  .content{
	display: grid;
	grid-template-columns: 1fr;
	grid-template-areas:
	  "aside"
	  "main";
  }

  main, aside{
	overflow: visible;
  }

  .main-scroll,
  .aside-scroll{
	overflow: visible;
	max-height: none;
  }
}

@media (max-width: 700px){
  th, td{
	font-size: 13px;
	padding: 6px;
  }
}

@media (min-width: 900px){
  textarea{
	font-size: 12px;
  }
}


footer{
  text-align: center;
  color: #333;
  font-size: 14px;
  padding: 6px 0 2px;
}

/* Highlight today's card after auto-scroll */
.day-card {
  position: relative;
}

.day-card.today-highlight {
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.8);
  transform: scale(1.01);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.today-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: #FFD700;
  color: #000;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
