/*! HTML5 Boilerplate v8.0.0 | MIT License | https://html5boilerplate.com/ */
/* main.css 2.1.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
    color: #222;
    font-size: 1rem;
    line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Vendor-prefixed and regular ::selection selectors cannot be combined:
 * https://stackoverflow.com/a/16982510/7133471
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
    background: #b3d4fc;
    text-shadow: none;
}

::selection {
    background: #b3d4fc;
    text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
    vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
    resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

/* ---------- Structure ---------- */
/* Margin/padding reset */
h1,
h2,
nav,
figure,
figcaption,
p {
    margin: 0;
    padding: 0;
}

/* Centered blocks */
body,
nav section,
p,
figcaption,
article {
    margin: 0 auto;
}

/* Other behaviours */
header h1 span {
    display: none;
}

nav li {
    /* large line height in nav to simplify navigation */
    line-height: 2rem;
}

body > header {
    margin-top: 1rem;
}

main header,
main article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    grid-gap: 1rem;
}

main header h1,
main article a.title {
    grid-column: 1 / 3;
    grid-row: 1;
}

main header h2.date {
    grid-column: 1;
    grid-row: 2;
    text-align: start;
    font-size: 0.8rem;
}

main header h2.place {
    grid-column: 2;
    grid-row: 2;
    text-align: end;
    font-size: 0.8rem;
}

main article .place {
    grid-column: 1;
    grid-row: 2;
    text-align: start;
    font-size: 0.8rem;
}

main article .date {
    grid-column: 2;
    grid-row: 2;
    text-align: end;
    font-size: 0.8rem;
}

main article a.category {
    grid-column: 1;
    grid-row: 3;
    text-align: start;
    font-size: 0.8rem;
}

main article .imgCount {
    grid-column: 2;
    grid-row: 3;
    text-align: end;
    font-size: 0.8rem;
}

footer {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    grid-gap: 1rem;
}

/* ---------- Fonts ---------- */
/* noto-serif-jp-regular - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Noto Serif JP';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/noto-serif-jp-v21-latin-regular.woff2') format('woff2'), /* Chrome 36+, Opera 23+, Firefox 39+ */
    url('../fonts/noto-serif-jp-v21-latin-regular.woff') format('woff'); /* Chrome 5+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* noto-serif-jp-700 - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Noto Serif JP';
    font-style: normal;
    font-weight: 700;
    src: url('../fonts/noto-serif-jp-v21-latin-700.woff2') format('woff2'), /* Chrome 36+, Opera 23+, Firefox 39+ */
    url('../fonts/noto-serif-jp-v21-latin-700.woff') format('woff'); /* Chrome 5+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* oleo-script-regular - latin-ext_latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Oleo Script';
    font-style: normal;
    font-weight: 400;
    src: url('/fonts/oleo-script-v14-latin-ext_latin-regular.woff2') format('woff2'), /* Chrome 36+, Opera 23+, Firefox 39+ */
    url('/fonts/oleo-script-v14-latin-ext_latin-regular.woff') format('woff'); /* Chrome 5+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* oleo-script-700 - latin-ext_latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Oleo Script';
    font-style: normal;
    font-weight: 700;
    src: url('/fonts/oleo-script-v14-latin-ext_latin-700.woff2') format('woff2'), /* Chrome 36+, Opera 23+, Firefox 39+ */
    url('/fonts/oleo-script-v14-latin-ext_latin-700.woff') format('woff'); /* Chrome 5+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* Families */
body {
    font-family: 'Noto Serif JP', serif;
}

body > header h1,
main header h1,
nav section h1,
main article a.title {
    font-family: 'Oleo Script', 'Noto Serif JP', cursive;
}

/* Sizes */
body > header h1 {
    font-size: 2.5rem;
}

main header h1 {
    padding-left: 0.5rem;
    font-size: 1.5rem;
}

main article a.title {
    font-size: 1.25rem;
}

header h2,
main figcaption,
main p {
    font-size: 1rem;
    line-height: 1.5rem;
}

footer {
    font-size: 0.8rem;
    line-height: 1.5rem;
}

footer h1 {
    font-size: 1rem;
}

/* Aligns */
h1,
body > header,
main,
figure {
    text-align: center;
}

p,
ul,
ol {
    text-align: start;
}

section h1,
section h2,
section h3 {
    margin-bottom: 1rem;
}

/* ---------- Design ---------- */
/* Elements in boxes */
figure img,
iframe,
nav section,
main figcaption,
main > p,
body > header,
main header,
main article,
main > section,
footer {
    box-shadow: 0.25em 0.25em 0.25em rgba(50, 50, 50, 0.25);
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #fcfcfc;
    max-width: calc(100vw - 2rem);
}

/* Image border must be pure white */
figure img {
    background-color: white;
}

/* Boxes colors */
html {
    background-color: #808080;
}

nav section,
main header {
    background-color: #eee;
}

main figcaption,
main > p,
main article,
main > section {
    background-color: #ddd;
}

a {
    color: darkred;
    text-decoration: none;
}

a:focus, a:hover {
    text-decoration: solid underline darkred 0.1rem;
}

a:visited {
    color: #500;
}

body > header > a,
body > header > a:hover,
body > header > a:focus,
body > header > a:visited {
    color: #222;
    text-decoration: none;
}

/* Boxes behaviour (additional rules after structure for technical reasons) */
main figcaption,
main > p {
    max-width: fit-content;
}

main a[href^="http"]::after,
main a[href^="https://"]::after {
    content: "";
    width: 0.75rem;
    height: 0.75rem;
    margin-left: 0.25rem;
    margin-bottom: 0.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z'/%3E%3Cpath fill-rule='evenodd' d='M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    display: inline-block;
}

/* ---------- Width-dependent design elements ---------- */
/* Base = smartphone = all the design above */

@media screen and (min-width: 27rem) {
    /* Not-so-narrow smartphones don’t require to shrink some texts */
    main header h2.place,
    main header h2.date,
    main article .place,
    main article .date,
    main article a.category,
    main article .imgCount {
        font-size: 1rem;
    }
}

@media screen and (min-width: 29rem) {
    /* Add emojis in header */
    header h1 span {
        display: inline;
    }
}

/* Wide screen (desktop) */
@media screen and (min-width: 42rem) {
    /* 2-columns menu */
    nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-gap: 1rem;
        align-items: center;
    }

    nav > section {
        width: 17rem;
    }

    nav li {
        /* no need for extra height */
        line-height: initial;
    }
}

@media screen and (min-width: 48rem) {
    body > header h1 {
        font-size: 3rem;
    }

    main article {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        grid-gap: 1rem;
        align-items: center;
        line-height: 1rem;
    }

    main article a.title {
        grid-column: 1 / 3;
        grid-row: 1;
        text-align: start;
    }

    main article div.imgCount {
        grid-column: 3;
        grid-row: 1;
        text-align: end;
        font-size: 1rem;
    }

    main article div.date {
        grid-column: 1;
        grid-row: 2;
        text-align: start;
        font-size: 1rem;
    }

    main article div.place {
        grid-column: 2;
        grid-row: 2;
        text-align: center;
        font-size: 1rem;
    }

    main article a.category {
        grid-column: 3;
        grid-row: 2;
        text-align: end;
        font-size: 1rem;
    }
}

@media screen and (min-width: 64rem) {
    body {
        max-width: 64rem;
    }

    main article a.title {
        font-size: 1.5rem;
    }

    /* Images page header with better style for wide-screen */
    main header h1 {
        padding-left: 0.5rem;
        font-size: 2rem;
    }

    main header {
        display: grid;
        grid-template-columns: 3fr 1fr;
        grid-gap: 1rem;
        align-items: center;
    }

    main header h1 {
        grid-column: 1;
        grid-row: 1 / 3;
        text-align: start;
    }

    main header h2 {
        text-align: end;
        line-height: 1rem;
    }

    main header h2.date {
        grid-column: 2;
        grid-row: 1;
        font-size: 1rem;
        text-align: end;
    }

    main header h2.place {
        grid-column: 2;
        grid-row: 2;
        font-size: 1rem;
    }

    /* 3-column footer */
    footer {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        grid-gap: 1rem;
        align-items: start;
    }
}


/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
    display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.sr-only {
    border: 0;
    clip: rect(0, 0, 0, 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
    /* 1 */
}

/*
 * Extends the .sr-only class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.sr-only.focusable:active,
.sr-only.focusable:focus {
    clip: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    position: static;
    white-space: inherit;
    width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
    visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    `contenteditable` attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that receive the `clearfix` class.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
    content: " ";
    display: table;
}

.clearfix::after {
    clear: both;
}











