body {
  background-color: powderblue;
  margin:0;
}

#page {
  width: 90%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 800px;
  margin:0 auto;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 80%;
  margin: 0;
}

/* row 1: query box + ask button */
.search-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

/* input box */
.search-form input[type=text] {
  display: flex;
  flex-direction: row;
  flex:1;
  padding: 2px;
  font-size: 16px;
  min-width: 300px;
  width: auto;          
  border-radius: 5px;
  box-sizing: border-box; /* include padding & border within width and height */
}
/* ask button */
.search-form button {
  flex-shrink: 0;
  padding: 2px 24px;
  font-size: 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  background-color: #1a73e8;
  color: white;
  margin: 0;
}

/* row 2: checkbox + message */
.location-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.location-row[hidden] {
  display: none;
}

.location-row input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.location-row label {
  white-space: nowrap;
  cursor: pointer;
  margin: 0;
}

.location-row p {
  white-space: nowrap;
  margin: 0;
}

main {
  width: 80%;
  padding: 0 16px;
  box-sizing: border-box;
}


/* BEFORE search */
#page.home #search-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  height: 100vh;
  box-sizing: border-box;
}

/* large logo */
#page.home .logo { 
  height: 40vh;   
  width: auto;
}

/* AFTER search */
#page.searched #search-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 24px;
  width:80%;
}

/* small logo */
#page.searched .logo { 
  height: 100px;   
  width: auto;
}

/* input box */
#page.searched .search-form input[type="text"] {
  padding: 2px;
  font-size: 16px;
  flex: 1;               /* take all the leftover space */
  min-width: 300px;
  width: auto; 
  border-radius: 5px;
}

#page.searched .location-row {
  display: flex;
  flex-direction: row;
}

/* Status */
#queryStatus {
  margin: 12px 0 0;
  color: #b00020;      
  min-height: 1.5em;    
  text-align: center;
}

#queryStatus:empty {
  display: none;
}

#status:empty {
  display: none;
}

#suggestion:empty {
  display: none;
  margin: 0;      
}

#location-msg {
  color: #b00020;      
  min-height: 0;    
  text-align: left;
}

#location-msg:empty {
  display: none;
}

#location-msg.ok { color: #2c532e; }

/* Status */
#status {
  margin: 12px 0 0;
  min-height: 1.5em;    
  text-align: center;
}

/* Load More button */
#load-more {
  display: block;
  margin: 16px auto 32px;   /* auto left/right centers it */
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
}

#load-more[hidden] {
  display: none;
}

/* RESULTS */ 
.url {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result {
  white-space: nowrap;
  overflow-wrap: anywhere; 
  text-overflow: ellipsis;
}

.result .title {
  display: block;
  white-space: normal;
}

.result p {
   white-space: normal;
}

.search-box { 
  position: relative; 
  flex: 1;
  min-width: 300px;
}

#autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: white;
  border: 1px solid #ddd;
  display: none;
}

.ac-item { padding: 8px 12px; cursor: pointer; }
.ac-item:hover { background: #f1f1f1; }

/* highlight style */
.result mark {
  background: none;
  font-weight: bold;
  padding: 0;
}

.crawl-cache-link {
  margin: 8px;
  color: darkslategray;
  text-decoration: none;
}