/*--------------------------------------- */
/* RESET */
* {
 margin: 0;
 padding: 0;
 border: 0;
 font: inherit;
}

/*--------------------------------------- */
/* BASIC COMPONENTS */

/* Base card size, colors, and fonts. */
article {
  width: 640px;
  height: 360px;
  display: block;
  overflow: hidden;

  position: absolute;
  top: 0px;
  left: 0px;

  background-color: #000;
  color: #fff;

  font-family: 'Roboto';
  font-weight: 300;
  font-size: 40px;
  text-shadow: 0 1px 1px #000;

  /* By default we don't need the webview to layout all articles. Further
     down we ensure that the first card is shown. */
  visibility: hidden;
}

/* Apply the default link style (slightly bolder, no underline, white) to
   anchor tags. */
article a {
  text-decoration: none;
  color: #00fcff;
}

/* Make the first card is shown. */
article:first-of-type {
  visibility: visible;
}

/* Modifications to allow content to flow across pages. */
article.auto-paginate {
  overflow: visible;

  /* With the latest fonts, we keep the contents 40px from the top and 37px
     from the bottom of the screen in order to ensure the last line is present. */
  height: 283px;
  padding: 40px 0px 37px 0px;

  /* Actually causes the pagination. */
  -webkit-column-width: 640px;
  -webkit-column-gap: 0px;
  -webkit-column-rule: 0px solid #000;
}

/* Keeps content of pages 40px away from the left/right edges of the screen. */
article.auto-paginate > * {
  margin-left: 40px;
  margin-right: 40px;
}

/* Main content area, excluding footer. */
section {
  margin: 40px 40px 0 40px;
  padding: 0;
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 80px;
  overflow: hidden;
}

/* Remove margin on top and bottom for sections that are inside
   auto-paginating articles. */
article.auto-paginate > section {
  margin-top: 40px;
  margin-bottom: 40px;
}

/* Footer containing timestamp, auxiliary info. */
footer {
  margin: 0 40px 28px 40px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;

  font-weight: 600;
  font-size: 24px;
  line-height: 1.4em;
  overflow: hidden;
  text-overflow:ellipsis;
  white-space: nowrap;
}

/* Force footer content to be single-line, ellipsized. */
footer > div, footer > p, footer > time, footer > h1, footer > h2, footer > h3 {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Override text-minor's line height to the be the same height as the footer. This will center the text vertically. */
footer .text-minor {
  line-height: 40px;
}

footer img {
  padding: 0 10px 10px 10px;
}

footer img.left {
  padding-left: 0;
}

footer img.right {
  padding-right: 0;
}

/* Left panel content */
figure {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  overflow: hidden;
}

/** If a figure is shown, offset the section and footer to the right. */
figure ~ section {
  left: 230px;
}

figure ~ footer {
  left: 230px;
}


/*--------------------------------------- */
/* ICONS */

/* 30x30 icon size */
img.icon-small {
  margin-right: 4px;
  width: 30px;
  height: 30px;
}

/* For text sizes smaller than the icon, center the icon vertically. */
.text-x-small img.icon-small {
  vertical-align: -4px;
}

.text-small img.icon-small {
  vertical-align: -3px;
}


/*--------------------------------------- */
/* LISTS */

ul {
  list-style-type: none;
}

ol {
  list-style-position: inside;
}

ul li, ol li {
  border-bottom: 1px solid #333;
  padding: 6px 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

ul.no-border li, ol.no-border li {
  border-bottom: none;
}

/* Remove top padding for lists that are the first element in a section. */
section > ul:first-child li:first-child, ol:first-child li:first-child {
  padding-top: 0;
}

/* Remove bottom padding for lists that are the last element in a section. */
section > ul:last-child li:last-child, ol:last-child li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}


/*--------------------------------------- */
/* TABLES */

table {
  width: 100%;
  max-width: 560px;
  border-collapse: collapse;
  border-spacing: 0;
}

tr {
  border-bottom: 1px solid #333;
  padding: 0;
  max-width: 560px;
  height: 56px;
}

/* Set a smaller height for tables that are the first element in a section. */
section > table:first-child tr:first-child {
  height: 48px;
}

tr:last-child {
  border-bottom: none;
}

table.no-border tr {
  border-bottom: none;
}

td {
  color: #fff;
  padding-top: 8px;
  overflow: hidden;
  vertical-align: baseline;
  max-width: 560px;
}

td:first-child {
  padding-left: 4px;
}

td:last-child {
  padding-right: 0;
}

/* Set a padding of 1px for tables that are the first element in a section. */
section > table:first-child tr:first-child td, table:first-child th td {
  padding-top: 1px;
}

/* Remove bottom padding for tables that are the last element in a section. */
table:last-child tr:last-child td {
  padding-bottom: 0;
}

/* When justifying, align the leftmost column to the left, the rightmost column to the right
   and everything else to the center. */
table.align-justify {
  text-align: center;
}

table.align-justify td:first-child {
  text-align: left;
}

table.align-justify td:last-child {
  text-align: right;
}


/*---------------------------------------
/* MISC */

hr {
  clear: both;
  margin: 8px 0 14px;
  height: 0;
  border-top: 1px solid #333;
}


/*--------------------------------------- */
/* FLOATS */

.left {
  float: left;
}

.right {
  float: right;
}

footer time {
  float: right;
}


/*--------------------------------------- */
/* TYPOGRAPHY */

b, strong {
  font-weight: 300;
}

i, em {
  font-style: italic;
}

sup {
  font-size: 0.5em;
  font-weight: 600;
  line-height: 0.3em;
  vertical-align: super;
  padding-left: 0.1em;
}

sub {
  font-size: 0.5em;
  font-weight: 600;
  line-height: 0.3em;
  vertical-align: baseline;
  padding-left: 0.1em;
}

/* Alignment */
.align-center {
  text-align: center;
}

.align-left {
  text-align: left;
}

.align-right {
  text-align: right;
}

.align-justify {
  text-align: justify;
}

/*
  Text sizing. We use 5 sizes: 64px, 48px, 40px, 32px, 24px. We additionally have a 96px size for
  very short, important strings and a 24px size for footers. Large sizes >= 64px are Roboto Thin
  (font-weight 100), small sizes <= 24px are Roboto Regular (font-weight: 600), otherwise we use
  Roboto Light (font-weight 300).
  See //depot/google3/java/com/google/googlex/glass/common/stylesheets/device_fonts_kitkat_1.css
 */

.text-xx-large {
  font-weight: 100;
  font-size: 96px;
  letter-spacing: -1px;
  line-height: 115px;
}

.text-x-large {
  font-weight: 100;
  font-size: 64px;
  letter-spacing: -1px;
  line-height: 80px;
}

.text-large {
  font-weight: 300;
  font-size: 48px;
  letter-spacing: 0;
  line-height: 56px;
}

.text-normal {
  font-weight: 300;
  font-size: 40px;
  letter-spacing: 0;
  line-height: 48px;
}

.text-small {
  font-weight: 300;
  font-size: 32px;
  letter-spacing: 0;
  line-height: 40px;
}

.text-x-small {
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0;
  line-height: 29px;
}

/* Footer-style text. */
.text-minor {
  font-weight: 600;
  font-size: 24px;
  line-height: 29px;
}

/* Detected by the javascript to automatically size text. */
.text-auto-size {
  width: 100%;
  height: 100%;
  visibility: hidden;
}

/* Forces text onto a single line, ellipsized at the end. */
.single-line {
  height: 1.2em;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/*
  Used to create multi-line text that ends in an ellipsis. Requires specifying
  maximum number of lines on a per element basis with -webkit-line-clamp: N;
*/
.auto-overflow {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

/*---------------------------------------
/* LAYOUT */

/* Grid boundary for all layouts. */
[class^="layout-"] {
  position: relative;
  left: -29px;
  right: 29px;
  width: 618px;
  height: 100%;
  overflow: hidden;
}

[class^="layout-"]:after {
  clear: both;
}

/* Div padding and borders for all layouts. */
[class^="layout-"] > div {
  float: left;
  height: 100%;
  padding: 10px 29px 10px 30px;
  border-right: 1px solid #666;
  overflow: hidden;
}

[class^="layout-"] > div:last-child {
  border-right: none;
  padding-right: 30px;
}

/* Allow the borders to be suppressed */
[class^="layout-"].no-border > div {
  border-right: none;
  padding-right: 30px;
}

/* Layout with 2 equally-sized columns. */
.layout-two-column > div {
  width: 249px;
}

/* Layout with 3 equally-sized columns. */
.layout-three-column > div {
  width: 146px;
}

/* Layout where the 1st column is as wide as a <figure>, and the 2nd column fills the remainder. */
.layout-figure > div:first-child {
  width: 169px;
}

.layout-figure > div:nth-child(2) {
  width: 329px;
}

/* Always suppress borders in the footer. */
footer [class^="layout-"] > div {
  border: none;
  padding-right: 30px;
}


/*---------------------------------------
/* COLORS */

.red {
  color: #c33;
}

.yellow {
  color: #db1;
}

.green {
  color: #9c3;
}

.blue {
  color: #34a7ff;
}

.white {
  color: #fff;
}

.gray {
  color: #808080;
}

.muted {
  color: #808080;
}


/*---------------------------------------
/* ANSWER CARD METADATA */

.gls-ma, .gls-tts {
  display: none;
}


/*--------------------------------------- */
/* Default template styling */

/* Force text content to the top of the content area. */
article .text-xx-large:first-child {
  position: relative;
  top: -13px;
}

article .text-x-large:first-child {
  position: relative;
  top: -12px;
}

article .text-large:first-child {
  position: relative;
  top: -4px;
}

article .text-normal:first-child {
  position: relative;
  top: -5px;
}

article .text-small:first-child {
  position: relative;
  top: -7px;
}

article .text-x-small:first-child {
  position: relative;
  top: -5px;
}


/*--------------------------------------- */
/* Photo template styling */

article.photo section {
  top: 170px;
  bottom: 80px;
}

/* Overlay gradient to allow text to be read over the image. */
article.photo div.photo-overlay {
  display: block;
  position: absolute;
  top: 108px;
  left: 0;
  right: 0;
  bottom: 0;
  background: -webkit-linear-gradient(rgba(0,0,0,0.0), rgba(0,0,0,0.9));
}

article.photo .text-x-large {
  position: relative;
  top: -8px;
  white-space: nowrap;
  overflow: hidden;
}

article.photo .text-large {
  position: relative;
  top: 5px;
  white-space: nowrap;
  overflow: hidden;
}

article.photo .text-normal {
  position: relative;
  top: 11px;
  white-space: nowrap;
  overflow: hidden;
}

article.photo .text-small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  position: relative;
  overflow: hidden;
  /* Align the first line according to specs. */
  top: -7px;
}

article.photo .text-x-small {
  position: relative;
  top: -2px;
  overflow: hidden;
}

article.photo section img.left {
  margin-right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 32px;
}

article.photo section img.right {
  margin-left: 24px;
  width: 64px;
  height: 64px;
  border-radius: 32px;
}

/*
 * Properly set the width of a text element following an avatar so that
 * autosizer can properly compute the right size.
 */
article.photo img.left ~ .text-auto-size {
  max-width: 472px;
}

/*--------------------------------------- */
/* Photo mosaic styling */

/*
 * Mosaics are unordered lists with class="mosaic mosaicN", where N = the
 * number of photos in the mosaic, between 2-8 (mosaic1 is a no-op and defaults
 * to regular image placement). If placed inside a <figure>, the mosaic will be
 * a left-aligned style capable of holding up to 5 photos; otherwise, it will
 * take up the entire card background and can hold up to 1-4, 6, or 8 photos.
 * The user should specify the "background-image" style on each <li> tag to
 * provide the image, rather than using <img> tags, to ensure correct scaling
 * and centering.
 */
ul.mosaic li {
  float: left;
  display: block;
  padding: 0;
  margin: 0;
  border: none;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  width: 640px;
  height: 360px;
}

ul.mosaic.mosaic2 li {
  width: 320px;
  height: 360px;
}

ul.mosaic.mosaic3 li {
  width: 213px;
  height: 360px;
}

/* Give the rightmost image the extra pixel. */
ul.mosaic.mosaic3 li:nth-child(3n) {
  width: 214px;
}

ul.mosaic.mosaic4 li, ul.mosaic.mosaic5 li {
  width: 320px;
  height: 180px;
}

ul.mosaic.mosaic6 li, ul.mosaic.mosaic7 li {
  width: 213px;
  height: 180px;
}

/* Give the rightmost images the extra pixel. */
ul.mosaic.mosaic6 li:nth-child(3n), ul.mosaic.mosaic7 li:nth-child(3n) {
  width: 214px;
}

ul.mosaic.mosaic8 li {
  width: 160px;
  height: 180px;
}

/* Overrides for mosaics that are inside figures. */
figure ul.mosaic li {
  width: 240px;
  height: 360px;
}

figure ul.mosaic.mosaic2 li {
  width: 240px;
  height: 180px;
}

figure ul.mosaic.mosaic3 li:first-child {
  width: 240px;
  height: 180px;
}

figure ul.mosaic.mosaic3 li:nth-child(2),
figure ul.mosaic.mosaic3 li:nth-child(3) {
  width: 120px;
  height: 180px;
}

figure ul.mosaic.mosaic4 li:first-child {
  width: 240px;
  height: 180px;
}

figure ul.mosaic.mosaic4 li:nth-child(2) {
  width: 240px;
  height: 90px;
}

figure ul.mosaic.mosaic4 li:nth-child(3),
figure ul.mosaic.mosaic4 li:nth-child(4) {
  width: 120px;
  height: 90px;
}

figure ul.mosaic.mosaic5 li:first-child {
  width: 240px;
  height: 180px;
}

figure ul.mosaic.mosaic5 li:nth-child(2),
figure ul.mosaic.mosaic5 li:nth-child(3),
figure ul.mosaic.mosaic5 li:nth-child(4),
figure ul.mosaic.mosaic5 li:nth-child(5) {
  width: 120px;
  height: 90px;
}

/*--------------------------------------- */
/* Author template styling */

/* The author template provides a header at the top of the card that contains
 * an avatar image of the content author along with a primary heading (such as
 * the author's name/username) and a secondary heading.
 */
article.author header {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 70px;
  padding-left: 90px;
  margin: 40px 40px 40px 40px;
  font-size: 32px;
  font-weight: 300;
}

article.author header > img {
  position: absolute;
  left: 0;
  width: 64px;
  height: 64px;
  border-radius: 32px;
}

article.author header > h1 {
  color: #ffffff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  /* Align the first header according to spec. */
  padding-top: 1px;
  line-height: 32px;
  font-size: 24px;
  font-weight: 600;
}

article.author header > h2 {
  color: #808080;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  line-height: 32px;
  font-size: 24px;
  font-weight: 600;
}

/* Move the body section to be underneath the header. */
article.author section {
  top: 88px;
  height: 160px;
}

/* Overlay gradient to allow text to be read over the image. */

/* For cards with two lines of text (excluding footer)
 * ex: hybrid templates & those needing more bottom readability
 */
div.overlay-gradient-tall {
  display: block;
  position: absolute;
  top: 30%;
  left: 0;
  right: 0;
  bottom: 0;
  background: -webkit-linear-gradient(rgba(0,0,0,0.0), rgba(0,0,0,0.8));
}

/* A darker variant of the above gradient to improve readability. */
div.overlay-gradient-tall-dark {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: -webkit-linear-gradient(rgba(0,0,0,0.2) 30%, rgba(0,0,0,0.85) 100%);
}

/* For cards with one line of text (excluding footer)
 * ex: photos, videos, people
 */
div.overlay-gradient-medium {
  display: block;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  bottom: 0;
  background: -webkit-linear-gradient(rgba(0,0,0,0.0), rgba(0,0,0,0.8));
}

/* For cards with low text
 * ex: footer, tooltips
 */
div.overlay-gradient-short {
  display: block;
  position: absolute;
  top: 70%;
  left: 0;
  right: 0;
  bottom: 0;
  background: -webkit-linear-gradient(rgba(0,0,0,0.0), rgba(0,0,0,0.6));
}

/* For cards with full-height or near-full-height text on top of a photo or
 * mosiac. */
div.overlay-full {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
}
