﻿
/*  ************************************************************************  *
 *                                  hot.css                                   *
 *  ************************************************************************  */

/*  This style sheet is specifically for pages under What's Hot? Include 
    after MASTER.CSS and DOCUMENT.CSS.  */

/*  Familiarity with the other stylesheets and their comments is assumed!  */

/*  ************************************************************************  */

/*  The presentation of statistics has its own TABLE styling. Notably, only 
    on these pages does the site have tables without borders!  */

table.Hits, 
table.Hits td, 
table.Hits th {
  border:0px;
  padding:0px 1em;
}

table.Hits th {
  padding-bottom:1em;
}

/*  Some rows tell of pages that are of less importance for being merely 
    index pages that are likely visited only on the way to others. Show the 
    link as if faded.  */

table.Hits tr.Index a {
  color:#9999FF;
}

/*  ************************************************************************  */
/*  Text Alignment  */

/*  Two column boxes (one of which is typically two columns) have numbers 
    that would ideally be right-aligned. Up to and including Internet 
    Explorer 7, we can style the table cells through the CLASS names of 
    their COL assignments (if not overridden by styling the TD element). 

    The CSS standard, however, does not trouble to include COLGROUP and COL 
    in their reckoning of which elements fit where. To style them, we must 
    specify the ordering here and refer to them by number. That this 
    violates all the otherwise ordinary advice about separating content and 
    style is grotesque but looks to be well tolerated by just about everyone 
    except me. 

    The worst case is Internet Explorer 8, which ditches the earlier 
    versions' superior but non-standard support for styling columns but does 
    not yet support the :nth-child pseudo-class (which the standard - with 
    not enough embarrassment - suggests be used instead). 

    The second worst is Internet Explorer 7 in quirks mode, which doesn't 
    know the :first-child pseuo-class. We can still face this case as an 
    emulation by later versions. It's supportable, though, by retaining the 
    COL stylings.  */

/*  ====================  */
/*  Column Specification  */

/*  To be clear, then, every TABLE in the Hits class must have columns in a 
    particular order: 

    If the class name is "Hits" alone, the expected ordering of COL is: 

        <col class="Rank" span="2"><col class="Page"><col class="Visits"> 

    Moreover, the first header cell must have colspan="2". 

    If the class name is "Hits NewSeries", there is no previous Rank for 
    the second column: 
    
        <col class="Rank"><col class="Page"><col class="Visits">

    Either way, Count exists as an old name for Visits.  */

/*  ==========  */
/*  Data Cells  */

/*  Without the complication of the NewSeries, most columns are 
    right-aligned. The exception of left-alignment is just for column 3. 
    We might think to simplify by setting right-alignment for all TD 
    elements by default, with left-alignment as a special case. This, 
    however, would override the COL styling that's needed for Internet 
    Explorer 7 quirks mode.  */

table.Hits col.Rank, 
table.Hits td:first-child, 
table.Hits td:first-child + td {
    text-align:right;
}

/* redundant while third column is left-aligned by defalt 
table.Hits col.Page, 
table.Hits td:first-child + td + td {
    text-align:left;
}
*/

table.Hits col.Visits, 
table.Hits col.Count, 
table.Hits td:first-child + td + td + td {
    text-align:right;
}

/*  Adding NewSeries to the CLASS takes one column from Rank, such that 
    left-alignment is for column 2, not 3. This needs explicit "correction" 
    when styling by numbers. Grr!  */

table.Hits.NewSeries td:first-child + td {
    text-align:left;
}

table.Hits.NewSeries td:first-child + td + td {
    text-align:right;
}

/*  ============  */
/*  Header Cells  */

/*  Modern browsers default to centre-alignment for TH. It's not a bad 
    default - and could even be welcome, given that if we want headers to 
    have the same alignment as the data cells beneath them, then modern 
    browsers would require that we repeat much of the rubbish above. 

    That said, we do explicitly want centre-alignment when the Rank spans 
    columns. We may as well trouble over left- and right-alignment too. 
    
    Internet Explorer 7 in quirks mode applies the right-alignment from the 
    COL.Rank to both TD (wanted, above) and TH (not wanted). There looks to 
    be no way to revert to the default, e.g., centre-alignment, for this one 
    TH just for its being in the one specified column box.  */

table.Hits th:first-child {
    text-align:right;
}

table.Hits th[colspan="2"] {
    text-align:center;
}

table.Hits th:first-child + th {
    text-align:left;
}

table.Hits th:first-child + th + th {
    text-align:right;
}

/*  ************************************************************************  *
 *        Copyright © 2009-2021. Geoff Chappell. All rights reserved.         *
 *  ************************************************************************  */
